summaryrefslogtreecommitdiff
path: root/drivers/power/supply/gpio-charger.c
AgeCommit message (Collapse)Author
2018-12-13power: supply: gpio-charger: Do not use deprecated POWER_SUPPLY_TYPE_USB_*Sebastian Reichel
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-04-25power: supply: simplify getting .drvdataWolfram Sang
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: gpio-charger: Remove pdata from gpio_chargerLadislav Michl
Platform data are now used only during probe time, so remove them from gpio_charger structure and consolidate probing function accordingly. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> [Replace of_property_read_string with dev_property_read_string] Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: gpio-charger: Use GPIOF_ACTIVE_LOW for legacy setupLadislav Michl
Setting GPIOF_ACTIVE_LOW flag based on platform data gpio_active_low makes return value of gpiod_get_value_cansleep directly usable. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: gpio-charger: Remove redundant dev_err call in probe functionLadislav Michl
There is an error message within devm_kzalloc already. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-02-13power: supply: gpio-charger: use helper variable to access device infoLadislav Michl
Using explicit struct device variable makes code a bit more readable. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-02-13power: supply: gpio-charger: Drop driver remove functionLadislav Michl
Simplify error unwinding using devm_* allocators. This also makes driver remove function empty, so remove it. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-01-04power: supply: gpio_charger: switch to using GPIO descriptorsLinus Walleij
The GPIO charger is using a mix of the legacy GPIO interface and <linux/of_gpio.h> which is not the modern way to use GPIOs. Refactor like this: - Use a GPIO descriptor for the GPIO line used to monitor the charger. - Fetch the descriptor with devm_gpiod_get() as the first method. - If this fails and we are *not* using device tree, then start looking to see if we can use platform data instead. - After looking up and requesting a GPIO number with the legacy API, convert it to a descriptor. This way we can later isolate and drop the legacy code as more platforms move over to using descriptors. Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-11power: move power supply drivers to power/supplySebastian Reichel
This moves all power supply drivers from drivers/power/ to drivers/power/supply/. The intention is a cleaner source tree, since drivers/power/ also contains frameworks unrelated to power supply, like adaptive voltage scaling. Signed-off-by: Sebastian Reichel <sre@kernel.org>