diff options
author | Ray Chi <raychi@google.com> | 2023-12-20 14:13:02 +0800 |
---|---|---|
committer | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-01-03 05:20:35 +0000 |
commit | 6383692b1624b64253a6aa9b4df65f7bfa6b892b (patch) | |
tree | 6071cf60e1c6133ccbf64b7313702db281a69233 | |
parent | 06ebc76fe12c4d518c6dd1833909a9190edceb3d (diff) | |
download | gs-android-gs-shusky-5.15-android14-qpr2-beta.tar.gz |
usb: phy: remove the i2c retryandroid-u-qpr2-beta-3_r0.8android-u-qpr2-beta-3.1_r0.8android-gs-shusky-5.15-android14-qpr2-beta
Since suspend/resume time is limited about 150 ms, if eusb driver keep
doing retries during system suspend/resume, the total time will be
longer than the criteria.
This patch will remove the retry to fix this problem.
Bug: 316538540
Change-Id: Ifd36209676e057236b480abc2f0abb2653279dc8
Signed-off-by: Ray Chi <raychi@google.com>
-rw-r--r-- | drivers/phy/samsung/eusb_repeater.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/drivers/phy/samsung/eusb_repeater.c b/drivers/phy/samsung/eusb_repeater.c index c6ad00af4..5016670e8 100644 --- a/drivers/phy/samsung/eusb_repeater.c +++ b/drivers/phy/samsung/eusb_repeater.c @@ -186,32 +186,21 @@ static int eusb_repeater_fill_tune_param(struct eusb_repeater_data *tud, static int eusb_repeater_ctrl(int value) { struct eusb_repeater_data *tud = g_tud; - int i, ret = 0; + int ret = 0; u8 read_data, write_data; - for (i = 0; i < TUSB_MODE_CONTROL_RETRY_CNT; i++) { - ret = eusb_repeater_read_reg(tud, I2C_GLOBAL_CONFIG, &read_data, 1); - if (ret < 0) - goto retry; - - write_data = value ? (read_data & ~REG_DISABLE_P1) : (read_data | REG_DISABLE_P1); - ret = eusb_repeater_write_reg(tud, I2C_GLOBAL_CONFIG, &write_data, 1); - if (ret < 0) - goto retry; - - ret = eusb_repeater_read_reg(tud, I2C_GLOBAL_CONFIG, &read_data, 1); - if (ret < 0) - goto retry; - - break; - -retry: - if (i > 1) - goto err; + ret = eusb_repeater_read_reg(tud, I2C_GLOBAL_CONFIG, &read_data, 1); + if (ret < 0) + goto err; - usleep_range(30 * 1000, 80 * 1000); - } + write_data = value ? (read_data & ~REG_DISABLE_P1) : (read_data | REG_DISABLE_P1); + ret = eusb_repeater_write_reg(tud, I2C_GLOBAL_CONFIG, &write_data, 1); + if (ret < 0) + goto err; + ret = eusb_repeater_read_reg(tud, I2C_GLOBAL_CONFIG, &read_data, 1); + if (ret < 0) + goto err; dev_info(tud->dev, "%s Disabled mode, reg = %x\n", value ? "Exit" : "Enter", read_data); |