--- zzzz-none-000/linux-5.4.213/drivers/i2c/busses/i2c-qup.c 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/drivers/i2c/busses/i2c-qup.c 2024-08-14 09:01:58.000000000 +0000 @@ -818,6 +818,10 @@ if (!wait_for_completion_timeout(&qup->xfer, HZ)) dev_err(qup->dev, "flush timed out\n"); + ret = qup_i2c_change_state(qup,QUP_RESET_STATE); + if (ret) + dev_err(qup->dev, "change to reset state timed out"); + ret = (qup->bus_err & QUP_I2C_NACK_FLAG) ? -ENXIO : -EIO; } @@ -1794,6 +1798,16 @@ dev_err(qup->dev, "Could not get iface clock\n"); return PTR_ERR(qup->pclk); } + + if (!of_property_read_u32(pdev->dev.of_node, + "qup-clock-frequency", &src_clk_freq)) { + ret = clk_set_rate(qup->clk, src_clk_freq); + if (ret) { + dev_err(qup->dev, + "Set qup clock frequency failed\n"); + goto fail; + } + } qup_i2c_enable_clocks(qup); src_clk_freq = clk_get_rate(qup->clk); }