Commit eca6b494 authored by Roger Quadros's avatar Roger Quadros Committed by Felipe Balbi

usb: dwc3: keystone: Add support for ti,am654-dwc3

The AM654 SoC contains a DWC3 controller with TI specific
wrapper. Add support for that.

Unlike the Keystone 2 case, for AM654 We don't need to
process any IRQs for basic USB operation.
Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent d26c0578
...@@ -86,11 +86,11 @@ config USB_DWC3_HAPS ...@@ -86,11 +86,11 @@ config USB_DWC3_HAPS
platform, please say 'Y' or 'M' here. platform, please say 'Y' or 'M' here.
config USB_DWC3_KEYSTONE config USB_DWC3_KEYSTONE
tristate "Texas Instruments Keystone2 Platforms" tristate "Texas Instruments Keystone2/AM654 Platforms"
depends on ARCH_KEYSTONE || COMPILE_TEST depends on ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
default USB_DWC3 default USB_DWC3
help help
Support of USB2/3 functionality in TI Keystone2 platforms. Support of USB2/3 functionality in TI Keystone2 and AM654 platforms.
Say 'Y' or 'M' here if you have one such device Say 'Y' or 'M' here if you have one such device
config USB_DWC3_OF_SIMPLE config USB_DWC3_OF_SIMPLE
......
...@@ -106,6 +106,10 @@ static int kdwc3_probe(struct platform_device *pdev) ...@@ -106,6 +106,10 @@ static int kdwc3_probe(struct platform_device *pdev)
goto err_irq; goto err_irq;
} }
/* IRQ processing not required currently for AM65 */
if (of_device_is_compatible(node, "ti,am654-dwc3"))
goto skip_irq;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(&pdev->dev, "missing irq\n"); dev_err(&pdev->dev, "missing irq\n");
...@@ -123,6 +127,7 @@ static int kdwc3_probe(struct platform_device *pdev) ...@@ -123,6 +127,7 @@ static int kdwc3_probe(struct platform_device *pdev)
kdwc3_enable_irqs(kdwc); kdwc3_enable_irqs(kdwc);
skip_irq:
error = of_platform_populate(node, NULL, NULL, dev); error = of_platform_populate(node, NULL, NULL, dev);
if (error) { if (error) {
dev_err(&pdev->dev, "failed to create dwc3 core\n"); dev_err(&pdev->dev, "failed to create dwc3 core\n");
...@@ -152,8 +157,11 @@ static int kdwc3_remove_core(struct device *dev, void *c) ...@@ -152,8 +157,11 @@ static int kdwc3_remove_core(struct device *dev, void *c)
static int kdwc3_remove(struct platform_device *pdev) static int kdwc3_remove(struct platform_device *pdev)
{ {
struct dwc3_keystone *kdwc = platform_get_drvdata(pdev); struct dwc3_keystone *kdwc = platform_get_drvdata(pdev);
struct device_node *node = pdev->dev.of_node;
if (!of_device_is_compatible(node, "ti,am654-dwc3"))
kdwc3_disable_irqs(kdwc);
kdwc3_disable_irqs(kdwc);
device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core); device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core);
pm_runtime_put_sync(kdwc->dev); pm_runtime_put_sync(kdwc->dev);
pm_runtime_disable(kdwc->dev); pm_runtime_disable(kdwc->dev);
...@@ -165,6 +173,7 @@ static int kdwc3_remove(struct platform_device *pdev) ...@@ -165,6 +173,7 @@ static int kdwc3_remove(struct platform_device *pdev)
static const struct of_device_id kdwc3_of_match[] = { static const struct of_device_id kdwc3_of_match[] = {
{ .compatible = "ti,keystone-dwc3", }, { .compatible = "ti,keystone-dwc3", },
{ .compatible = "ti,am654-dwc3" },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, kdwc3_of_match); MODULE_DEVICE_TABLE(of, kdwc3_of_match);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment