Re: [PATCH 2/3] usb: host: xhci-plat: add support for the R-Car H2 and M2 xHCI controllers

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

 



On Monday 19 May 2014 19:08:05 Yoshihiro Shimoda wrote:
> 
>  #include "xhci.h"
>  #include "xhci-mvebu.h"
> +#include "xhci-rcar.h"
> 
>  static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
>  {
> @@ -39,6 +40,12 @@ static int xhci_plat_setup(struct usb_hcd *hcd)
> 
>  static int xhci_plat_start(struct usb_hcd *hcd)
>  {
> +	struct device_node *of_node = hcd->self.controller->of_node;
> +
> +	if (of_device_is_compatible(of_node, "renesas,r8a7790-xhci") ||
> +	    of_device_is_compatible(of_node, "renesas,r8a7790-xhci"))
> +		xhci_rcar_start(hcd);
> +
>  	return xhci_run(hcd);
>  }
> 
> @@ -165,6 +172,15 @@ static int xhci_plat_probe(struct platform_device *pdev)
>  			goto unmap_registers;
>  	}
> 
> +	if (of_device_is_compatible(pdev->dev.of_node,
> +				    "renesas,r8a7790-xhci") ||
> +	    of_device_is_compatible(pdev->dev.of_node,
> +				    "renesas,r8a7791-xhci")) {
> +		ret = xhci_rcar_init_quirk(pdev);
> +		if (ret)
> +			goto disable_clk;
> +	}
> +
>  	ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
>  	if (ret)
>  		goto disable_clk;
> @@ -270,6 +286,8 @@ static const struct of_device_id usb_xhci_of_match[] = {
>  	{ .compatible = "xhci-platform" },
>  	{ .compatible = "marvell,armada-375-xhci"},
>  	{ .compatible = "marvell,armada-380-xhci"},
> +	{ .compatible = "renesas,r8a7790-xhci"},
> +	{ .compatible = "renesas,r8a7791-xhci"},
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, usb_xhci_of_match);

Like the drivers before, this is way more than a quirk, and deserves to
be its own driver. It would be better to have an abstract way to split
out soc specific xhci front-ends and export functions from the xhci-platform
code.

	Arnd

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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux