History log of /drivers/power/gpio-charger.c
Revision Date Author Comments
4d96fb1ec81118c6406fe6d3670f172b2faaedf3 23-Sep-2014 Heiko Stuebner <heiko.stuebner@bq.com> power: gpio-charger: do not use gpio value directly

Some gpio implementations return interesting values for gpio_get_value when
the value is not 0 - as seen on a imx6sl board. Therefore do not use the
value returned from gpio_get_value directly but simply check for 0 or not 0.

Signed-off-by: Heiko Stuebner <heiko.stuebner@bq.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
4ea81266010ae41a48c7ce393335dfe241931209 10-Dec-2013 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> gpio-charger: Support wakeup events

Add support for using gpio-charger IRQ as a wakeup event.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
6fe6a40a83716166ac55e7f60053f59563d53878 06-May-2013 Jingoo Han <jg1.han@samsung.com> gpio-charger: Remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or on
probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is
not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
b92ff855b97795d8be3115c0aff04f6efb5a53aa 11-Mar-2013 Jingoo Han <jg1.han@samsung.com> gpio-charger: Use devm_kzalloc()

Use devm_kzalloc() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
415ec69fb1861fc377c65cb30ddc76999891b8e1 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> power: remove use of __devexit

CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
c8afa6406e60aec6ff90033e5ffe41a206609296 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> power: remove use of __devinit

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28ea73f4c67cb3dd8c972b21d9fdf84ea78d6daa 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> power: remove use of __devexit_p

CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ecb7a8ebdc4b063715d5a37919f9118c3f1031a8 22-May-2012 Pritesh Raithatha <praithatha@nvidia.com> gpio-charger: Use cansleep version of gpio_set_value

Context of gpio_charger_get_property is sleepable so we should
use gpio_set_value_cansleep instead of gpio_set_value.

It will remove WARN_ON incase of using gpio from i2c-to-gpio
expander like pca953x.

Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
300bac7fb85a20b2704dc3645419057992f78565 25-Nov-2011 Axel Lin <axel.lin@gmail.com> power_supply: Convert drivers/power/* to use module_platform_driver()

This patch converts the drivers in drivers/power/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Nithish Mahalingam <nithish.mahalingam@intel.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Balaji Rao <balajirrao@openmoko.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Clifton Barnes <cabarnes@indesign-llc.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
f8c63918c9a3004bd052fa4af08aa1cefbcd79ac 04-Jul-2011 Axel Lin <axel.lin@gmail.com> gpio-charger: Fix checking return value of request_any_context_irq

request_any_context_irq() returns a negative value on failure.
On success, it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
f10513de2a6036742b55e23278f0322f2e5c3772 07-Apr-2011 Benson Leung <bleung@chromium.org> gpio-charger: Add gpio_charger_resume

Gpio charger should notify if the gpio state had changed
during suspend. This will send a CHANGED event each time
the system resumes, ensuring a plug/unplug of the charger
is not missed.

Signed-off-by: Benson Leung <bleung@chromium.org>
Acked-By: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
26eb387265872b59566ddeed5e9bf142a6b9ff5b 18-Nov-2010 Lars-Peter Clausen <lars@metafoo.de> gpio-charger: Fix potential race between irq handler and probe/remove

This patch fixes a potential race between the irq handler and the probe
and remove functions.

The irq should not be requested before the chargers power_supply has been
registered and has to be freed before the power_supply is unregistered,
otherwise it is possible that the irq fires while the power_supply is not
initialized yet or has already been freed.

While we are at it replace request_irq with request_any_context_irq.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
80577b8a478f3386d106464f2a2241b2d43571ce 18-Nov-2010 Lars-Peter Clausen <lars@metafoo.de> gpio-charger: Provide default name for the power_supply

This patch sets a default name for the power_supply in case there was
no name supplied through the platform_data.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2e9ff5f5e4c6b034554f3539f29529265279102c 18-Nov-2010 Lars-Peter Clausen <lars@metafoo.de> gpio-charger: Check result of kzalloc

Since kzalloc can return NULL we have to check its result.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
5070437cd99511f69ae561f2ab417142a47a85ec 21-Oct-2010 Lars-Peter Clausen <lars@metafoo.de> power_supply: Add gpio charger driver

This patch adds a simple driver for chargers indicating their online
status through a GPIO pin.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>