1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * AXP20x PMIC USB power supply status driver
5 * Copyright (C) 2015 Hans de Goede <hdegoede@redhat.com>
6 * Copyright (C) 2014 Bruno Prémont <bonbons@linux-vserver.org>
9 #include <linux/bitops.h>
10 #include <linux/device.h>
11 #include <linux/devm-helpers.h>
12 #include <linux/init.h>
13 #include <linux/interrupt.h>
14 #include <linux/kernel.h>
15 #include <linux/mfd/axp20x.h>
16 #include <linux/module.h>
18 #include <linux/platform_device.h>
20 #include <linux/power_supply.h>
21 #include <linux/regmap.h>
22 #include <linux/slab.h>
23 #include <linux/iio/consumer.h>
24 #include <linux/workqueue.h>
26 #define DRVNAME "axp20x-usb-power-supply"
28 #define AXP192_USB_OTG_STATUS 0x04
30 #define AXP20X_PWR_STATUS_VBUS_PRESENT BIT(5)
31 #define AXP20X_PWR_STATUS_VBUS_USED BIT(4)
33 #define AXP20X_USB_STATUS_VBUS_VALID BIT(2)
35 #define AXP20X_VBUS_VHOLD_uV(b) (4000000 + (((b) >> 3) & 7) * 100000)
36 #define AXP20X_VBUS_VHOLD_MASK GENMASK(5, 3)
37 #define AXP20X_VBUS_VHOLD_OFFSET 3
39 #define AXP20X_ADC_EN1_VBUS_CURR BIT(2)
40 #define AXP20X_ADC_EN1_VBUS_VOLT BIT(3)
43 * Note do not raise the debounce time, we must report Vusb high within
44 * 100ms otherwise we get Vbus errors in musb.
46 #define DEBOUNCE_TIME msecs_to_jiffies(50)
49 const struct power_supply_desc *power_desc;
50 const char * const *irq_names;
51 unsigned int num_irq_names;
52 const int *curr_lim_table;
53 int curr_lim_table_size;
54 struct reg_field curr_lim_fld;
55 struct reg_field vbus_valid_bit;
56 struct reg_field vbus_mon_bit;
57 struct reg_field usb_bc_en_bit;
58 struct reg_field usb_bc_det_fld;
59 struct reg_field vbus_disable_bit;
60 bool vbus_needs_polling: 1;
63 struct axp20x_usb_power {
65 struct regmap *regmap;
66 struct regmap_field *curr_lim_fld;
67 struct regmap_field *vbus_valid_bit;
68 struct regmap_field *vbus_mon_bit;
69 struct regmap_field *usb_bc_en_bit;
70 struct regmap_field *usb_bc_det_fld;
71 struct regmap_field *vbus_disable_bit;
72 struct power_supply *supply;
73 const struct axp_data *axp_data;
74 struct iio_channel *vbus_v;
75 struct iio_channel *vbus_i;
76 struct delayed_work vbus_detect;
77 unsigned int old_status;
79 unsigned int num_irqs;
80 unsigned int irqs[] __counted_by(num_irqs);
83 static bool axp20x_usb_vbus_needs_polling(struct axp20x_usb_power *power)
86 * Polling is only necessary while VBUS is offline. While online, a
87 * present->absent transition implies an online->offline transition
88 * and will trigger the VBUS_REMOVAL IRQ.
90 if (power->axp_data->vbus_needs_polling && !power->online)
96 static irqreturn_t axp20x_usb_power_irq(int irq, void *devid)
98 struct axp20x_usb_power *power = devid;
100 power_supply_changed(power->supply);
102 mod_delayed_work(system_power_efficient_wq, &power->vbus_detect, DEBOUNCE_TIME);
107 static void axp20x_usb_power_poll_vbus(struct work_struct *work)
109 struct axp20x_usb_power *power =
110 container_of(work, struct axp20x_usb_power, vbus_detect.work);
114 ret = regmap_read(power->regmap, AXP20X_PWR_INPUT_STATUS, &val);
118 val &= (AXP20X_PWR_STATUS_VBUS_PRESENT | AXP20X_PWR_STATUS_VBUS_USED);
119 if (val != power->old_status)
120 power_supply_changed(power->supply);
122 if (power->usb_bc_en_bit && (val & AXP20X_PWR_STATUS_VBUS_PRESENT) !=
123 (power->old_status & AXP20X_PWR_STATUS_VBUS_PRESENT)) {
124 dev_dbg(power->dev, "Cable status changed, re-enabling USB BC");
125 ret = regmap_field_write(power->usb_bc_en_bit, 1);
127 dev_err(power->dev, "failed to enable USB BC: errno %d",
131 power->old_status = val;
132 power->online = val & AXP20X_PWR_STATUS_VBUS_USED;
135 if (axp20x_usb_vbus_needs_polling(power))
136 mod_delayed_work(system_power_efficient_wq, &power->vbus_detect, DEBOUNCE_TIME);
139 static int axp20x_get_usb_type(struct axp20x_usb_power *power,
140 union power_supply_propval *val)
145 if (!power->usb_bc_det_fld)
148 ret = regmap_field_read(power->usb_bc_det_fld, ®);
154 val->intval = POWER_SUPPLY_USB_TYPE_SDP;
157 val->intval = POWER_SUPPLY_USB_TYPE_CDP;
160 val->intval = POWER_SUPPLY_USB_TYPE_DCP;
163 val->intval = POWER_SUPPLY_USB_TYPE_UNKNOWN;
170 static int axp20x_usb_power_get_property(struct power_supply *psy,
171 enum power_supply_property psp, union power_supply_propval *val)
173 struct axp20x_usb_power *power = power_supply_get_drvdata(psy);
174 unsigned int input, v;
178 case POWER_SUPPLY_PROP_VOLTAGE_MIN:
179 ret = regmap_read(power->regmap, AXP20X_VBUS_IPSOUT_MGMT, &v);
183 val->intval = AXP20X_VBUS_VHOLD_uV(v);
185 case POWER_SUPPLY_PROP_VOLTAGE_NOW:
186 if (IS_ENABLED(CONFIG_AXP20X_ADC)) {
187 ret = iio_read_channel_processed(power->vbus_v,
193 * IIO framework gives mV but Power Supply framework
200 ret = axp20x_read_variable_width(power->regmap,
201 AXP20X_VBUS_V_ADC_H, 12);
205 val->intval = ret * 1700; /* 1 step = 1.7 mV */
207 case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
208 ret = regmap_field_read(power->curr_lim_fld, &v);
212 if (v < power->axp_data->curr_lim_table_size)
213 val->intval = power->axp_data->curr_lim_table[v];
215 val->intval = power->axp_data->curr_lim_table[
216 power->axp_data->curr_lim_table_size - 1];
218 case POWER_SUPPLY_PROP_CURRENT_NOW:
219 if (IS_ENABLED(CONFIG_AXP20X_ADC)) {
220 ret = iio_read_channel_processed(power->vbus_i,
226 * IIO framework gives mA but Power Supply framework
233 ret = axp20x_read_variable_width(power->regmap,
234 AXP20X_VBUS_I_ADC_H, 12);
238 val->intval = ret * 375; /* 1 step = 0.375 mA */
241 case POWER_SUPPLY_PROP_USB_TYPE:
242 return axp20x_get_usb_type(power, val);
247 /* All the properties below need the input-status reg value */
248 ret = regmap_read(power->regmap, AXP20X_PWR_INPUT_STATUS, &input);
253 case POWER_SUPPLY_PROP_HEALTH:
254 if (!(input & AXP20X_PWR_STATUS_VBUS_PRESENT)) {
255 val->intval = POWER_SUPPLY_HEALTH_UNKNOWN;
259 val->intval = POWER_SUPPLY_HEALTH_GOOD;
261 if (power->vbus_valid_bit) {
262 ret = regmap_field_read(power->vbus_valid_bit, &v);
267 val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE;
271 case POWER_SUPPLY_PROP_PRESENT:
272 val->intval = !!(input & AXP20X_PWR_STATUS_VBUS_PRESENT);
274 case POWER_SUPPLY_PROP_ONLINE:
275 val->intval = !!(input & AXP20X_PWR_STATUS_VBUS_USED);
284 static int axp20x_usb_power_set_voltage_min(struct axp20x_usb_power *power,
298 val = (intval - 4000000) / 100000;
299 return regmap_update_bits(power->regmap,
300 AXP20X_VBUS_IPSOUT_MGMT,
301 AXP20X_VBUS_VHOLD_MASK,
302 val << AXP20X_VBUS_VHOLD_OFFSET);
310 static int axp20x_usb_power_set_input_current_limit(struct axp20x_usb_power *power,
315 const unsigned int max = power->axp_data->curr_lim_table_size;
321 * BC1.2 detection can cause a race condition if we try to set a current
322 * limit while it's in progress. When it finishes it will overwrite the
323 * current limit we just set.
325 if (power->usb_bc_en_bit) {
327 "disabling BC1.2 detection because current limit was set");
328 ret = regmap_field_write(power->usb_bc_en_bit, 0);
333 for (reg = max - 1; reg > 0; reg--)
334 if (power->axp_data->curr_lim_table[reg] <= intval)
337 dev_dbg(power->dev, "setting input current limit reg to %d (%d uA), requested %d uA",
338 reg, power->axp_data->curr_lim_table[reg], intval);
340 return regmap_field_write(power->curr_lim_fld, reg);
343 static int axp20x_usb_power_set_property(struct power_supply *psy,
344 enum power_supply_property psp,
345 const union power_supply_propval *val)
347 struct axp20x_usb_power *power = power_supply_get_drvdata(psy);
350 case POWER_SUPPLY_PROP_ONLINE:
351 if (!power->vbus_disable_bit)
354 return regmap_field_write(power->vbus_disable_bit, !val->intval);
356 case POWER_SUPPLY_PROP_VOLTAGE_MIN:
357 return axp20x_usb_power_set_voltage_min(power, val->intval);
359 case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
360 return axp20x_usb_power_set_input_current_limit(power, val->intval);
369 static int axp20x_usb_power_prop_writeable(struct power_supply *psy,
370 enum power_supply_property psp)
372 struct axp20x_usb_power *power = power_supply_get_drvdata(psy);
375 * The VBUS path select flag works differently on AXP288 and newer:
376 * - On AXP20x and AXP22x, the flag enables VBUS (ignoring N_VBUSEN).
377 * - On AXP288 and AXP8xx, the flag disables VBUS (ignoring N_VBUSEN).
378 * We only expose the control on variants where it can be used to force
379 * the VBUS input offline.
381 if (psp == POWER_SUPPLY_PROP_ONLINE)
382 return power->vbus_disable_bit != NULL;
384 return psp == POWER_SUPPLY_PROP_VOLTAGE_MIN ||
385 psp == POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT;
388 static enum power_supply_property axp20x_usb_power_properties[] = {
389 POWER_SUPPLY_PROP_HEALTH,
390 POWER_SUPPLY_PROP_PRESENT,
391 POWER_SUPPLY_PROP_ONLINE,
392 POWER_SUPPLY_PROP_VOLTAGE_MIN,
393 POWER_SUPPLY_PROP_VOLTAGE_NOW,
394 POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
395 POWER_SUPPLY_PROP_CURRENT_NOW,
398 static enum power_supply_property axp22x_usb_power_properties[] = {
399 POWER_SUPPLY_PROP_HEALTH,
400 POWER_SUPPLY_PROP_PRESENT,
401 POWER_SUPPLY_PROP_ONLINE,
402 POWER_SUPPLY_PROP_VOLTAGE_MIN,
403 POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
406 static enum power_supply_property axp813_usb_power_properties[] = {
407 POWER_SUPPLY_PROP_HEALTH,
408 POWER_SUPPLY_PROP_PRESENT,
409 POWER_SUPPLY_PROP_ONLINE,
410 POWER_SUPPLY_PROP_VOLTAGE_MIN,
411 POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
412 POWER_SUPPLY_PROP_USB_TYPE,
415 static enum power_supply_usb_type axp813_usb_types[] = {
416 POWER_SUPPLY_USB_TYPE_SDP,
417 POWER_SUPPLY_USB_TYPE_DCP,
418 POWER_SUPPLY_USB_TYPE_CDP,
419 POWER_SUPPLY_USB_TYPE_UNKNOWN,
422 static const struct power_supply_desc axp20x_usb_power_desc = {
423 .name = "axp20x-usb",
424 .type = POWER_SUPPLY_TYPE_USB,
425 .properties = axp20x_usb_power_properties,
426 .num_properties = ARRAY_SIZE(axp20x_usb_power_properties),
427 .property_is_writeable = axp20x_usb_power_prop_writeable,
428 .get_property = axp20x_usb_power_get_property,
429 .set_property = axp20x_usb_power_set_property,
432 static const struct power_supply_desc axp22x_usb_power_desc = {
433 .name = "axp20x-usb",
434 .type = POWER_SUPPLY_TYPE_USB,
435 .properties = axp22x_usb_power_properties,
436 .num_properties = ARRAY_SIZE(axp22x_usb_power_properties),
437 .property_is_writeable = axp20x_usb_power_prop_writeable,
438 .get_property = axp20x_usb_power_get_property,
439 .set_property = axp20x_usb_power_set_property,
442 static const struct power_supply_desc axp813_usb_power_desc = {
443 .name = "axp20x-usb",
444 .type = POWER_SUPPLY_TYPE_USB,
445 .properties = axp813_usb_power_properties,
446 .num_properties = ARRAY_SIZE(axp813_usb_power_properties),
447 .property_is_writeable = axp20x_usb_power_prop_writeable,
448 .get_property = axp20x_usb_power_get_property,
449 .set_property = axp20x_usb_power_set_property,
450 .usb_types = axp813_usb_types,
451 .num_usb_types = ARRAY_SIZE(axp813_usb_types),
454 static const char * const axp20x_irq_names[] = {
461 static const char * const axp22x_irq_names[] = {
466 static int axp192_usb_curr_lim_table[] = {
473 static int axp20x_usb_curr_lim_table[] = {
480 static int axp221_usb_curr_lim_table[] = {
487 static int axp813_usb_curr_lim_table[] = {
499 static const struct axp_data axp192_data = {
500 .power_desc = &axp20x_usb_power_desc,
501 .irq_names = axp20x_irq_names,
502 .num_irq_names = ARRAY_SIZE(axp20x_irq_names),
503 .curr_lim_table = axp192_usb_curr_lim_table,
504 .curr_lim_table_size = ARRAY_SIZE(axp192_usb_curr_lim_table),
505 .curr_lim_fld = REG_FIELD(AXP20X_VBUS_IPSOUT_MGMT, 0, 1),
506 .vbus_valid_bit = REG_FIELD(AXP192_USB_OTG_STATUS, 2, 2),
507 .vbus_mon_bit = REG_FIELD(AXP20X_VBUS_MON, 3, 3),
510 static const struct axp_data axp202_data = {
511 .power_desc = &axp20x_usb_power_desc,
512 .irq_names = axp20x_irq_names,
513 .num_irq_names = ARRAY_SIZE(axp20x_irq_names),
514 .curr_lim_table = axp20x_usb_curr_lim_table,
515 .curr_lim_table_size = ARRAY_SIZE(axp20x_usb_curr_lim_table),
516 .curr_lim_fld = REG_FIELD(AXP20X_VBUS_IPSOUT_MGMT, 0, 1),
517 .vbus_valid_bit = REG_FIELD(AXP20X_USB_OTG_STATUS, 2, 2),
518 .vbus_mon_bit = REG_FIELD(AXP20X_VBUS_MON, 3, 3),
521 static const struct axp_data axp221_data = {
522 .power_desc = &axp22x_usb_power_desc,
523 .irq_names = axp22x_irq_names,
524 .num_irq_names = ARRAY_SIZE(axp22x_irq_names),
525 .curr_lim_table = axp221_usb_curr_lim_table,
526 .curr_lim_table_size = ARRAY_SIZE(axp221_usb_curr_lim_table),
527 .curr_lim_fld = REG_FIELD(AXP20X_VBUS_IPSOUT_MGMT, 0, 1),
528 .vbus_needs_polling = true,
531 static const struct axp_data axp223_data = {
532 .power_desc = &axp22x_usb_power_desc,
533 .irq_names = axp22x_irq_names,
534 .num_irq_names = ARRAY_SIZE(axp22x_irq_names),
535 .curr_lim_table = axp20x_usb_curr_lim_table,
536 .curr_lim_table_size = ARRAY_SIZE(axp20x_usb_curr_lim_table),
537 .curr_lim_fld = REG_FIELD(AXP20X_VBUS_IPSOUT_MGMT, 0, 1),
538 .vbus_needs_polling = true,
541 static const struct axp_data axp813_data = {
542 .power_desc = &axp813_usb_power_desc,
543 .irq_names = axp22x_irq_names,
544 .num_irq_names = ARRAY_SIZE(axp22x_irq_names),
545 .curr_lim_table = axp813_usb_curr_lim_table,
546 .curr_lim_table_size = ARRAY_SIZE(axp813_usb_curr_lim_table),
547 .curr_lim_fld = REG_FIELD(AXP22X_CHRG_CTRL3, 4, 7),
548 .usb_bc_en_bit = REG_FIELD(AXP288_BC_GLOBAL, 0, 0),
549 .usb_bc_det_fld = REG_FIELD(AXP288_BC_DET_STAT, 5, 7),
550 .vbus_disable_bit = REG_FIELD(AXP20X_VBUS_IPSOUT_MGMT, 7, 7),
551 .vbus_needs_polling = true,
554 #ifdef CONFIG_PM_SLEEP
555 static int axp20x_usb_power_suspend(struct device *dev)
557 struct axp20x_usb_power *power = dev_get_drvdata(dev);
561 * Allow wake via VBUS_PLUGIN only.
563 * As nested threaded IRQs are not automatically disabled during
564 * suspend, we must explicitly disable the remainder of the IRQs.
566 if (device_may_wakeup(&power->supply->dev))
567 enable_irq_wake(power->irqs[i++]);
568 while (i < power->num_irqs)
569 disable_irq(power->irqs[i++]);
574 static int axp20x_usb_power_resume(struct device *dev)
576 struct axp20x_usb_power *power = dev_get_drvdata(dev);
579 if (device_may_wakeup(&power->supply->dev))
580 disable_irq_wake(power->irqs[i++]);
581 while (i < power->num_irqs)
582 enable_irq(power->irqs[i++]);
584 mod_delayed_work(system_power_efficient_wq, &power->vbus_detect, DEBOUNCE_TIME);
590 static SIMPLE_DEV_PM_OPS(axp20x_usb_power_pm_ops, axp20x_usb_power_suspend,
591 axp20x_usb_power_resume);
593 static int configure_iio_channels(struct platform_device *pdev,
594 struct axp20x_usb_power *power)
596 power->vbus_v = devm_iio_channel_get(&pdev->dev, "vbus_v");
597 if (IS_ERR(power->vbus_v)) {
598 if (PTR_ERR(power->vbus_v) == -ENODEV)
599 return -EPROBE_DEFER;
600 return PTR_ERR(power->vbus_v);
603 power->vbus_i = devm_iio_channel_get(&pdev->dev, "vbus_i");
604 if (IS_ERR(power->vbus_i)) {
605 if (PTR_ERR(power->vbus_i) == -ENODEV)
606 return -EPROBE_DEFER;
607 return PTR_ERR(power->vbus_i);
613 static int configure_adc_registers(struct axp20x_usb_power *power)
615 /* Enable vbus voltage and current measurement */
616 return regmap_update_bits(power->regmap, AXP20X_ADC_EN1,
617 AXP20X_ADC_EN1_VBUS_CURR |
618 AXP20X_ADC_EN1_VBUS_VOLT,
619 AXP20X_ADC_EN1_VBUS_CURR |
620 AXP20X_ADC_EN1_VBUS_VOLT);
623 static int axp20x_regmap_field_alloc_optional(struct device *dev,
624 struct regmap *regmap,
625 struct reg_field fdesc,
626 struct regmap_field **fieldp)
628 struct regmap_field *field;
630 if (fdesc.reg == 0) {
635 field = devm_regmap_field_alloc(dev, regmap, fdesc);
637 return PTR_ERR(field);
643 static int axp20x_usb_power_probe(struct platform_device *pdev)
645 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
646 struct power_supply_config psy_cfg = {};
647 struct axp20x_usb_power *power;
648 const struct axp_data *axp_data;
651 if (!of_device_is_available(pdev->dev.of_node))
655 dev_err(&pdev->dev, "Parent drvdata not set\n");
659 axp_data = of_device_get_match_data(&pdev->dev);
661 power = devm_kzalloc(&pdev->dev,
662 struct_size(power, irqs, axp_data->num_irq_names),
667 platform_set_drvdata(pdev, power);
669 power->dev = &pdev->dev;
670 power->axp_data = axp_data;
671 power->regmap = axp20x->regmap;
672 power->num_irqs = axp_data->num_irq_names;
674 power->curr_lim_fld = devm_regmap_field_alloc(&pdev->dev, power->regmap,
675 axp_data->curr_lim_fld);
676 if (IS_ERR(power->curr_lim_fld))
677 return PTR_ERR(power->curr_lim_fld);
679 ret = axp20x_regmap_field_alloc_optional(&pdev->dev, power->regmap,
680 axp_data->vbus_valid_bit,
681 &power->vbus_valid_bit);
685 ret = axp20x_regmap_field_alloc_optional(&pdev->dev, power->regmap,
686 axp_data->vbus_mon_bit,
687 &power->vbus_mon_bit);
691 ret = axp20x_regmap_field_alloc_optional(&pdev->dev, power->regmap,
692 axp_data->usb_bc_en_bit,
693 &power->usb_bc_en_bit);
697 ret = axp20x_regmap_field_alloc_optional(&pdev->dev, power->regmap,
698 axp_data->usb_bc_det_fld,
699 &power->usb_bc_det_fld);
703 ret = axp20x_regmap_field_alloc_optional(&pdev->dev, power->regmap,
704 axp_data->vbus_disable_bit,
705 &power->vbus_disable_bit);
709 ret = devm_delayed_work_autocancel(&pdev->dev, &power->vbus_detect,
710 axp20x_usb_power_poll_vbus);
714 if (power->vbus_mon_bit) {
715 /* Enable vbus valid checking */
716 ret = regmap_field_write(power->vbus_mon_bit, 1);
720 if (IS_ENABLED(CONFIG_AXP20X_ADC))
721 ret = configure_iio_channels(pdev, power);
723 ret = configure_adc_registers(power);
729 if (power->usb_bc_en_bit) {
730 /* Enable USB Battery Charging specification detection */
731 ret = regmap_field_write(power->usb_bc_en_bit, 1);
736 psy_cfg.of_node = pdev->dev.of_node;
737 psy_cfg.drv_data = power;
739 power->supply = devm_power_supply_register(&pdev->dev,
740 axp_data->power_desc,
742 if (IS_ERR(power->supply))
743 return PTR_ERR(power->supply);
745 /* Request irqs after registering, as irqs may trigger immediately */
746 for (i = 0; i < axp_data->num_irq_names; i++) {
747 irq = platform_get_irq_byname(pdev, axp_data->irq_names[i]);
751 power->irqs[i] = regmap_irq_get_virq(axp20x->regmap_irqc, irq);
752 ret = devm_request_any_context_irq(&pdev->dev, power->irqs[i],
753 axp20x_usb_power_irq, 0,
756 dev_err(&pdev->dev, "Error requesting %s IRQ: %d\n",
757 axp_data->irq_names[i], ret);
762 if (axp20x_usb_vbus_needs_polling(power))
763 queue_delayed_work(system_power_efficient_wq, &power->vbus_detect, 0);
768 static const struct of_device_id axp20x_usb_power_match[] = {
770 .compatible = "x-powers,axp192-usb-power-supply",
771 .data = &axp192_data,
773 .compatible = "x-powers,axp202-usb-power-supply",
774 .data = &axp202_data,
776 .compatible = "x-powers,axp221-usb-power-supply",
777 .data = &axp221_data,
779 .compatible = "x-powers,axp223-usb-power-supply",
780 .data = &axp223_data,
782 .compatible = "x-powers,axp813-usb-power-supply",
783 .data = &axp813_data,
784 }, { /* sentinel */ }
786 MODULE_DEVICE_TABLE(of, axp20x_usb_power_match);
788 static struct platform_driver axp20x_usb_power_driver = {
789 .probe = axp20x_usb_power_probe,
792 .of_match_table = axp20x_usb_power_match,
793 .pm = &axp20x_usb_power_pm_ops,
797 module_platform_driver(axp20x_usb_power_driver);
799 MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
800 MODULE_DESCRIPTION("AXP20x PMIC USB power supply status driver");
801 MODULE_LICENSE("GPL");