From: Stanislav Brabec <utx@penguin.cz>
To: Cyril Hrubis <metan@ucw.cz>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>,
Marek Vasut <marek.vasut@gmail.com>,
linux-arm-kernel@lists.infradead.org,
Eric Miao <eric.y.miao@gmail.com>,
dbaryshkov@gmail.com, arminlitzel@web.de,
kernel list <linux-kernel@vger.kernel.org>,
lenz@cs.wisc.edu, rpurdie@rpsys.net, pave@ucw.cz,
thommycheck@gmail.com, zaurus-devel@www.linuxtogo.org,
omegamoon@gmail.com
Subject: Re: usb gadget on zaurus and kexec
Date: Tue, 13 Jul 2010 18:47:06 +0200 [thread overview]
Message-ID: <1279039626.9908.50.camel@hammer.suse.cz> (raw)
In-Reply-To: <20100713112649.GA17065@atrey.karlin.mff.cuni.cz>
Cyril Hrubis wrote:
> Would be great. So far the GPIO for usb host/slave cable detection is not used
> on spitz so there is no way to switch to USB slave for gadgets to work if you
> don't want to play with devmem2.
Well, just the driver is missing, the hardware is there. See attached
usb-auto script using pxaregs utility.
There is another issue in the gadget mode (probably including the latest
kernels): If host mode is not active, it should turn USB power off. It
does not, and it causes soft short circuit in client mode. It also makes
impossible to differentiate between no cable and client cable.
Here are GPIOs to control OTG:
SPITZ_GPIO_USB_DEVICE GPIO35 USB Client power is present
SPITZ_GPIO_USB_HOST GPIO37 USB OTG 5V Host power supply control
SPITZ_GPIO_USB_CONNECT GPIO41 USB Host Cable is connected
----------- usb-auto ----------
#!/bin/sh
if test -z "$CLIENT_MODULE" ; then
# Uncomment client module you want by default (only one at a time is possible in 2.6.26RP):
CLIENT_MODULE=g_ether
#CLIENT_MODULE=g_file_storage
fi
if test `pxaregs GPLR1_41 | sed -n 's/.*\(.\) GPIO.*/\1/p'` = 0 ; then
echo "Host cable is present."
pxaregs GPSR1_37 1 # Turn on USB power
rmmod g_file_storage g_ether pxa27x_udc 2>/dev/null
sleep 1
modprobe ohci-hcd 2>/dev/null
else
pxaregs GPCR1_37 1 # Turn off USB power
sleep 1 # Wait a bit to discharge capacitors
if test `pxaregs GPLR1_35 | sed -n 's/.*\(.\) GPIO.*/\1/p'` = 0 ; then
echo "No cable in USB."
ifdown usb0 2>/dev/null
sleep 1
rmmod g_file_storage g_ether pxa27x_udc 2>/dev/null
sleep 1
rmmod ohci-hcd 2>/dev/null
else
echo "Client cable is present."
rmmod ohci-hcd 2>/dev/null
sleep 1
modprobe pxa27x_udc
modprobe $CLIENT_MODULE
ifup usb0 2>/dev/null
fi
fi
-------------------------------
--
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus
prev parent reply other threads:[~2010-07-13 17:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-19 15:46 Cyril Hrubis
2010-05-20 5:05 ` Eric Miao
2010-06-10 6:10 ` Eric Miao
2010-06-10 7:00 ` Marek Vasut
2010-06-10 13:14 ` Robert Jarzmik
2010-07-13 11:26 ` Cyril Hrubis
2010-07-13 16:47 ` Stanislav Brabec [this message]
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=1279039626.9908.50.camel@hammer.suse.cz \
--to=utx@penguin.cz \
--cc=arminlitzel@web.de \
--cc=dbaryshkov@gmail.com \
--cc=eric.y.miao@gmail.com \
--cc=lenz@cs.wisc.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.vasut@gmail.com \
--cc=metan@ucw.cz \
--cc=omegamoon@gmail.com \
--cc=pave@ucw.cz \
--cc=robert.jarzmik@free.fr \
--cc=rpurdie@rpsys.net \
--cc=thommycheck@gmail.com \
--cc=zaurus-devel@www.linuxtogo.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
Powered by JetHome