<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/power, branch v6.8-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>power: supply: bq24190_charger: Fix "initializer element is not constant" error</title>
<updated>2024-01-19T00:03:17+00:00</updated>
<author>
<name>Nathan Chancellor</name>
<email>nathan@kernel.org</email>
</author>
<published>2024-01-03T16:57:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=17d49b7e47a1001c8796f05f4a2bbdef0a998213'/>
<id>17d49b7e47a1001c8796f05f4a2bbdef0a998213</id>
<content type='text'>
When building with a version of GCC prior to 8.x, there is an error
around non-constant initializer elements:

  drivers/power/supply/bq24190_charger.c:1978:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:1978:16: note: (near initialization for 'bq24190_chip_info_tbl[0].vbus_desc')
  drivers/power/supply/bq24190_charger.c:1989:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:1989:16: note: (near initialization for 'bq24190_chip_info_tbl[1].vbus_desc')
  drivers/power/supply/bq24190_charger.c:2000:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:2000:16: note: (near initialization for 'bq24190_chip_info_tbl[2].vbus_desc')
  drivers/power/supply/bq24190_charger.c:2011:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:2011:16: note: (near initialization for 'bq24190_chip_info_tbl[3].vbus_desc')
  drivers/power/supply/bq24190_charger.c:2022:16: error: initializer element is not constant
     .vbus_desc = bq24296_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:2022:16: note: (near initialization for 'bq24190_chip_info_tbl[4].vbus_desc')

Clang versions prior to 17.x show a similar error:

  drivers/power/supply/bq24190_charger.c:1978:16: error: initializer element is not a compile-time constant
                  .vbus_desc = bq24190_vbus_desc,
                               ^~~~~~~~~~~~~~~~~
  1 error generated.

Newer compilers have decided to accept these structures as compile time
constants as an extension. To resolve this issue for all supported
compilers, change the vbus_desc member in 'struct bq24190_chip_info' to
a pointer, as it is only ever passed by reference anyways, and adjust
the assignments accordingly.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1973
Fixes: b150a703b56f ("power: supply: bq24190_charger: Add support for BQ24296")
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Justin Stitt &lt;justinstitt@google.com&gt;
Link: https://lore.kernel.org/r/20240103-fix-bq24190_charger-vbus_desc-non-const-v1-1-115ddf798c70@kernel.org
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When building with a version of GCC prior to 8.x, there is an error
around non-constant initializer elements:

  drivers/power/supply/bq24190_charger.c:1978:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:1978:16: note: (near initialization for 'bq24190_chip_info_tbl[0].vbus_desc')
  drivers/power/supply/bq24190_charger.c:1989:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:1989:16: note: (near initialization for 'bq24190_chip_info_tbl[1].vbus_desc')
  drivers/power/supply/bq24190_charger.c:2000:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:2000:16: note: (near initialization for 'bq24190_chip_info_tbl[2].vbus_desc')
  drivers/power/supply/bq24190_charger.c:2011:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:2011:16: note: (near initialization for 'bq24190_chip_info_tbl[3].vbus_desc')
  drivers/power/supply/bq24190_charger.c:2022:16: error: initializer element is not constant
     .vbus_desc = bq24296_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:2022:16: note: (near initialization for 'bq24190_chip_info_tbl[4].vbus_desc')

Clang versions prior to 17.x show a similar error:

  drivers/power/supply/bq24190_charger.c:1978:16: error: initializer element is not a compile-time constant
                  .vbus_desc = bq24190_vbus_desc,
                               ^~~~~~~~~~~~~~~~~
  1 error generated.

