23 #include <linux/kernel.h>
28 #include <linux/input.h>
64 #define NETXBIG_V2_GPIO_SWITCH_POWER_ON 13
65 #define NETXBIG_V2_GPIO_SWITCH_POWER_OFF 15
66 #define NETXBIG_V2_GPIO_FUNC_BUTTON 34
68 #define NETXBIG_V2_SWITCH_POWER_ON 0x1
69 #define NETXBIG_V2_SWITCH_POWER_OFF 0x2
76 .desc =
"Back power switch (on|auto)",
83 .desc =
"Back power switch (auto|off)",
89 .desc =
"Function button",
95 .buttons = netxbig_v2_buttons,
103 .platform_data = &netxbig_v2_button_data,
120 static int netxbig_v2_gpio_ext_addr[] = { 47, 48, 49 };
121 static int netxbig_v2_gpio_ext_data[] = { 44, 45, 46 };
124 .addr = netxbig_v2_gpio_ext_addr,
125 .num_addr =
ARRAY_SIZE(netxbig_v2_gpio_ext_addr),
126 .data = netxbig_v2_gpio_ext_data,
127 .num_data =
ARRAY_SIZE(netxbig_v2_gpio_ext_data),
213 #define NETXBIG_LED(_name, maddr, mval, baddr) \
215 .mode_addr = maddr, \
217 .bright_addr = baddr }
219 static struct netxbig_led net2big_v2_leds_ctrl[] = {
220 NETXBIG_LED(
"net2big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled, 1),
221 NETXBIG_LED(
"net2big-v2:red:power", 0, netxbig_v2_red_mled, 1),
222 NETXBIG_LED(
"net2big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
223 NETXBIG_LED(
"net2big-v2:red:sata0", 3, netxbig_v2_red_mled, 2),
224 NETXBIG_LED(
"net2big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
225 NETXBIG_LED(
"net2big-v2:red:sata1", 4, netxbig_v2_red_mled, 2),
229 .gpio_ext = &netxbig_v2_gpio_ext,
230 .timer = netxbig_v2_led_timer,
231 .num_timer =
ARRAY_SIZE(netxbig_v2_led_timer),
232 .leds = net2big_v2_leds_ctrl,
236 static struct netxbig_led net5big_v2_leds_ctrl[] = {
237 NETXBIG_LED(
"net5big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled, 1),
238 NETXBIG_LED(
"net5big-v2:red:power", 0, netxbig_v2_red_mled, 1),
239 NETXBIG_LED(
"net5big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
240 NETXBIG_LED(
"net5big-v2:red:sata0", 3, netxbig_v2_red_mled, 2),
241 NETXBIG_LED(
"net5big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
242 NETXBIG_LED(
"net5big-v2:red:sata1", 4, netxbig_v2_red_mled, 2),
243 NETXBIG_LED(
"net5big-v2:blue:sata2", 5, netxbig_v2_blue_sata_mled, 2),
244 NETXBIG_LED(
"net5big-v2:red:sata2", 5, netxbig_v2_red_mled, 2),
245 NETXBIG_LED(
"net5big-v2:blue:sata3", 6, netxbig_v2_blue_sata_mled, 2),
246 NETXBIG_LED(
"net5big-v2:red:sata3", 6, netxbig_v2_red_mled, 2),
247 NETXBIG_LED(
"net5big-v2:blue:sata4", 7, netxbig_v2_blue_sata_mled, 2),
248 NETXBIG_LED(
"net5big-v2:red:sata5", 7, netxbig_v2_red_mled, 2),
252 .gpio_ext = &netxbig_v2_gpio_ext,
253 .timer = netxbig_v2_led_timer,
254 .num_timer =
ARRAY_SIZE(netxbig_v2_led_timer),
255 .leds = net5big_v2_leds_ctrl,
260 .name =
"leds-netxbig",
263 .platform_data = &net2big_v2_leds_data,
271 static unsigned int net2big_v2_mpp_config[]
__initdata = {
307 static unsigned int net5big_v2_mpp_config[]
__initdata = {
356 #define NETXBIG_V2_GPIO_POWER_OFF 7
358 static void netxbig_v2_power_off(
void)
363 static void __init netxbig_v2_init(
void)
369 if (machine_is_net2big_v2())
374 if (machine_is_net2big_v2())
381 if (machine_is_net5big_v2())
388 if (machine_is_net5big_v2())
389 netxbig_v2_leds.
dev.platform_data = &net5big_v2_leds_data;
397 pr_err(
"netxbig_v2: failed to configure power-off GPIO\n");
400 #ifdef CONFIG_MACH_NET2BIG_V2
402 .atag_offset = 0x100,
403 .init_machine = netxbig_v2_init,
412 #ifdef CONFIG_MACH_NET5BIG_V2
414 .atag_offset = 0x100,
415 .init_machine = netxbig_v2_init,