All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Peter Chen <hzpeterchen@gmail.com>
Cc: "kishon@ti.com" <kishon@ti.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"balbi@kernel.org" <balbi@kernel.org>,
	"Peter.Chen@nxp.com" <Peter.Chen@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>
Subject: RE: [PATCH v2] phy: rcar-gen3-usb2: add sysfs for usb role swap
Date: Wed, 2 Nov 2016 00:43:15 +0000	[thread overview]
Message-ID: <HK2PR06MB0548F0CB64D8B6A2E32A052DD8A00@HK2PR06MB0548.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <20161101113743.GC28525@b29397-desktop>

Hi Peter,

> From: Peter Chen [mailto:hzpeterchen@gmail.com]
> Sent: Tuesday, November 01, 2016 8:38 PM
> 
> On Tue, Nov 01, 2016 at 04:01:58PM +0900, Yoshihiro Shimoda wrote:
> > This patch adds sysfs "otg_inputs" for usb role swap. This parameter
> > is write-only and if you use them as the following, you can swap
> > the usb role.
> >
> > For example:
> >  1) connect a usb cable using 2 salvator-x boards
> >  2) On A-device (as host), you input the following command:
> >    # echo a_bus_req/ > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs
> >  3) On B-device (as peripheral), you input the following command:
> >    # echo b_bus_req > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs
> >
> > Then, the A-device acts as a peripheral (A-peripheral) and the B-device
> > acts as a host (B-host).
> > Please note that A-device must input the following command if you
> > want the board to act as a host again. (even if you disconnect the usb
> > cable, since id state may be the same, the condition keeps "A-peripheral".)
> >  # echo a_bus_drop > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs
> >
> > Also you can use the following command if you want the B-device board to
> > act as a peripheral again.
> >  # echo b_bus_req/ > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> >  This patch is based on the latest linux-phy.git / next branch.
> >  (commit id = 7809cd2ce6abd4f431e4b14e6b1276a7cc842ac4)
> >
> >  Since this patch is related to usb, I added email addresses of Greg, Felipe,
> >  Peter and USB ML as CC. (This patch doesn't use USB OTG FSM though.)
> >
> >  Changed from v1:
> >   - rebase the latest next branch.
> >
> >  .../ABI/testing/sysfs-platform-phy-rcar-gen3-usb2  |  11 ++
> >  drivers/phy/phy-rcar-gen3-usb2.c                   | 124 ++++++++++++++++++++-
> >  2 files changed, 134 insertions(+), 1 deletion(-)
> >  create mode 100644 Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2
> >
> > diff --git a/Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2
> b/Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2
> > new file mode 100644
> > index 0000000..c7e715af
> > --- /dev/null
> > +++ b/Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2
> > @@ -0,0 +1,11 @@
> > +What:		/sys/devices/platform/<phy-name>/otg-inputs
> > +Date:		October 2016
> > +KernelVersion:	4.10
> > +Contact:	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > +Description:
> > +		This write-only file changes the phy mode for role swap of usb.
> > +		This file accepts the following strings:
> > +		 "a_bus_req/" - switching from A-Host to A-Peripheral
> > +		 "a_bus_drop" - switching from A-Peripheral to A-Host
> > +		 "b_bus_req"  - switching from B-Peripheral to B-Host
> > +		 "b_bus_req/" - switching from B-Host to B-Peripheral
> 
> Would you really care OTG FSM state machine? If not, you could just use
> "host" and "peripheral" to stand for current USB role, and implement
> role switch sysfs like: /sys/devices/platform/<phy-name>/role.

Thank you for the comment!
Since I would not care OTG FSM state machine for now, I will modify the patch to
use "host" and "peripheral" that you suggested.

Best regards,
Yoshihiro Shimoda

> Peter
> 

  reply	other threads:[~2016-11-02  0:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-01  7:01 [PATCH v2] phy: rcar-gen3-usb2: add sysfs for usb role swap Yoshihiro Shimoda
2016-11-01 11:37 ` Peter Chen
2016-11-02  0:43   ` Yoshihiro Shimoda [this message]
2016-11-02  0:43     ` Yoshihiro Shimoda

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=HK2PR06MB0548F0CB64D8B6A2E32A052DD8A00@HK2PR06MB0548.apcprd06.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=Peter.Chen@nxp.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hzpeterchen@gmail.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.