Newer compilers have decided to accept these structures as compile time
constants as an extension. To resolve this issue for all supported
compilers, change the vbus_desc member in 'struct bq24190_chip_info' to
a pointer, as it is only ever passed by reference anyways, and adjust
the assignments accordingly.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1973
Fixes: b150a703b56f ("power: supply: bq24190_charger: Add support for BQ24296")
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Justin Stitt &lt;justinstitt@google.com&gt;
Link: https://lore.kernel.org/r/20240103-fix-bq24190_charger-vbus_desc-non-const-v1-1-115ddf798c70@kernel.org
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge power-supply fixes for 6.7 cycle</title>
<updated>2024-01-14T20:38:31+00:00</updated>
<author>
<name>Sebastian Reichel</name>
<email>sebastian.reichel@collabora.com</email>
</author>
<published>2024-01-14T20:38:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=05599b5f56b750b5a92ff7f2c081945210816f83'/>
<id>05599b5f56b750b5a92ff7f2c081945210816f83</id>
<content type='text'>
Merge power-supply fixes branch, which I never send for
the v6.7 cycle.

Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Merge power-supply fixes branch, which I never send for
the v6.7 cycle.

Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: bq24190_charger: Add support for BQ24296</title>
<updated>2023-12-24T23:58:14+00:00</updated>
<author>
<name>Hermes Zhang</name>
<email>chenhuiz@axis.com</email>
</author>
<published>2023-12-08T03:47:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b150a703b56fb6eb282d059b421652ccd9155c23'/>
<id>b150a703b56fb6eb282d059b421652ccd9155c23</id>
<content type='text'>
The BQ24296 is most similar to the BQ24196, but the:
1. OTG config is split from CHG config (REG01)
2. ICHG (Fast Charge Current limit) range is smaller (&lt;=3008mA)
3. NTC fault is simplified to 2 bits

Signed-off-by: Hermes Zhang &lt;chenhuiz@axis.com&gt;
Link: https://lore.kernel.org/r/20231208034708.1248389-3-Hermes.Zhang@axis.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The BQ24296 is most similar to the BQ24196, but the:
1. OTG config is split from CHG config (REG01)
2. ICHG (Fast Charge Current limit) range is smaller (&lt;=3008mA)
3. NTC fault is simplified to 2 bits

Signed-off-by: Hermes Zhang &lt;chenhuiz@axis.com&gt;
Link: https://lore.kernel.org/r/20231208034708.1248389-3-Hermes.Zhang@axis.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: qcom_battmgr: Register the power supplies after PDR is up</title>
<updated>2023-12-24T23:02:03+00:00</updated>
<author>
<name>Konrad Dybcio</name>
<email>konrad.dybcio@linaro.org</email>
</author>
<published>2023-12-18T14:41:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b43f7ddc2b7a5a90447d96cb4d3c6d142dd4a810'/>
<id>b43f7ddc2b7a5a90447d96cb4d3c6d142dd4a810</id>
<content type='text'>
Currently, a not-yet-entirely-initialized battmgr (e.g. with pd-mapper
not having yet started or ADSP not being up etc.) results in a couple of
zombie power supply devices hanging around.

This is particularly noticeable when trying to suspend the device (even
s2idle): the PSY-internal thermal zone is inaccessible and returns
-ENODEV, which causes log spam.

Register the power supplies only after we received some notification
indicating battmgr is ready to take off.

Signed-off-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Tested-by: Luca Weiss &lt;luca.weiss@fairphone.com&gt;
Link: https://lore.kernel.org/r/20231218-topic-battmgr_fixture_attempt-v1-1-6145745f34fe@linaro.org
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, a not-yet-entirely-initialized battmgr (e.g. with pd-mapper
not having yet started or ADSP not being up etc.) results in a couple of
zombie power supply devices hanging around.

This is particularly noticeable when trying to suspend the device (even
s2idle): the PSY-internal thermal zone is inaccessible and returns
-ENODEV, which causes log spam.

Register the power supplies only after we received some notification
indicating battmgr is ready to take off.

