From: peter.chen@freescale.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v8 3/8] usb: chipidea: add otg id switch and vbus connect/disconnect detect
Date: Sun, 17 Feb 2013 11:27:29 +0800 [thread overview]
Message-ID: <20130217032728.GB1588@nchen-desktop> (raw)
In-Reply-To: <87wqub9ill.fsf@ashishki-desk.ger.corp.intel.com>
On Thu, Feb 14, 2013 at 02:37:42PM +0200, Alexander Shishkin wrote:
> Peter Chen <peter.chen@freescale.com> writes:
>
> > @@ -130,6 +130,7 @@ struct hw_bank {
> > * @transceiver: pointer to USB PHY, if any
> > * @hcd: pointer to usb_hcd for ehci host driver
> > * @otg: for otg support
> > + * @events: events for otg, and handled at ci_role_work
>
> Should be id_event and b_sess_valid_event.
Will change
>
> If you reordered the patchset so that the role api patch comes before
> this one, this function would have been much shorter from the start. Now
> it looks like you're adding lots of code in one patch and then replace
> and reshuffle it in subsequent patches, which makes it really difficult
> to review.
I will merge the 3/8 and 4/8 to one patch.
> > +static void ci_delayed_work(struct work_struct *work)
> > +{
> > + struct delayed_work *dwork = to_delayed_work(work);
> > + struct ci13xxx *ci = container_of(dwork, struct ci13xxx, dwork);
> > +
> > + otg_set_vbus(&ci->otg, true);
> > +
> > +}
>
> That's one newline too many.
Will change
>
> > +
> > static ssize_t show_role(struct device *dev, struct device_attribute *attr,
> > char *buf)
> > {
> > @@ -352,25 +469,49 @@ static ssize_t store_role(struct device *dev, struct device_attribute *attr,
> >
> > static DEVICE_ATTR(role, S_IRUSR | S_IWUSR, show_role, store_role);
> >
> > +static bool ci_supports_gadget(struct ci13xxx *ci)
> > +{
> > + return (ci->roles[CI_ROLE_GADGET]) ? true : false;
>
I prefer to keep it
> > +}
> > +
> > static irqreturn_t ci_irq(int irq, void *data)
> > {
> > struct ci13xxx *ci = data;
> > irqreturn_t ret = IRQ_NONE;
> > u32 otgsc = 0;
> >
> > - if (ci->is_otg)
> > + if (ci_supports_gadget(ci))
>
> We can't do this since there are indeed devices out there that support
> gadget and don't support otg to such an extend that OTGSC accesses are
> discouraged. We should really make sure that we're only touching it on
> otg capable devices.
>
OK, for such devices they need external gpio to judge connection
and disconnection.
I will replace ci_supports_gadget(ci) to ci_supports_otg(ci), it
indicates the controller supports both host and devices. Currently,
the ci->is_otg indicates the driver has both host and device funcitons.
--
Best Regards,
Peter Chen
next prev parent reply other threads:[~2013-02-17 3:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-05 8:00 [PATCH v8 0/8] Add tested id switch and vbus connect detect support for Chipidea Peter Chen
2013-02-05 8:00 ` [PATCH v8 1/8] Revert "USB: chipidea: add vbus detect for udc" Peter Chen
2013-02-05 8:00 ` [PATCH v8 2/8] usb: chipidea: add otg file Peter Chen
2013-02-05 8:00 ` [PATCH v8 3/8] usb: chipidea: add otg id switch and vbus connect/disconnect detect Peter Chen
2013-02-14 12:37 ` Alexander Shishkin
2013-02-17 3:27 ` Peter Chen [this message]
2013-02-05 8:00 ` [PATCH v8 4/8] usb: chipidea: consolidate kinds of APIs for both roles Peter Chen
2013-02-05 8:00 ` [PATCH v8 5/8] usb: chipidea: udc: add pullup/pulldown dp at hw_device_state Peter Chen
2013-02-05 8:00 ` [PATCH v8 6/8] usb: chipidea: udc: retire the flag CI13_PULLUP_ON_VBUS Peter Chen
2013-02-05 8:00 ` [PATCH v8 7/8] usb: chipidea: imx: add internal vbus regulator control Peter Chen
2013-02-05 8:00 ` [PATCH v8 8/8] usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget Peter Chen
2013-02-13 8:41 ` Felipe Balbi
2013-02-17 3:09 ` Peter Chen
2013-02-26 18:21 ` Felipe Balbi
2013-02-27 3:10 ` Peter Chen
2013-02-27 8:42 ` Felipe Balbi
2013-02-27 8:57 ` Chen Peter-B29397
2013-02-14 12:15 ` [PATCH v8 0/8] Add tested id switch and vbus connect detect support for Chipidea Alexander Shishkin
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=20130217032728.GB1588@nchen-desktop \
--to=peter.chen@freescale.com \
--cc=linux-arm-kernel@lists.infradead.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