Skip to content

Commit 401a8e9

Browse files
Wolfram SangAndi Shyti
authored andcommitted
i2c: mpc: use proper binding for transfer timeouts
"i2c-scl-clk-low-timeout-us" is wrongly used here because it describes maximum clock stretching not maximum transfer time. Additionally, it is deprecated because of issues. Move this driver to the correct binding. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent f9ccb45 commit 401a8e9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/i2c/busses/i2c-mpc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -844,14 +844,14 @@ static int fsl_i2c_probe(struct platform_device *op)
844844
mpc_i2c_setup_8xxx(op->dev.of_node, i2c, clock);
845845
}
846846

847-
/*
848-
* "fsl,timeout" has been marked as deprecated and, to maintain
849-
* backward compatibility, we will only look for it if
850-
* "i2c-scl-clk-low-timeout-us" is not present.
851-
*/
847+
/* Sadly, we have to support two deprecated bindings here */
852848
result = of_property_read_u32(op->dev.of_node,
853-
"i2c-scl-clk-low-timeout-us",
849+
"i2c-transfer-timeout-us",
854850
&mpc_ops.timeout);
851+
if (result == -EINVAL)
852+
result = of_property_read_u32(op->dev.of_node,
853+
"i2c-scl-clk-low-timeout-us",
854+
&mpc_ops.timeout);
855855
if (result == -EINVAL)
856856
result = of_property_read_u32(op->dev.of_node,
857857
"fsl,timeout", &mpc_ops.timeout);

0 commit comments

Comments
 (0)