Signed-off-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Tested-by: Luca Weiss &lt;luca.weiss@fairphone.com&gt;
Link: https://lore.kernel.org/r/20231218-topic-battmgr_fixture_attempt-v1-1-6145745f34fe@linaro.org
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: Fix null pointer dereference in smb2_probe</title>
<updated>2023-12-24T22:43:28+00:00</updated>
<author>
<name>Kunwu Chan</name>
<email>chentao@kylinos.cn</email>
</author>
<published>2023-11-24T07:50:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=88f04bc3e737155e13caddf0ba8ed19db87f0212'/>
<id>88f04bc3e737155e13caddf0ba8ed19db87f0212</id>
<content type='text'>
devm_kasprintf and devm_kzalloc return a pointer to dynamically
allocated memory which can be NULL upon failure.

Fixes: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
Signed-off-by: Kunwu Chan &lt;chentao@kylinos.cn&gt;
Link: https://lore.kernel.org/r/20231124075021.1335289-1-chentao@kylinos.cn
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
devm_kasprintf and devm_kzalloc return a pointer to dynamically
allocated memory which can be NULL upon failure.

Fixes: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
Signed-off-by: Kunwu Chan &lt;chentao@kylinos.cn&gt;
Link: https://lore.kernel.org/r/20231124075021.1335289-1-chentao@kylinos.cn
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: reset: at91: Drop '__init' from at91_wakeup_status()</title>
<updated>2023-12-24T22:43:10+00:00</updated>
<author>
<name>Nathan Chancellor</name>
<email>nathan@kernel.org</email>
</author>
<published>2023-11-20T22:35:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=195c3167865454ea909d717557c8585ccfe1b2a3'/>
<id>195c3167865454ea909d717557c8585ccfe1b2a3</id>
<content type='text'>
When building with clang, there are two section mismatch warnings:

  WARNING: modpost: vmlinux: section mismatch in reference: at91_poweroff_probe+0x7c (section: .text) -&gt; at91_wakeup_status (section: .init.text)
  WARNING: modpost: vmlinux: section mismatch in reference: at91_shdwc_probe+0xcc (section: .text) -&gt; at91_wakeup_status (section: .init.text)

Drop '__init' from at91_wakeup_status() to clear up the mismatch.

Fixes: dde74a5de817 ("power: reset: at91-sama5d2_shdwc: Stop using module_platform_driver_probe()")
Fixes: 099806de68b7 ("power: reset: at91-poweroff: Stop using module_platform_driver_probe()")
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt;
Reviewed-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When building with clang, there are two section mismatch warnings:

  WARNING: modpost: vmlinux: section mismatch in reference: at91_poweroff_probe+0x7c (section: .text) -&gt; at91_wakeup_status (section: .init.text)
  WARNING: modpost: vmlinux: section mismatch in reference: at91_shdwc_probe+0xcc (section: .text) -&gt; at91_wakeup_status (section: .init.text)

Drop '__init' from at91_wakeup_status() to clear up the mismatch.

Fixes: dde74a5de817 ("power: reset: at91-sama5d2_shdwc: Stop using module_platform_driver_probe()")
Fixes: 099806de68b7 ("power: reset: at91-poweroff: Stop using module_platform_driver_probe()")
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt;
Reviewed-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: Use multiple MODULE_AUTHOR statements</title>
<updated>2023-12-24T21:59:28+00:00</updated>
<author>
<name>Charalampos Mitrodimas</name>
<email>charmitro@posteo.net</email>
</author>
<published>2023-11-18T13:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3cbbe1be0e3bd4cac5502eb141dd257ab34a4460'/>
<id>3cbbe1be0e3bd4cac5502eb141dd257ab34a4460</id>
<content type='text'>
This resolves checkpatch warning "quoted string split across lines" on:
	1640: WARNING: quoted string split across lines
	1641: WARNING: quoted string split across lines

The motive to use multiple MODULE_AUTHOR statements came from this
comment from "include/linux/module.h":
	/*
	 * Author(s), use "Name &lt;email&gt;" or just "Name", for multiple
	 * authors use multiple MODULE_AUTHOR() statements/lines.
	 */
	#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)

Signed-off-by: Charalampos Mitrodimas &lt;charmitro@posteo.net&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This resolves checkpatch warning "quoted string split across lines" on:
	1640: WARNING: quoted string split across lines
	1641: WARNING: quoted string split across lines

