pci: msm: Return -EPROBE_DEFER when i2c is not probed

Change is to reutrn -EPROBE_DEFER error when i2c is not probed and
delay PCIE probe. I2C probe is gettting called post pcie enumeration
and this results in i2c de-emphasis settings not being applied.
Pine doesn't enumerate as these settings are not applied.

Change-Id: I1ac966b26c65f44afb32987927558209bf8787a7
Signed-off-by: Subramanian Ananthanarayanan <quic_skananth@quicinc.com>
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Signed-off-by: Yogesh Jadav <quic_yjadav@quicinc.com>
Signed-off-by: Joco Zhang <quic_pingshen@quicinc.com>
This commit is contained in:
Subramanian Ananthanarayanan 2021-12-07 19:39:07 +05:30 committed by Joco Zhang
parent 08a7e87926
commit 428f0be4d5

View File

@ -8222,6 +8222,12 @@ static int msm_pcie_i2c_ctrl_init(struct msm_pcie_dev_t *pcie_dev)
PCIE_DBG(pcie_dev, "PCIe: RC%d: No i2c phandle found\n",
pcie_dev->rc_idx);
return 0;
} else {
if (!i2c_ctrl->client) {
PCIE_DBG(pcie_dev, "PCIe: RC%d: No i2c probe yet\n",
pcie_dev->rc_idx);
return -EPROBE_DEFER;
}
}
i2c_client_node = of_get_child_by_name(of_node, "pcie_i2c_ctrl");
@ -8656,6 +8662,12 @@ static int msm_pcie_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, pcie_dev);
#if IS_ENABLED(CONFIG_I2C)
ret = msm_pcie_i2c_ctrl_init(pcie_dev);
if (ret)
goto decrease_rc_num;
#endif
ret = msm_pcie_get_resources(pcie_dev, pcie_dev->pdev);
if (ret)
goto decrease_rc_num;
@ -8695,10 +8707,6 @@ static int msm_pcie_probe(struct platform_device *pdev)
INIT_KFIFO(pcie_dev->aer_fifo);
#if IS_ENABLED(CONFIG_I2C)
msm_pcie_i2c_ctrl_init(pcie_dev);
#endif
msm_pcie_sysfs_init(pcie_dev);
pcie_dev->drv_ready = true;
@ -9841,12 +9849,12 @@ static int pcie_i2c_ctrl_probe(struct i2c_client *client,
if (client_id == I2C_CLIENT_ID_NTN3) {
i2c_ctrl = &msm_pcie_dev[rc_index].i2c_ctrl;
i2c_ctrl->client = client;
i2c_ctrl->client_i2c_read = ntn3_i2c_read;
i2c_ctrl->client_i2c_write = ntn3_i2c_write;
i2c_ctrl->client_i2c_reset = ntn3_ep_reset_ctrl;
i2c_ctrl->client_i2c_dump_regs = ntn3_dump_regs;
i2c_ctrl->client_i2c_de_emphasis_wa = ntn3_de_emphasis_wa;
i2c_ctrl->client = client;
} else {
dev_err(&client->dev, "invalid client id %d\n", client_id);
}