From: Pavan Kondeti <pkondeti@codeaurora.org>
To: David Brownell <david-b@pacbell.net>
Cc: Matthieu CASTET <matthieu.castet@parrot.com>,
Brian Swetland <swetland@google.com>,
"greg@kroah.com" <greg@kroah.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
Mike Lockwood <lockwood@android.com>
Subject: Re: [PATCH v2] USB: Add MSM USB Device Controller driver
Date: Sun, 28 Nov 2010 17:39:31 +0530 [thread overview]
Message-ID: <4CF2467B.9070304@codeaurora.org> (raw)
In-Reply-To: <1290925809.2529.313.camel@helium>
Hi Dave,
On 11/28/2010 12:00 PM, David Brownell wrote:
>
>> implementing specific hooks needed for MSM. I am relying on
>> gadget_is_xxx() macro for MSM specific workarounds.
>
> NEVER DO THAT from inside controller drivers.
Here we are using the macro in ci13xxx_udc core which is included by
two gadget controller drivers.
>
> (If the code isn't specific to the msm silicon, and works on
> other vendors' implementations too, it'd misbehave anyway.
>
> Those calls are for gadget drivers, e.g. to embed knowledge about
> controller issues which can't be detected by looking at
> what's advertised by the gadget controller device. Using them isn't
> encouraged.
>
>
> Controller drivers should see what hardware they're talking to by
> actually talking to the chip and detecting any quirks (be they
> revision-specific or otherwise). In some cases platform_data will
> be the way to package such information.
>
We need the following hooks/extension in ci13xxx_udc for MSM SoC.
1. MSM USB device controller depends on OTG driver for clocks, Low power
mode,
and PHY initialization. So udc_probe() must fail if
otg_get_transceiver() fails.
2. By default streaming mode is enabled in ci13xxx controller. It has to be
disabled due to some known issues.
3. Currently, pull-up is enabled upon gadget driver registration. But we
want
to enable only upon VBUS presence. also controller must be reset before
enabling
the pull-up as the controller was in host mode before.
4. Hardware registers should not be accessed in udc_probe()
I have started with flags to achieve the above and ended up with following:
TRANSCEIVER_IS_REQUIRED: Fail udc_probe() if otg_get_transceiver() == NULL
SKIP_RESET_IN_PROBE: avoid resetting the hardware in udc_prob()
ENABLE_PULLUP_UPON_VBUS: Enable pull-up upon VBUS
RESET_BEFORE_PULLUP: Reset the hardware before pull-up
DISABLE_STREAM_MODE: Disable streaming mode
A post reset callback to write into special registers after reset
I thought introducing this many flags may not be a good idea and used
gadget_is_xxx()
macro to achieve the same. if tomorrow, some gadget controller wants to
fail udc_probe()
if otg_get_tranceiver(), they can too OR their gadget_is_xxx() macro. If
you say using
flags is not _bad_, I will take that approach.
Thanks,
Pavan
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next prev parent reply other threads:[~2010-11-28 12:09 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-09 11:18 [PATCH v2] Add MSM USB Device Controller support Pavankumar Kondeti
2010-11-09 11:18 ` [PATCH v2] USB: Add MSM USB Device Controller driver Pavankumar Kondeti
2010-11-09 11:40 ` Matthieu CASTET
2010-11-09 12:16 ` Pavan Kondeti
2010-11-09 13:36 ` Matthieu CASTET
2010-11-10 2:12 ` Pavan Kondeti
2010-11-10 2:54 ` David Brownell
2010-11-10 6:22 ` Brian Swetland
2010-11-19 17:16 ` Matthieu CASTET
2010-11-27 14:00 ` Pavan Kondeti
2010-11-28 6:30 ` David Brownell
2010-11-28 12:09 ` Pavan Kondeti [this message]
2010-12-07 12:44 ` Pavan Kondeti
2010-11-09 13:25 ` Heikki Krogerus
2010-11-09 13:52 ` Matthieu CASTET
2010-11-09 15:36 ` Igor Grinberg
2010-11-10 2:19 ` Pavan Kondeti
2010-11-10 6:47 ` Igor Grinberg
2010-11-11 2:10 ` Pavan Kondeti
2010-11-19 5:50 ` Pavan Kondeti
2010-11-21 8:09 ` Igor Grinberg
2010-11-10 2:17 ` Pavan Kondeti
2010-11-09 11:18 ` [PATCH v2] USB: msm72k_udc: Add debugfs support Pavankumar Kondeti
2010-11-09 11:18 ` [PATCH v2] USB: msm72k_udc: Add Remote wakeup support Pavankumar Kondeti
2010-11-09 11:18 ` [PATCH v2] USB: msm72k_udc: Add Test Mode support Pavankumar Kondeti
2010-11-09 11:18 ` [PATCH] USB: msm72k_udc: Add charging notification support Pavankumar Kondeti
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=4CF2467B.9070304@codeaurora.org \
--to=pkondeti@codeaurora.org \
--cc=david-b@pacbell.net \
--cc=greg@kroah.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lockwood@android.com \
--cc=matthieu.castet@parrot.com \
--cc=swetland@google.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;
as well as URLs for NNTP newsgroup(s).