Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1623607

Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod

From Peter Chen <hzpeterchen@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod
Date 2017-04-14 11:40 +0200
Message-ID <tw5RU-7Pb-17@gated-at.bofh.it> (permalink)
References <tv5Ki-gG-13@gated-at.bofh.it> <tvp6h-3Zp-5@gated-at.bofh.it> <tvpSG-4v9-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] chipidea: Fix issue in reconnecing gadget without  insmod/rmmod Niranjan Dighe <niranjan.dighe@gmail.com> - 2017-04-11 17:20 +0200
  Re: [PATCH] chipidea: Fix issue in reconnecing gadget without  insmod/rmmod kbuild test robot <lkp@intel.com> - 2017-04-11 20:30 +0200
  Re: [PATCH] chipidea: Fix issue in reconnecing gadget without  insmod/rmmod Peter Chen <hzpeterchen@gmail.com> - 2017-04-12 14:00 +0200
    Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod Niranjan Dighe <niranjan.dighe@gmail.com> - 2017-04-12 14:50 +0200
      Re: [PATCH] chipidea: Fix issue in reconnecing gadget without  insmod/rmmod Peter Chen <hzpeterchen@gmail.com> - 2017-04-14 11:40 +0200

csiph-web