Dear Igor,
Thank you so much for your reply.
But, I am afraid, moving to another board at this time is not feasible, as this is customer requirement on existing products.
The HDMI edid reading from monitor using i2c_transfer is working fine. So I think there is no hardware issue.
We are only facing i2c_transfer timeout issue after full system resume.
Also, the LCD is working fine.
So, if anything can be done in this version itself, please let me know.
I just need some clue to debug the issue. I will try to fix myself.
I tried to implement suspend/resume support in i2c-imx driver (drivers/i2c/busses/i2c-imx.c).
Like this:
{{{
+static int i2c_imx_suspend(struct device *dev) +{ + pinctrl_pm_select_sleep_state(dev); + + pr_info("[PINTU]: %s: Done\n", __func__); + + return 0; +} + +static int i2c_imx_resume(struct device *dev) +{ + pinctrl_pm_select_default_state(dev); + + pr_info("[PINTU]: %s: Done\n", __func__); + + return 0; +} + + +static SIMPLE_DEV_PM_OPS(i2c_imx_pm_ops, i2c_imx_suspend, i2c_imx_resume); + static struct platform_driver i2c_imx_driver = { .probe = i2c_imx_probe, .remove = i2c_imx_remove, .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, + .pm = &i2c_imx_pm_ops, .of_match_table = i2c_imx_dt_ids, }, .id_table = imx_i2c_devtype,}}}
But still I get i2c_transfer timeout issue.
I also tried to implement like this:
{{{
static int i2c_imx_suspend(struct device *dev)
{
struct platform_device *pdev = container_of(dev,
struct platform_device, dev);
struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev);
clk_disable_unprepare(i2c_imx->clk);
devm_clk_put(&pdev->dev, NULL);
i2c_imx->suspended = 1;
return 0;
}
static int i2c_imx_resume(struct device *dev)
{
struct platform_device *pdev = container_of(dev,
struct platform_device, dev);
struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev);
int ret;
i2c_imx->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(i2c_imx->clk)) {
dev_err(&pdev->dev, "can't get I2C clock\n");
return PTR_ERR(i2c_imx->clk);
}
ret = clk_prepare_enable(i2c_imx->clk);
if (ret) {
dev_err(dev, "Cannot enable clock.\n");
return ret;
}
i2c_imx->suspended = 0;
return 0;
}
static const struct dev_pm_ops i2c_imx_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(i2c_imx_suspend,
i2c_imx_resume)
};
}}}
But, this way it gives some backtraces, and clk_disable fails.
So, I am not sure which is the right way, and also not sure whether suspend/resume can resolve i2c transfer issue.
Currently, I think, after resume, i2c-imx would have gone to some invalid state.
So, if you have any other pointers about i2c_transfer timeout issue (after resume).
Please help!
This is a customer specific requirement, so at least we need to update what is the exact issue.
Regards,
Pintu