linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	balbi-l0cyMroinI0@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
	Ravi Babu <ravibabu-l0cyMroinI0@public.gmane.org>
Subject: Re: [PATCH 3/6 v3] omap: musb: ti81xx: Add phy power function
Date: Fri, 7 Oct 2011 11:57:53 +0300	[thread overview]
Message-ID: <20111007085752.GF10910@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <1315576070-7618-4-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3723 bytes --]

On Fri, Sep 09, 2011 at 07:17:47PM +0530, Ajay Kumar Gupta wrote:
> Adding ti81xx_musb_phy_power() which will be used by musb driver through
> its function pointer in board_data.
> 
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
> Signed-off-by: Ravi Babu <ravibabu-l0cyMroinI0@public.gmane.org>

this should go through OMAP tree.

> ---
>  arch/arm/mach-omap2/omap_phy_internal.c |   24 +++++++++++++++++++++++
>  arch/arm/plat-omap/include/plat/usb.h   |   32 +++++++++++++++++++++++++++++++
>  2 files changed, 56 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
> index 58775e3..d5e8497 100644
> --- a/arch/arm/mach-omap2/omap_phy_internal.c
> +++ b/arch/arm/mach-omap2/omap_phy_internal.c
> @@ -260,3 +260,27 @@ void am35x_set_mode(u8 musb_mode)
>  
>  	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
>  }
> +
> +void ti81xx_musb_phy_power(u8 on)
> +{
> +	u32 usbphycfg = omap_ctrl_readl(USBCTRL0);
> +
> +	if (on) {
> +		if (cpu_is_ti816x()) {
> +			usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;
> +			usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;
> +		} else if (cpu_is_ti814x()) {
> +			usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN
> +				| USBPHY_DPINPUT | USBPHY_DMINPUT);
> +			usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN
> +				| USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);
> +		}
> +	} else {
> +		if (cpu_is_ti816x())
> +			usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE;
> +		else if (cpu_is_ti814x())
> +			usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
> +
> +	}
> +	omap_ctrl_writel(usbphycfg, USBCTRL0);

don't use omap_ctrl_*(). ioremap your memory space.

> diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
> index 17d3c93..c616385 100644
> --- a/arch/arm/plat-omap/include/plat/usb.h
> +++ b/arch/arm/plat-omap/include/plat/usb.h
> @@ -114,6 +114,7 @@ extern void am35x_musb_reset(void);
>  extern void am35x_musb_phy_power(u8 on);
>  extern void am35x_musb_clear_irq(void);
>  extern void am35x_set_mode(u8 musb_mode);
> +extern void ti81xx_musb_phy_power(u8 on);
>  
>  /*
>   * FIXME correct answer depends on hmc_mode,
> @@ -273,6 +274,37 @@ static inline void omap2_usbfs_init(struct omap_usb_config *pdata)
>  #define CONF2_OTGPWRDN		(1 << 2)
>  #define CONF2_DATPOL		(1 << 1)
>  
> +/* TI81XX specific definitions */
> +#define USBCTRL0	0x620
> +#define USBSTAT0	0x624
> +
> +/* TI816X PHY controls bits */
> +#define TI816X_USBPHY0_NORMAL_MODE	(1 << 0)
> +#define TI816X_USBPHY_REFCLK_OSC	(1 << 8)
> +
> +/* TI814X PHY controls bits */
> +#define USBPHY_CM_PWRDN		(1 << 0)
> +#define USBPHY_OTG_PWRDN	(1 << 1)
> +#define USBPHY_CHGDET_DIS	(1 << 2)
> +#define USBPHY_CHGDET_RSTRT	(1 << 3)
> +#define USBPHY_SRCONDM		(1 << 4)
> +#define USBPHY_SINKONDP		(1 << 5)
> +#define USBPHY_CHGISINK_EN	(1 << 6)
> +#define USBPHY_CHGVSRC_EN	(1 << 7)
> +#define USBPHY_DMPULLUP		(1 << 8)
> +#define USBPHY_DPPULLUP		(1 << 9)
> +#define USBPHY_CDET_EXTCTL	(1 << 10)
> +#define USBPHY_GPIO_MODE	(1 << 12)
> +#define USBPHY_DPOPBUFCTL	(1 << 13)
> +#define USBPHY_DMOPBUFCTL	(1 << 14)
> +#define USBPHY_DPINPUT		(1 << 15)
> +#define USBPHY_DMINPUT		(1 << 16)
> +#define USBPHY_DPGPIO_PD	(1 << 17)
> +#define USBPHY_DMGPIO_PD	(1 << 18)
> +#define USBPHY_OTGVDET_EN	(1 << 19)
> +#define USBPHY_OTGSESSEND_EN	(1 << 20)
> +#define USBPHY_DATA_POLARITY	(1 << 23)
> +
>  #if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_USB)
>  u32 omap1_usb0_init(unsigned nwires, unsigned is_device);
>  u32 omap1_usb1_init(unsigned nwires);
> -- 
> 1.6.2.4
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2011-10-07  8:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-09 13:47 [PATCH 0/6 v3] usb: musb: Adding support for ti81xx Ajay Kumar Gupta
     [not found] ` <1315576070-7618-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2011-09-09 13:47   ` [PATCH 1/6 v3] omap: musb: Adding hwmod data " Ajay Kumar Gupta
     [not found]     ` <1315576070-7618-2-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2011-09-26  9:51       ` Gupta, Ajay Kumar
     [not found]         ` <19F8576C6E063C45BE387C64729E739404ECA545E3-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2011-10-07  8:56           ` Felipe Balbi
2011-10-10  5:10             ` Gupta, Ajay Kumar
2011-10-10  5:44               ` Felipe Balbi
2011-10-11  8:43                 ` Gupta, Ajay Kumar
     [not found]                   ` <19F8576C6E063C45BE387C64729E739404ECCE551F-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2011-10-11  9:10                     ` Felipe Balbi
     [not found]                       ` <20111011091055.GE10155-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-10-11  9:37                         ` Gupta, Ajay Kumar
2011-10-11  9:43                           ` Felipe Balbi
2011-10-11 10:02                             ` Gupta, Ajay Kumar
2011-09-09 13:47   ` [PATCH 4/6 v3] ti816evm: Add support for musb interface Ajay Kumar Gupta
     [not found]     ` <1315576070-7618-5-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2011-10-07  8:58       ` Felipe Balbi
2011-09-09 13:47 ` [PATCH 2/6 v3] omap: musb: Adding support for ti81xx Ajay Kumar Gupta
2011-10-07  8:56   ` Felipe Balbi
2011-09-09 13:47 ` [PATCH 3/6 v3] omap: musb: ti81xx: Add phy power function Ajay Kumar Gupta
     [not found]   ` <1315576070-7618-4-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2011-10-07  8:57     ` Felipe Balbi [this message]
2011-09-09 13:47 ` [PATCH 5/6 v3] ti814evm: Add support for musb interface Ajay Kumar Gupta
2011-10-07  8:58   ` Felipe Balbi
2011-09-09 13:47 ` [PATCH 6/6 v3] usb: musb: Add support for ti81xx platform Ajay Kumar Gupta
2011-10-07  8:59   ` Felipe Balbi

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=20111007085752.GF10910@legolas.emea.dhcp.ti.com \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=ajay.gupta-l0cyMroinI0@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ravibabu-l0cyMroinI0@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).