Commit Graph

34 Commits

Author SHA1 Message Date
Linus Torvalds 4520dcbe0d power supply and reset changes for the v5.15 series
battery/charger related changes:
  - cros-peripheral-charger: new driver
  - mt6360-charger: new driver
  - simple-battery: support reading chemistry info
  - max17042-battery: add max77849 support
  - sbs-battery: add time_to_empty_now support
  - smb347-charger: prepare USB OTG support
  - rn5t618: add voltage_now support
  - axp288: cleanup & optimizations
  - max17042_battery: cleanups
  - ab8500: cleanups
  - misc minor cleanups and DT binding fixes
 
 reset related changes:
  - tps65086-restart: new driver
  - linkstation-poweroff: support NETGEAR ReadyNAS Duo v2
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmEmUVwACgkQ2O7X88g7
 +poFbA//XimqwjO0MR7xqmm2905l78L3L1cNn7vRPzfdPbcf/kKPg8Jrx8kTn1EK
 wKdbP4ZQJOIyCLIFcI6oURUaNHh485KXj4DFvT13AsbkPw+2xUv0Ha5p8J698QAG
 RPmkTNHk+0M/K+/Z7/GPb6t0B7uQi3cg7/aIZeFo26FYpIP5XekoxP1xoLfE9lO2
 aSrSbDh8oIjOLFPc4nuzm0x4Bcg/MpbUG1nhTBdP8OD8xjuMSmDUnbEvLgQYv4oP
 9PLbi4jxm0VSfFhdECCSZ+x7CO0+wqxLXWCoOGlzDQ1Y2OYp9nG+Xgsj46HGh38c
 11WER/16J7AfzUg1zqfu7NKDOKWad+TsTvQgXVK4GAxDOxpOS8Hz7GuP0/nnZBLx
 PoDAb7ZBtb6QXJDEvCDWoo+yMcZRaULbefQCgR/ys6bWoL+B6wdowxfV/daFGpmx
 fAMDGoSGrmYJhbPkcfAVJrN196zd5EQzbB6pyOfAPu3lJiDz+M/DyPNYwkljagAx
 JzSK80cwtXk07lgZZvC8Z3MJruN5pqqvWX/TA8l7dHpReoguCM3hAPUJ9pdVoIa7
 haavL0UzLwya9C2sK9hcys8EBim5thkXI6GsnpRxiztkXZh0LtsUP9Dydt2srGA6
 Hl4BD/g23W9+zmjkAIAvgMwbBoZ2/SHkD7l3ZqG2N2j6LrQxpwc=
 =UcdD
 -----END PGP SIGNATURE-----

Merge tag 'for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 "Battery/charger related:
   - cros-peripheral-charger: new driver
   - mt6360-charger: new driver
   - simple-battery: support reading chemistry info
   - max17042-battery: add max77849 support
   - sbs-battery: add time_to_empty_now support
   - smb347-charger: prepare USB OTG support
   - rn5t618: add voltage_now support
   - axp288: cleanup & optimizations
   - max17042_battery: cleanups
   - ab8500: cleanups
   - misc minor cleanups and DT binding fixes

  reset related:
   - tps65086-restart: new driver
   - linkstation-poweroff: support NETGEAR ReadyNAS Duo v2"

* tag 'for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (51 commits)
  power: supply: core: Fix parsing of battery chemistry/technology
  power: supply: max17042_battery: log SOC threshold using debug log level
  power: supply: max17042_battery: more robust chip type checks
  power: supply: max17042_battery: fix typo in MAx17042_TOFF
  power: supply: max17042_battery: clean up MAX17055_V_empty
  power: supply: smb347-charger: Implement USB VBUS regulator
  power: supply: smb347-charger: Add missing pin control activation
  power: supply: smb347-charger: Utilize generic regmap caching
  power: supply: smb347-charger: Make smb347_set_writable() IRQ-safe
  dt-bindings: power: supply: smb347-charger: Document USB VBUS regulator
  power: reset: Add TPS65086 restart driver
  dt-bindings: power: supply: max17042: describe interrupt
  power: supply: max17042: remove duplicated STATUS bit defines
  power: supply: max17042: handle fails of reading status register
  power: supply: core: Parse battery chemistry/technology
  dt-bindings: power: Extend battery bindings with chemistry
  power: reset: linkstation-poweroff: add new device
  power: reset: linkstation-poweroff: prepare for new devices
  power: supply: bq24735: reorganize ChargeOption command macros
  power: supply: rn5t618: Add voltage_now property
  ...
