11 #include <linux/kernel.h>
14 #include <linux/input.h>
19 #include <linux/i2c.h>
47 #include <../drivers/staging/iio/light/tsl2563.h>
50 #if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE)
58 #define SYSTEM_REV_B_USES_VAUX3 0x1699
59 #define SYSTEM_REV_S_USES_VAUX3 0x8
61 #define RX51_WL1251_POWER_GPIO 87
62 #define RX51_WL1251_IRQ_GPIO 42
63 #define RX51_FMTX_RESET_GPIO 163
64 #define RX51_FMTX_IRQ 53
65 #define RX51_LP5523_CHIP_EN_GPIO 41
67 #define RX51_USB_TRANSCEIVER_RST_GPIO 67
69 #define RX51_TSC2005_RESET_GPIO 104
70 #define RX51_TSC2005_IRQ_GPIO 100
72 #define LIS302_IRQ1_GPIO 181
73 #define LIS302_IRQ2_GPIO 180
85 #if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
86 static int lis302_setup(
void)
114 static int lis302_release(
void)
128 .click_thresh_z = 10,
130 .click_time_limit = 9,
136 .wakeup_thresh = 800 / 18,
138 .wakeup_thresh2 = 900 / 18,
148 .setup_resources = lis302_setup,
149 .release_resources = lis302_release,
150 .st_min_limits = {-32, 3, 3},
151 .st_max_limits = {-3, 32, 32},
155 #if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
161 #if defined(CONFIG_LEDS_LP5523) || defined(CONFIG_LEDS_LP5523_MODULE)
193 static int rx51_lp5523_setup(
void)
199 static void rx51_lp5523_release(
void)
204 static void rx51_lp5523_enable(
bool state)
211 .num_channels =
ARRAY_SIZE(rx51_lp5523_led_config),
213 .setup_resources = rx51_lp5523_setup,
214 .release_resources = rx51_lp5523_release,
215 .enable = rx51_lp5523_enable,
233 .modalias =
"wl1251",
236 .max_speed_hz = 48000000,
238 .controller_data = &wl1251_mcspi_config,
239 .platform_data = &wl1251_pdata,
242 .modalias =
"acx565akm",
245 .max_speed_hz = 6000000,
246 .controller_data = &mipid_mcspi_config,
249 .modalias =
"tsc2005",
252 .max_speed_hz = 6000000,
253 .controller_data = &tsc2005_mcspi_config,
254 .platform_data = &tsc2005_pdata,
258 static void rx51_charger_set_power(
bool on)
264 .set_power = rx51_charger_set_power,
268 .name =
"isp1704_charger",
270 .platform_data = &rx51_charger_data,
274 static void __init rx51_charger_init(
void)
282 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
284 #define RX51_GPIO_CAMERA_LENS_COVER 110
285 #define RX51_GPIO_CAMERA_FOCUS 68
286 #define RX51_GPIO_CAMERA_CAPTURE 69
287 #define RX51_GPIO_KEYPAD_SLIDE 71
288 #define RX51_GPIO_LOCK_BUTTON 113
289 #define RX51_GPIO_PROXIMITY 89
291 #define RX51_GPIO_DEBOUNCE_TIMEOUT 10
295 .
desc =
"Camera Lens Cover",
298 .gpio = RX51_GPIO_CAMERA_LENS_COVER,
300 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
302 .desc =
"Camera Focus",
305 .gpio = RX51_GPIO_CAMERA_FOCUS,
307 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
309 .desc =
"Camera Capture",
312 .gpio = RX51_GPIO_CAMERA_CAPTURE,
314 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
316 .desc =
"Lock Button",
319 .gpio = RX51_GPIO_LOCK_BUTTON,
321 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
323 .desc =
"Keypad Slide",
326 .gpio = RX51_GPIO_KEYPAD_SLIDE,
328 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
330 .desc =
"Proximity Sensor",
333 .gpio = RX51_GPIO_PROXIMITY,
335 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
348 .platform_data = &rx51_gpio_keys_data,
352 static void __init rx51_add_gpio_keys(
void)
357 static void __init rx51_add_gpio_keys(
void)
421 .keymap = board_keymap,
426 .keymap_data = &board_map_data,
466 static void rx51_mmc2_remux(
struct device *
dev,
int slot,
int power_on)
482 .power_saving =
true,
491 .nonremovable =
true,
492 .power_saving =
true,
493 .remux = rx51_mmc2_remux,
553 .num_consumer_supplies =
ARRAY_SIZE(rx51_vaux1_consumers),
554 .consumer_supplies = rx51_vaux1_consumers,
567 .num_consumer_supplies =
ARRAY_SIZE(rx51_vaux2_supply),
568 .consumer_supplies = rx51_vaux2_supply,
574 .name =
"VCAM_DIG_18",
597 .num_consumer_supplies =
ARRAY_SIZE(rx51_vaux3_supply),
598 .consumer_supplies = rx51_vaux3_supply,
603 .name =
"VCAM_ANA_28",
624 .num_consumer_supplies =
ARRAY_SIZE(rx51_vmmc1_supply),
625 .consumer_supplies = rx51_vmmc1_supply,
641 .num_consumer_supplies =
ARRAY_SIZE(rx51_vmmc2_supplies),
642 .consumer_supplies = rx51_vmmc2_supplies,
673 .name =
"VMMC2_IO_18",
682 .num_consumer_supplies =
ARRAY_SIZE(rx51_vsim_supply),
683 .consumer_supplies = rx51_vsim_supply,
696 .num_consumer_supplies =
ARRAY_SIZE(rx51_vio_supplies),
697 .consumer_supplies = rx51_vio_supplies,
741 static struct i2c_board_info rx51_si4713_board_info __initdata_or_module = {
743 .platform_data = &rx51_si4713_i2c_data,
748 .subdev_board_info = &rx51_si4713_board_info,
752 .name =
"radio-si4713",
755 .platform_data = &rx51_si4713_data,
759 static __init void rx51_init_si4713(
void)
772 static int rx51_twlgpio_setup(
struct device *dev,
unsigned gpio,
unsigned n)
787 .setup = rx51_twlgpio_setup,
790 static struct twl4030_ins sleep_on_seq[] __initdata = {
798 .script = sleep_on_seq,
803 static struct twl4030_ins wakeup_seq[] __initdata = {
811 .script = wakeup_seq,
816 static struct twl4030_ins wakeup_p3_seq[] __initdata = {
824 .script = wakeup_p3_seq,
829 static struct twl4030_ins wrst_seq[] __initdata = {
871 { .resource =
RES_VDD2, .devgroup = -1,
880 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
883 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
886 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
889 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
892 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
895 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
898 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
900 { .resource =
RES_VDAC, .devgroup = -1,
901 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
903 { .resource =
RES_VSIM, .devgroup = -1,
904 .type = -1, .type2 = 3, .remap_off = -1, .remap_sleep = -1
907 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
910 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
913 .type = -1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
916 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
919 .type = 1, .type2 = -1 , .remap_off = -1, .remap_sleep = -1
922 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
925 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
928 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
931 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
934 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
937 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
940 .type = 1, .type2 = -1, .remap_off = -1, .remap_sleep = -1
946 .scripts = twl4030_scripts,
948 .resource_config = twl4030_rconfig,
956 .audio_mclk = 26000000,
957 .vibra = &rx51_vibra_data,
962 .gpio = &rx51_gpio_data,
963 .keypad = &rx51_kp_data,
964 .power = &rx51_t2scripts_data,
965 .audio = &rx51_audio_data,
967 .vaux1 = &rx51_vaux1,
968 .vaux2 = &rx51_vaux2,
969 .vaux4 = &rx51_vaux4,
970 .vmmc1 = &rx51_vmmc1,
971 .vpll1 = &rx51_vpll1,
972 .vpll2 = &rx51_vpll2,
974 .vintana1 = &rx51_vintana1,
975 .vintana2 = &rx51_vintana2,
976 .vintdig = &rx51_vintdig,
991 .setup = &rx51_aic34_setup,
999 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
1002 .platform_data = &rx51_aic3x_data,
1006 .platform_data = &rx51_aic3x_data2,
1008 #if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
1011 .platform_data = &rx51_tsl2563_platform_data,
1014 #if defined(CONFIG_LEDS_LP5523) || defined(CONFIG_LEDS_LP5523_MODULE)
1017 .platform_data = &rx51_lp5523_platform_data,
1025 .platform_data = &rx51_tpa6130a2_data,
1029 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_3[] = {
1030 #if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
1033 .platform_data = &rx51_lis3lv02d_data,
1038 static int __init rx51_i2c_init(
void)
1042 rx51_twldata.vaux3 = &rx51_vaux3_mmc;
1046 rx51_twldata.vaux3 = &rx51_vaux3_cam;
1048 rx51_twldata.vmmc2 = &rx51_vmmc2;
1053 rx51_twldata.vdac->constraints.apply_uV =
true;
1054 rx51_twldata.vdac->constraints.name =
"VDAC";
1058 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
1059 #if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
1064 ARRAY_SIZE(rx51_peripherals_i2c_board_info_3));
1068 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
1069 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
1073 .
name =
"bootloader",
1109 .parts = onenand_partitions,
1116 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1126 static void __init board_smc91x_init(
void)
1137 static inline void board_smc91x_init(
void)
1143 static void rx51_wl1251_set_power(
bool enable)
1148 static struct gpio rx51_wl1251_gpios[] __initdata = {
1153 static void __init rx51_init_wl1251(
void)
1166 wl1251_pdata.set_power = rx51_wl1251_set_power;
1176 wl1251_pdata.set_power =
NULL;
1185 .ts_pressure_max = 2048,
1186 .ts_pressure_fudge = 2,
1191 .ts_x_plate_ohm = 280,
1192 .esd_timeout_ms = 8000,
1195 static struct gpio rx51_tsc2005_gpios[] __initdata = {
1200 static void rx51_tsc2005_set_reset(
bool enable)
1205 static void __init rx51_init_tsc2005(
void)
1220 tsc2005_pdata.
set_reset = rx51_tsc2005_set_reset;
1225 #if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE)
1232 .
name =
"lirc_rx51",
1235 .platform_data = &rx51_lirc_data,
1239 static void __init rx51_init_lirc(
void)
1244 static void __init rx51_init_lirc(
void)
1254 board_smc91x_init();
1255 rx51_add_gpio_keys();
1257 rx51_init_tsc2005();
1261 ARRAY_SIZE(rx51_peripherals_spi_board_info));
1265 omap_hsmmc_init(mmc);
1267 rx51_charger_init();