Skip to content

Commit 3e2ed55

Browse files
author
Daz Jones
committedDec 28, 2012
blade2: huge cleanup and update for new USB driver
1 parent f5e34b7 commit 3e2ed55

File tree

4 files changed

+1045
-1865
lines changed

4 files changed

+1045
-1865
lines changed
 

‎arch/arm/configs/blade2_jb_p736e_defconfig

+1-11
Original file line numberDiff line numberDiff line change
@@ -1793,18 +1793,8 @@ CONFIG_USB_GADGET_DUALSPEED=y
17931793
# CONFIG_USB_G_SERIAL is not set
17941794
# CONFIG_USB_MIDI_GADGET is not set
17951795
# CONFIG_USB_G_PRINTER is not set
1796-
CONFIG_USB_ANDROID=y
1797-
# CONFIG_USB_ANDROID_ACM is not set
1798-
CONFIG_USB_ANDROID_ADB=y
1799-
CONFIG_USB_ANDROID_DIAG=y
1800-
CONFIG_USB_ANDROID_MASS_STORAGE=y
1796+
CONFIG_USB_G_ANDROID=y
18011797
CONFIG_USB_CSW_HACK=y
1802-
# CONFIG_USB_ANDROID_MTP is not set
1803-
CONFIG_USB_ANDROID_RNDIS=y
1804-
# CONFIG_USB_ANDROID_RNDIS_WCEIS is not set
1805-
# CONFIG_USB_ANDROID_RMNET is not set
1806-
CONFIG_USB_F_SERIAL=y
1807-
CONFIG_MODEM_SUPPORT=y
18081798
# CONFIG_USB_CDC_COMPOSITE is not set
18091799
# CONFIG_USB_G_NOKIA is not set
18101800
# CONFIG_USB_G_MULTI is not set

‎arch/arm/configs/blade2_jb_p736v_defconfig

+1-11
Original file line numberDiff line numberDiff line change
@@ -1793,18 +1793,8 @@ CONFIG_USB_GADGET_DUALSPEED=y
17931793
# CONFIG_USB_G_SERIAL is not set
17941794
# CONFIG_USB_MIDI_GADGET is not set
17951795
# CONFIG_USB_G_PRINTER is not set
1796-
CONFIG_USB_ANDROID=y
1797-
# CONFIG_USB_ANDROID_ACM is not set
1798-
CONFIG_USB_ANDROID_ADB=y
1799-
CONFIG_USB_ANDROID_DIAG=y
1800-
CONFIG_USB_ANDROID_MASS_STORAGE=y
1796+
CONFIG_USB_G_ANDROID=y
18011797
CONFIG_USB_CSW_HACK=y
1802-
# CONFIG_USB_ANDROID_MTP is not set
1803-
CONFIG_USB_ANDROID_RNDIS=y
1804-
# CONFIG_USB_ANDROID_RNDIS_WCEIS is not set
1805-
# CONFIG_USB_ANDROID_RMNET is not set
1806-
CONFIG_USB_F_SERIAL=y
1807-
CONFIG_MODEM_SUPPORT=y
18081798
# CONFIG_USB_CDC_COMPOSITE is not set
18091799
# CONFIG_USB_G_NOKIA is not set
18101800
# CONFIG_USB_G_MULTI is not set

‎arch/arm/mach-msm/board-zte-blade2-keypad.c

+28-58
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,22 @@
1717

1818
#include <asm/mach-types.h>
1919

20-
21-
//static unsigned int keypad_row_gpios[] = {33, 31, 28};
22-
static unsigned int keypad_row_gpios[] = {34, 28, 33};
23-
static unsigned int keypad_col_gpios[] = {37, 41, 40};
20+
static unsigned int keypad_row_gpios[] = {34, 28, 33};
21+
static unsigned int keypad_col_gpios[] = {37, 41, 40};
2422

2523
#define KEYMAP_INDEX(row, col) ((row)*ARRAY_SIZE(keypad_col_gpios) + (col))
2624

27-
#if 0
2825
static const unsigned short keypad_keymap_blade2[ARRAY_SIZE(keypad_col_gpios) *
29-
ARRAY_SIZE(keypad_row_gpios)] = {
30-
/* row, col */
31-
[KEYMAP_INDEX(0, 0)] = KEY_BACK,
32-
[KEYMAP_INDEX(0, 1)] = 0,
33-
[KEYMAP_INDEX(0, 2)] = KEY_MENU,
34-
[KEYMAP_INDEX(1, 0)] = 0,
35-
[KEYMAP_INDEX(1, 1)] = 0,
36-
[KEYMAP_INDEX(1, 2)] = KEY_HOME,
37-
[KEYMAP_INDEX(2, 0)] = KEY_VOLUMEUP,
38-
[KEYMAP_INDEX(2, 1)] = KEY_VOLUMEDOWN,
39-
[KEYMAP_INDEX(2, 2)] = 0,
40-
};
41-
#endif
42-
static const unsigned short keypad_keymap_blade2[ARRAY_SIZE(keypad_col_gpios) *
43-
ARRAY_SIZE(keypad_row_gpios)] = {
44-
/* row, col */
45-
[KEYMAP_INDEX(0, 0)] = 0,
26+
ARRAY_SIZE(keypad_row_gpios)] = {
27+
[KEYMAP_INDEX(0, 0)] = 0,
4628
[KEYMAP_INDEX(0, 1)] = 0,
4729
[KEYMAP_INDEX(0, 2)] = KEY_MENU,
4830
[KEYMAP_INDEX(1, 0)] = KEY_VOLUMEUP,
49-
[KEYMAP_INDEX(1, 1)] = KEY_VOLUMEDOWN,
31+
[KEYMAP_INDEX(1, 1)] = KEY_VOLUMEDOWN,
5032
[KEYMAP_INDEX(1, 2)] = 0,
5133
[KEYMAP_INDEX(2, 0)] = KEY_BACK,
52-
[KEYMAP_INDEX(2, 1)] = 0,
53-
[KEYMAP_INDEX(2, 2)] =KEY_HOME,
34+
[KEYMAP_INDEX(2, 1)] = 0,
35+
[KEYMAP_INDEX(2, 2)] = KEY_HOME,
5436
};
5537

