summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2011-02-02 11:59:56 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-02-02 17:20:56 -0800
commit50cc69413c7ac5f1e093273c6b93131c1752e143 (patch)
treec865c431210d685fe21b17ee3592bbfdb2ad39fd
parent06516faa6f60d82e535cc164c1cce604211aec89 (diff)
arm: tegra_hsuart: Add wake_peer operation
Recently wake_peer op was added to uart_ops. Add this op for tegra_hsuart allowing a platform to implement peer specific wakeup. BUG 781303 Change-Id: Icfbac324815d7737c0e0820e57a2e8d844855ba0 Reviewed-on: http://git-master/r/17993 Tested-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/serial/tegra_hsuart.c11
-rw-r--r--include/linux/tegra_uart.h27
2 files changed, 38 insertions, 0 deletions
diff --git a/drivers/serial/tegra_hsuart.c b/drivers/serial/tegra_hsuart.c
index 3c8e83b807b9..0250789253ea 100644
--- a/drivers/serial/tegra_hsuart.c
+++ b/drivers/serial/tegra_hsuart.c
@@ -41,6 +41,8 @@
#include <linux/debugfs.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
+#include <linux/tegra_uart.h>
+
#include <mach/dma.h>
#include <mach/clk.h>
@@ -813,6 +815,14 @@ static void tegra_shutdown(struct uart_port *u)
dev_vdbg(u->dev, "-tegra_shutdown\n");
}
+static void tegra_wake_peer(struct uart_port *u)
+{
+ struct tegra_uart_platform_data *pdata = u->dev->platform_data;
+
+ if (pdata && pdata->wake_peer)
+ pdata->wake_peer(u);
+}
+
static unsigned int tegra_get_mctrl(struct uart_port *u)
{
/* RI - Ring detector is active
@@ -1113,6 +1123,7 @@ static struct uart_ops tegra_uart_ops = {
.break_ctl = tegra_break_ctl,
.startup = tegra_startup,
.shutdown = tegra_shutdown,
+ .wake_peer = tegra_wake_peer,
.set_termios = tegra_set_termios,
.pm = tegra_pm,
.type = tegra_type,
diff --git a/include/linux/tegra_uart.h b/include/linux/tegra_uart.h
new file mode 100644
index 000000000000..b33bbb6f366a
--- /dev/null
+++ b/include/linux/tegra_uart.h
@@ -0,0 +1,27 @@
+/* include/linux/tegra_uart.h
+ *
+ * Copyright (C) 2011 NVIDIA Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _TEGRA_UART_H_
+#define _TEGRA_UART_H_
+
+struct tegra_uart_platform_data {
+ void (*wake_peer)(struct uart_port *);
+};
+
+#endif /* _TEGRA_UART_H_ */