Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: phy: phy-gpio-vbus-usb: Add device tree probing

Make it possible to probe the GPIO VBUS detection driver
from the device tree compatible for GPIO USB B connectors.

Since this driver is using the "gpio-usb-b-connector"
compatible, it is important to discern it from the role
switch connector driver (which does not provide a phy),
so we add some Kconfig text and depend on !USB_CONN_GPIO.

Cc: Rob Herring <robh@kernel.org>
Cc: Prashant Malani <pmalani@chromium.org>
Cc: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20221106230506.1646101-1-linus.walleij@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Linus Walleij and committed by
Greg Kroah-Hartman
0ce0f9d0 a8bc8cc1

+17 -1
+5 -1
drivers/usb/phy/Kconfig
··· 93 93 tristate "GPIO based peripheral-only VBUS sensing 'transceiver'" 94 94 depends on GPIOLIB || COMPILE_TEST 95 95 depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' 96 + depends on !USB_CONN_GPIO 96 97 select USB_PHY 97 98 help 98 99 Provides simple GPIO VBUS sensing for controllers with an 99 100 internal transceiver via the usb_phy interface, and 100 101 optionally control of a D+ pullup GPIO as well as a VBUS 101 - current limit regulator. 102 + current limit regulator. This driver is for devices that do 103 + NOT support role switch. OTG devices that can do role switch 104 + (master/peripheral) shall use the USB based connection 105 + detection driver USB_CONN_GPIO. 102 106 103 107 config OMAP_OTG 104 108 tristate "OMAP USB OTG controller driver"
+12
drivers/usb/phy/phy-gpio-vbus-usb.c
··· 366 366 367 367 MODULE_ALIAS("platform:gpio-vbus"); 368 368 369 + /* 370 + * NOTE: this driver matches against "gpio-usb-b-connector" for 371 + * devices that do NOT support role switch. 372 + */ 373 + static const struct of_device_id gpio_vbus_of_match[] = { 374 + { 375 + .compatible = "gpio-usb-b-connector", 376 + }, 377 + {}, 378 + }; 379 + 369 380 static struct platform_driver gpio_vbus_driver = { 370 381 .driver = { 371 382 .name = "gpio-vbus", 372 383 #ifdef CONFIG_PM 373 384 .pm = &gpio_vbus_dev_pm_ops, 374 385 #endif 386 + .of_match_table = gpio_vbus_of_match, 375 387 }, 376 388 .probe = gpio_vbus_probe, 377 389 .remove = gpio_vbus_remove,