Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18fe151e authored by Arumuga Durai A's avatar Arumuga Durai A
Browse files

USB: misc: usb2533: Add delay between HUB and LAN7500 reset



HUB enters SW_INIT stage on reset and moves to SOC-CONFIG
stage within 300msec if it finds pull-ups on I2C lines.
If HUB doesn't find I2C pull-ups then it directly enters
CONFIG stage and disables I2C support.
Driver expects HUB to be in SOC-Config after reset so that
it can enable FLEX mode using I2C commands.
I2C transfers to io-expander are also issued as part of usb-eth
device reset immediately after hub reset which is resulting
HUB to not find I2C pull-up after its reset and enters CONFIG
stage with I2C support disabled.
Without I2C connection to HUB, enabling flex-connect fails.
Fix this by adding delay between hub and LAN7500 reset to avoid
any I2C access before HUB enters SOC-Config stage.

CRs-Fixed: 2053404
Change-Id: I5efa82a96820e8efb60a83613151a7aa483a6346
Signed-off-by: default avatarArumuga Durai A <cadurai@codeaurora.org>
parent 1bc1b27c
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -174,6 +174,12 @@ static int flex_hub_usbdev_notify(struct notifier_block *self,
			gpio_direction_output(
				usb_hub->hub_reset_gpio, 1);
		}

		/*
		 * After HUB reset, 300ms delay is required in
		 * SOC config stage before doing any i2c access.
		 */
		msleep(300);
		if (gpio_is_valid(usb_hub->usbeth_reset_gpio)) {
			gpio_direction_output(
				usb_hub->usbeth_reset_gpio, 0);
@@ -182,13 +188,6 @@ static int flex_hub_usbdev_notify(struct notifier_block *self,
			gpio_direction_output(
				usb_hub->usbeth_reset_gpio, 1);
		}

		/*
		 * After HUB Reset, We need to wait for 300ms in
		 * SOC config stage before doing read/write of
		 * USB2533 HUB's configuration register
		 */
		msleep(300);
		i2c_hub_flex_enable(usb_hub);
		flex_enabled = true;
		break;