15 #include <linux/kernel.h>
19 #include <linux/input.h>
44 #define QI_LB60_GPIO_SD_CD JZ_GPIO_PORTD(0)
45 #define QI_LB60_GPIO_SD_VCC_EN_N JZ_GPIO_PORTD(2)
47 #define QI_LB60_GPIO_KEYOUT(x) (JZ_GPIO_PORTC(10) + (x))
48 #define QI_LB60_GPIO_KEYIN(x) (JZ_GPIO_PORTD(18) + (x))
49 #define QI_LB60_GPIO_KEYIN8 JZ_GPIO_PORTD(26)
55 6, 7, 8, 9, 10, 11, 12, 13,
56 14, 15, 16, 17, 18, 19, 20, 21,
57 22, 23, 24, 25, 26, 27, 28, 29,
58 30, 31, 32, 33, 34, 35, 36, 37,
62 { .offset = 2, .length = 4 },
63 { .offset = 42, .length = 22 }
72 .name =
"NAND BOOT partition",
73 .offset = 0 * 0x100000,
77 .name =
"NAND KERNEL partition",
78 .offset = 4 * 0x100000,
82 .name =
"NAND ROOTFS partition",
83 .offset = 8 * 0x100000,
84 .size = (504 + 512) * 0x100000,
91 12, 13, 14, 15, 16, 17, 18, 19,
92 20, 21, 22, 23, 24, 25, 26, 27,
93 28, 29, 30, 31, 32, 33, 34, 35,
94 36, 37, 38, 39, 40, 41, 42, 43,
95 44, 45, 46, 47, 48, 49, 50, 51,
96 52, 53, 54, 55, 56, 57, 58, 59,
97 60, 61, 62, 63, 64, 65, 66, 67,
98 68, 69, 70, 71, 72, 73, 74, 75,
99 76, 77, 78, 79, 80, 81, 82, 83
102 { .offset = 2, .length = 10 },
103 { .offset = 84, .length = 44 },
109 .name =
"NAND BOOT partition",
110 .offset = 0 * 0x100000,
111 .size = 4 * 0x100000,
114 .name =
"NAND KERNEL partition",
115 .offset = 4 * 0x100000,
116 .size = 4 * 0x100000,
119 .name =
"NAND ROOTFS partition",
120 .offset = 8 * 0x100000,
121 .size = (504 + 512 + 1024) * 0x100000,
130 chip->
ecc.layout = &qi_lb60_ecclayout_2gb;
131 *partitions = qi_lb60_partitions_2gb;
132 *num_partitions =
ARRAY_SIZE(qi_lb60_partitions_2gb);
134 chip->
ecc.layout = &qi_lb60_ecclayout_1gb;
135 *partitions = qi_lb60_partitions_1gb;
136 *num_partitions =
ARRAY_SIZE(qi_lb60_partitions_1gb);
141 .ident_callback = qi_lb60_nand_ident,
148 #define KEY_QI_QI KEY_F13
149 #define KEY_QI_UPRED KEY_RIGHTALT
150 #define KEY_QI_VOLUP KEY_VOLUMEUP
151 #define KEY_QI_VOLDOWN KEY_VOLUMEDOWN
152 #define KEY_QI_FN KEY_LEFTCTRL
154 static const uint32_t qi_lb60_keymap[] = {
218 .keymap = qi_lb60_keymap,
222 static const unsigned int qi_lb60_keypad_cols[] = {
233 static const unsigned int qi_lb60_keypad_rows[] = {
245 .keymap_data = &qi_lb60_keymap_data,
246 .col_gpios = qi_lb60_keypad_cols,
247 .row_gpios = qi_lb60_keypad_rows,
248 .num_col_gpios =
ARRAY_SIZE(qi_lb60_keypad_cols),
249 .num_row_gpios =
ARRAY_SIZE(qi_lb60_keypad_rows),
250 .col_scan_delay_us = 10,
257 .name =
"matrix-keypad",
260 .platform_data = &qi_lb60_pdata,
286 .modes = qi_lb60_video_modes,
289 .pixclk_falling_edge = 1,
309 .modalias =
"ili8960",
313 .max_speed_hz = 30 * 1000,
321 .gpio_charge_active_low = 1,
325 .voltage_max_design = 4200000,
326 .voltage_min_design = 3600000,
342 .nbuttons =
ARRAY_SIZE(qi_lb60_gpio_keys_buttons),
343 .buttons = qi_lb60_gpio_keys_buttons,
350 .platform_data = &qi_lb60_gpio_keys_data,
356 .gpio_read_only = -1,
358 .power_active_low = 1,
366 .num_consumer_supplies = 1,
367 .consumer_supplies = &avt2_usb_regulator_consumer,
378 .supply_name =
"USB power",
379 .microvolts = 5000000,
381 .init_data = &avt2_usb_regulator_init_data,
385 .name =
"reg-fixed-voltage",
388 .platform_data = &avt2_usb_regulator_data,
394 .name =
"pwm-beeper",
397 .platform_data = (
void *)4,
402 static char *qi_lb60_batteries[] = {
410 .gpio_active_low = 1,
411 .supplied_to = qi_lb60_batteries,
412 .num_supplicants =
ARRAY_SIZE(qi_lb60_batteries),
416 .name =
"gpio-charger",
418 .platform_data = &qi_lb60_charger_pdata,
424 .name =
"qi-lb60-audio",
443 &qi_lb60_charger_device,
444 &qi_lb60_audio_device,
447 static void __init board_gpio_setup(
void)
455 static int __init qi_lb60_init_platform_devices(
void)
478 .ext_rate = 12000000,
491 static int __init qi_lb60_board_setup(
void)
494 is_avt2 ?
"AVT2" :
"LB60");
498 if (qi_lb60_init_platform_devices())
499 panic(
"Failed to initialize platform devices");