diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2009-03-28 10:15:07 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2009-03-28 10:15:07 -0400 |
commit | 3ea57218fde5fe6c2ff449d4c30fc69ac6976096 (patch) | |
tree | 00b8e53b80c5ddc1189c183dcb50b5f499de5cb3 /arch/blackfin | |
parent | 2c8beb2cbef632a3683950aab8bcd9735a0a0270 (diff) |
Blackfin arch: Privide BF537-STAMP platform data of ADP5520 Multifunction driver
ADP5520 Multifunction LCD Backlight and Keypad Input Device Driver
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 0afe9bd6dbc9..f32b7477dcb0 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -1073,6 +1073,141 @@ static struct adp5588_kpad_platform_data adp5588_kpad_data = { | |||
1073 | }; | 1073 | }; |
1074 | #endif | 1074 | #endif |
1075 | 1075 | ||
1076 | #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) | ||
1077 | #include <linux/mfd/adp5520.h> | ||
1078 | |||
1079 | /* | ||
1080 | * ADP5520/5501 Backlight Data | ||
1081 | */ | ||
1082 | |||
1083 | static struct adp5520_backlight_platfrom_data adp5520_backlight_data = { | ||
1084 | .fade_in = FADE_T_1200ms, | ||
1085 | .fade_out = FADE_T_1200ms, | ||
1086 | .fade_led_law = BL_LAW_LINEAR, | ||
1087 | .en_ambl_sens = 1, | ||
1088 | .abml_filt = BL_AMBL_FILT_640ms, | ||
1089 | .l1_daylight_max = BL_CUR_mA(15), | ||
1090 | .l1_daylight_dim = BL_CUR_mA(0), | ||
1091 | .l2_office_max = BL_CUR_mA(7), | ||
1092 | .l2_office_dim = BL_CUR_mA(0), | ||
1093 | .l3_dark_max = BL_CUR_mA(3), | ||
1094 | .l3_dark_dim = BL_CUR_mA(0), | ||
1095 | .l2_trip = L2_COMP_CURR_uA(700), | ||
1096 | .l2_hyst = L2_COMP_CURR_uA(50), | ||
1097 | .l3_trip = L3_COMP_CURR_uA(80), | ||
1098 | .l3_hyst = L3_COMP_CURR_uA(20), | ||
1099 | }; | ||
1100 | |||
1101 | /* | ||
1102 | * ADP5520/5501 LEDs Data | ||
1103 | */ | ||
1104 | |||
1105 | #include <linux/leds.h> | ||
1106 | |||
1107 | static struct led_info adp5520_leds[] = { | ||
1108 | { | ||
1109 | .name = "adp5520-led1", | ||
1110 | .default_trigger = "none", | ||
1111 | .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | LED_OFFT_600ms, | ||
1112 | }, | ||
1113 | #ifdef ADP5520_EN_ALL_LEDS | ||
1114 | { | ||
1115 | .name = "adp5520-led2", | ||
1116 | .default_trigger = "none", | ||
1117 | .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1, | ||
1118 | }, | ||
1119 | { | ||
1120 | .name = "adp5520-led3", | ||
1121 | .default_trigger = "none", | ||
1122 | .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2, | ||
1123 | }, | ||
1124 | #endif | ||
1125 | }; | ||
1126 | |||
1127 | static struct adp5520_leds_platfrom_data adp5520_leds_data = { | ||
1128 | .num_leds = ARRAY_SIZE(adp5520_leds), | ||
1129 | .leds = adp5520_leds, | ||
1130 | .fade_in = FADE_T_600ms, | ||
1131 | .fade_out = FADE_T_600ms, | ||
1132 | .led_on_time = LED_ONT_600ms, | ||
1133 | }; | ||
1134 | |||
1135 | /* | ||
1136 | * ADP5520 GPIO Data | ||
1137 | */ | ||
1138 | |||
1139 | static struct adp5520_gpio_platfrom_data adp5520_gpio_data = { | ||
1140 | .gpio_start = 50, | ||
1141 | .gpio_en_mask = GPIO_C1 | GPIO_C2 | GPIO_R2, | ||
1142 | .gpio_pullup_mask = GPIO_C1 | GPIO_C2 | GPIO_R2, | ||
1143 | }; | ||
1144 | |||
1145 | /* | ||
1146 | * ADP5520 Keypad Data | ||
1147 | */ | ||
1148 | |||
1149 | #include <linux/input.h> | ||
1150 | static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = { | ||
1151 | [KEY(0, 0)] = KEY_GRAVE, | ||
1152 | [KEY(0, 1)] = KEY_1, | ||
1153 | [KEY(0, 2)] = KEY_2, | ||
1154 | [KEY(0, 3)] = KEY_3, | ||
1155 | [KEY(1, 0)] = KEY_4, | ||
1156 | [KEY(1, 1)] = KEY_5, | ||
1157 | [KEY(1, 2)] = KEY_6, | ||
1158 | [KEY(1, 3)] = KEY_7, | ||
1159 | [KEY(2, 0)] = KEY_8, | ||
1160 | [KEY(2, 1)] = KEY_9, | ||
1161 | [KEY(2, 2)] = KEY_0, | ||
1162 | [KEY(2, 3)] = KEY_MINUS, | ||
1163 | [KEY(3, 0)] = KEY_EQUAL, | ||
1164 | [KEY(3, 1)] = KEY_BACKSLASH, | ||
1165 | [KEY(3, 2)] = KEY_BACKSPACE, | ||
1166 | [KEY(3, 3)] = KEY_ENTER, | ||
1167 | }; | ||
1168 | |||
1169 | static struct adp5520_keys_platfrom_data adp5520_keys_data = { | ||
1170 | .rows_en_mask = ROW_R3 | ROW_R2 | ROW_R1 | ROW_R0, | ||
1171 | .cols_en_mask = COL_C3 | COL_C2 | COL_C1 | COL_C0, | ||
1172 | .keymap = adp5520_keymap, | ||
1173 | .keymapsize = ARRAY_SIZE(adp5520_keymap), | ||
1174 | .repeat = 0, | ||
1175 | }; | ||
1176 | |||
1177 | /* | ||
1178 | * ADP5520/5501 Multifuction Device Init Data | ||
1179 | */ | ||
1180 | |||
1181 | static struct adp5520_subdev_info adp5520_subdevs[] = { | ||
1182 | { | ||
1183 | .name = "adp5520-backlight", | ||
1184 | .id = ID_ADP5520, | ||
1185 | .platform_data = &adp5520_backlight_data, | ||
1186 | }, | ||
1187 | { | ||
1188 | .name = "adp5520-led", | ||
1189 | .id = ID_ADP5520, | ||
1190 | .platform_data = &adp5520_leds_data, | ||
1191 | }, | ||
1192 | { | ||
1193 | .name = "adp5520-gpio", | ||
1194 | .id = ID_ADP5520, | ||
1195 | .platform_data = &adp5520_gpio_data, | ||
1196 | }, | ||
1197 | { | ||
1198 | .name = "adp5520-keys", | ||
1199 | .id = ID_ADP5520, | ||
1200 | .platform_data = &adp5520_keys_data, | ||
1201 | }, | ||
1202 | }; | ||
1203 | |||
1204 | static struct adp5520_platform_data adp5520_pdev_data = { | ||
1205 | .num_subdevs = ARRAY_SIZE(adp5520_subdevs), | ||
1206 | .subdevs = adp5520_subdevs, | ||
1207 | }; | ||
1208 | |||
1209 | #endif | ||
1210 | |||
1076 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { | 1211 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { |
1077 | #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) | 1212 | #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) |
1078 | { | 1213 | { |
@@ -1105,6 +1240,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { | |||
1105 | .platform_data = (void *)&adp5588_kpad_data, | 1240 | .platform_data = (void *)&adp5588_kpad_data, |
1106 | }, | 1241 | }, |
1107 | #endif | 1242 | #endif |
1243 | #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) | ||
1244 | { | ||
1245 | I2C_BOARD_INFO("pmic-adp5520", 0x32), | ||
1246 | .irq = IRQ_PF7, | ||
1247 | .platform_data = (void *)&adp5520_pdev_data, | ||
1248 | }, | ||
1249 | #endif | ||
1108 | }; | 1250 | }; |
1109 | 1251 | ||
1110 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 1252 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |