提交 97720706 编写于 作者: D Derek Basehore 提交者: Lee Jones

i2c: i2c-cros-ec-tunnel: Set retries to 3

Since the i2c bus can get wedged on the EC sometimes, set the number of retries
to 3. Since we un-wedge the bus immediately after the wedge happens, this is the
correct fix since only one transfer will fail.
Signed-off-by: NDerek Basehore <dbasehore@chromium.org>
Reviewed-by: NDoug Anderson <dianders@chromium.org>
Acked-by: NWolfram Sang <wsa@the-dreams.de>
Signed-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 63427530
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/slab.h> #include <linux/slab.h>
#define I2C_MAX_RETRIES 3
/** /**
* struct ec_i2c_device - Driver data for I2C tunnel * struct ec_i2c_device - Driver data for I2C tunnel
* *
...@@ -290,6 +292,7 @@ static int ec_i2c_probe(struct platform_device *pdev) ...@@ -290,6 +292,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
bus->adap.algo_data = bus; bus->adap.algo_data = bus;
bus->adap.dev.parent = &pdev->dev; bus->adap.dev.parent = &pdev->dev;
bus->adap.dev.of_node = np; bus->adap.dev.of_node = np;
bus->adap.retries = I2C_MAX_RETRIES;
err = i2c_add_adapter(&bus->adap); err = i2c_add_adapter(&bus->adap);
if (err) { if (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册