Re: [PATCH 2/2] usb: renesas_usbhs: Add device tree support for R-Car H2 and M2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxxx>
> ---
(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 ?

Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux