[PATCH v2] sh: sh7785lcr: register the PCA9564 as I2C bus 0
From: Karl Mehltretter
Date: Sun Oct 04 2026 - 14:47:30 EST
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@xxxxxxxxxxxxxxxxxxx>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx>
Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
---
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@xxxxxxxxx/
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