Re: [PATCH 2/2] OMAP3: rx51: specify phy_power for usb tranceiver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 21 Mar 2011 15:50:20 +0200
Kalle Jokiniemi <kalle.jokiniemi@xxxxxxxxx> wrote:

> This patch allows the ISP1707 USB tranceiver on Nokia
> N900 to be disabled when usb cable is disconnected.
> This saves approximately 14mA of battery current.
> 
I can measure that these two patches save about 14 mA.

> +static void __init rx51_xceiv_init(void)
> +{
> +	if (gpio_request(RX51_USB_TRANSCEIVER_RST_GPIO, NULL) < 0)
> +		BUG();
> +	gpio_direction_output(RX51_USB_TRANSCEIVER_RST_GPIO, 1);
> +}

gpio_request_one makes this function needless.

> +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);
> +

Hmm... 100 ms busy loop. I wonder are there better ways in usb to
achieve this gpio control than this loop here and playing with these
registers? I believe musb/phy/etc has knowledge when they are idle and
can do some board specific stuff?

-- 
Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux