aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-02 00:02:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-02 00:02:35 -0400
commit367069f16e32e188d4687fe2c3e30f2ca583836f (patch)
tree977f87038b75e53af9d132cba2f7a2aecb2fa005 /drivers/tty/serial
parent81a3c10ce8a7fd5bf9a06bfc38bd417512911831 (diff)
parentc72dbae971400e466ad9ff16c920cd6d9d8c55a1 (diff)
Merge branch 'next/dt' of git://git.linaro.org/people/arnd/arm-soc
* 'next/dt' of git://git.linaro.org/people/arnd/arm-soc: ARM: gic: use module.h instead of export.h ARM: gic: fix irq_alloc_descs handling for sparse irq ARM: gic: add OF based initialization ARM: gic: add irq_domain support irq: support domains with non-zero hwirq base of/irq: introduce of_irq_init ARM: at91: add at91sam9g20 and Calao USB A9G20 DT support ARM: at91: dt: at91sam9g45 family and board device tree files arm/mx5: add device tree support for imx51 babbage arm/mx5: add device tree support for imx53 boards ARM: msm: Add devicetree support for msm8660-surf msm_serial: Add devicetree support msm_serial: Use relative resources for iomem Fix up conflicts in arch/arm/mach-at91/{at91sam9260.c,at91sam9g45.c}
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/msm_serial.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index 29cbfd8c4e7c..8131e2c28015 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -19,6 +19,7 @@
19# define SUPPORT_SYSRQ 19# define SUPPORT_SYSRQ
20#endif 20#endif
21 21
22#include <linux/atomic.h>
22#include <linux/hrtimer.h> 23#include <linux/hrtimer.h>
23#include <linux/module.h> 24#include <linux/module.h>
24#include <linux/io.h> 25#include <linux/io.h>
@@ -33,6 +34,8 @@
33#include <linux/clk.h> 34#include <linux/clk.h>
34#include <linux/platform_device.h> 35#include <linux/platform_device.h>
35#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/of.h>
38#include <linux/of_device.h>
36 39
37#include "msm_serial.h" 40#include "msm_serial.h"
38 41
@@ -589,9 +592,8 @@ static void msm_release_port(struct uart_port *port)
589 iowrite32(GSBI_PROTOCOL_IDLE, msm_port->gsbi_base + 592 iowrite32(GSBI_PROTOCOL_IDLE, msm_port->gsbi_base +
590 GSBI_CONTROL); 593 GSBI_CONTROL);
591 594
592 gsbi_resource = platform_get_resource_byname(pdev, 595 gsbi_resource = platform_get_resource(pdev,
593 IORESOURCE_MEM, 596 IORESOURCE_MEM, 1);
594 "gsbi_resource");
595 597
596 if (unlikely(!gsbi_resource)) 598 if (unlikely(!gsbi_resource))
597 return; 599 return;
@@ -612,8 +614,7 @@ static int msm_request_port(struct uart_port *port)
612 resource_size_t size; 614 resource_size_t size;
613 int ret; 615 int ret;
614 616
615 uart_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, 617 uart_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
616 "uart_resource");
617 if (unlikely(!uart_resource)) 618 if (unlikely(!uart_resource))
618 return -ENXIO; 619 return -ENXIO;
619 620
@@ -628,8 +629,7 @@ static int msm_request_port(struct uart_port *port)
628 goto fail_release_port; 629 goto fail_release_port;
629 } 630 }
630 631
631 gsbi_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, 632 gsbi_resource = platform_get_resource(pdev, IORESOURCE_MEM, 1);
632 "gsbi_resource");
633 /* Is this a GSBI-based port? */ 633 /* Is this a GSBI-based port? */
634 if (gsbi_resource) { 634 if (gsbi_resource) {
635 size = resource_size(gsbi_resource); 635 size = resource_size(gsbi_resource);
@@ -857,6 +857,8 @@ static struct uart_driver msm_uart_driver = {
857 .cons = MSM_CONSOLE, 857 .cons = MSM_CONSOLE,
858}; 858};
859 859
860static atomic_t msm_uart_next_id = ATOMIC_INIT(0);
861
860static int __init msm_serial_probe(struct platform_device *pdev) 862static int __init msm_serial_probe(struct platform_device *pdev)
861{ 863{
862 struct msm_port *msm_port; 864 struct msm_port *msm_port;
@@ -864,6 +866,9 @@ static int __init msm_serial_probe(struct platform_device *pdev)
864 struct uart_port *port; 866 struct uart_port *port;
865 int irq; 867 int irq;
866 868
869 if (pdev->id == -1)
870 pdev->id = atomic_inc_return(&msm_uart_next_id) - 1;
871
867 if (unlikely(pdev->id < 0 || pdev->id >= UART_NR)) 872 if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
868 return -ENXIO; 873 return -ENXIO;
869 874
@@ -873,7 +878,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
873 port->dev = &pdev->dev; 878 port->dev = &pdev->dev;
874 msm_port = UART_TO_MSM(port); 879 msm_port = UART_TO_MSM(port);
875 880
876 if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "gsbi_resource")) 881 if (platform_get_resource(pdev, IORESOURCE_MEM, 1))
877 msm_port->is_uartdm = 1; 882 msm_port->is_uartdm = 1;
878 else 883 else
879 msm_port->is_uartdm = 0; 884 msm_port->is_uartdm = 0;
@@ -897,8 +902,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
897 printk(KERN_INFO "uartclk = %d\n", port->uartclk); 902 printk(KERN_INFO "uartclk = %d\n", port->uartclk);
898 903
899 904
900 resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, 905 resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
901 "uart_resource");
902 if (unlikely(!resource)) 906 if (unlikely(!resource))
903 return -ENXIO; 907 return -ENXIO;
904 port->mapbase = resource->start; 908 port->mapbase = resource->start;
@@ -922,11 +926,17 @@ static int __devexit msm_serial_remove(struct platform_device *pdev)
922 return 0; 926 return 0;
923} 927}
924 928
929static struct of_device_id msm_match_table[] = {
930 { .compatible = "qcom,msm-uart" },
931 {}
932};
933
925static struct platform_driver msm_platform_driver = { 934static struct platform_driver msm_platform_driver = {
926 .remove = msm_serial_remove, 935 .remove = msm_serial_remove,
927 .driver = { 936 .driver = {
928 .name = "msm_serial", 937 .name = "msm_serial",
929 .owner = THIS_MODULE, 938 .owner = THIS_MODULE,
939 .of_match_table = msm_match_table,
930 }, 940 },
931}; 941};
932 942