linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <hzpeterchen@gmail.com>
To: Niranjan Dighe <niranjan.dighe@gmail.com>
Cc: Peter.Chen@freescale.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod
Date: Fri, 14 Apr 2017 17:38:55 +0800	[thread overview]
Message-ID: <20170414093855.GA28433@b29397-desktop> (raw)
In-Reply-To: <CADCM0G+_HDzRkvi1F-Pz4RfDQG2_J99PrFoXaWARNLZUHvc6ZA@mail.gmail.com>

On Wed, Apr 12, 2017 at 06:18:20PM +0530, Niranjan Dighe wrote:
> > Hi Niranjan,
> >
> > When working with iAP device, there are two role-switch methods
> > - Through OTG FSM, and using sysfs entries under
> > /sys/bus/platform/devices/ci_hdrc.0/inputs
> > but you may need to patch code to keep vbus always on for A-device,
> > it is not compliance with OTG spec.
> > - Using role interface under debugfs (I move it under sysfs for v4.12).
> > But you need to patch the code and let the A-device switch back to
> > host after iAP is disconnected.
> >
> > You don't need to use above two methods together, I suggest using the
> > 2nd method since OTG FSM is hard to maintain due to no mandatory use
> > case for it.
> >
> > --
> >
> > Best Regards,
> > Peter Chen
> 
> Thank you Peter for your response.
> 
> Yes, I will try to switch the role on disconnection of iAP device to Host. If
> I understand correctly I have to do something like this -
> 
>         ci_role_stop(ci); //Gadget role stop
>         ret = ci_role_start(ci, role); //Host role start
> 
Applying below patch [1] first.

- When your app detects the board needs to switch role to gadget, do
echo gadget > /sys/bus/platform/devices/ci_hdrc.0/role
- When your app detects the iAP devices is disconnected from the board, do
echo host > /sys/bus/platform/devices/ci_hdrc.0/role

[1] https://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git/commit/?h=ci-for-usb-next
-- 

Best Regards,
Peter Chen

      reply	other threads:[~2017-04-14  9:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 15:16 [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod Niranjan Dighe
2017-04-11 17:17 ` kbuild test robot
2017-04-11 18:22 ` kbuild test robot
2017-04-12 11:51 ` Peter Chen
2017-04-12 12:48   ` Niranjan Dighe
2017-04-14  9:38     ` Peter Chen [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=20170414093855.GA28433@b29397-desktop \
    --to=hzpeterchen@gmail.com \
    --cc=Peter.Chen@freescale.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=niranjan.dighe@gmail.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).