Re: [PATCH] sh: sh7785lcr: register the PCA9564 as I2C bus 0
From: John Paul Adrian Glaubitz
Date: Sat Oct 03 2026 - 05:07:51 EST
On Sat, 2026-10-03 at 10:28 +0200, Karl Mehltretter wrote:
> The R2025S/D board information is registered on I2C bus 0. Commit
> 44454baa7ca7 ("i2c: Dynamically assign adapter id if it wasn't explictly
> specified") changed the PCA9564 platform driver to pass negative platform
> device IDs to the I2C core. The SH7785LCR device uses ID -1, so the core
> assigns it a dynamic bus number. Reserving bus 0 for the board information
> makes i2c-1 the first dynamic bus, and the RTC is never instantiated.
>
> Set the platform device ID to 0 so the adapter is registered as i2c-0 and
> the RTC board information matches it.
>
> Fixes: 44454baa7ca7 ("i2c: Dynamically assign adapter id if it wasn't explictly specified")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
> ---
>
> Tested with 29-bit and 32-bit kernels on a custom QEMU model of the
> SH7785LCR. Both registered the controller as i2c-0 and the R2025S/D as
> rtc0.
> Testing on real hardware is welcome.
>
> 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,
> },
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx>
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913