Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107132
b: refs/heads/master
c: 8077655
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Pinchart authored and Kumar Gala committed Jul 28, 2008
1 parent feb71bb commit 3d184bd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7485d26b7e13ee8ff82adb271ac90a996c1fe830
refs/heads/master: 80776554b6c93cf828ddc702010c6a189aa0d0e9
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ config FSL_ULI1575

config CPM
bool
select PPC_CLOCK

config OF_RTC
bool
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/serial/cpm_uart/cpm_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct uart_cpm_port {
unsigned char *rx_buf;
u32 flags;
void (*set_lineif)(struct uart_cpm_port *);
struct clk *clk;
u8 brg;
uint dp_addr;
void *mem_addr;
Expand Down
26 changes: 19 additions & 7 deletions trunk/drivers/serial/cpm_uart/cpm_uart_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <linux/of_platform.h>
#include <linux/gpio.h>
#include <linux/of_gpio.h>
#include <linux/clk.h>

#include <asm/io.h>
#include <asm/irq.h>
Expand Down Expand Up @@ -596,7 +597,10 @@ static void cpm_uart_set_termios(struct uart_port *port,
out_be16(&sccp->scc_psmr, (sbits << 12) | scval);
}

cpm_set_brg(pinfo->brg - 1, baud);
if (pinfo->clk)
clk_set_rate(pinfo->clk, baud);
else
cpm_set_brg(pinfo->brg - 1, baud);
spin_unlock_irqrestore(&port->lock, flags);
}

Expand Down Expand Up @@ -1023,13 +1027,21 @@ static int cpm_uart_init_port(struct device_node *np,
int ret;
int i;

data = of_get_property(np, "fsl,cpm-brg", &len);
if (!data || len != 4) {
printk(KERN_ERR "CPM UART %s has no/invalid "
"fsl,cpm-brg property.\n", np->name);
return -EINVAL;
data = of_get_property(np, "clock", NULL);
if (data) {
struct clk *clk = clk_get(NULL, (const char*)data);
if (!IS_ERR(clk))
pinfo->clk = clk;
}
if (!pinfo->clk) {
data = of_get_property(np, "fsl,cpm-brg", &len);
if (!data || len != 4) {
printk(KERN_ERR "CPM UART %s has no/invalid "
"fsl,cpm-brg property.\n", np->name);
return -EINVAL;
}
pinfo->brg = *data;
}
pinfo->brg = *data;

data = of_get_property(np, "fsl,cpm-command", &len);
if (!data || len != 4) {
Expand Down

0 comments on commit 3d184bd

Please sign in to comment.