public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@nokia.com>
To: "Jokiniemi Kalle (Nokia-MS/Tampere)" <kalle.jokiniemi@nokia.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"balbi@ti.com" <balbi@ti.com>,
	"tony@atomide.com" <tony@atomide.com>,
	"jhnikula@gmail.com" <jhnikula@gmail.com>,
	"Koskinen Ilkka (Nokia-MS/Tampere)" <ilkka.koskinen@nokia.com>
Subject: Re: [PATCH 2/2] OMAP3: rx51: specify phy_power for usb tranceiver
Date: Tue, 22 Mar 2011 12:54:51 +0200	[thread overview]
Message-ID: <20110322105451.GE4286@esdhcp034230> (raw)
In-Reply-To: <9D0D31AA57AAF5499AFDC63D6472631B06AFCF@008-AM1MPN1-036.mgdnok.nokia.com>

Hi,

On Tue, Mar 22, 2011 at 12:24:27PM +0200, Jokiniemi Kalle (Nokia-MS/Tampere) wrote:
>  > > +static int rx51_xceiv_power(struct device *dev, int iD, int on)
>  > > +{
>  > > +	unsigned long	timeout;
>  > > +
>  > > +	if (!on) {
>  > > +		/* Let musb go stdby before powering down the transceiver */
>  > > +		timeout = jiffies + msecs_to_jiffies(100);
>  > > +		while (!time_after(jiffies, timeout))
>  > > +			if (omap2_cm_read_mod_reg(CORE_MOD,
>  > CM_IDLEST1)
>  > > +				&
>  > OMAP3430ES2_ST_HSOTGUSB_STDBY_MASK)
>  > > +				break;
>  > > +		if (!(omap2_cm_read_mod_reg(CORE_MOD, CM_IDLEST1)
>  > > +			& OMAP3430ES2_ST_HSOTGUSB_STDBY_MASK))
>  > > +			WARN(1, "could not put musb to sleep\n");
>  > > +	}
>  > > +	gpio_set_value(RX51_USB_TRANSCEIVER_RST_GPIO, on);
>  > > +
>  > > +	return 0;
>  > > +}
>  > 
>  > The busy loop is not needed, and not what we want. We need to be able
>  > to toggle the CHIP_SEL even if the USB block is not IDLE or STDBY.
> 
> I basically just took what was in the maemo kernel. Was there some reason
> originally to include the busyloop? Do I get it now correctly that the ISP is
> only needed active when we are charging?

OK, my comment was incorrect. The gpio is clearly set regardless of the
outcome of the loop. To answer your question, we only need the ISP to
be active when _detecting_ the charger and obviously when USB is in
use.

We had problems hitting off-mode if we switched the transceiver off
before the controller had entered STDBY. I think this needs to be
tested again. The code in drivers/usb/musb/omap2430.c is quite
different then what we had in maemo kernel. It could be that there is
no need for the loop anymore. If you want to play it safe, fix it and
leave it there.

-- 
heikki

  reply	other threads:[~2011-03-22 10:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 13:50 [PATCH 0/2] USB: twl4030-usb: fix isp1707 xceiver powering Kalle Jokiniemi
2011-03-21 13:50 ` [PATCH 1/2] USB: twl4030-usb: do board specific phy_power up/down Kalle Jokiniemi
     [not found]   ` <1300715420-25602-2-git-send-email-kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2011-03-21 14:21     ` Sergei Shtylyov
     [not found]       ` <4D875EE6.50505-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2011-03-22 10:12         ` kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w
2011-03-22  9:17   ` Heikki Krogerus
2011-03-21 13:50 ` [PATCH 2/2] OMAP3: rx51: specify phy_power for usb tranceiver Kalle Jokiniemi
     [not found]   ` <1300715420-25602-3-git-send-email-kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2011-03-21 14:28     ` Sergei Shtylyov
     [not found]       ` <4D8760AB.1080307-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2011-03-21 14:40         ` Aaro Koskinen
     [not found]           ` <alpine.DEB.1.10.1103211637510.2634-etG4378wJBqbbBH2nJjHHo8aPWbYBoAt8eUrP9FhD0M@public.gmane.org>
2011-03-21 16:21             ` Greg KH
     [not found]               ` <20110321162148.GA659-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2011-03-22  8:43                 ` Felipe Balbi
2011-03-22 10:13         ` kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w
2011-03-21 15:20     ` Jarkko Nikula
     [not found]       ` <20110321172058.a8b66331.jhnikula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-03-22 10:30         ` kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w
2011-03-22  9:13   ` Heikki Krogerus
2011-03-22 10:24     ` kalle.jokiniemi
2011-03-22 10:54       ` Heikki Krogerus [this message]
2011-03-22  9:45 ` [PATCH 0/2] USB: twl4030-usb: fix isp1707 xceiver powering Heikki Krogerus
2011-03-22 10:19   ` kalle.jokiniemi

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=20110322105451.GE4286@esdhcp034230 \
    --to=heikki.krogerus@nokia.com \
    --cc=balbi@ti.com \
    --cc=ilkka.koskinen@nokia.com \
    --cc=jhnikula@gmail.com \
    --cc=kalle.jokiniemi@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tony@atomide.com \
    /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