Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272927
b: refs/heads/master
c: cfdad2a
h: refs/heads/master
i:
  272925: 22e8880
  272923: 3608494
  272919: 9a410c7
  272911: 3e02649
  272895: 6dc06f5
v: v3
  • Loading branch information
David Brown committed Aug 29, 2011
1 parent d484782 commit bba289f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 886a451bd2491de3551c2aea2a2f155f159716c8
refs/heads/master: cfdad2aba7398021f6eec415b9271b9cb40065f9
27 changes: 27 additions & 0 deletions trunk/Documentation/devicetree/bindings/tty/serial/msm_serial.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
* Qualcomm MSM UART

Required properties:
- compatible :
- "qcom,msm-uart", and one of "qcom,msm-hsuart" or
"qcom,msm-lsuart".
- reg : offset and length of the register set for the device
for the hsuart operating in compatible mode, there should be a
second pair describing the gsbi registers.
- interrupts : should contain the uart interrupt.

There are two different UART blocks used in MSM devices,
"qcom,msm-hsuart" and "qcom,msm-lsuart". The msm-serial driver is
able to handle both of these, and matches against the "qcom,msm-uart"
as the compatibility.

The registers for the "qcom,msm-hsuart" device need to specify both
register blocks, even for the common driver.

Example:

uart@19c400000 {
compatible = "qcom,msm-hsuart", "qcom,msm-uart";
reg = <0x19c40000 0x1000>,
<0x19c00000 0x1000>;
interrupts = <195>;
};
14 changes: 14 additions & 0 deletions trunk/drivers/tty/serial/msm_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# define SUPPORT_SYSRQ
#endif

#include <linux/atomic.h>
#include <linux/hrtimer.h>
#include <linux/module.h>
#include <linux/io.h>
Expand All @@ -33,6 +34,8 @@
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/of.h>
#include <linux/of_device.h>

#include "msm_serial.h"

Expand Down Expand Up @@ -856,13 +859,18 @@ static struct uart_driver msm_uart_driver = {
.cons = MSM_CONSOLE,
};

static atomic_t msm_uart_next_id = ATOMIC_INIT(0);

static int __init msm_serial_probe(struct platform_device *pdev)
{
struct msm_port *msm_port;
struct resource *resource;
struct uart_port *port;
int irq;

if (pdev->id == -1)
pdev->id = atomic_inc_return(&msm_uart_next_id) - 1;

if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
return -ENXIO;

Expand Down Expand Up @@ -920,11 +928,17 @@ static int __devexit msm_serial_remove(struct platform_device *pdev)
return 0;
}

static struct of_device_id msm_match_table[] = {
{ .compatible = "qcom,msm-uart" },
{}
};

static struct platform_driver msm_platform_driver = {
.remove = msm_serial_remove,
.driver = {
.name = "msm_serial",
.owner = THIS_MODULE,
.of_match_table = msm_match_table,
},
};

Expand Down

0 comments on commit bba289f

Please sign in to comment.