The motive to use multiple MODULE_AUTHOR statements came from this
comment from "include/linux/module.h":
	/*
	 * Author(s), use "Name &lt;email&gt;" or just "Name", for multiple
	 * authors use multiple MODULE_AUTHOR() statements/lines.
	 */
	#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)

Signed-off-by: Charalampos Mitrodimas &lt;charmitro@posteo.net&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: Fix indentation and some other warnings</title>
<updated>2023-12-24T21:59:28+00:00</updated>
<author>
<name>Charalampos Mitrodimas</name>
<email>charmitro@posteo.net</email>
</author>
<published>2023-11-18T13:29:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c73cc447751898aeac5ef1c0012a03d45721949a'/>
<id>c73cc447751898aeac5ef1c0012a03d45721949a</id>
<content type='text'>
These were mentioned by checkpatch:
	Errors:
		(1) code indent should use tabs where possible
		(2) switch and case should be at the same indent
	Warnings:
		(1) Missing a blank line after declarations

Signed-off-by: Charalampos Mitrodimas &lt;charmitro@posteo.net&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These were mentioned by checkpatch:
	Errors:
		(1) code indent should use tabs where possible
		(2) switch and case should be at the same indent
	Warnings:
		(1) Missing a blank line after declarations

Signed-off-by: Charalampos Mitrodimas &lt;charmitro@posteo.net&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: reset: gpio-restart: Use devm_register_sys_off_handler()</title>
<updated>2023-12-24T21:54:01+00:00</updated>
<author>
<name>Andrew Davis</name>
<email>afd@ti.com</email>
</author>
<published>2023-11-17T16:10:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c04c4ebd452476af1bdfa917105d9da97f01868d'/>
<id>c04c4ebd452476af1bdfa917105d9da97f01868d</id>
<content type='text'>
Use device life-cycle managed register function to simplify probe error
path and eliminate need for explicit remove function.

Signed-off-by: Andrew Davis &lt;afd@ti.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use device life-cycle managed register function to simplify probe error
path and eliminate need for explicit remove function.

Signed-off-by: Andrew Davis &lt;afd@ti.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: bq256xx: fix some problem in bq256xx_hw_init</title>
<updated>2023-11-16T19:23:41+00:00</updated>
<author>
<name>Su Hui</name>
<email>suhui@nfschina.com</email>
</author>
<published>2023-11-16T04:18:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b55d073e6501dc6077edaa945a6dad8ac5c8bbab'/>
<id>b55d073e6501dc6077edaa945a6dad8ac5c8bbab</id>
<content type='text'>
smatch complains that there is a buffer overflow and clang complains
'ret' is never read.

Smatch error:
drivers/power/supply/bq256xx_charger.c:1578 bq256xx_hw_init() error:
buffer overflow 'bq256xx_watchdog_time' 4 &lt;= 4

Clang static checker:
Value stored to 'ret' is never read.

Add check for buffer overflow and error code from regmap_update_bits().

Fixes: 32e4978bb920 ("power: supply: bq256xx: Introduce the BQ256XX charger driver")
Signed-off-by: Su Hui &lt;suhui@nfschina.com&gt;
Link: https://lore.kernel.org/r/20231116041822.1378758-1-suhui@nfschina.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
smatch complains that there is a buffer overflow and clang complains
'ret' is never read.

Smatch error:
drivers/power/supply/bq256xx_charger.c:1578 bq256xx_hw_init() error:
buffer overflow 'bq256xx_watchdog_time' 4 &lt;= 4

Clang static checker:
Value stored to 'ret' is never read.

Add check for buffer overflow and error code from regmap_update_bits().

Fixes: 32e4978bb920 ("power: supply: bq256xx: Introduce the BQ256XX charger driver")
Signed-off-by: Su Hui &lt;suhui@nfschina.com&gt;
Link: https://lore.kernel.org/r/20231116041822.1378758-1-suhui@nfschina.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
