Skip to content

Commit

Permalink
usb: gadget: renesas_usbhs: remove usbhs_sys_usb_ctrl()
Browse files Browse the repository at this point in the history
usbhs_sys_usb_ctrl() can collect into usbhs_sys_host/function_ctrl().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Kuninori Morimoto authored and Felipe Balbi committed Dec 12, 2011
1 parent 2288e10 commit 3244a7b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
13 changes: 4 additions & 9 deletions drivers/usb/renesas_usbhs/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,10 @@ void usbhs_sys_clock_ctrl(struct usbhs_priv *priv, int enable)
usbhs_bset(priv, SYSCFG, SCKE, enable ? SCKE : 0);
}

void usbhs_sys_usb_ctrl(struct usbhs_priv *priv, int enable)
{
usbhs_bset(priv, SYSCFG, USBE, enable ? USBE : 0);
}

void usbhs_sys_host_ctrl(struct usbhs_priv *priv, int enable)
{
u16 mask = DCFM | DRPD | DPRPU | HSE;
u16 val = DCFM | DRPD | HSE;
u16 mask = DCFM | DRPD | DPRPU | HSE | USBE;
u16 val = DCFM | DRPD | HSE | USBE;
int has_otg = usbhs_get_dparam(priv, has_otg);

if (has_otg)
Expand All @@ -125,8 +120,8 @@ void usbhs_sys_host_ctrl(struct usbhs_priv *priv, int enable)

void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable)
{
u16 mask = DCFM | DRPD | DPRPU | HSE;
u16 val = DPRPU | HSE;
u16 mask = DCFM | DRPD | DPRPU | HSE | USBE;
u16 val = DPRPU | HSE | USBE;

/*
* if enable
Expand Down
1 change: 0 additions & 1 deletion drivers/usb/renesas_usbhs/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev);
* sysconfig
*/
void usbhs_sys_clock_ctrl(struct usbhs_priv *priv, int enable);
void usbhs_sys_usb_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);

Expand Down
2 changes: 0 additions & 2 deletions drivers/usb/renesas_usbhs/mod_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,6 @@ static int usbhsg_try_start(struct usbhs_priv *priv, u32 status)
* - usb module
*/
usbhs_sys_function_ctrl(priv, 1);
usbhs_sys_usb_ctrl(priv, 1);

/*
* enable irq callback
Expand Down Expand Up @@ -731,7 +730,6 @@ static int usbhsg_try_stop(struct usbhs_priv *priv, u32 status)

/* disable sys */
usbhs_sys_function_ctrl(priv, 0);
usbhs_sys_usb_ctrl(priv, 0);

usbhsg_pipe_disable(dcp);

Expand Down
2 changes: 0 additions & 2 deletions drivers/usb/renesas_usbhs/mod_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,6 @@ static int usbhsh_start(struct usbhs_priv *priv)
* - usb module
*/
usbhs_sys_host_ctrl(priv, 1);
usbhs_sys_usb_ctrl(priv, 1);

/*
* enable irq callback
Expand Down Expand Up @@ -1242,7 +1241,6 @@ static int usbhsh_stop(struct usbhs_priv *priv)

/* disable sys */
usbhs_sys_host_ctrl(priv, 0);
usbhs_sys_usb_ctrl(priv, 0);

dev_dbg(dev, "quit host\n");

Expand Down

0 comments on commit 3244a7b

Please sign in to comment.