5638
static const unsigned short blade2_keypad_virtual_keys[] = {
@@ -62,46 +44,37 @@ static const unsigned short blade2_keypad_virtual_keys[] = {
6244
const unsigned short *p_keypad_keymap;
6345
void zte_get_gpio_for_key(int *keycode)
6446
{
65-
int gpio_wakeup_col; //which col the gpio is in keypad_col_gpios
47+
int gpio_wakeup_col; //which col the gpio is in keypad_col_gpios
6648
int col_array_size = ARRAY_SIZE(keypad_col_gpios);
67-
int r=0;
68-
int keymap_index= 0;
49+
int r = 0;
50+
int keymap_index = 0;
6951
pr_info("[IRQWAKE] wakeup APP keycode %d\n",*keycode);
7052
while((*keycode != p_keypad_keymap[keymap_index]) && keymap_index <= (ARRAY_SIZE(keypad_col_gpios) * ARRAY_SIZE(keypad_row_gpios)))
7153
{
72-
keymap_index ++;
54+
keymap_index++;
7355
}
7456

75-
//pr_info("[IRQWAKE] keymap_index %d\n",keymap_index);
76-
77-
do{
57+
do {
7858
gpio_wakeup_col = keymap_index - r * col_array_size;
7959
r++;
80-
}while(gpio_wakeup_col > col_array_size);
81-
82-
//pr_info("[IRQWAKE] gpio_col %d\n",gpio_wakeup_col);
60+
} while(gpio_wakeup_col > col_array_size);
61+
8362
*keycode = keypad_col_gpios[gpio_wakeup_col];
84-
pr_info("[IRQWAKE] wakeup gpio_num %d\n",*keycode);
85-
63+
pr_info("[IRQWAKE] wakeup gpio_num %d\n", *keycode);
8664
}
87-
8865
#endif
66+
8967
/* blade2 keypad platform device information */
9068
static struct gpio_event_matrix_info blade2_keypad_matrix_info = {
91-
.info.func = gpio_event_matrix_func,
92-
.keymap = keypad_keymap_blade2,
69+
.info.func = gpio_event_matrix_func,
70+
.keymap = keypad_keymap_blade2,
9371
.output_gpios = keypad_row_gpios,
9472
.input_gpios = keypad_col_gpios,
95-
.noutputs = ARRAY_SIZE(keypad_row_gpios),
96-
.ninputs = ARRAY_SIZE(keypad_col_gpios),
97-
.settle_time.tv.nsec = 0,
98-
.poll_time.tv.nsec = 20 * NSEC_PER_MSEC,
99-
#if 1 // chenjun
100-
.flags = GPIOKPF_LEVEL_TRIGGERED_IRQ | GPIOKPF_DRIVE_INACTIVE |
101-
GPIOKPF_PRINT_UNMAPPED_KEYS
102-
#else
103-
.flags = GPIOKPF_LEVEL_TRIGGERED_IRQ | GPIOKPF_DRIVE_INACTIVE | GPIOKPF_ACTIVE_HIGH | GPIOKPF_PRINT_UNMAPPED_KEYS /*| GPIOKPF_PRINT_MAPPED_KEYS*/
104-
#endif
73+
.noutputs = ARRAY_SIZE(keypad_row_gpios),
74+
.ninputs = ARRAY_SIZE(keypad_col_gpios),
75+
.settle_time.tv.nsec = 0,
76+
.poll_time.tv.nsec = 20 * NSEC_PER_MSEC,
77+
.flags = GPIOKPF_LEVEL_TRIGGERED_IRQ | GPIOKPF_DRIVE_INACTIVE | GPIOKPF_PRINT_UNMAPPED_KEYS
10578
};
10679

10780
static struct gpio_event_info *blade2_keypad_info[] = {
@@ -116,26 +89,24 @@ static struct gpio_event_platform_data blade2_keypad_data = {
11689

11790
struct platform_device keypad_device_blade2 = {
11891
.name = GPIO_EVENT_DEV_NAME,
119-
.id = -1,
92+
.id = -1,
12093
.dev = {
12194
.platform_data = &blade2_keypad_data,
12295
},
12396
};
12497

125-
12698
#ifdef CONFIG_ZTE_FTM_FLAG_SUPPORT
12799
extern int zte_get_ftm_flag(void);
128100
#endif
129101

130102
static int __init blade2_init_keypad(void)
131103
{
132-
133-
#ifdef CONFIG_ZTE_FTM_FLAG_SUPPORT
104+
#ifdef CONFIG_ZTE_FTM_FLAG_SUPPORT
134105
int ftm_flag;
135106
ftm_flag = zte_get_ftm_flag();
136-
if (1 ==ftm_flag)return 0;
137-
#endif
138-
107+
if (1 == ftm_flag) return 0;
108+
#endif
109+
139110
blade2_keypad_matrix_info.keymap = keypad_keymap_blade2;
140111
#ifdef CONFIG_MSM_GPIO_WAKE
141112
p_keypad_keymap = blade2_keypad_matrix_info.keymap;
@@ -144,4 +115,3 @@ static int __init blade2_init_keypad(void)
144115
}
145116

146117
device_initcall(blade2_init_keypad);
147-

0 commit comments

Comments
 (0)
Failed to load comments.