2021-08-30 11:47:32 -07:00
Linus Walleij 484a9cc3dc power: supply: ab8500: Drop abx500 concept
Drop the entire idea with abx500 being abstract and different from ab8500
in the AB8500 charging drivers. This rids the two identical definitions
of a slew of structs in ab8500-bm.h and makes things less confusion and
easier to understand.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-07-16 15:14:30 +02:00
Linus Walleij f820547446 power: supply: ab8500: Use library interpolation
The kernel already has a static inline for linear interpolation
so use that instead of rolling our own.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-07-16 15:14:30 +02:00
Gustavo A. R. Silva b51883d47d power: supply: Fix fall-through warnings for Clang
Fix the following fallthrough warnings:

drivers/power/supply/ab8500_fg.c:1730:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
drivers/power/supply/abx500_chargalg.c:1155:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2021-07-13 14:50:47 -05:00
Zou Wei dfe52db13a power: supply: ab8500: add missing MODULE_DEVICE_TABLE
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-06-30 00:00:01 +02:00
Linus Walleij 7e2bb83c61 power: supply: ab8500: Call battery population once
The code was calling ab8500_bm_of_probe() in four different
spots effectively overwriting the same configuration three
times. This was done because probe order was uncertain.

Since we now used componentized probe, call it only once
while probing the main charging component.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-06-03 18:40:15 +02:00
Linus Walleij 1c1f13a006 power: supply: ab8500: Move to componentized binding
The driver has problems with the different components of
the charging code racing with each other to probe().

This results in all four subdrivers populating battery
information to ascertain that it is populated for their
own needs for example.

Fix this by using component probing and thus expressing
to the kernel that these are dependent components.
The probes can happen in any order and will only acquire
resources such as state container, regulators and
interrupts and initialize the data structures, but no
execution happens until the .bind() callback is called.

The charging driver is the main component and binds
first, then bind in order the three subcomponents:
ab8500-fg, ab8500-btemp and ab8500-chargalg.

Do some housekeeping while we are moving the code around.
Like use devm_* for IRQs so as to cut down on some
boilerplate.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-06-03 18:40:15 +02:00
Jian Xin 94233f11f8 power: supply: ab8500: Fix typo
fix misspelled 'interrupts'

Signed-off-by: Jian Xin <xinjian@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-06-03 18:40:10 +02:00
Linus Walleij 417c0fc24d mfd/power: ab8500: Push data to power supply code
The global definition of platform data for the battery
management code has no utility after the OF conversion,
move the <linux/mfd/abx500/ab8500-bm.h> to be a local
file in drivers/power/supply and stop defining the
platform data in drivers/power/supply/ab8500_bmdata.c
and broadcast to the kernel only to have it assigned
as platform data to the MFD cells and then picked back
into the same subsystem that defined it in the first
place. This kills off a layer of indirection.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-03-22 14:55:38 +00:00
Linus Walleij 53207aa1a7 power: ab8500: Require device tree
The core AB8500 driver and the whole platform is completely
dependent on being probed from device tree so remove the
non-DT probe paths.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-03-22 14:55:06 +00:00
Zheng Yongjun f005e63100 power: supply: ab8500_fg: convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-01-16 12:38:22 +01:00
Linus Walleij 36f1de0d5c power: supply: ab8500: Use dev_err_probe() for IIO channels
The code obtaining the ADC channels is outdated: it is
trying to work around the IIO subsystem not returning
the right -EPROBE_DEFER error code. Fix this up
by using the dev_err_probe() helper so we defer silently
where appropriate and not bail out if the IIO core
returns -EPROBE_DEFER as happens now.

