@@ -25,12 +25,16 @@ default frequency is 100kHz
whenever you're using the "allwinner,sun6i-a31-i2c"
compatible.
+ - timeout-ms : timeout value in miliseconds. If not set the default
+ timeout is 1000ms
+
Examples:
i2c@11000 {
compatible = "marvell,mv64xxx-i2c";
reg = <0x11000 0x20>;
interrupts = <29>;
+ timeout-ms = <1000>;
clock-frequency = <100000>;
};
@@ -40,5 +44,6 @@ For the Armada XP:
compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
reg = <0x11000 0x100>;
interrupts = <29>;
+ timeout-ms = <1000>;
clock-frequency = <100000>;
};
@@ -803,7 +803,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
#else
const struct of_device_id *device;
struct device_node *np = dev->of_node;
- u32 bus_freq, tclk;
+ u32 bus_freq, tclk, timeout;
int rc = 0;
if (IS_ERR(drv_data->clk)) {
@@ -832,10 +832,9 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
reset_control_deassert(drv_data->rstc);
}
- /* Its not yet defined how timeouts will be specified in device tree.
- * So hard code the value to 1 second.
- */
- drv_data->adapter.timeout = HZ;
+ if (of_property_read_u32(np, "timeout-ms", &timeout))
+ timeout = 1000; /* 1000ms by default */
+ drv_data->adapter.timeout = msecs_to_jiffies(timeout);
device = of_match_device(mv64xxx_i2c_of_match_table, dev);
if (!device)