From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> To: Simon Horman <horms@verge.net.au> Cc: "balbi@kernel.org" <balbi@kernel.org>, "robh+dt@kernel.org" <robh+dt@kernel.org>, "mark.rutland@arm.com" <mark.rutland@arm.com>, "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>, "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>, "linux-renesas-soc@vger.kernel.org" <linux-renesas-soc@vger.kernel.org>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org> Subject: RE: [PATCH 1/2] usb: gadget: udc: renesas_usb3: add property "renesas,ignore-id" Date: Thu, 12 Apr 2018 05:03:23 +0000 [thread overview] Message-ID: <TY1PR06MB0992A446CC3822360157B948D8BC0@TY1PR06MB0992.apcprd06.prod.outlook.com> (raw) In-Reply-To: <20180411072810.powlmegmyyju3nol@verge.net.au> Hi Simon-san, > From: Simon Horman, Sent: Wednesday, April 11, 2018 4:28 PM > > On Tue, Apr 10, 2018 at 09:13:53PM +0900, Yoshihiro Shimoda wrote: <snip> > > This patch adds a new property to ignore the ID signal on a board. > > > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> > > --- > > Documentation/devicetree/bindings/usb/renesas_usb3.txt | 2 ++ > > drivers/usb/gadget/udc/renesas_usb3.c | 10 ++++++++++ > > 2 files changed, 12 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/usb/renesas_usb3.txt > b/Documentation/devicetree/bindings/usb/renesas_usb3.txt > > index 2c071bb..53949bd 100644 > > --- a/Documentation/devicetree/bindings/usb/renesas_usb3.txt > > +++ b/Documentation/devicetree/bindings/usb/renesas_usb3.txt > > @@ -19,6 +19,8 @@ Required properties: > > Optional properties: > > - phys: phandle + phy specifier pair > > - phy-names: must be "usb" > > + - renesas,ignore-id: when a board doesn't use ID pin, you can add this > > + property to ignore the ID state. > > > > Example of R-Car H3 ES1.x: > > usb3_peri0: usb@ee020000 { > > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c > > index 409cde4..59e1485 100644 > > --- a/drivers/usb/gadget/udc/renesas_usb3.c > > +++ b/drivers/usb/gadget/udc/renesas_usb3.c > > @@ -350,6 +350,7 @@ struct renesas_usb3 { > > bool extcon_host; /* check id and set EXTCON_USB_HOST */ > > bool extcon_usb; /* check vbus and set EXTCON_USB */ > > bool forced_b_device; > > + bool ignore_id; > > }; > > > > #define gadget_to_renesas_usb3(_gadget) \ > > @@ -645,6 +646,9 @@ static void usb3_check_vbus(struct renesas_usb3 *usb3) > > > > static void usb3_set_mode(struct renesas_usb3 *usb3, bool host) > > { > > + if (usb3->ignore_id && !usb3->forced_b_device) > > + return; > > + > > if (host) > > usb3_clear_bit(usb3, DRD_CON_PERI_CON, USB3_DRD_CON); > > else > > @@ -675,6 +679,9 @@ static void usb3_mode_config(struct renesas_usb3 *usb3, bool host, bool a_dev) > > > > static bool usb3_is_a_device(struct renesas_usb3 *usb3) > > { > > + if (usb3->ignore_id) > > + return false; > > + > > return !(usb3_read(usb3, USB3_USB_OTG_STA) & USB_OTG_IDMON); > > } > > > > @@ -2632,6 +2639,9 @@ static int renesas_usb3_probe(struct platform_device *pdev) > > if (ret < 0) > > goto err_add_udc; > > > > + if (of_property_read_bool(pdev->dev.of_node, "renesas,no-id")) > > + usb3->ignore_id = true; > > I wonder if this is better expressed as: > > usb3->ignore_id = of_property_read_bool(pdev->dev.of_node, > "renesas,no-id")); Thank you for the pointed out! I agree with you. However, I would like to recall this adding property for now because I'm thinking that the OF graph of usb-connector can assume this via connector-type instead of such a local property. So, I'll try to use the usb-connector bindings on this driver. Best regards, Yoshihiro Shimoda > > + > > ret = device_create_file(&pdev->dev, &dev_attr_role); > > if (ret < 0) > > goto err_dev_create; > > -- > > 1.9.1 > >
WARNING: multiple messages have this Message-ID (diff)
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> To: Simon Horman <horms@verge.net.au> Cc: "balbi@kernel.org" <balbi@kernel.org>, "robh+dt@kernel.org" <robh+dt@kernel.org>, "mark.rutland@arm.com" <mark.rutland@arm.com>, "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>, "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>, "linux-renesas-soc@vger.kernel.org" <linux-renesas-soc@vger.kernel.org>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org> Subject: [1/2] usb: gadget: udc: renesas_usb3: add property "renesas,ignore-id" Date: Thu, 12 Apr 2018 05:03:23 +0000 [thread overview] Message-ID: <TY1PR06MB0992A446CC3822360157B948D8BC0@TY1PR06MB0992.apcprd06.prod.outlook.com> (raw) Hi Simon-san, > From: Simon Horman, Sent: Wednesday, April 11, 2018 4:28 PM > > On Tue, Apr 10, 2018 at 09:13:53PM +0900, Yoshihiro Shimoda wrote: <snip> > > This patch adds a new property to ignore the ID signal on a board. > > > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> > > --- > > Documentation/devicetree/bindings/usb/renesas_usb3.txt | 2 ++ > > drivers/usb/gadget/udc/renesas_usb3.c | 10 ++++++++++ > > 2 files changed, 12 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/usb/renesas_usb3.txt > b/Documentation/devicetree/bindings/usb/renesas_usb3.txt > > index 2c071bb..53949bd 100644 > > --- a/Documentation/devicetree/bindings/usb/renesas_usb3.txt > > +++ b/Documentation/devicetree/bindings/usb/renesas_usb3.txt > > @@ -19,6 +19,8 @@ Required properties: > > Optional properties: > > - phys: phandle + phy specifier pair > > - phy-names: must be "usb" > > + - renesas,ignore-id: when a board doesn't use ID pin, you can add this > > + property to ignore the ID state. > > > > Example of R-Car H3 ES1.x: > > usb3_peri0: usb@ee020000 { > > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c > > index 409cde4..59e1485 100644 > > --- a/drivers/usb/gadget/udc/renesas_usb3.c > > +++ b/drivers/usb/gadget/udc/renesas_usb3.c > > @@ -350,6 +350,7 @@ struct renesas_usb3 { > > bool extcon_host; /* check id and set EXTCON_USB_HOST */ > > bool extcon_usb; /* check vbus and set EXTCON_USB */ > > bool forced_b_device; > > + bool ignore_id; > > }; > > > > #define gadget_to_renesas_usb3(_gadget) \ > > @@ -645,6 +646,9 @@ static void usb3_check_vbus(struct renesas_usb3 *usb3) > > > > static void usb3_set_mode(struct renesas_usb3 *usb3, bool host) > > { > > + if (usb3->ignore_id && !usb3->forced_b_device) > > + return; > > + > > if (host) > > usb3_clear_bit(usb3, DRD_CON_PERI_CON, USB3_DRD_CON); > > else > > @@ -675,6 +679,9 @@ static void usb3_mode_config(struct renesas_usb3 *usb3, bool host, bool a_dev) > > > > static bool usb3_is_a_device(struct renesas_usb3 *usb3) > > { > > + if (usb3->ignore_id) > > + return false; > > + > > return !(usb3_read(usb3, USB3_USB_OTG_STA) & USB_OTG_IDMON); > > } > > > > @@ -2632,6 +2639,9 @@ static int renesas_usb3_probe(struct platform_device *pdev) > > if (ret < 0) > > goto err_add_udc; > > > > + if (of_property_read_bool(pdev->dev.of_node, "renesas,no-id")) > > + usb3->ignore_id = true; > > I wonder if this is better expressed as: > > usb3->ignore_id = of_property_read_bool(pdev->dev.of_node, > "renesas,no-id")); Thank you for the pointed out! I agree with you. However, I would like to recall this adding property for now because I'm thinking that the OF graph of usb-connector can assume this via connector-type instead of such a local property. So, I'll try to use the usb-connector bindings on this driver. Best regards, Yoshihiro Shimoda > > + > > ret = device_create_file(&pdev->dev, &dev_attr_role); > > if (ret < 0) > > goto err_dev_create; > > -- > > 1.9.1 > > --- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-04-12 5:03 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-04-10 12:13 [PATCH 0/2] usb: gadet: udc: renesas_usb3: add role switch for R-Car SoCs Yoshihiro Shimoda 2018-04-10 12:13 ` [PATCH 1/2] usb: gadget: udc: renesas_usb3: add property "renesas,ignore-id" Yoshihiro Shimoda 2018-04-10 12:13 ` [1/2] " Yoshihiro Shimoda 2018-04-11 7:28 ` [PATCH 1/2] " Simon Horman 2018-04-11 7:28 ` [1/2] " Simon Horman 2018-04-12 5:03 ` Yoshihiro Shimoda [this message] 2018-04-12 5:03 ` Yoshihiro Shimoda 2018-04-10 12:13 ` [PATCH 2/2] usb: gadget: udc: renesas_usb3: add devm_of_platform_populate() Yoshihiro Shimoda 2018-04-10 12:13 ` [2/2] " 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=TY1PR06MB0992A446CC3822360157B948D8BC0@TY1PR06MB0992.apcprd06.prod.outlook.com \ --to=yoshihiro.shimoda.uh@renesas.com \ --cc=balbi@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=gregkh@linuxfoundation.org \ --cc=horms@verge.net.au \ --cc=linux-renesas-soc@vger.kernel.org \ --cc=linux-usb@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=robh+dt@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: linkBe 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.