From 1e7bad0f5b91150fef78d732095ca84ca4a16585 Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Sun, 10 Jun 2012 15:20:06 +0200 Subject: ARM: Orion: DTify the watchdog timer. Add device tree support to the Orion watchdog timer, and enable its use in the kirkwood devices using device tree. Signed-off-by: Andrew Lunn Acked-by: Sebastian Hesselbarth Tested-by: Simon Baatz --- drivers/watchdog/orion_wdt.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers') diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 0f5736949c61..1531e0256c34 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c @@ -25,6 +25,7 @@ #include #include #include +#include #include /* @@ -295,6 +296,12 @@ static void orion_wdt_shutdown(struct platform_device *pdev) orion_wdt_disable(); } +static const struct of_device_id orion_wdt_of_match_table[] __devinitdata = { + { .compatible = "marvell,orion-wdt", }, + {}, +}; +MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table); + static struct platform_driver orion_wdt_driver = { .probe = orion_wdt_probe, .remove = __devexit_p(orion_wdt_remove), @@ -302,6 +309,7 @@ static struct platform_driver orion_wdt_driver = { .driver = { .owner = THIS_MODULE, .name = "orion_wdt", + .of_match_table = of_match_ptr(orion_wdt_of_match_table), }, }; -- cgit v1.2.3 From 97b414e119ccc7216e29c3bd62fe1a1797f21404 Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Sun, 10 Jun 2012 16:45:37 +0200 Subject: ATA: sata_mv: Add device tree support Add support for instantiating this driver from device tree, and add the necassary DT information to the kirkwood.dtsi file. This is based on previous work by Michael Walle and Jason Cooper. Signed-off-by: Andrew Lunn Tested-by: Josh Coombs --- drivers/ata/sata_mv.c | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 24712adf69df..311be18d3f03 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -65,6 +65,8 @@ #include #include #include +#include +#include #include #include #include @@ -4026,7 +4028,7 @@ static int mv_platform_probe(struct platform_device *pdev) struct ata_host *host; struct mv_host_priv *hpriv; struct resource *res; - int n_ports = 0; + int n_ports = 0, irq = 0; int rc; #if defined(CONFIG_HAVE_CLK) int port; @@ -4050,8 +4052,14 @@ static int mv_platform_probe(struct platform_device *pdev) return -EINVAL; /* allocate host */ - mv_platform_data = pdev->dev.platform_data; - n_ports = mv_platform_data->n_ports; + if (pdev->dev.of_node) { + of_property_read_u32(pdev->dev.of_node, "nr-ports", &n_ports); + irq = irq_of_parse_and_map(pdev->dev.of_node, 0); + } else { + mv_platform_data = pdev->dev.platform_data; + n_ports = mv_platform_data->n_ports; + irq = platform_get_irq(pdev, 0); + } host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports); hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL); @@ -4109,8 +4117,7 @@ static int mv_platform_probe(struct platform_device *pdev) dev_info(&pdev->dev, "slots %u ports %d\n", (unsigned)MV_MAX_Q_DEPTH, host->n_ports); - rc = ata_host_activate(host, platform_get_irq(pdev, 0), mv_interrupt, - IRQF_SHARED, &mv6_sht); + rc = ata_host_activate(host, irq, mv_interrupt, IRQF_SHARED, &mv6_sht); if (!rc) return 0; @@ -4205,15 +4212,24 @@ static int mv_platform_resume(struct platform_device *pdev) #define mv_platform_resume NULL #endif +#ifdef CONFIG_OF +static struct of_device_id mv_sata_dt_ids[] __devinitdata = { + { .compatible = "marvell,orion-sata", }, + {}, +}; +MODULE_DEVICE_TABLE(of, mv_sata_dt_ids); +#endif + static struct platform_driver mv_platform_driver = { - .probe = mv_platform_probe, - .remove = __devexit_p(mv_platform_remove), - .suspend = mv_platform_suspend, - .resume = mv_platform_resume, - .driver = { - .name = DRV_NAME, - .owner = THIS_MODULE, - }, + .probe = mv_platform_probe, + .remove = __devexit_p(mv_platform_remove), + .suspend = mv_platform_suspend, + .resume = mv_platform_resume, + .driver = { + .name = DRV_NAME, + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(mv_sata_dt_ids), + }, }; -- cgit v1.2.3