All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Ajay Kumar Gupta <ajay.gupta@ti.com>
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, balbi@ti.com
Subject: Re: [PATCH] musb: am35x: fix compile error due to control apis
Date: Fri, 03 Dec 2010 22:23:33 +0300	[thread overview]
Message-ID: <4CF943B5.2000303@ru.mvista.com> (raw)
In-Reply-To: <1291399965-19623-1-git-send-email-ajay.gupta@ti.com>

Hello.

Ajay Kumar Gupta wrote:

> As the control.h have been moved to new location and it's
> uses are not allowed to drivers directly so moving the phy
> control, interrupt clear and reset functionality to board
> files.

> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
[...]

> diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
> index 7260558..1f32fdb 100644
> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -33,6 +33,82 @@
>  
>  #ifdef CONFIG_USB_MUSB_SOC
>  
> +static void am35x_musb_phy_power(u8 on)
> +{
> +	unsigned long timeout = jiffies + msecs_to_jiffies(100);
> +	u32 devconf2;
> +
> +	if (on) {
> +		/*
> +		 * Start the on-chip PHY and its PLL.
> +		 */
> +		devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
> +
> +		devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
> +		devconf2 |= CONF2_PHY_PLLON;
> +
> +		omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
> +
> +		printk(KERN_INFO "Waiting for PHY clock good...\n");

    pr_info().

> +		while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
> +				& CONF2_PHYCLKGD)) {
> +			cpu_relax();
> +
> +			if (time_after(jiffies, timeout)) {
> +				printk(KERN_ERR "musb PHY clock good timed out\n");

    pr_err().

> diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
> index 59c7fe7..4299097 100644
> --- a/arch/arm/plat-omap/include/plat/usb.h
> +++ b/arch/arm/plat-omap/include/plat/usb.h
> @@ -69,6 +69,9 @@ struct omap_musb_board_data {
>  	u8	mode;
>  	u16	power;
>  	unsigned extvbus:1;
> +	void	(*set_phy_power) (u8 on);
> +	void	(*clear_irq) (void);
> +	void	(*set_mode) (u8 mode);

    Should be no spaces between ) and (. scripts/checkpatch.pl used to complain 
about such things, now it's silent though...

> @@ -364,37 +324,21 @@ eoi:
>  
>  int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
>  {
> -	u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
> +	struct device *dev = musb->controller;
> +	struct musb_hdrc_platform_data *plat = dev->platform_data;
> +	struct omap_musb_board_data *data = plat->board_data;
>  
> -	devconf2 &= ~CONF2_OTGMODE;
> -	switch (musb_mode) {
> -#ifdef	CONFIG_USB_MUSB_HDRC_HCD
> -	case MUSB_HOST:		/* Force VBUS valid, ID = 0 */
> -		devconf2 |= CONF2_FORCE_HOST;
> -		break;
> -#endif
> -#ifdef	CONFIG_USB_GADGET_MUSB_HDRC
> -	case MUSB_PERIPHERAL:	/* Force VBUS valid, ID = 1 */
> -		devconf2 |= CONF2_FORCE_DEVICE;
> -		break;
> -#endif
> -#ifdef	CONFIG_USB_MUSB_OTG
> -	case MUSB_OTG:		/* Don't override the VBUS/ID comparators */
> -		devconf2 |= CONF2_NO_OVERRIDE;
> -		break;
> -#endif
> -	default:
> -		DBG(2, "Trying to set unsupported mode %u\n", musb_mode);
> -	}
> +	if (data->set_mode)
> +		data->set_mode(musb_mode);

    You should return -EIO if data->set_mode is NULL.

WBR, Sergei


  parent reply	other threads:[~2010-12-03 19:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03 18:12 [PATCH] musb: am35x: fix compile error due to control apis Ajay Kumar Gupta
     [not found] ` <1291399965-19623-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2010-12-03 18:50   ` Anand Gadiyar
2010-12-04 13:53     ` Gupta, Ajay Kumar
2010-12-03 19:23 ` Sergei Shtylyov [this message]
2010-12-04 13:57   ` Gupta, Ajay Kumar
2010-12-23 17:16 ` Ben Gamari
     [not found]   ` <87hbe41kbd.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-12-27  9:20     ` Felipe Balbi
     [not found]       ` <20101227092038.GB2301-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2010-12-30  7:44         ` Ben Gamari
     [not found]           ` <877heriu1j.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-12-30 12:27             ` Felipe Balbi
2010-12-30 13:06               ` Sergei Shtylyov
2010-12-30 15:00               ` Ben Gamari
2010-12-30 15:24                 ` Anca Emanuel
     [not found]                   ` <AANLkTinE9Dgz9nCFv-1d=DdF22OEXSYn16s7krxo3CGp-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-30 16:04                     ` Felipe Balbi
2010-12-30 16:05                 ` Felipe Balbi
2010-12-30 16:14                   ` Sergei Shtylyov
2010-12-30 16:20 ` Ben Gamari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CF943B5.2000303@ru.mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=ajay.gupta@ti.com \
    --cc=balbi@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.