summaryrefslogtreecommitdiff
path: root/include/linux/platform_data/max310x.h
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-09-17 03:12:26 (GMT)
committerOlof Johansson <olof@lixom.net>2012-09-17 03:13:04 (GMT)
commitf4936639bc4a75218b5598ff69c52b9a8dd7f23d (patch)
tree9c08fc81cb3d3e658ca7f8dc20a949496d9e6130 /include/linux/platform_data/max310x.h
parentd1226e8f98f130918265fb5b4dddcb60b783eb34 (diff)
parent11964f53eb4d9ce59a058be9999d9cfcb1ced878 (diff)
downloadlinux-fsl-qoriq-f4936639bc4a75218b5598ff69c52b9a8dd7f23d.tar.xz
Merge tag 'omap-devel-am33xx-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc
From Tony Lindgren: From Paul Walmsley <paul@pwsan.com>: AM33xx hwmod data and miscellaneous clock and hwmod fixes. AM33xx should now boot on mainline after this is applied, according to Vaibhav. (The shortlog makes no sense here since it contains mostly the dependent cleanups that are part of the preceding branches). Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'include/linux/platform_data/max310x.h')
-rw-r--r--include/linux/platform_data/max310x.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/include/linux/platform_data/max310x.h b/include/linux/platform_data/max310x.h
new file mode 100644
index 0000000..91648bf
--- /dev/null
+++ b/include/linux/platform_data/max310x.h
@@ -0,0 +1,67 @@
+/*
+ * Maxim (Dallas) MAX3107/8 serial driver
+ *
+ * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
+ *
+ * Based on max3100.c, by Christian Pellegrin <chripell@evolware.org>
+ * Based on max3110.c, by Feng Tang <feng.tang@intel.com>
+ * Based on max3107.c, by Aavamobile
+ *
+ * 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.
+ */
+
+#ifndef _MAX310X_H_
+#define _MAX310X_H_
+
+/*
+ * Example board initialization data:
+ *
+ * static struct max310x_pdata max3107_pdata = {
+ * .driver_flags = MAX310X_EXT_CLK,
+ * .uart_flags[0] = MAX310X_ECHO_SUPRESS | MAX310X_AUTO_DIR_CTRL,
+ * .frequency = 3686400,
+ * .gpio_base = -1,
+ * };
+ *
+ * static struct spi_board_info spi_device_max3107[] = {
+ * {
+ * .modalias = "max3107",
+ * .irq = IRQ_EINT3,
+ * .bus_num = 1,
+ * .chip_select = 1,
+ * .platform_data = &max3107_pdata,
+ * },
+ * };
+ */
+
+#define MAX310X_MAX_UARTS 1
+
+/* MAX310X platform data structure */
+struct max310x_pdata {
+ /* Flags global to driver */
+ const u8 driver_flags:2;
+#define MAX310X_EXT_CLK (0x00000001) /* External clock enable */
+#define MAX310X_AUTOSLEEP (0x00000002) /* Enable AutoSleep mode */
+ /* Flags global to UART port */
+ const u8 uart_flags[MAX310X_MAX_UARTS];
+#define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */
+#define MAX310X_ECHO_SUPRESS (0x00000002) /* Enable echo supress */
+#define MAX310X_AUTO_DIR_CTRL (0x00000004) /* Enable Auto direction
+ * control (RS-485)
+ */
+ /* Frequency (extrenal clock or crystal) */
+ const int frequency;
+ /* GPIO base number (can be negative) */
+ const int gpio_base;
+ /* Called during startup */
+ void (*init)(void);
+ /* Called before finish */
+ void (*exit)(void);
+ /* Suspend callback */
+ void (*suspend)(int do_suspend);
+};
+
+#endif