i2c: fsi: Fixes for systems with more ports
Subsystems (2)
Eddie James
maintainerv2 cover i2c: fsi: Fixes for systems with more ports
This series fixes a register definition for the FSI-attached I2C master to allow all the available ports. In addition, the code to add an adapter for each port is modified to require a device-tree entry for the bus. This is so that systems with lots of busses that have no devices on them don't add lots of unecessary devices.
Changes since v1:
- Remove the check for null device node since that is checked in of_device_is_available
Eddie James (2):
i2c: fsi: Fix the port number field in status register
i2c: fsi: Prevent adding adapters for ports without dts nodes
drivers/i2c/busses/i2c-fsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.24.0
Eddie James
maintainerPATCH v2 1/2 i2c: fsi: Fix the port number field in status register
The port number field in the status register was not correct, so fix it.
--- drivers/i2c/busses/i2c-fsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-fsi.c +1 -1
@@ -98,7 +98,7 @@#define I2C_STAT_DAT_REQ BIT(25)#define I2C_STAT_CMD_COMP BIT(24)#define I2C_STAT_STOP_ERR BIT(23) -#define I2C_STAT_MAX_PORT GENMASK(19, 16) +#define I2C_STAT_MAX_PORT GENMASK(22, 16)#define I2C_STAT_ANY_INT BIT(15)#define I2C_STAT_SCL_IN BIT(11)#define I2C_STAT_SDA_IN BIT(10)
Signature · 1 line
2.24.0
Wolfram Sang
AppliedRe: [PATCH v2 1/2] i2c: fsi: Fix the port number field in status register
Quoted 5 lines · Eddie James
The port number field in the status register was not correct, so fix it.
Fixes d6ffb6300116 ("i2c: Add FSI-attached I2C master algorithm")Signed-off-by Eddie James <[email protected]>Signed-off-by Joel Stanley <[email protected]>
Applied to for-current, thanks!
Eddie James
maintainerPATCH v2 2/2 i2c: fsi: Prevent adding adapters for ports without dts nodes
In reply to Eddie JamesPorts should be defined in the devicetree if they are to be enabled on the system.
---
Changes since v1:
- Remove the check for null device node since that is checked in of_device_is_available
drivers/i2c/busses/i2c-fsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-fsi.c +1 -1
@@ -703,7 +703,7 @@ static int fsi_i2c_probe(struct device *dev)for (port_no =0 ; port_no < ports; port_no++) { np =fsi_i2c_find_port_of_node (dev->of_node, port_no); -if (np && !of_device_is_available (np)) +if (!of_device_is_available (np))continue ; port =kzalloc (sizeof (*port),GFP_KERNEL );
Signature · 1 line
2.24.0
Re: [PATCH v2 2/2] i2c: fsi: Prevent adding adapters for ports without dts nodes
Quoted 2 lines · Eddie James
Ports should be defined in the devicetree if they are to be enabled on the system.
The patch description does not really fit anymore, does it? There is no change in behaviour, we just remove a redundant check.
Quoted 27 lines
Signed-off-by Eddie James <[email protected]>Signed-off-by Joel Stanley <[email protected]>---
Changes since v1:
- Remove the check for null device node since that is checked inof_device_is_availabledrivers/i2c/busses/i2c-fsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-fsi.c +1
-1@@ -703,7 +703,7 @@ static int fsi_i2c_probe(struct device *dev)for (port_no =0 ; port_no < ports; port_no++) { np =fsi_i2c_find_port_of_node (dev->of_node, port_no); -if (np && !of_device_is_available (np)) +if (!of_device_is_available (np))continue ; port =kzalloc (sizeof (*port),GFP_KERNEL );Signature · 1 line
2.24.0
Eddie James
maintainerRe: [PATCH v2 2/2] i2c: fsi: Prevent adding adapters for ports without dts nodes
Quoted 5 lines · Wolfram Sang
Quoted 2 lines · Eddie James
Ports should be defined in the devicetree if they are to be enabled on the system.
The patch description does not really fit anymore, does it? There is no change in behaviour, we just remove a redundant check.
Hi, it does change the behavior actually. By checking for the device node pointer, it would proceed and create the port for a NULL device node, which is not the desired behavior.
Thanks,
Eddie
Quoted 27 lines
Quoted 27 lines
Signed-off-by Eddie James <[email protected]>Signed-off-by Joel Stanley <[email protected]>---
Changes since v1:
- Remove the check for null device node since that is checked inof_device_is_availabledrivers/i2c/busses/i2c-fsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-fsi.c +1
-1@@ -703,7 +703,7 @@ static int fsi_i2c_probe(struct device *dev)for (port_no =0 ; port_no < ports; port_no++) { np =fsi_i2c_find_port_of_node (dev->of_node, port_no); -if (np && !of_device_is_available (np)) +if (!of_device_is_available (np))continue ; port =kzalloc (sizeof (*port),GFP_KERNEL );Signature · 1 line
2.24.0
Re: [PATCH v2 2/2] i2c: fsi: Prevent adding adapters for ports without dts nodes
Quoted 4 lines
Hi, it does change the behavior actually. By checking for the device node pointer, it would proceed and create the port for a NULL device node, which is not the desired behavior.
Brown paper bag, please...
Wolfram Sang
AppliedRe: [PATCH v2 2/2] i2c: fsi: Prevent adding adapters for ports without dts nodes
In reply to Eddie JamesQuoted 5 lines · Eddie James
Ports should be defined in the devicetree if they are to be enabled on the system.
Signed-off-by Eddie James <[email protected]>Signed-off-by Joel Stanley <[email protected]>
Applied to for-next, thanks!
Quoted 7 lines · Eddie James
This series fixes a register definition for the FSI-attached I2C master to allow all the available ports. In addition, the code to add an adapter for each port is modified to require a device-tree entry for the bus. This is so that systems with lots of busses that have no devices on them don't add lots of unecessary devices.
FWIW,
Quoted 14 lines
Changes since v1:
- Remove the check for null device node since that is checked inof_device_is_availableEddie James (2):
i2c: fsi: Fix the port number field in status register
i2c: fsi: Prevent adding adapters for ports without dts nodesdrivers/i2c/busses/i2c-fsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)--
2.24.0
Signature · 2 lines
With Best Regards, Andy Shevchenko