History log of /drivers/power/ds2781_battery.c
Revision Date Author Comments
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>
deacc4fe57794f80ad4449c7cea611921c2d0420 30-Jul-2012 Devendra Naga <develkernel412222@gmail.com> ds2781_battery: Replace call to kzalloc with devm_kzalloc

With devm_kzalloc there is no need of freeing at the errorpath and also
at unregister it.

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
bc6e51d8891629a9d117dc75a8a2eb9a411a3510 30-Jul-2012 Devendra Naga <develkernel412222@gmail.com> ds2781_battery: Convert to module_platform_driver

module_platform_driver can be used to replace the platform_driver
register and unregister functions, with the calls to module_init
and module_exit,

i.e. all the code that is doing like the below

static int __init mymod_init(void)
{
return platform_driver_register(&drv_operations);
}

static void __exit mymod_exit(void)
{
platform_driver_unregister(&drv_operations);
}

module_init(mymod_init);
module_exit(mymod_exit);

can be replaced with
module_platform_driver(drv_operations)...

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
7dbae5562e86f2731d13bd2b8b3ea3f974f4b87d 18-Jun-2012 Anton Vorontsov <cbouatmailru@gmail.com> ds2781_battery: w1_ds2781_read() should be static

This patch fixes the following sparse warning:

CHECK drivers/power/ds2781_battery.c
drivers/power/ds2781_battery.c:72:5: warning: symbol 'w1_ds2781_read' was not declared. Should it be static?

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
b02f8bede217a4b145ecc16d3940c78d83941147 18-May-2012 NeilBrown <neilb@suse.de> W1: split master mutex to avoid deadlocks.

The 'mutex' in struct w1_master is use for two very different
purposes.

Firstly it protects various data structures such as the list of all
slaves.

Secondly it protects the w1 buss against concurrent accesses.

This can lead to deadlocks when the ->probe code called while adding a
slave needs to talk on the bus, as is the case for power_supply
devices.
ds2780 and ds2781 drivers contain a work around to track which
process hold the lock simply to avoid this deadlock. bq27000 doesn't
have that work around and so deadlocks.

There are other possible deadlocks involving sysfs.
When removing a device the sysfs s_active lock is held, so the lock
that protects the slave list must take precedence over s_active.
However when access power_supply attributes via sysfs, the s_active
lock must take precedence over the lock that protects accesses to
the bus.

So to avoid deadlocks between w1 slaves and sysfs, these must be
two separate locks. Making them separate means that the work around
in ds2780 and ds2781 can be removed.

So this patch:
- adds a new mutex: "bus_mutex" which serialises access to the bus.
- takes in mutex in w1_search and ds1wm_search while they access
the bus for searching. The mutex is dropped before calling the
callback which adds the slave.
- changes all slaves to use bus_mutex instead of mutex to
protect access to the bus
- removes w1_ds2790_io_nolock and w1_ds2781_io_nolock, and the
related code from drivers/power/ds278[01]_battery.c which
calls them.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13f2483cd5e3df425cfa492cc62cf8fada5d01b9 17-Mar-2012 Axel Lin <axel.lin@gmail.com> ds2781_battery: Use DS2781_PARAM_EEPROM_SIZE and DS2781_USER_EEPROM_SIZE

Since we have defined DS2781_PARAM_EEPROM_SIZE and
DS2781_USER_EEPROM_SIZE, use them to simplify the code.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
fef37e9a47b9927ce2817fe1a0fa8cf40f6eefb6 29-Feb-2012 Renata Sayakhova <rsayakhova@gmail.com> DS2781 Maxim Stand-Alone Fuel Gauge battery and w1 slave drivers

Signed-off-by: Renata Sayakhova <rsayakhova@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>