From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Date: Wed, 01 Oct 2014 19:22:36 +0000 Subject: Re: [PATCH v3 2/2] usb: renesas_usbhs: Add device tree support for R-Car H2 and M2 Message-Id: <542C547C.1080601@cogentembedded.com> List-Id: References: <5406A664.2050501@renesas.com> <54298A38.5030703@cogentembedded.com> <542A7D29.3010805@renesas.com> <542B21DE.4010903@cogentembedded.com> In-Reply-To: <542B21DE.4010903-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Yoshihiro Shimoda , Greg Kroah-Hartman , Felipe Balbi Cc: Rob Herring , "pawel.moll-5wv7dgnIgG8@public.gmane.org" , "mark.rutland-5wv7dgnIgG8@public.gmane.org" , "ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org" , "galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , SH-Linux , kuninori morimoto , Ulrich Hecht On 10/01/2014 01:34 AM, Sergei Shtylyov wrote: >>>> This driver supports other SoCs, but they need boards/Soc depend code. >>>> So, this patch adds device tree support for R-Car H2 and M2 initially. >>>> Signed-off-by: Yoshihiro Shimoda >>>> Acked-by: Kuninori Morimoto >>>> --- >>>> drivers/usb/renesas_usbhs/common.c | 44 >>>> ++++++++++++++++++++++++++++++++++++ >>>> 1 file changed, 44 insertions(+) >>>> diff --git a/drivers/usb/renesas_usbhs/common.c >>>> b/drivers/usb/renesas_usbhs/common.c >>>> index 1b9bf8d..b3b6813 100644 >>>> --- a/drivers/usb/renesas_usbhs/common.c >>>> +++ b/drivers/usb/renesas_usbhs/common.c > [...] >>>> @@ -438,6 +440,43 @@ static int usbhsc_drvcllbck_notify_hotplug(struct >>>> platform_device *pdev) >>> [...] >>>> +static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device >>>> *dev) >>>> +{ >>>> + struct renesas_usbhs_platform_info *info; >>>> + struct renesas_usbhs_driver_param *dparam; >>>> + const struct of_device_id *of_id = of_match_device(usbhs_of_match, dev); >>>> + u32 tmp; >>>> + int gpio; >>>> + >>>> + info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); >>>> + if (!info) >>>> + return NULL; >>>> + >>>> + dparam = &info->driver_param; >>>> + dparam->type = of_id ? (u32)of_id->data : 0; >>>> + if (!of_property_read_u32(dev->of_node, "renesas,buswait", &tmp)) >>>> + dparam->buswait_bwait = tmp; >>>> + gpio = of_get_named_gpio_flags(dev->of_node, "renesas,enable-gpio", 0, >>>> + NULL); >>>> + if (gpio > 0) >>>> + dparam->enable_gpio = gpio; >>>> + >>>> + return info; >>> I don't see where you parse the optional "phy" property. It should exist >>> for the Lager and Koelsch boards you target. [...] >> About using the phy driver in renesas_usbhs driver, I intend to modify >> the drivers/usb/renesas_usbhs/rcar.c. > Hm, it slready supports 'struct usb_phy'. Also PHYs are not limited to > R-Car Gen2 SoCs... OK, let's do this locally to rcar2.c for now. But since you still haven't provided the patches and I'm tasked with the USBHS support, I have to take the further development in my hands. >> Best regards, >> Yoshihiro Shimoda WBR, Sergei From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCH v3 2/2] usb: renesas_usbhs: Add device tree support for R-Car H2 and M2 Date: Wed, 01 Oct 2014 23:22:36 +0400 Message-ID: <542C547C.1080601@cogentembedded.com> References: <5406A664.2050501@renesas.com> <54298A38.5030703@cogentembedded.com> <542A7D29.3010805@renesas.com> <542B21DE.4010903@cogentembedded.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <542B21DE.4010903-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Yoshihiro Shimoda , Greg Kroah-Hartman , Felipe Balbi Cc: Rob Herring , "pawel.moll-5wv7dgnIgG8@public.gmane.org" , "mark.rutland-5wv7dgnIgG8@public.gmane.org" , "ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org" , "galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , SH-Linux , kuninori morimoto , Ulrich Hecht List-Id: devicetree@vger.kernel.org On 10/01/2014 01:34 AM, Sergei Shtylyov wrote: >>>> This driver supports other SoCs, but they need boards/Soc depend code. >>>> So, this patch adds device tree support for R-Car H2 and M2 initially. >>>> Signed-off-by: Yoshihiro Shimoda >>>> Acked-by: Kuninori Morimoto >>>> --- >>>> drivers/usb/renesas_usbhs/common.c | 44 >>>> ++++++++++++++++++++++++++++++++++++ >>>> 1 file changed, 44 insertions(+) >>>> diff --git a/drivers/usb/renesas_usbhs/common.c >>>> b/drivers/usb/renesas_usbhs/common.c >>>> index 1b9bf8d..b3b6813 100644 >>>> --- a/drivers/usb/renesas_usbhs/common.c >>>> +++ b/drivers/usb/renesas_usbhs/common.c > [...] >>>> @@ -438,6 +440,43 @@ static int usbhsc_drvcllbck_notify_hotplug(struct >>>> platform_device *pdev) >>> [...] >>>> +static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device >>>> *dev) >>>> +{ >>>> + struct renesas_usbhs_platform_info *info; >>>> + struct renesas_usbhs_driver_param *dparam; >>>> + const struct of_device_id *of_id = of_match_device(usbhs_of_match, dev); >>>> + u32 tmp; >>>> + int gpio; >>>> + >>>> + info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); >>>> + if (!info) >>>> + return NULL; >>>> + >>>> + dparam = &info->driver_param; >>>> + dparam->type = of_id ? (u32)of_id->data : 0; >>>> + if (!of_property_read_u32(dev->of_node, "renesas,buswait", &tmp)) >>>> + dparam->buswait_bwait = tmp; >>>> + gpio = of_get_named_gpio_flags(dev->of_node, "renesas,enable-gpio", 0, >>>> + NULL); >>>> + if (gpio > 0) >>>> + dparam->enable_gpio = gpio; >>>> + >>>> + return info; >>> I don't see where you parse the optional "phy" property. It should exist >>> for the Lager and Koelsch boards you target. [...] >> About using the phy driver in renesas_usbhs driver, I intend to modify >> the drivers/usb/renesas_usbhs/rcar.c. > Hm, it slready supports 'struct usb_phy'. Also PHYs are not limited to > R-Car Gen2 SoCs... OK, let's do this locally to rcar2.c for now. But since you still haven't provided the patches and I'm tasked with the USBHS support, I have to take the further development in my hands. >> Best regards, >> Yoshihiro Shimoda WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html