summaryrefslogtreecommitdiff
path: root/drivers/power/supply/ds2760_battery.c
AgeCommit message (Collapse)AuthorFilesLines
2024-01-27power: supply: ds2760: Use devm_power_supply_register() helperAndrew Davis1-3/+1
Use the device lifecycle managed register function. This helps prevent mistakes like unregistering out of order in cleanup functions and forgetting to unregister on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20240123163653.384385-4-afd@ti.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2023-01-20ARM: pxa: remove unused board filesArnd Bergmann1-8/+0
The majority of all pxa board files has not been touched in a long time, and no users have spoken up in favor of keeping them around. This leaves only support for the platforms that were already converted to DT, as well as the gumstix and spitz/akita/borzoi machines that work in qemu and can still be converted to DT later. Cc: Ales Bardorfer <ales@i-tech.si> Cc: Ales Snuparek <snuparek@atlas.cz> Cc: Alex Osborne <ato@meshy.org> Cc: Alex Osborne <bobofdoom@gmail.com> Cc: Dirk Opfer <dirk@opfer-online.de> Cc: Ian Molton <spyro@f2s.com> Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Michael Petchkovsky <mkpetch@internode.on.net> Cc: Nick Bane <nick@cecomputing.co.uk> Cc: Paul Parsons <lost.distance@yahoo.com> Cc: Philipp Zabel <philipp.zabel@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Sergey Lapin <slapin@ossfans.org> Cc: Tomas Cech <sleep_walker@suse.cz> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-01-28power-supply: use kobj_to_dev()Jian Dong1-1/+1
Use kobj_to_dev() instead of open-coding it Signed-off-by: Jian Dong <dongjian@yulong.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-05power: supply: Constify static w1_family_ops structsRikard Falkeborn1-1/+1
The only usage of these structs is to assign their address to the fops field in the w1_family struct, which is a const pointer. Make them const to allow the compiler to put them in read-only memory. This was done with the following Coccinelle semantic patch (http://coccinelle.lip6.fr/): // <smpl> @r1 disable optional_qualifier @ identifier i; position p; @@ static struct w1_family_ops i@p = {...}; @ok1@ identifier r1.i; position p; identifier s; @@ static struct w1_family s = { .fops=&i@p, }; @bad1@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad1 disable optional_qualifier@ identifier r1.i; @@ static +const struct w1_family_ops i={}; // </smpl> Acked-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20201004193202.4044-4-rikard.falkeborn@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11power: supply: ds2760_battery: add devicetree probingDaniel Mack1-1/+28
Add a matching table for devicetree probing, and optionally set the module parameter variables from DT properties. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-07-11power: supply: ds2760_battery: merge ds2760 supply driver with its w1 slave ↵Daniel Mack1-90/+231
companion This patch removes the w1 slave driver that used to register the w1 family and instanciate a platform device at runtime. The code now lives in the supply driver instead to avoid that level of indirection. The old device name "ds2760-battery.0" is preserved, so userspace applications can access the same virtual device nodes as before. Note that because the w1 core does not currently have a framework for suspend/resume, the driver now registers a PM notifier callback. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-06-09w1: Add subsystem kernel public interfaceAndrew F. Davis1-1/+1
Like other subsystems we should be able to define slave devices outside of the w1 directory. To do this we move public facing interface definitions to include/linux/w1.h and rename the internal definition file to w1_internal.h. As w1_family.h and w1_int.h contained almost entirely public driver interface definitions we simply removed these files and moved the remaining definitions into w1_internal.h. With this we can now start to move slave devices out of w1/slaves and into the subsystem based on the function they implement, again like other drivers. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Sebastian Reichel <sre@kernel.org> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-16power: ds2760_battery: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-1/+2
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces deprecated create_singlethread_workqueue(). This is the identity conversion. The workqueue "monitor_wqueue" is used to monitor the battery status. It has been identity converted. It queues multiple work items viz &di->monitor_work, &di->set_charged_work, which require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance. WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory pressure. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-11power: move power supply drivers to power/supplySebastian Reichel1-0/+647
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>