Commit 4cd2f599 authored by kuninori.morimoto.gx@renesas.com's avatar kuninori.morimoto.gx@renesas.com Committed by Felipe Balbi

usb: renesas_usbhs: gadget: add usb_gadget_ops :: pullup support

This patch adds usbhs_sys_function_pullup() to control
D+ line for USB function, and enabled pullup support on mod_gadget.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent ddffeb8c
...@@ -132,6 +132,11 @@ void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable) ...@@ -132,6 +132,11 @@ void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable)
usbhs_bset(priv, SYSCFG, mask, enable ? val : 0); usbhs_bset(priv, SYSCFG, mask, enable ? val : 0);
} }
void usbhs_sys_function_pullup(struct usbhs_priv *priv, int enable)
{
usbhs_bset(priv, SYSCFG, DPRPU, enable ? DPRPU : 0);
}
void usbhs_sys_set_test_mode(struct usbhs_priv *priv, u16 mode) void usbhs_sys_set_test_mode(struct usbhs_priv *priv, u16 mode)
{ {
usbhs_write(priv, TESTMODE, mode); usbhs_write(priv, TESTMODE, mode);
......
...@@ -285,6 +285,7 @@ void usbhs_bset(struct usbhs_priv *priv, u32 reg, u16 mask, u16 data); ...@@ -285,6 +285,7 @@ void usbhs_bset(struct usbhs_priv *priv, u32 reg, u16 mask, u16 data);
*/ */
void usbhs_sys_host_ctrl(struct usbhs_priv *priv, int enable); void usbhs_sys_host_ctrl(struct usbhs_priv *priv, int enable);
void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable); void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable);
void usbhs_sys_function_pullup(struct usbhs_priv *priv, int enable);
void usbhs_sys_set_test_mode(struct usbhs_priv *priv, u16 mode); void usbhs_sys_set_test_mode(struct usbhs_priv *priv, u16 mode);
/* /*
......
...@@ -883,6 +883,16 @@ static int usbhsg_get_frame(struct usb_gadget *gadget) ...@@ -883,6 +883,16 @@ static int usbhsg_get_frame(struct usb_gadget *gadget)
return usbhs_frame_get_num(priv); return usbhs_frame_get_num(priv);
} }
static int usbhsg_pullup(struct usb_gadget *gadget, int is_on)
{
struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget);
struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv);
usbhs_sys_function_pullup(priv, is_on);
return 0;
}
static int usbhsg_set_selfpowered(struct usb_gadget *gadget, int is_self) static int usbhsg_set_selfpowered(struct usb_gadget *gadget, int is_self)
{ {
struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget);
...@@ -900,6 +910,7 @@ static struct usb_gadget_ops usbhsg_gadget_ops = { ...@@ -900,6 +910,7 @@ static struct usb_gadget_ops usbhsg_gadget_ops = {
.set_selfpowered = usbhsg_set_selfpowered, .set_selfpowered = usbhsg_set_selfpowered,
.udc_start = usbhsg_gadget_start, .udc_start = usbhsg_gadget_start,
.udc_stop = usbhsg_gadget_stop, .udc_stop = usbhsg_gadget_stop,
.pullup = usbhsg_pullup,
}; };
static int usbhsg_start(struct usbhs_priv *priv) static int usbhsg_start(struct usbhs_priv *priv)
......
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