diff options
author | Bernhard Messerklinger <bernhard.messerklinger@br-automation.com> | 2025-04-04 09:27:58 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@amd.com> | 2025-04-16 15:39:48 +0200 |
commit | d294e70eee8a98bdc61bf5e6dcf3d25e134df03a (patch) | |
tree | 5d0f77b13b2ab77009b002b00030fd66fff31b27 | |
parent | 970152e4d1d0a839bf004e701ced597e8fc23237 (diff) |
board/BuR/common: add parameter for reset controller I2C bus selection
Normally B&R reset controllers are located at I2C bus 0. This patch adds
the possibility to change this bus number with the kconfig option
BR_RESETC_I2CBUS.
Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Link: https://lore.kernel.org/r/20250404072819.69642-3-bernhard.messerklinger@br-automation.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
-rw-r--r-- | board/BuR/common/Kconfig | 8 | ||||
-rw-r--r-- | board/BuR/common/br_resetc.c | 10 |
2 files changed, 16 insertions, 2 deletions
diff --git a/board/BuR/common/Kconfig b/board/BuR/common/Kconfig new file mode 100644 index 00000000000..490201e7407 --- /dev/null +++ b/board/BuR/common/Kconfig @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# B&R Industrial Automation GmbH - http://www.br-automation.com + +config BR_RESETC_I2CBUS + int "I2C Bus address of B&R reset controller" + depends on SYS_VENDOR = "BuR" && DM_I2C + default 0 diff --git a/board/BuR/common/br_resetc.c b/board/BuR/common/br_resetc.c index f5d09fef3d3..248064f974b 100644 --- a/board/BuR/common/br_resetc.c +++ b/board/BuR/common/br_resetc.c @@ -52,10 +52,16 @@ static int resetc_init(void) { struct udevice *i2cbus; int rc; +#if !defined(BR_RESETC_I2CBUS) + int busno = 0; +#else + int busno = CONFIG_BR_RESETC_I2CBUS; +#endif + + rc = uclass_get_device_by_seq(UCLASS_I2C, busno, &i2cbus); - rc = uclass_get_device_by_seq(UCLASS_I2C, 0, &i2cbus); if (rc) { - printf("Cannot find I2C bus #0!\n"); + printf("Cannot find I2C bus #%d!\n", busno); return -1; } |