mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] sh: sh7785lcr: register the PCA9564 as I2C bus 0
@ 2026-10-04 18:46 Karl Mehltretter
  2026-10-04 20:34 ` John Paul Adrian Glaubitz
  2026-10-13 17:25 ` John Paul Adrian Glaubitz
  0 siblings, 2 replies; 3+ messages in thread
From: Karl Mehltretter @ 2026-10-04 18:46 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker
  Cc: Karl Mehltretter, John Paul Adrian Glaubitz, Geert Uytterhoeven,
	linux-sh, linux-kernel, Geert Uytterhoeven

Before commit 44454baa7ca7 ("i2c: Dynamically assign adapter id if it
wasn't explictly specified"), a negative ID was replaced by zero, and
I2C bus zero was instantiated. Since that commit, a negative ID is passed
verbatim, instantiating an I2C bus with a dynamic number. As SH boards
still use i2c_register_board_info(0, ...) to register I2C devices, they
rely on the I2C bus being bus zero.

The SH7785LCR is the only SH board whose I2C adapter has a negative ID.
Its PCA9564 becomes i2c-1, causing registration of the R2025S/D RTC to
fail, and hwclock finds no /dev/rtc0.

Set the platform device ID to 0, so that the adapter is registered as
bus zero again.

Fixes: 44454baa7ca7 ("i2c: Dynamically assign adapter id if it wasn't explictly specified")
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---

v2:
- Rewrite the commit message based on Geert's suggested wording.
- Add the tags from Adrian and Geert.
- No code change.

v1: https://lore.kernel.org/r/20261003082833.21511-1-kmehltretter@gmail.com/

 arch/sh/boards/board-sh7785lcr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
index 25c4968f0d8b..b93423df582f 100644
--- a/arch/sh/boards/board-sh7785lcr.c
+++ b/arch/sh/boards/board-sh7785lcr.c
@@ -256,7 +256,7 @@ static struct i2c_pca9564_pf_platform_data i2c_platform_data = {
 
 static struct platform_device i2c_device = {
 	.name		= "i2c-pca-platform",
-	.id		= -1,
+	.id		= 0,
 	.dev		= {
 		.platform_data	= &i2c_platform_data,
 	},
-- 
2.53.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] sh: sh7785lcr: register the PCA9564 as I2C bus 0
  2026-10-04 18:46 [PATCH v2] sh: sh7785lcr: register the PCA9564 as I2C bus 0 Karl Mehltretter
@ 2026-10-04 20:34 ` John Paul Adrian Glaubitz
  2026-10-13 17:25 ` John Paul Adrian Glaubitz
  1 sibling, 0 replies; 3+ messages in thread
From: John Paul Adrian Glaubitz @ 2026-10-04 20:34 UTC (permalink / raw)
  To: Karl Mehltretter, Yoshinori Sato, Rich Felker
  Cc: Geert Uytterhoeven, linux-sh, linux-kernel, Geert Uytterhoeven

Hi Karl,

On Sun, 2026-10-04 at 20:46 +0200, Karl Mehltretter wrote:
> Before commit 44454baa7ca7 ("i2c: Dynamically assign adapter id if it
> wasn't explictly specified"), a negative ID was replaced by zero, and
> I2C bus zero was instantiated. Since that commit, a negative ID is passed
> verbatim, instantiating an I2C bus with a dynamic number. As SH boards
> still use i2c_register_board_info(0, ...) to register I2C devices, they
> rely on the I2C bus being bus zero.
> 
> The SH7785LCR is the only SH board whose I2C adapter has a negative ID.
> Its PCA9564 becomes i2c-1, causing registration of the R2025S/D RTC to
> fail, and hwclock finds no /dev/rtc0.
> 
> Set the platform device ID to 0, so that the adapter is registered as
> bus zero again.
> 
> Fixes: 44454baa7ca7 ("i2c: Dynamically assign adapter id if it wasn't explictly specified")
> Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
> ---
> 
> v2:
> - Rewrite the commit message based on Geert's suggested wording.
> - Add the tags from Adrian and Geert.
> - No code change.
> 
> v1: https://lore.kernel.org/r/20261003082833.21511-1-kmehltretter@gmail.com/
> 
>  arch/sh/boards/board-sh7785lcr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
> index 25c4968f0d8b..b93423df582f 100644
> --- a/arch/sh/boards/board-sh7785lcr.c
> +++ b/arch/sh/boards/board-sh7785lcr.c
> @@ -256,7 +256,7 @@ static struct i2c_pca9564_pf_platform_data i2c_platform_data = {
>  
>  static struct platform_device i2c_device = {
>  	.name		= "i2c-pca-platform",
> -	.id		= -1,
> +	.id		= 0,
>  	.dev		= {
>  		.platform_data	= &i2c_platform_data,
>  	},

Thanks a lot! I'll merge it in the upcoming week together with some
more pending patches. This patch will then be part of v7.4.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] sh: sh7785lcr: register the PCA9564 as I2C bus 0
  2026-10-04 18:46 [PATCH v2] sh: sh7785lcr: register the PCA9564 as I2C bus 0 Karl Mehltretter
  2026-10-04 20:34 ` John Paul Adrian Glaubitz
@ 2026-10-13 17:25 ` John Paul Adrian Glaubitz
  1 sibling, 0 replies; 3+ messages in thread
From: John Paul Adrian Glaubitz @ 2026-10-13 17:25 UTC (permalink / raw)
  To: Karl Mehltretter, Yoshinori Sato, Rich Felker
  Cc: Geert Uytterhoeven, linux-sh, linux-kernel, Geert Uytterhoeven

On Sun, 2026-10-04 at 20:46 +0200, Karl Mehltretter wrote:
> Before commit 44454baa7ca7 ("i2c: Dynamically assign adapter id if it
> wasn't explictly specified"), a negative ID was replaced by zero, and
> I2C bus zero was instantiated. Since that commit, a negative ID is passed
> verbatim, instantiating an I2C bus with a dynamic number. As SH boards
> still use i2c_register_board_info(0, ...) to register I2C devices, they
> rely on the I2C bus being bus zero.
> 
> The SH7785LCR is the only SH board whose I2C adapter has a negative ID.
> Its PCA9564 becomes i2c-1, causing registration of the R2025S/D RTC to
> fail, and hwclock finds no /dev/rtc0.
> 
> Set the platform device ID to 0, so that the adapter is registered as
> bus zero again.
> 
> Fixes: 44454baa7ca7 ("i2c: Dynamically assign adapter id if it wasn't explictly specified")
> Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
> ---
> 
> v2:
> - Rewrite the commit message based on Geert's suggested wording.
> - Add the tags from Adrian and Geert.
> - No code change.
> 
> v1: https://lore.kernel.org/r/20261003082833.21511-1-kmehltretter@gmail.com/
> 
>  arch/sh/boards/board-sh7785lcr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
> index 25c4968f0d8b..b93423df582f 100644
> --- a/arch/sh/boards/board-sh7785lcr.c
> +++ b/arch/sh/boards/board-sh7785lcr.c
> @@ -256,7 +256,7 @@ static struct i2c_pca9564_pf_platform_data i2c_platform_data = {
>  
>  static struct platform_device i2c_device = {
>  	.name		= "i2c-pca-platform",
> -	.id		= -1,
> +	.id		= 0,
>  	.dev		= {
>  		.platform_data	= &i2c_platform_data,
>  	},

Merged into for-next for v7.4.

Thanks,
Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-13 17:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-04 18:46 [PATCH v2] sh: sh7785lcr: register the PCA9564 as I2C bus 0 Karl Mehltretter
2026-10-04 20:34 ` John Paul Adrian Glaubitz
2026-10-13 17:25 ` John Paul Adrian Glaubitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®