lkml.org 
[lkml]   [2019]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v3 PATCH 6/6] usb: mtu3: register a USB Role Switch for dual role mode
On Wed, Apr 03, 2019 at 10:09:14AM +0800, Chunfeng Yun wrote:
> +static int ssusb_role_sw_register(struct otg_switch_mtk *otg_sx)
> +{
> + struct usb_role_switch_desc role_sx_desc = { 0 };
> + struct ssusb_mtk *ssusb =
> + container_of(otg_sx, struct ssusb_mtk, otg_switch);
> +
> + if (!otg_sx->role_sw_used)
> + return 0;
> +
> + role_sx_desc.set = ssusb_role_sw_set;
> + role_sx_desc.get = ssusb_role_sw_get;

role_sw_desc.fwnode = dev_fwnode(ssusb->dev);

> + otg_sx->role_sw = usb_role_switch_register(ssusb->dev, &role_sx_desc);
> +
> + return PTR_ERR_OR_ZERO(otg_sx->role_sw);
> +}

thanks,

--
heikki

\
 
 \ /
  Last update: 2019-04-10 12:25    [W:1.332 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site