History log of /drivers/power/jz4740-battery.c
Revision Date Author Comments
16735d022f72b20ddbb2274b8e109f69575e9b2b 14-Nov-2013 Wolfram Sang <wsa@the-dreams.de> tree-wide: use reinit_completion instead of INIT_COMPLETION

Use this new function to make code more comprehensible, since we are
reinitialzing the completion, not initializing.

[akpm@linux-foundation.org: linux-next resyncs]
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13)
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8ff3fb2902dd5d3c953f907906a413b18d9d150a 06-May-2013 Jingoo Han <jg1.han@samsung.com> jz4740-battery: 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>
e2cbdf3cb72571f1231cd7c3cb14009f9b8df707 21-Jan-2013 Thierry Reding <thierry.reding@avionic-design.de> power: Convert to devm_ioremap_resource()

Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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>
9790f98fdcfb1c60b953973ae256d00857b5ebb7 07-Nov-2012 Marcos Paulo de Souza <marcos.souza.org@gmail.com> jz4740-battery: Use devm_request_and_ioremap

No functional changes. Just a cleanup.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
ec073c9b319fee6564dcb9f1fb7a70eb6a8a06b5 07-Nov-2012 Marcos Paulo de Souza <marcos.souza.org@gmail.com> jz4740-battery: Use devm_kzalloc

This is just a small cleanup, makes a logic a little bit more simplier.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
41f63c5359d14ca995172b8f6eaffd93f60fec54 03-Aug-2012 Tejun Heo <tj@kernel.org> workqueue: use mod_delayed_work() instead of cancel + queue

Convert delayed_work users doing cancel_delayed_work() followed by
queue_delayed_work() to mod_delayed_work().

Most conversions are straight-forward. Ones worth mentioning are,

* drivers/edac/edac_mc.c: edac_mc_workq_setup() converted to always
use mod_delayed_work() and cancel loop in
edac_mc_reset_delay_period() is dropped.

* drivers/platform/x86/thinkpad_acpi.c: No need to remember whether
watchdog is active or not. @fan_watchdog_active and related code
dropped.

* drivers/power/charger-manager.c: Seemingly a lot of
delayed_work_pending() abuse going on here.
[delayed_]work_pending() are unsynchronized and racy when used like
this. I converted one instance in fullbatt_handler(). Please
conver the rest so that it invokes workqueue APIs for the intended
target state rather than trying to game work item pending state
transitions. e.g. if timer should be modified - call
mod_delayed_work(), canceled - call cancel_delayed_work[_sync]().

* drivers/thermal/thermal_sys.c: thermal_zone_device_set_polling()
simplified. Note that round_jiffies() calls in this function are
meaningless. round_jiffies() work on absolute jiffies not delta
delay used by delayed_work.

v2: Tomi pointed out that __cancel_delayed_work() users can't be
safely converted to mod_delayed_work(). They could be calling it
from irq context and if that happens while delayed_work_timer_fn()
is running, it could deadlock. __cancel_delayed_work() users are
dropped.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: David Howells <dhowells@redhat.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Doug Thompson <dougthompson@xmission.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Roland Dreier <roland@kernel.org>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Len Brown <len.brown@intel.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
ef7906f3204280ccaf8cd7ace974b7c0a1393812 08-Dec-2011 Axel Lin <axel.lin@gmail.com> jz4740-battery: Fix signedness bug

wait_for_completion_interruptible_timeout() may return negative value.
In this case, checking if (t > 0) will return true if t is unsigned.

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>
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>
e9300066bbd21c4fba3c8c5475c6a21d9c97694e 01-Mar-2011 Andres Salomon <dilinger@queued.net> jz4740: silence warnings related to mfd_get_cell changes

mfd_get_cell returns a const, so change the jz4740 clients to store
a const mfd cell. This silences type mismatch warnings.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
6a54ac2149ab5b8972bb4f77bd42b43dbeabb56f 18-Feb-2011 Andres Salomon <dilinger@queued.net> mfd: mfd_cell is now implicitly available to jz4740 drivers

No need to explicitly set the cell's platform_data/data_size.

Modify clients to use mfd_get_cell helper function instead of
accessing platform_data directly.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
f3dcab70e192b0489ac05cc554e0b1cedae46d1a 22-Dec-2010 Anton Vorontsov <cbouatmailru@gmail.com> jz4740-battery: Should include linux/io.h

During test-build (with disabled 'depends on') I found that
jz4740-battery driver lacks linux/io.h, which makes build break
like this (on x86):

CC [M] drivers/power/isp1704_charger.o
jz4740-battery.c: In function 'jz_battery_read_voltage':
jz4740-battery.c:84: error: implicit declaration of function 'readw’
jz4740-battery.c: In function 'jz_battery_probe':
jz4740-battery.c:284: error: implicit declaration of function 'ioremap_nocache’
jz4740-battery.c:285: warning: assignment makes pointer from integer without a cast
jz4740-battery.c:372: error: implicit declaration of function 'iounmap'
make[2]: *** [drivers/power/jz4740-battery.o] Error 1

This patch fixes the issues, and thus makes it easier to build-test
the driver for me.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
8477cedb49c69ce64b603d76c7776811eec0f9d7 11-Nov-2010 Lars-Peter Clausen <lars@metafoo.de> jz4740-battery: Check if platform_data is supplied

Currently platform_data is dereferenced without checking whether it
is actually set, which can lead to kernel crashes.
This patch adds a check which will abort the drivers probe function
gracefully if no platform_data is supplied.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
8ec98fe0b4ffdedce4c1caa9fb3d550f52ad1c6b 11-Nov-2010 Lars-Peter Clausen <lars@metafoo.de> jz4740-battery: Protect against concurrent battery readings

We can not handle more then one ADC request at a time to the battery.
The patch adds a mutex around the ADC read code to ensure this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: stable@kernel.org
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
5f29895f3e8cd4c4b25613c3dd64b68124a1762f 27-Sep-2010 Axel Lin <axel.lin@gmail.com> jz4740-battery: Add missing kfree(jz_battery) in jz_battery_remove()

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>
f6a21388bd255773cc80d4423afb4c69d4daa173 19-Jun-2010 Lars-Peter Clausen <lars@metafoo.de> POWER: Add JZ4740 battery driver.

Add support for the battery voltage measurement part of the JZ4740 ADC unit.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/1416/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>