Re: [PATCH v11 10/37] pinctrl: airoha: fix I2C1 pin mux config for AN7581

[email protected]
Newsgroups org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Setting I2C1 to master mode fails to explicitly clear the mutually exclusive I2C slave mode bit, risking hardware conflicts.
--

--- Patch [10]: [PATCH v11 10/37] pinctrl: airoha: fix I2C1 pin mux config for AN7581 ---
commit b286eed89799e719b07da2fdf90f3f9a8f22ef3b
Author: Daniel Schwierzeck <[email protected]>

pinctrl: airoha: fix I2C1 pin mux config for AN7581

This commit updates the i2c1 pin group configuration to enable I2C1 master
mode by default on the AN7581. It adds the master mode bit to the regmap
update for REG_GPIO_2ND_I2C_MODE.

> diff --git a/drivers/pinctrl/airoha/pinctrl-airoha.c b/drivers/pinctrl/airoha/pinctrl-airoha.c
> index ee2bd0ee8c40f..2695342adfc76 100644
> --- a/drivers/pinctrl/airoha/pinctrl-airoha.c
> +++ b/drivers/pinctrl/airoha/pinctrl-airoha.c
> @@ -1158,8 +1158,8 @@ static const struct airoha_pinctrl_func_group i2c_func_group[] = {
>  		.regmap[0] = {
>  			AIROHA_FUNC_MUX,
>  			REG_GPIO_2ND_I2C_MODE,
> -			GPIO_2ND_I2C_MODE_MASK,
> -			GPIO_2ND_I2C_MODE_MASK
> +			GPIO_2ND_I2C_MODE_MASK | GPIO_I2C_MASTER_MODE_MODE,
> +			GPIO_2ND_I2C_MODE_MASK | GPIO_I2C_MASTER_MODE_MODE,

[Severity: Medium]
Does this mask need to include GPIO_I2C_SLAVE_MODE_MODE to ensure the slave
mode bit is explicitly cleared?

If a bootloader leaves the hardware in slave mode before the kernel boots,
could omitting GPIO_I2C_SLAVE_MODE_MODE from the mask result in both master
and slave mode bits being set simultaneously, potentially causing a hardware
conflict on the I2C bus?

>  		},
>  		.regmap_size = 1,
>  	},

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=10
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.