From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
Cc: SH-Linux <linux-sh@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH 2/2] usb: renesas_usbhs: Add device tree support for R-Car H2 and M2
Date: Mon, 04 Aug 2014 04:27:01 +0000 [thread overview]
Message-ID: <53DF0B95.8090203@renesas.com> (raw)
In-Reply-To: <877g2pxgoi.wl%kuninori.morimoto.gx@gmail.com>
Hi Morimoto-san,
(2014/08/04 9:05), Kuninori Morimoto wrote:
>
> Hi Shimoda-san
>
>> 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 <yoshihiro.shimoda.uh@renesas.com>
>> ---
> (snip)
>> +static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
>> +{
>> + struct renesas_usbhs_platform_info *info;
>> + struct renesas_usbhs_driver_param *dparam;
>> + u32 tmp;
>> + int gpio;
>> +
>> + info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
>> + if (!info)
>> + return NULL;
>> +
>> + dparam = &info->driver_param;
>> +
>> + if (of_device_is_compatible(dev->of_node, "renesas,usbhs-r8a7790"))
>> + dparam->type = USBHS_TYPE_R8A7790;
>> +
>> + if (of_device_is_compatible(dev->of_node, "renesas,usbhs-r8a7791"))
>> + dparam->type = USBHS_TYPE_R8A7791;
>> +
>> + if (!of_property_read_u32(dev->of_node, "buswait_bwait", &tmp))
>> + dparam->buswait_bwait = tmp;
>> + gpio = of_get_named_gpio_flags(dev->of_node, "enable-gpio", 0, NULL);
>> + if (gpio > 0)
>> + dparam->enable_gpio = gpio;
> (snip)
>> +static const struct of_device_id usbhs_of_match[] = {
>> + { .compatible = "renesas,usbhs-r8a7790"},
>> + { .compatible = "renesas,usbhs-r8a7791"},
>> + { },
>
> How about to use "of_device_id :: data" for USBHS_TYPE_xxx ?
Thank you for the suggestion.
To remove the "if (of_device_is_compatible(...))", I will use the
"of_device_id :: data" lile a ".data = (void *)USBHS_TYPE_R8A7790".
Best regards,
Yoshihiro Shimoda
> Best regards
> ---
> Kuninori Morimoto
>
WARNING: multiple messages have this Message-ID (diff)
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
Cc: SH-Linux <linux-sh@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH 2/2] usb: renesas_usbhs: Add device tree support for R-Car H2 and M2
Date: Mon, 4 Aug 2014 13:27:01 +0900 [thread overview]
Message-ID: <53DF0B95.8090203@renesas.com> (raw)
In-Reply-To: <877g2pxgoi.wl%kuninori.morimoto.gx@gmail.com>
Hi Morimoto-san,
(2014/08/04 9:05), Kuninori Morimoto wrote:
>
> Hi Shimoda-san
>
>> 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 <yoshihiro.shimoda.uh@renesas.com>
>> ---
> (snip)
>> +static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
>> +{
>> + struct renesas_usbhs_platform_info *info;
>> + struct renesas_usbhs_driver_param *dparam;
>> + u32 tmp;
>> + int gpio;
>> +
>> + info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
>> + if (!info)
>> + return NULL;
>> +
>> + dparam = &info->driver_param;
>> +
>> + if (of_device_is_compatible(dev->of_node, "renesas,usbhs-r8a7790"))
>> + dparam->type = USBHS_TYPE_R8A7790;
>> +
>> + if (of_device_is_compatible(dev->of_node, "renesas,usbhs-r8a7791"))
>> + dparam->type = USBHS_TYPE_R8A7791;
>> +
>> + if (!of_property_read_u32(dev->of_node, "buswait_bwait", &tmp))
>> + dparam->buswait_bwait = tmp;
>> + gpio = of_get_named_gpio_flags(dev->of_node, "enable-gpio", 0, NULL);
>> + if (gpio > 0)
>> + dparam->enable_gpio = gpio;
> (snip)
>> +static const struct of_device_id usbhs_of_match[] = {
>> + { .compatible = "renesas,usbhs-r8a7790"},
>> + { .compatible = "renesas,usbhs-r8a7791"},
>> + { },
>
> How about to use "of_device_id :: data" for USBHS_TYPE_xxx ?
Thank you for the suggestion.
To remove the "if (of_device_is_compatible(...))", I will use the
"of_device_id :: data" lile a ".data = (void *)USBHS_TYPE_R8A7790".
Best regards,
Yoshihiro Shimoda
> Best regards
> ---
> Kuninori Morimoto
>
next prev parent reply other threads:[~2014-08-04 4:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 11:49 [PATCH 2/2] usb: renesas_usbhs: Add device tree support for R-Car H2 and M2 Yoshihiro Shimoda
2014-08-01 11:49 ` Yoshihiro Shimoda
2014-08-04 0:05 ` Kuninori Morimoto
2014-08-04 0:05 ` Kuninori Morimoto
2014-08-04 4:27 ` Yoshihiro Shimoda [this message]
2014-08-04 4:27 ` 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=53DF0B95.8090203@renesas.com \
--to=yoshihiro.shimoda.uh@renesas.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=kuninori.morimoto.gx@gmail.com \
--cc=linux-sh@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--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: 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.