diff options
Diffstat (limited to 'arch/arm/mach-mxs/mach-mx28evk.c')
-rw-r--r-- | arch/arm/mach-mxs/mach-mx28evk.c | 98 |
1 files changed, 88 insertions, 10 deletions
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c index eaaf6ff28990..e7bff1e2cd2b 100644 --- a/arch/arm/mach-mxs/mach-mx28evk.c +++ b/arch/arm/mach-mxs/mach-mx28evk.c | |||
@@ -16,8 +16,10 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
18 | #include <linux/leds.h> | 18 | #include <linux/leds.h> |
19 | #include <linux/irq.h> | ||
20 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/i2c.h> | ||
21 | #include <linux/regulator/machine.h> | ||
22 | #include <linux/regulator/fixed.h> | ||
21 | 23 | ||
22 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
23 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
@@ -183,6 +185,24 @@ static const iomux_cfg_t mx28evk_pads[] __initconst = { | |||
183 | 185 | ||
184 | /* led */ | 186 | /* led */ |
185 | MX28_PAD_AUART1_TX__GPIO_3_5 | MXS_PAD_CTRL, | 187 | MX28_PAD_AUART1_TX__GPIO_3_5 | MXS_PAD_CTRL, |
188 | |||
189 | /* I2C */ | ||
190 | MX28_PAD_I2C0_SCL__I2C0_SCL | | ||
191 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
192 | MX28_PAD_I2C0_SDA__I2C0_SDA | | ||
193 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
194 | |||
195 | /* saif0 & saif1 */ | ||
196 | MX28_PAD_SAIF0_MCLK__SAIF0_MCLK | | ||
197 | (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
198 | MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK | | ||
199 | (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
200 | MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK | | ||
201 | (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
202 | MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 | | ||
203 | (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
204 | MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0 | | ||
205 | (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
186 | }; | 206 | }; |
187 | 207 | ||
188 | /* led */ | 208 | /* led */ |
@@ -352,6 +372,55 @@ static struct mxs_mmc_platform_data mx28evk_mmc_pdata[] __initdata = { | |||
352 | }, | 372 | }, |
353 | }; | 373 | }; |
354 | 374 | ||
375 | static struct i2c_board_info mxs_i2c0_board_info[] __initdata = { | ||
376 | { | ||
377 | I2C_BOARD_INFO("sgtl5000", 0x0a), | ||
378 | }, | ||
379 | }; | ||
380 | |||
381 | #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) | ||
382 | static struct regulator_consumer_supply mx28evk_audio_consumer_supplies[] = { | ||
383 | REGULATOR_SUPPLY("VDDA", "0-000a"), | ||
384 | REGULATOR_SUPPLY("VDDIO", "0-000a"), | ||
385 | }; | ||
386 | |||
387 | static struct regulator_init_data mx28evk_vdd_reg_init_data = { | ||
388 | .constraints = { | ||
389 | .name = "3V3", | ||
390 | .always_on = 1, | ||
391 | }, | ||
392 | .consumer_supplies = mx28evk_audio_consumer_supplies, | ||
393 | .num_consumer_supplies = ARRAY_SIZE(mx28evk_audio_consumer_supplies), | ||
394 | }; | ||
395 | |||
396 | static struct fixed_voltage_config mx28evk_vdd_pdata = { | ||
397 | .supply_name = "board-3V3", | ||
398 | .microvolts = 3300000, | ||
399 | .gpio = -EINVAL, | ||
400 | .enabled_at_boot = 1, | ||
401 | .init_data = &mx28evk_vdd_reg_init_data, | ||
402 | }; | ||
403 | static struct platform_device mx28evk_voltage_regulator = { | ||
404 | .name = "reg-fixed-voltage", | ||
405 | .id = -1, | ||
406 | .num_resources = 0, | ||
407 | .dev = { | ||
408 | .platform_data = &mx28evk_vdd_pdata, | ||
409 | }, | ||
410 | }; | ||
411 | static void __init mx28evk_add_regulators(void) | ||
412 | { | ||
413 | platform_device_register(&mx28evk_voltage_regulator); | ||
414 | } | ||
415 | #else | ||
416 | static void __init mx28evk_add_regulators(void) {} | ||
417 | #endif | ||
418 | |||
419 | static struct gpio mx28evk_lcd_gpios[] = { | ||
420 | { MX28EVK_LCD_ENABLE, GPIOF_OUT_INIT_HIGH, "lcd-enable" }, | ||
421 | { MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" }, | ||
422 | }; | ||
423 | |||
355 | static void __init mx28evk_init(void) | 424 | static void __init mx28evk_init(void) |
356 | { | 425 | { |
357 | int ret; | 426 | int ret; |
@@ -378,19 +447,24 @@ static void __init mx28evk_init(void) | |||
378 | mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]); | 447 | mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]); |
379 | } | 448 | } |
380 | 449 | ||
381 | ret = gpio_request_one(MX28EVK_LCD_ENABLE, GPIOF_DIR_OUT, "lcd-enable"); | 450 | ret = gpio_request_array(mx28evk_lcd_gpios, |
451 | ARRAY_SIZE(mx28evk_lcd_gpios)); | ||
382 | if (ret) | 452 | if (ret) |
383 | pr_warn("failed to request gpio lcd-enable: %d\n", ret); | 453 | pr_warn("failed to request gpio pins for lcd: %d\n", ret); |
384 | else | 454 | else |
385 | gpio_set_value(MX28EVK_LCD_ENABLE, 1); | 455 | mx28_add_mxsfb(&mx28evk_mxsfb_pdata); |
386 | 456 | ||
387 | ret = gpio_request_one(MX28EVK_BL_ENABLE, GPIOF_DIR_OUT, "bl-enable"); | 457 | mx28_add_saif(0); |
388 | if (ret) | 458 | mx28_add_saif(1); |
389 | pr_warn("failed to request gpio bl-enable: %d\n", ret); | 459 | |
390 | else | 460 | mx28_add_mxs_i2c(0); |
391 | gpio_set_value(MX28EVK_BL_ENABLE, 1); | 461 | i2c_register_board_info(0, mxs_i2c0_board_info, |
462 | ARRAY_SIZE(mxs_i2c0_board_info)); | ||
392 | 463 | ||
393 | mx28_add_mxsfb(&mx28evk_mxsfb_pdata); | 464 | mx28evk_add_regulators(); |
465 | |||
466 | mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0, | ||
467 | NULL, 0); | ||
394 | 468 | ||
395 | /* power on mmc slot by writing 0 to the gpio */ | 469 | /* power on mmc slot by writing 0 to the gpio */ |
396 | ret = gpio_request_one(MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW, | 470 | ret = gpio_request_one(MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW, |
@@ -403,7 +477,11 @@ static void __init mx28evk_init(void) | |||
403 | "mmc1-slot-power"); | 477 | "mmc1-slot-power"); |
404 | if (ret) | 478 | if (ret) |
405 | pr_warn("failed to request gpio mmc1-slot-power: %d\n", ret); | 479 | pr_warn("failed to request gpio mmc1-slot-power: %d\n", ret); |
480 | else | ||
481 | mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]); | ||
482 | |||
406 | mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]); | 483 | mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]); |
484 | mx28_add_rtc_stmp3xxx(); | ||
407 | 485 | ||
408 | gpio_led_register_device(0, &mx28evk_led_data); | 486 | gpio_led_register_device(0, &mx28evk_led_data); |
409 | } | 487 | } |