Cc: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-12 22:11:18 +01:00
Linus Walleij 807042539d power: supply: ab8500_fg: Request all IRQs as threaded
Since these IRQs are cascaded from a nested IRQ, the
generic IRQ system detects this and refuse to deliver
a fastpath IRQ in response to request_irq():

  nested = irq_settings_is_nested_thread(desc);
  if (nested) {
          if (!new->thread_fn) {
                  ret = -EINVAL;
                  goto out_mput;
          }
   (...)

Threaded IRQs work just as well so let's just request
threaded IRQs. One of the IRQs are alread requested
as threaded anyways.

Cc: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-12 22:08:27 +01:00
Linus Walleij f8efa0a881 power: supply: ab8500: Convert to dev_pm_ops
Switch over to using generic dev_pm_ops since these
drivers aren't even using the special power state passed
to the legacy call.

Cc: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-12 22:06:57 +01:00
Linus Walleij ad89cb5f0a power: supply: ab8500: Use local helper
Use a local "dev" helper variable to make the probe()
code easier to read in the ab8500 subdrivers.

Drop out-of-memory messages as these should come from the
slab core.

Cc: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-12 21:30:08 +01:00
Linus Torvalds 38525c6919 power supply and reset changes for the v5.10 series
power-supply core:
  * Add wireless type
  * Properly document current direction
 
 battery/charger driver changes:
  * New fuel-gauge/charger driver for RN5T618/RN5T619
  * New charger driver for BQ25980, BQ25975 and BQ25960
  * bq27xxx-battery: add support for TI bq34z100
  * gpio-charger: convert to GPIO descriptors
  * gpio-charger: add optional support for charge current limiting
  * max17040: add support for max17041, max17043, max17044
  * max17040: add support for max17048, max17049, max17058, max17059
  * smb347-charger: add DT support
  * smb247-charger: add SMB345 and SMB358 support
  * simple-battery: add temperature properties
  * lots of minor fixes, cleanups and DT binding YAML conversions
 
 reset drivers:
  * ocelot: Add support for Sparx5
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAl+IsXoACgkQ2O7X88g7
 +prL8RAAprDcwF5irflM2bWwzKnfuNgTjk6P/o9gIWiSJsNA1R3XKJEm6l38givV
 EhnceGaZXgWg8blh3htd5Z6DNEEFX5ucB9KtQESW5ehM/KGvcEwD7CJilSJejqt4
 3AQiFQLa41s4tnBBao/9gp+juSsvwg2NoeCaOa1H2K5oVi7WDmnmQyexa6CAty7b
 D4Uz8EOfpVi9FvYalffGP7QkA5ZsNWSLRRLJshHCw6QH54+h51F5efhu5S5qxXEA
 L/yjfFFhiB99df7y4LzvCItfaTGLcLNFfCas4+0yOWnViXosIr9rQk51FihXaDot
 DBCyF6hHWFDCnymnjMjWclYeatPFw+jnPrjmn+b0mQ/RaTgz30tgvuZurepcCwN/
 ZKZftnvN16VAnUYgrE397F706sBZHjE6NonWvpXExawNUznA4h2uTu1bwWhtp5Um
 gcIjhL0ePEMf1yAYW3iI/l70NfIgPoEep6w+8oyLgV4vvffkKxkHkndoV7ZcS79M
 OdKbgGq4ZBNTS8ABsjHDO0o+/vBuKa3KE3/2J+916G3mc8FM6WJBfo1mIuwD51GA
 ASwG4UlE1Kyu91z4rP15GGMwSho7UKvWORB5ECsmfZ8xjiJSRHJAiDhmiaSaZZi0
 dc5JKVDdM056IWOuP8THEVG6r3BiG/B1i8eY4YJ6GPv82JP/iks=
 =QtfI
 -----END PGP SIGNATURE-----

Merge tag 'for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 "Power-supply core:
   - add wireless type
   - properly document current direction

  Battery/charger driver changes:
   - new fuel-gauge/charger driver for RN5T618/RN5T619
   - new charger driver for BQ25980, BQ25975 and BQ25960
   - bq27xxx-battery: add support for TI bq34z100
   - gpio-charger: convert to GPIO descriptors
   - gpio-charger: add optional support for charge current limiting
   - max17040: add support for max17041, max17043, max17044
   - max17040: add support for max17048, max17049, max17058, max17059
   - smb347-charger: add DT support
   - smb247-charger: add SMB345 and SMB358 support
   - simple-battery: add temperature properties
   - lots of minor fixes, cleanups and DT binding YAML conversions

  Reset drivers:
   - ocelot: Add support for Sparx5"

* tag 'for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (81 commits)
  power: reset: POWER_RESET_OCELOT_RESET should depend on Ocelot or Sparx5
  power: supply: bq25980: Fix uninitialized wd_reg_val and overrun
  power: supply: ltc2941: Fix ptr to enum cast
  power: supply: test-power: revise parameter printing to use sprintf
  power: supply: charger-manager: fix incorrect check on charging_duration_ms
  power: supply: max17040: Fix ptr to enum cast
  power: supply: bq25980: Fix uninitialized wd_reg_val
  power: supply: bq25980: remove redundant zero check on ret
  power: reset: ocelot: Add support for Sparx5
  dt-bindings: reset: ocelot: Add Sparx5 support
  power: supply: sbs-battery: keep error code when get_property() fails
  power: supply: bq25980: Add support for the BQ259xx family
  dt-binding: bq25980: Add the bq25980 flash charger
  power: supply: fix spelling mistake "unprecise" -> "imprecise"
  power: supply: test_power: add missing newlines when printing parameters by sysfs
  power: supply: pm2301: drop duplicated i2c_device_id
  power: supply: charger-manager: drop unused charger assignment
  power: supply: rt9455: skip 'struct acpi_device_id' when !CONFIG_ACPI
  power: supply: goldfish: skip 'struct acpi_device_id' when !CONFIG_ACPI
  power: supply: bq25890: skip 'struct acpi_device_id' when !CONFIG_ACPI
  ...
2020-10-20 10:56:34 -07:00
Wang Qing ec3af53aa4 power: supply: ab8500-fg: fix spelling typo
Modify the comment typo: "compliment" -> "complement".

Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-09-30 01:12:22 +02:00
Gustavo A. R. Silva df561f6688 treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-08-23 17:36:59 -05:00
Jason Yan ddd86c9534 power: supply: ab8500_fg: remove comparison to bool
Fix the following coccicheck warning:

drivers/power/supply/ab8500_fg.c:2402:5-24: WARNING: Comparison to bool

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-04-28 21:18:47 +02:00
Ma Feng c6ef5234ef power: supply: ab8500: Remove unneeded semicolon
Fixes coccicheck warning:

drivers/power/supply/ab8500_fg.c:2224:5-6: Unneeded semicolon
drivers/power/supply/ab8500_fg.c:2227:4-5: Unneeded semicolon
drivers/power/supply/ab8500_fg.c:2334:3-4: Unneeded semicolon
drivers/power/supply/ab8500_fg.c:2342:3-4: Unneeded semicolon
drivers/power/supply/ab8500_fg.c:2350:3-4: Unneeded semicolon
drivers/power/supply/ab8500_fg.c:2358:3-4: Unneeded semicolon
drivers/power/supply/ab8500_fg.c:2366:3-4: Unneeded semicolon

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ma Feng <mafeng.ma@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-12-19 18:05:28 +01:00
Krzysztof Kozlowski b10e97003d power: supply: ab8500: Handle invalid IRQ from platform_get_irq_byname()
platform_get_irq_byname() might return -errno which later would be
cast to an unsigned int and used in request_irq().

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-10-20 15:18:44 +02:00
Krzysztof Kozlowski 2410899327 power: supply: ab8500_fg: Do not free non-requested IRQs in probe's error path
When requesting interrupt fails, free only interrupts already requested,
not all of them.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-10-20 15:18:08 +02:00
Krzysztof Kozlowski ccc023a581 power: supply: ab8500: Cleanup probe in reverse order
It is logical to cleanup in probe's error path in reverse order to
previous actions.  It also makes easier to add additional goto labels
within this error path.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-10-20 15:17:15 +02:00
Linus Walleij 1e82623c3c power: supply: ab8500_fg: Convert to IIO ADC
This switches the AB8500 fuel gauge driver to using
the standard IIO ADC channel lookup and conversion routines.

Acked-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18 19:37:03 +01:00
Thomas Gleixner 0376148f30 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 197
Based on 1 normalized pattern(s):

  license terms gnu general public license v2

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 37 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Steve Winslow <swinslow@gmail.com>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170027.724130665@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30 11:29:22 -07:00
Dan Carpenter 54baff8d4e power: supply: ab8500_fg: silence uninitialized variable warnings
If kstrtoul() fails then we print "charge_full" when it's uninitialized.
The debug printk doesn't add anything so I deleted it and cleaned these
two functions up a bit.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-09-16 11:40:46 +02:00
Ding Xiang b00b04aa66 power: supply: ab8500_fg: fix obsolete function
simple_strtoul is obsolete, and use kstrtoint instead

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-08-30 00:06:45 +02:00
Arnd Bergmann 8b0d62d49a power: supply: ab8500: stop using getnstimeofday64()
getnstimeofday64() is deprecated in favor of the ktime_get() family.

The direct replacement would be ktime_get_real_ts64(), but we only need
the seconds value, and it seems better to use boottime than real time
to avoid unexpected behavior with a concurrent settimeofday().

ktime_get_seconds() might also work, but it seems better to use
boottime than monotonic time since I assume that the charging
process continues during suspend.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-07-06 16:58:02 +02:00
Linus Walleij 4c4268dc97 power: supply: ab8500: Drop AB8540/9540 support
The AB8540 was an evolved version of the AB8500, but it was never
mass produced or put into products, only reference designs exist.
The upstream support was never completed and it is unlikely that
this will happen so drop the support for now to simplify
maintenance of the AB8500.

Cc: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-04-25 23:49:44 +02:00
Colin Ian King 8c2fac99f2 power: supply: ab8500_fg: fix spelling mistake: "Disharge" -> "Discharge"
Trivial fix to spelling mistake in dev_dbg message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-04-25 23:46:24 +02:00
Julia Lawall 32c52eff6a power: supply: improve function-level documentation
In drivers/power/supply/ab8500_fg.c, fix two typos and adjust the function
name in two cases to correspond to the names of the defined functions.

In drivers/power/supply/power_supply_core.c, change two variable names to
the names of the corresponding parameters.

Issue detected using Coccinelle (http://coccinelle.lip6.fr/)

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-10-19 05:06:22 +02:00
Masahiro Yamada f04f7aef7f power: supply: ab8500: cleanup with list_first_entry_or_null()
The combo of list_empty() check and return list_first_entry()
can be replaced with list_first_entry_or_null().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-19 21:22:10 +02:00
Bhaktipriya Shridhar 1c53f3709c power: ab8500_fg: Remove deprecated create_singlethread_workqueue
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces
deprecated create_singlethread_workqueue(). This is the identity
conversion.

The workqueue "fg_wq" is used for running the FG algorithm periodically.
It has been identity converted.

It has multiple work items viz fg_periodic_work, fg_low_bat_work,
fg_reinit_work, fg_work, fg_acc_cur_work and fg_check_hw_failure_work,
which require execution ordering. Hence, a dedicated ordered workqueue
has been used here.

The WQ_MEM_RECLAIM flag has been set to guarantee forward progress under
memory pressure.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:54:37 +02:00
Sebastian Reichel 8c0984e5a7 power: move power supply drivers to power/supply
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>
2016-08-11 01:11:03 +02:00