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 read back the settings from the chip

On most x86/ACPI devices there is no devicetree to supply the necessary
init-data. Instead the firmware already fully initializes the bq25890
charger at boot. To support this, add support for reading back the
settings from the chip through a new "linux,read-back-settings" boolean.

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
40428bd4 7e3b8e35

+6 -1
+6 -1
drivers/power/supply/bq25890_charger.c
··· 111 111 struct regmap_field *rmap_fields[F_MAX_FIELDS]; 112 112 113 113 bool skip_reset; 114 + bool read_back_init_data; 114 115 enum bq25890_chip_version chip_version; 115 116 struct bq25890_init_data init_data; 116 117 struct bq25890_state state; ··· 697 696 698 697 static int bq25890_rw_init_data(struct bq25890_device *bq) 699 698 { 700 - bool write = true; 699 + bool write = !bq->read_back_init_data; 701 700 int ret; 702 701 int i; 703 702 ··· 982 981 struct bq25890_init_data *init = &bq->init_data; 983 982 984 983 bq->skip_reset = device_property_read_bool(bq->dev, "linux,skip-reset"); 984 + bq->read_back_init_data = device_property_read_bool(bq->dev, 985 + "linux,read-back-settings"); 986 + if (bq->read_back_init_data) 987 + return 0; 985 988 986 989 ret = bq25890_fw_read_u32_props(bq); 987 990 if (ret < 0)