Re: [PATCH 8/8] usb: dwc3: Add Amlogic G12A DWC3 glue

From: Neil Armstrong
Date: Mon Mar 04 2019 - 04:34:02 EST


Hi,

On 02/03/2019 11:29, Martin Blumenstingl wrote:
> Hi Neil,
>
>>> +static int dwc3_meson_g12a_debugfs_init(struct dwc3_meson_g12a *priv)
>>> +{
>>> + priv->root = debugfs_create_dir("dwc3-meson-g12a", NULL);
>>> + if (IS_ERR(priv->root))
>>> + return PTR_ERR(priv->root);
>>> +
>>> + debugfs_create_file("mode_force", 0600, priv->root, priv,
>>> + &dwc3_meson_g12a_mode_force_fops);
>>> +
>>> + debugfs_create_file("otg_id", 0400, priv->root, priv,
>>> + &dwc3_meson_g12a_otg_id_fops);
>>> +
>>> + return 0;
>>> +}
> I just stumbled across the "USB role switch framework", see [0]
> it seems to provide a userspace API as well and two in-kernel drivers
> are using this framework already
> (drivers/usb/gadget/udc/renesas_usb3.c,
> drivers/usb/roles/intel-xhci-usb-role-switch.c)

Just added support for it, works perfectly :-)

Neil

>
>
> [0] https://elixir.bootlin.com/linux/v5.0-rc8/source/drivers/usb/roles/class.c#L246
>