power: supply: axp20x_battery: use data struct for variant specific code
authorQuentin Schulz <quentin.schulz@bootlin.com>
Wed, 28 Feb 2018 10:35:58 +0000 (11:35 +0100)
committerSebastian Reichel <sre@kernel.org>
Fri, 9 Mar 2018 15:51:06 +0000 (16:51 +0100)
commit648badd797c762a713b48afc3b67d56abdd0073b
tree0692c1a32f6516bd9c7807c0f11ba48ffd7b9e88
parentd47c1e4b2f51e81683b087480401b9b42b2a58fd
power: supply: axp20x_battery: use data struct for variant specific code

We used to use IDs to select a function or a feature depending on the
variant. It's easier to maintain the code by adding data structure
storing the few differences between variants so that we don't add a pile
of if conditions.

Let's use this data structure and update the code to use it.

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
[updated POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN write property to use
the introduced set_max_voltage() callback]
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/axp20x_battery.c