|
31 | 31 | GPIO_POWER = 0, // Power input enable |
32 | 32 | GPIO_FASTBOOT_KEY, // Usually volume key |
33 | 33 | GPIO_POWER_KEY, // Key to power the device |
34 | | - GPIO_USB_DISCONNECT, // Simulate main USB connection |
| 34 | + GPIO_USB0_DISCONNECT, // Simulate main USB connection |
| 35 | + GPIO_USB1_DISCONNECT, // Simulate secondary USB connection |
35 | 36 | GPIO_OUTPUT_ENABLE, // Enable FTDI signals to flow to the board |
36 | 37 | GPIO_COUNT |
37 | 38 | }; |
@@ -131,7 +132,7 @@ static void ftdi_gpio_parse_config(struct ftdi_gpio_options *options, char *valu |
131 | 132 | else if (strncmp("POWER_KEY", name, off - name - 1) == 0) |
132 | 133 | gpio_type = GPIO_POWER_KEY; |
133 | 134 | else if (strncmp("USB_DISCONNECT", name, off - name - 1) == 0) |
134 | | - gpio_type = GPIO_USB_DISCONNECT; |
| 135 | + gpio_type = GPIO_USB0_DISCONNECT; |
135 | 136 | else if (strncmp("OUTPUT_ENABLE", name, off - name - 1) == 0) |
136 | 137 | gpio_type = GPIO_OUTPUT_ENABLE; |
137 | 138 | else |
@@ -182,7 +183,11 @@ void *ftdi_gpio_parse_options(struct device_parser *dp) |
182 | 183 | } else if (!strcmp(key, "power_key")) { |
183 | 184 | gpio_id = GPIO_POWER_KEY; |
184 | 185 | } else if (!strcmp(key, "usb_disconnect")) { |
185 | | - gpio_id = GPIO_USB_DISCONNECT; |
| 186 | + gpio_id = GPIO_USB0_DISCONNECT; |
| 187 | + } else if (!strcmp(key, "usb0_disconnect")) { |
| 188 | + gpio_id = GPIO_USB0_DISCONNECT; |
| 189 | + } else if (!strcmp(key, "usb1_disconnect")) { |
| 190 | + gpio_id = GPIO_USB1_DISCONNECT; |
186 | 191 | } else if (!strcmp(key, "output_enable")) { |
187 | 192 | gpio_id = GPIO_OUTPUT_ENABLE; |
188 | 193 | } else { |
@@ -357,7 +362,8 @@ static int ftdi_gpio_device_power(struct ftdi_gpio *ftdi_gpio, bool on) |
357 | 362 |
|
358 | 363 | static void ftdi_gpio_device_usb(struct ftdi_gpio *ftdi_gpio, bool on) |
359 | 364 | { |
360 | | - ftdi_gpio_toggle_io(ftdi_gpio, GPIO_USB_DISCONNECT, on); |
| 365 | + ftdi_gpio_toggle_io(ftdi_gpio, GPIO_USB0_DISCONNECT, on); |
| 366 | + ftdi_gpio_toggle_io(ftdi_gpio, GPIO_USB1_DISCONNECT, on); |
361 | 367 | } |
362 | 368 |
|
363 | 369 | static int ftdi_gpio_power(struct device *dev, bool on) |
|
0 commit comments