usb: mtu3: expose role-switch control to userspace
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Mon, 17 Apr 2023 02:52:01 +0000 (10:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Apr 2023 09:17:05 +0000 (11:17 +0200)
The allow_userspace_control flag enables manual role switch from userspace,
turn this feature on like several other USB DRD controller drivers.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20230417025203.18097-5-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/mtu3/mtu3_dr.c

index 9b8aded..8191b7e 100644 (file)
@@ -294,6 +294,7 @@ static int ssusb_role_sw_register(struct otg_switch_mtk *otg_sx)
        role_sx_desc.get = ssusb_role_sw_get;
        role_sx_desc.fwnode = dev_fwnode(dev);
        role_sx_desc.driver_data = ssusb;
+       role_sx_desc.allow_userspace_control = true;
        otg_sx->role_sw = usb_role_switch_register(dev, &role_sx_desc);
        if (IS_ERR(otg_sx->role_sw))
                return PTR_ERR(otg_sx->role_sw);