This source file includes following definitions.
- pcm037_eet_init_devices
1
2
3
4
5
6 #include <linux/gpio.h>
7 #include <linux/input.h>
8 #include <linux/platform_device.h>
9 #include <linux/spi/spi.h>
10
11 #include <asm/mach-types.h>
12
13 #include "pcm037.h"
14 #include "common.h"
15 #include "devices-imx31.h"
16 #include "iomux-mx3.h"
17
18 static unsigned int pcm037_eet_pins[] = {
19
20 IOMUX_MODE(MX31_PIN_KEY_COL7, IOMUX_CONFIG_GPIO),
21
22 IOMUX_MODE(MX31_PIN_GPIO1_0, IOMUX_CONFIG_GPIO),
23 IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO),
24 IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO),
25 IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO),
26 IOMUX_MODE(MX31_PIN_SVEN0, IOMUX_CONFIG_GPIO),
27 IOMUX_MODE(MX31_PIN_STX0, IOMUX_CONFIG_GPIO),
28 IOMUX_MODE(MX31_PIN_SRX0, IOMUX_CONFIG_GPIO),
29 IOMUX_MODE(MX31_PIN_SIMPD0, IOMUX_CONFIG_GPIO),
30 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_GPIO),
31 IOMUX_MODE(MX31_PIN_CTS1, IOMUX_CONFIG_GPIO),
32 IOMUX_MODE(MX31_PIN_KEY_ROW4, IOMUX_CONFIG_GPIO),
33 IOMUX_MODE(MX31_PIN_KEY_ROW5, IOMUX_CONFIG_GPIO),
34 IOMUX_MODE(MX31_PIN_KEY_ROW6, IOMUX_CONFIG_GPIO),
35 IOMUX_MODE(MX31_PIN_KEY_ROW7, IOMUX_CONFIG_GPIO),
36
37
38 IOMUX_MODE(MX31_PIN_DTR_DTE1, IOMUX_CONFIG_GPIO),
39 IOMUX_MODE(MX31_PIN_DSR_DTE1, IOMUX_CONFIG_GPIO),
40 IOMUX_MODE(MX31_PIN_KEY_COL5, IOMUX_CONFIG_GPIO),
41 IOMUX_MODE(MX31_PIN_KEY_COL6, IOMUX_CONFIG_GPIO),
42 };
43
44
45 static struct spi_board_info pcm037_spi_dev[] = {
46 {
47 .modalias = "dac124s085",
48 .max_speed_hz = 400000,
49 .bus_num = 0,
50 .chip_select = 1,
51 .mode = SPI_CPHA,
52 },
53 };
54
55
56 static const struct spi_imx_master pcm037_spi1_pdata __initconst = {
57 .num_chipselect = 2,
58 };
59
60
61 static struct gpio_keys_button pcm037_gpio_keys[] = {
62 {
63 .type = EV_KEY,
64 .code = KEY_L,
65 .gpio = 0,
66 .desc = "Wheel Manual",
67 .wakeup = 0,
68 }, {
69 .type = EV_KEY,
70 .code = KEY_A,
71 .gpio = 1,
72 .desc = "Wheel AF",
73 .wakeup = 0,
74 }, {
75 .type = EV_KEY,
76 .code = KEY_V,
77 .gpio = 2,
78 .desc = "Wheel View",
79 .wakeup = 0,
80 }, {
81 .type = EV_KEY,
82 .code = KEY_M,
83 .gpio = 3,
84 .desc = "Wheel Menu",
85 .wakeup = 0,
86 }, {
87 .type = EV_KEY,
88 .code = KEY_UP,
89 .gpio = 32,
90 .desc = "Nav Pad Up",
91 .wakeup = 0,
92 }, {
93 .type = EV_KEY,
94 .code = KEY_RIGHT,
95 .gpio = 33,
96 .desc = "Nav Pad Right",
97 .wakeup = 0,
98 }, {
99 .type = EV_KEY,
100 .code = KEY_DOWN,
101 .gpio = 34,
102 .desc = "Nav Pad Down",
103 .wakeup = 0,
104 }, {
105 .type = EV_KEY,
106 .code = KEY_LEFT,
107 .gpio = 35,
108 .desc = "Nav Pad Left",
109 .wakeup = 0,
110 }, {
111 .type = EV_KEY,
112 .code = KEY_ENTER,
113 .gpio = 38,
114 .desc = "Nav Pad Ok",
115 .wakeup = 0,
116 }, {
117 .type = EV_KEY,
118 .code = KEY_O,
119 .gpio = 39,
120 .desc = "Wheel Off",
121 .wakeup = 0,
122 }, {
123 .type = EV_KEY,
124 .code = BTN_FORWARD,
125 .gpio = 50,
126 .desc = "Focus Forward",
127 .wakeup = 0,
128 }, {
129 .type = EV_KEY,
130 .code = BTN_BACK,
131 .gpio = 51,
132 .desc = "Focus Backward",
133 .wakeup = 0,
134 }, {
135 .type = EV_KEY,
136 .code = BTN_MIDDLE,
137 .gpio = 52,
138 .desc = "Release Half",
139 .wakeup = 0,
140 }, {
141 .type = EV_KEY,
142 .code = BTN_EXTRA,
143 .gpio = 53,
144 .desc = "Release Full",
145 .wakeup = 0,
146 },
147 };
148
149 static const struct gpio_keys_platform_data
150 pcm037_gpio_keys_platform_data __initconst = {
151 .buttons = pcm037_gpio_keys,
152 .nbuttons = ARRAY_SIZE(pcm037_gpio_keys),
153 .rep = 0,
154 };
155
156 int __init pcm037_eet_init_devices(void)
157 {
158 if (pcm037_variant() != PCM037_EET)
159 return 0;
160
161 mxc_iomux_setup_multiple_pins(pcm037_eet_pins,
162 ARRAY_SIZE(pcm037_eet_pins), "pcm037_eet");
163
164
165 spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev));
166 imx31_add_spi_imx0(&pcm037_spi1_pdata);
167
168 imx_add_gpio_keys(&pcm037_gpio_keys_platform_data);
169
170 return 0;
171 }