diff mbox series

[v4,2/2] usb: musb: mediatek: Expose role-switch control to userspace

Message ID 20210830155903.13907-3-mans0n@gorani.run
State Accepted
Commit 7042b10141542f56e1b4179a228aefa8a5ac3fab
Headers show
Series Add MUSB for MT7623 | expand

Commit Message

Sungbo Eo Aug. 30, 2021, 3:59 p.m. UTC
The allow_userspace_control flag enables manual role-switch from userspace.
Turn this feature on like several other USB DRD controller drivers.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/usb/musb/mediatek.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Chunfeng Yun (云春峰) Aug. 31, 2021, 6:15 a.m. UTC | #1
On Tue, 2021-08-31 at 00:59 +0900, Sungbo Eo wrote:
> The allow_userspace_control flag enables manual role-switch from

> userspace.

> Turn this feature on like several other USB DRD controller drivers.

> 

> Signed-off-by: Sungbo Eo <mans0n@gorani.run>

> Tested-by: Frank Wunderlich <frank-w@public-files.de>

> ---

>  drivers/usb/musb/mediatek.c | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/drivers/usb/musb/mediatek.c

> b/drivers/usb/musb/mediatek.c

> index 6b92d037d8fc..f5d97eb84cb5 100644

> --- a/drivers/usb/musb/mediatek.c

> +++ b/drivers/usb/musb/mediatek.c

> @@ -185,6 +185,7 @@ static int mtk_otg_switch_init(struct mtk_glue

> *glue)

>  

>  	role_sx_desc.set = musb_usb_role_sx_set;

>  	role_sx_desc.get = musb_usb_role_sx_get;

> +	role_sx_desc.allow_userspace_control = true;

>  	role_sx_desc.fwnode = dev_fwnode(glue->dev);

>  	role_sx_desc.driver_data = glue;

>  	glue->role_sw = usb_role_switch_register(glue->dev,

> &role_sx_desc);


Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>


Thanks
diff mbox series

Patch

diff --git a/drivers/usb/musb/mediatek.c b/drivers/usb/musb/mediatek.c
index 6b92d037d8fc..f5d97eb84cb5 100644
--- a/drivers/usb/musb/mediatek.c
+++ b/drivers/usb/musb/mediatek.c
@@ -185,6 +185,7 @@  static int mtk_otg_switch_init(struct mtk_glue *glue)
 
 	role_sx_desc.set = musb_usb_role_sx_set;
 	role_sx_desc.get = musb_usb_role_sx_get;
+	role_sx_desc.allow_userspace_control = true;
 	role_sx_desc.fwnode = dev_fwnode(glue->dev);
 	role_sx_desc.driver_data = glue;
 	glue->role_sw = usb_role_switch_register(glue->dev, &role_sx_desc);