summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRui Zhuo <rzhuo@nvidia.com>2010-06-28 16:57:03 +0800
committerGary King <gking@nvidia.com>2010-06-28 19:10:22 -0700
commit0bd55d98d414bebbc5022229c27aa17e875c0331 (patch)
tree254eec03337b00ec960960be6f2645c6e14b49c2 /drivers
parent5a3885d5b0d35960f7268faf47e4b984417aa726 (diff)
Tegra odm uart: add odm call-backs in uart driver
Adding NVODM UART callbacks into linux uart driver so that customer can customized UART according to their actual usecases. Hook four NVODM UART functions in linux uart driver: NvOdmUartOpen, NvOdmUartClose, NvOdmUartSuspend, NvOdmUartResume. Bug 684390. Change-Id: I8f1a89122a57e14631efe876cb7e7bd4a35b73cd Reviewed-on: http://git-master/r/2817 Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'drivers')
-rwxr-xr-xdrivers/serial/tegra_hsuart.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/serial/tegra_hsuart.c b/drivers/serial/tegra_hsuart.c
index 0f6102f7bfb0..6162f306212d 100755
--- a/drivers/serial/tegra_hsuart.c
+++ b/drivers/serial/tegra_hsuart.c
@@ -43,7 +43,7 @@
#include <mach/dma.h>
#include <mach/pinmux.h>
#include <mach/serial.h>
-
+#include "nvodm_uart.h"
#define TX_EMPTY_STATUS (UART_LSR_TEMT | UART_LSR_THRE)
#define BYTES_TO_ALIGN(x) ((unsigned long)(ALIGN((x), sizeof(u32))) - \
@@ -118,6 +118,7 @@ struct tegra_uart_port {
bool rx_timeout;
int uart_state;
+ NvOdmUartHandle odm_uart_handle;
};
static inline u8 uart_readb(struct tegra_uart_port *t, unsigned long reg)
@@ -1134,6 +1135,10 @@ static int tegra_uart_suspend(struct platform_device *pdev, pm_message_t state)
pr_err("Invalid Uart instance (%d)\n", pdev->id);
dev_err(t->uport.dev, "tegra_uart_suspend called\n");
+
+ if (t->odm_uart_handle)
+ NvOdmUartSuspend(t->odm_uart_handle);
+
u = &t->uport;
/* Enable clock before calling suspend so that controller
@@ -1167,6 +1172,8 @@ static int tegra_uart_resume(struct platform_device *pdev)
uart_resume_port(&tegra_uart_driver, u);
t->uart_state = TEGRA_UART_OPENED;
}
+ if (t->odm_uart_handle)
+ NvOdmUartResume(t->odm_uart_handle);
return 0;
}
@@ -1182,6 +1189,8 @@ static int __devexit tegra_uart_remove(struct platform_device *pdev)
u = &t->uport;
uart_remove_one_port(&tegra_uart_driver, u);
+ if (t->odm_uart_handle)
+ NvOdmUartClose(t->odm_uart_handle);
platform_set_drvdata(pdev, NULL);
@@ -1221,6 +1230,7 @@ static int __init tegra_uart_probe(struct platform_device *pdev)
u->regshift = 2;
t->pinmux = pdata->pinmux;
t->nr_pins = pdata->nr_pins;
+ t->odm_uart_handle = NvOdmUartOpen(pdev->id);
t->clk = clk_get(&pdev->dev, NULL);
if (!t->clk) {
@@ -1244,6 +1254,8 @@ static int __init tegra_uart_probe(struct platform_device *pdev)
t->uart_state = TEGRA_UART_CLOSED;
return ret;
fail:
+ if (t->odm_uart_handle)
+ NvOdmUartClose(t->odm_uart_handle);
kfree(t);
return -ENODEV;
}