[PATCH 1/2] add ad714x platform_data definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



AD714x is very flexible, it can be used as buttons, scrollwheel,
slider, touchpad at the same time. That depends on the boards.
The platform_data for the device's "struct device" holds these
information.
The data-struct defined in this file descript the hardware feature
of button/scrollwheel/slider/touchpad components on target boards,
which need be filled in the arch/mach-/.

Signed-off-by: Barry Song <21cnbao@xxxxxxxxx>
---
 include/linux/spi/ad714x.h |   60 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/spi/ad714x.h

diff --git a/include/linux/spi/ad714x.h b/include/linux/spi/ad714x.h
new file mode 100644
index 0000000..f6439a9
--- /dev/null
+++ b/include/linux/spi/ad714x.h
@@ -0,0 +1,60 @@
+/*
+ * include/linux/ad714x.h
+ *
+ * AD714x is very flexible, it can be used as buttons, scrollwheel,
+ * slider, touchpad at the same time. That depends on the boards.
+ * The platform_data for the device's "struct device" holds this
+ * information.
+ */
+
+
+#ifndef AD714X_HW_H
+#define AD714X_HW_H
+
+#define STAGE_NUM              12
+#define STAGE_CFGREG_NUM       8
+#define SYS_CFGREG_NUM         8
+
+/* board information which need be initialized in arch/mach... */
+struct ad714x_slider_plat {
+	int start_stage;
+	int end_stage;
+	int max_coord;
+};
+
+struct ad714x_wheel_plat {
+	int start_stage;
+	int end_stage;
+	int max_coord;
+};
+
+struct ad714x_touchpad_plat {
+	int x_start_stage;
+	int x_end_stage;
+	int x_max_coord;
+
+	int y_start_stage;
+	int y_end_stage;
+	int y_max_coord;
+};
+
+struct ad714x_button_plat {
+	int keycode;
+	unsigned short l_mask;
+	unsigned short h_mask;
+};
+
+struct ad714x_platform_data {
+	int slider_num;
+	int wheel_num;
+	int touchpad_num;
+	int button_num;
+	struct ad714x_slider_plat *slider;
+	struct ad714x_wheel_plat *wheel;
+	struct ad714x_touchpad_plat *touchpad;
+	struct ad714x_button_plat *button;
+	unsigned short stage_cfg_reg[STAGE_NUM][STAGE_CFGREG_NUM];
+	unsigned short sys_cfg_reg[SYS_CFGREG_NUM];
+};
+
+#endif
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux