Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

power: supply: bq25890: Add support to skip reset at probe() / remove()

On most x86/ACPI devices the firmware already fully initializes
the bq25890 charger at boot, in this case it is best to not reset
it at probe() time.

At support for a new "linux,skip-reset" boolean property to support this.
So far this new property is only used on x86/ACPI (non devicetree) devs,
IOW it is not used in actual devicetree files. The devicetree-bindings
maintainers have requested properties like these to not be added to the
devicetree-bindings, so the new property is deliberately not added
to the existing devicetree-bindings.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Hans de Goede and committed by
Sebastian Reichel
7e3b8e35 7b22a974

+13 -6
+13 -6
drivers/power/supply/bq25890_charger.c
··· 110 110 struct regmap *rmap; 111 111 struct regmap_field *rmap_fields[F_MAX_FIELDS]; 112 112 113 + bool skip_reset; 113 114 enum bq25890_chip_version chip_version; 114 115 struct bq25890_init_data init_data; 115 116 struct bq25890_state state; ··· 740 739 { 741 740 int ret; 742 741 743 - ret = bq25890_chip_reset(bq); 744 - if (ret < 0) { 745 - dev_dbg(bq->dev, "Reset failed %d\n", ret); 746 - return ret; 742 + if (!bq->skip_reset) { 743 + ret = bq25890_chip_reset(bq); 744 + if (ret < 0) { 745 + dev_dbg(bq->dev, "Reset failed %d\n", ret); 746 + return ret; 747 + } 747 748 } 748 749 749 750 /* disable watchdog */ ··· 980 977 int ret; 981 978 struct bq25890_init_data *init = &bq->init_data; 982 979 980 + bq->skip_reset = device_property_read_bool(bq->dev, "linux,skip-reset"); 981 + 983 982 ret = bq25890_fw_read_u32_props(bq); 984 983 if (ret < 0) 985 984 return ret; ··· 1094 1089 if (!IS_ERR_OR_NULL(bq->usb_phy)) 1095 1090 usb_unregister_notifier(bq->usb_phy, &bq->usb_nb); 1096 1091 1097 - /* reset all registers to default values */ 1098 - bq25890_chip_reset(bq); 1092 + if (!bq->skip_reset) { 1093 + /* reset all registers to default values */ 1094 + bq25890_chip_reset(bq); 1095 + } 1099 1096 1100 1097 return 0; 1101 1098 }