Skip to content

Commit 908f61b

Browse files
Radhey Shyam Pandeygregkh
authored andcommitted
usb: misc: onboard_dev: extend platform data to add power on delay field
Introduce dedicated field 'power_on_delay_us' in onboard platform data and update its delay for USB5744 configuration. Hub itself requires some delay after reset to get to state where configuration data is going to be accepted. Without delay upcoming support for configuration via SMBUS is reporting a failure on the first SMBus write. i2c 2-002d: error -ENXIO: BYPASS_UDC_SUSPEND bit configuration failed Similar delay is likely also required for default configuration but because there is enough time (code execution) between reset and usage of the hub any issue is not visible but it doesn't mean delay shouldn't be reflected. Signed-off-by: Radhey Shyam Pandey <[email protected]> Suggested-by: Matthias Kaehlcke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2c6b6af commit 908f61b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

drivers/usb/misc/onboard_usb_dev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static int onboard_dev_power_on(struct onboard_dev *onboard_dev)
9898

9999
fsleep(onboard_dev->pdata->reset_us);
100100
gpiod_set_value_cansleep(onboard_dev->reset_gpio, 0);
101+
fsleep(onboard_dev->pdata->power_on_delay_us);
101102

102103
onboard_dev->is_powered_on = true;
103104

drivers/usb/misc/onboard_usb_dev.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
struct onboard_dev_pdata {
1212
unsigned long reset_us; /* reset pulse width in us */
13+
unsigned long power_on_delay_us; /* power on delay in us */
1314
unsigned int num_supplies; /* number of supplies */
1415
const char * const supply_names[MAX_SUPPLIES];
1516
bool is_hub;
@@ -24,6 +25,7 @@ static const struct onboard_dev_pdata microchip_usb424_data = {
2425

2526
static const struct onboard_dev_pdata microchip_usb5744_data = {
2627
.reset_us = 0,
28+
.power_on_delay_us = 10000,
2729
.num_supplies = 2,
2830
.supply_names = { "vdd", "vdd2" },
2931
.is_hub = true,

0 commit comments

Comments
 (0)