@@ -5,6 +5,7 @@
#include <linux/device.h>
#include <linux/io.h>
#include <linux/kernel.h>
+#include <linux/property.h>
#include <linux/serial_8250.h>
#include <linux/serial_core.h>
@@ -90,6 +91,7 @@ EXPORT_SYMBOL_GPL(dw8250_do_set_termios);
void dw8250_setup_port(struct uart_port *p)
{
struct uart_8250_port *up = up_to_u8250p(p);
+ const struct dw8250_platform_data *pdata = device_get_match_data(p->dev);
u32 reg;
/*
@@ -116,6 +118,13 @@ void dw8250_setup_port(struct uart_port *p)
}
reg = dw8250_readl_ext(p, DW_UART_CPR);
+ if (!reg) {
+ if (pdata)
+ reg = pdata->cpr;
+
+ dev_dbg(p->dev, "CPR is not available, using %x instead\n", reg);
+ }
+
if (!reg)
return;
@@ -23,6 +23,7 @@ struct dw8250_port_data {
struct dw8250_platform_data {
unsigned int quirks;
+ u32 cpr;
};
struct dw8250_data {