Commit 0ce0f9d0 authored by Linus Walleij's avatar Linus Walleij Committed by Greg Kroah-Hartman

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: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20221106230506.1646101-1-linus.walleij@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8bc8cc1
...@@ -93,12 +93,16 @@ config USB_GPIO_VBUS ...@@ -93,12 +93,16 @@ config USB_GPIO_VBUS
tristate "GPIO based peripheral-only VBUS sensing 'transceiver'" tristate "GPIO based peripheral-only VBUS sensing 'transceiver'"
depends on GPIOLIB || COMPILE_TEST depends on GPIOLIB || COMPILE_TEST
depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y'
depends on !USB_CONN_GPIO
select USB_PHY select USB_PHY
help help
Provides simple GPIO VBUS sensing for controllers with an Provides simple GPIO VBUS sensing for controllers with an
internal transceiver via the usb_phy interface, and internal transceiver via the usb_phy interface, and
optionally control of a D+ pullup GPIO as well as a VBUS optionally control of a D+ pullup GPIO as well as a VBUS
current limit regulator. current limit regulator. This driver is for devices that do
NOT support role switch. OTG devices that can do role switch
(master/peripheral) shall use the USB based connection
detection driver USB_CONN_GPIO.
config OMAP_OTG config OMAP_OTG
tristate "OMAP USB OTG controller driver" tristate "OMAP USB OTG controller driver"
......
...@@ -366,12 +366,24 @@ static const struct dev_pm_ops gpio_vbus_dev_pm_ops = { ...@@ -366,12 +366,24 @@ static const struct dev_pm_ops gpio_vbus_dev_pm_ops = {
MODULE_ALIAS("platform:gpio-vbus"); MODULE_ALIAS("platform:gpio-vbus");
/*
* NOTE: this driver matches against "gpio-usb-b-connector" for
* devices that do NOT support role switch.
*/
static const struct of_device_id gpio_vbus_of_match[] = {
{
.compatible = "gpio-usb-b-connector",
},
{},
};
static struct platform_driver gpio_vbus_driver = { static struct platform_driver gpio_vbus_driver = {
.driver = { .driver = {
.name = "gpio-vbus", .name = "gpio-vbus",
#ifdef CONFIG_PM #ifdef CONFIG_PM
.pm = &gpio_vbus_dev_pm_ops, .pm = &gpio_vbus_dev_pm_ops,
#endif #endif
.of_match_table = gpio_vbus_of_match,
}, },
.probe = gpio_vbus_probe, .probe = gpio_vbus_probe,
.remove = gpio_vbus_remove, .remove = gpio_vbus_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment