* [PATCH 1/6] eukrea_mbimxsd: add audio support
@ 2011-02-25 13:38 Eric Bénard
2011-02-25 13:38 ` [PATCH 2/6] cpuimx51sd: add cpufreq support Eric Bénard
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Eric Bénard @ 2011-02-25 13:38 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Eric B?nard <eric@eukrea.com>
---
arch/arm/mach-mx5/Kconfig | 1 +
arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | 28 ++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index 4e4d7af..ded1d2d 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -108,6 +108,7 @@ config MACH_EUKREA_MBIMXSD51_BASEBOARD
prompt "Eukrea MBIMXSD development board"
bool
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+ select IMX_HAVE_PLATFORM_IMX_SSI
help
This adds board specific devices that can be found on Eukrea's
MBIMXSD evaluation board.
diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
index c372a43..712061c 100644
--- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
@@ -67,6 +67,11 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
MX51_PAD_SD1_DATA1__SD1_DATA1,
MX51_PAD_SD1_DATA2__SD1_DATA2,
MX51_PAD_SD1_DATA3__SD1_DATA3,
+ /* SSI */
+ MX51_PAD_AUD3_BB_TXD__AUD3_TXD,
+ MX51_PAD_AUD3_BB_RXD__AUD3_RXD,
+ MX51_PAD_AUD3_BB_CK__AUD3_TXC,
+ MX51_PAD_AUD3_BB_FS__AUD3_TXFS,
};
#define GPIO_LED1 IMX_GPIO_NR(3, 30)
@@ -133,6 +138,11 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = {
},
};
+static const
+struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = {
+ .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE,
+};
+
/*
* system init for baseboard usage. Will be called by cpuimx51sd init.
*
@@ -145,10 +155,28 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
ARRAY_SIZE(eukrea_mbimxsd_pads)))
printk(KERN_ERR "error setting mbimxsd pads !\n");
+#if defined(CONFIG_SND_SOC_EUKREA_TLV320)
+ /* SSI unit master I2S codec connected to SSI_AUD3 */
+ mxc_audmux_v2_configure_port(0,
+ MXC_AUDMUX_V2_PTCR_SYN |
+ MXC_AUDMUX_V2_PTCR_TFSDIR |
+ MXC_AUDMUX_V2_PTCR_TFSEL(2) |
+ MXC_AUDMUX_V2_PTCR_TCLKDIR |
+ MXC_AUDMUX_V2_PTCR_TCSEL(2),
+ MXC_AUDMUX_V2_PDCR_RXDSEL(2)
+ );
+ mxc_audmux_v2_configure_port(2,
+ MXC_AUDMUX_V2_PTCR_SYN |
+ MXC_AUDMUX_V2_PTCR_TCSEL(0),
+ MXC_AUDMUX_V2_PDCR_RXDSEL(0)
+ );
+#endif
+
imx51_add_imx_uart(1, NULL);
imx51_add_imx_uart(2, &uart_pdata);
imx51_add_sdhci_esdhc_imx(0, NULL);
+ imx51_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
gpio_request(GPIO_LED1, "LED1");
gpio_direction_output(GPIO_LED1, 1);
--
1.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/6] cpuimx51sd: add cpufreq support 2011-02-25 13:38 [PATCH 1/6] eukrea_mbimxsd: add audio support Eric Bénard @ 2011-02-25 13:38 ` Eric Bénard 2011-02-25 13:38 ` [PATCH 3/6] cpuimx51sd: fix tsc2007 Eric Bénard ` (3 subsequent siblings) 4 siblings, 0 replies; 8+ messages in thread From: Eric Bénard @ 2011-02-25 13:38 UTC (permalink / raw) To: linux-arm-kernel Signed-off-by: Eric B?nard <eric@eukrea.com> --- arch/arm/mach-mx5/board-cpuimx51sd.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c index b89afba..68ecfc0 100644 --- a/arch/arm/mach-mx5/board-cpuimx51sd.c +++ b/arch/arm/mach-mx5/board-cpuimx51sd.c @@ -42,6 +42,7 @@ #include "devices-imx51.h" #include "devices.h" +#include "cpu_op-mx51.h" #define USBH1_RST IMX_GPIO_NR(2, 28) #define ETH_RST IMX_GPIO_NR(2, 31) @@ -269,6 +270,10 @@ static void __init eukrea_cpuimx51sd_init(void) mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51sd_pads, ARRAY_SIZE(eukrea_cpuimx51sd_pads)); +#if defined(CONFIG_CPU_FREQ_IMX) + get_cpu_op = mx51_get_cpu_op; +#endif + imx51_add_imx_uart(0, &uart_pdata); imx51_add_mxc_nand(&eukrea_cpuimx51sd_nand_board_info); -- 1.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/6] cpuimx51sd: fix tsc2007 2011-02-25 13:38 [PATCH 1/6] eukrea_mbimxsd: add audio support Eric Bénard 2011-02-25 13:38 ` [PATCH 2/6] cpuimx51sd: add cpufreq support Eric Bénard @ 2011-02-25 13:38 ` Eric Bénard 2011-02-25 14:04 ` [PATCH v2 " Eric Bénard 2011-02-25 13:38 ` [PATCH 4/6] cpuimx51sd: mcp2515 supports up to 10MHz SPI clock Eric Bénard ` (2 subsequent siblings) 4 siblings, 1 reply; 8+ messages in thread From: Eric Bénard @ 2011-02-25 13:38 UTC (permalink / raw) To: linux-arm-kernel - wrong MUX was set before for IRQ - get_pendown_state is no more needed Signed-off-by: Eric B?nard <eric@eukrea.com> --- arch/arm/mach-mx5/board-cpuimx51sd.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c index 68ecfc0..5b19419 100644 --- a/arch/arm/mach-mx5/board-cpuimx51sd.c +++ b/arch/arm/mach-mx5/board-cpuimx51sd.c @@ -110,7 +110,7 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = { /* Touchscreen */ /* IRQ */ - _MX51_PAD_CSI1_D8__GPIO3_12 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP | + MX51_PAD_GPIO_NAND__GPIO_NAND | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP | PAD_CTL_PKE | PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), }; @@ -119,15 +119,9 @@ static const struct imxuart_platform_data uart_pdata __initconst = { .flags = IMXUART_HAVE_RTSCTS, }; -static int ts_get_pendown_state(void) -{ - return gpio_get_value(TSC2007_IRQGPIO) ? 0 : 1; -} - static struct tsc2007_platform_data tsc2007_info = { .model = 2007, .x_plate_ohms = 180, - .get_pendown_state = ts_get_pendown_state, }; static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = { -- 1.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/6] cpuimx51sd: fix tsc2007 2011-02-25 13:38 ` [PATCH 3/6] cpuimx51sd: fix tsc2007 Eric Bénard @ 2011-02-25 14:04 ` Eric Bénard 0 siblings, 0 replies; 8+ messages in thread From: Eric Bénard @ 2011-02-25 14:04 UTC (permalink / raw) To: linux-arm-kernel - wrong MUX was set before for IRQ - get_pendown_state is no more needed Signed-off-by: Eric B?nard <eric@eukrea.com> --- v2 : use correct define for pad name (with _) arch/arm/mach-mx5/board-cpuimx51sd.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c index 68ecfc0..6ac41d5 100644 --- a/arch/arm/mach-mx5/board-cpuimx51sd.c +++ b/arch/arm/mach-mx5/board-cpuimx51sd.c @@ -110,7 +110,7 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = { /* Touchscreen */ /* IRQ */ - _MX51_PAD_CSI1_D8__GPIO3_12 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP | + _MX51_PAD_GPIO_NAND__GPIO_NAND | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP | PAD_CTL_PKE | PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), }; @@ -119,15 +119,9 @@ static const struct imxuart_platform_data uart_pdata __initconst = { .flags = IMXUART_HAVE_RTSCTS, }; -static int ts_get_pendown_state(void) -{ - return gpio_get_value(TSC2007_IRQGPIO) ? 0 : 1; -} - static struct tsc2007_platform_data tsc2007_info = { .model = 2007, .x_plate_ohms = 180, - .get_pendown_state = ts_get_pendown_state, }; static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = { -- 1.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/6] cpuimx51sd: mcp2515 supports up to 10MHz SPI clock 2011-02-25 13:38 [PATCH 1/6] eukrea_mbimxsd: add audio support Eric Bénard 2011-02-25 13:38 ` [PATCH 2/6] cpuimx51sd: add cpufreq support Eric Bénard 2011-02-25 13:38 ` [PATCH 3/6] cpuimx51sd: fix tsc2007 Eric Bénard @ 2011-02-25 13:38 ` Eric Bénard 2011-02-25 13:38 ` [PATCH 5/6] eukrea_mbimxsd51: add IPU support Eric Bénard 2011-02-25 13:38 ` [PATCH 6/6] eukrea_mbimxsd51: add SD Card detect Eric Bénard 4 siblings, 0 replies; 8+ messages in thread From: Eric Bénard @ 2011-02-25 13:38 UTC (permalink / raw) To: linux-arm-kernel Signed-off-by: Eric B?nard <eric@eukrea.com> --- arch/arm/mach-mx5/board-cpuimx51sd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c index 5b19419..4d4e8e4 100644 --- a/arch/arm/mach-mx5/board-cpuimx51sd.c +++ b/arch/arm/mach-mx5/board-cpuimx51sd.c @@ -237,7 +237,7 @@ static struct mcp251x_platform_data mcp251x_info = { static struct spi_board_info cpuimx51sd_spi_device[] = { { .modalias = "mcp2515", - .max_speed_hz = 6500000, + .max_speed_hz = 10000000, .bus_num = 0, .mode = SPI_MODE_0, .chip_select = 0, -- 1.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/6] eukrea_mbimxsd51: add IPU support 2011-02-25 13:38 [PATCH 1/6] eukrea_mbimxsd: add audio support Eric Bénard ` (2 preceding siblings ...) 2011-02-25 13:38 ` [PATCH 4/6] cpuimx51sd: mcp2515 supports up to 10MHz SPI clock Eric Bénard @ 2011-02-25 13:38 ` Eric Bénard 2011-02-25 14:04 ` [PATCH v2 " Eric Bénard 2011-02-25 13:38 ` [PATCH 6/6] eukrea_mbimxsd51: add SD Card detect Eric Bénard 4 siblings, 1 reply; 8+ messages in thread From: Eric Bénard @ 2011-02-25 13:38 UTC (permalink / raw) To: linux-arm-kernel - TFT lcd or DVI output selection - if a TFT is used, add backight and lcd platform data Signed-off-by: Eric B?nard <eric@eukrea.com> --- arch/arm/mach-mx5/Kconfig | 1 + arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | 131 ++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index ded1d2d..c50089b 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig @@ -109,6 +109,7 @@ config MACH_EUKREA_MBIMXSD51_BASEBOARD bool select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX select IMX_HAVE_PLATFORM_IMX_SSI + select IMX_HAVE_PLATFORM_IMX_IPUV3 help This adds board specific devices that can be found on Eukrea's MBIMXSD evaluation board. diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c index 712061c..fe70e76 100644 --- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c @@ -30,6 +30,11 @@ #include <linux/gpio_keys.h> #include <linux/input.h> #include <linux/i2c.h> +#include <linux/mfd/imx-ipu-v3.h> +#include <linux/fb.h> +#include <linux/delay.h> +#include <video/platform_lcd.h> +#include <linux/backlight.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -41,6 +46,7 @@ #include <mach/imx-uart.h> #include <mach/iomux-mx51.h> #include <mach/audmux.h> +#include <mach/ipu-v3.h> #include "devices-imx51.h" #include "devices.h" @@ -72,10 +78,78 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { MX51_PAD_AUD3_BB_RXD__AUD3_RXD, MX51_PAD_AUD3_BB_CK__AUD3_TXC, MX51_PAD_AUD3_BB_FS__AUD3_TXFS, + /* LCD */ + MX51_PAD_DISP1_DAT0__DISP1_DAT0, + MX51_PAD_DISP1_DAT1__DISP1_DAT1, + MX51_PAD_DISP1_DAT2__DISP1_DAT2, + MX51_PAD_DISP1_DAT3__DISP1_DAT3, + MX51_PAD_DISP1_DAT4__DISP1_DAT4, + MX51_PAD_DISP1_DAT5__DISP1_DAT5, + MX51_PAD_DISP1_DAT6__DISP1_DAT6, + MX51_PAD_DISP1_DAT7__DISP1_DAT7, + MX51_PAD_DISP1_DAT8__DISP1_DAT8, + MX51_PAD_DISP1_DAT9__DISP1_DAT9, + MX51_PAD_DISP1_DAT10__DISP1_DAT10, + MX51_PAD_DISP1_DAT11__DISP1_DAT11, + MX51_PAD_DISP1_DAT12__DISP1_DAT12, + MX51_PAD_DISP1_DAT13__DISP1_DAT13, + MX51_PAD_DISP1_DAT14__DISP1_DAT14, + MX51_PAD_DISP1_DAT15__DISP1_DAT15, + MX51_PAD_DISP1_DAT16__DISP1_DAT16, + MX51_PAD_DISP1_DAT17__DISP1_DAT17, + MX51_PAD_DI1_PIN3__DI1_PIN3, + MX51_PAD_DI1_PIN2__DI1_PIN2, + /* LCD Backlight */ + MX51_PAD_DI1_D1_CS__GPIO3_4, + /* LCD RST */ + MX51_PAD_CSI1_D9__GPIO3_13, }; #define GPIO_LED1 IMX_GPIO_NR(3, 30) #define GPIO_SWITCH1 IMX_GPIO_NR(3, 31) +#define GPIO_LCDRST IMX_GPIO_NR(3, 13) +#define GPIO_LCDBL IMX_GPIO_NR(3, 4) + +static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd, + unsigned int power) +{ + if (power) + gpio_direction_output(GPIO_LCDRST, 1); + else + gpio_direction_output(GPIO_LCDRST, 0); +} + +static struct plat_lcd_data eukrea_mbimxsd_lcd_power_data = { + .set_power = eukrea_mbimxsd_lcd_power_set, +}; + +static struct platform_device eukrea_mbimxsd_lcd_powerdev = { + .name = "platform-lcd", + .dev.platform_data = &eukrea_mbimxsd_lcd_power_data, +}; + +static void eukrea_mbimxsd_bl_set_intensity(int intensity) +{ + if (intensity) + gpio_direction_output(GPIO_LCDBL, 1); + else + gpio_direction_output(GPIO_LCDBL, 0); +} + +static struct generic_bl_info eukrea_mbimxsd_bl_info = { + .name = "eukrea_mbimxsd-bl", + .max_intensity = 0xff, + .default_intensity = 0xff, + .set_bl_intensity = eukrea_mbimxsd_bl_set_intensity, +}; + +static struct platform_device eukrea_mbimxsd_bl_dev = { + .name = "generic-bl", + .id = 1, + .dev = { + .platform_data = &eukrea_mbimxsd_bl_info, + }, +}; static struct gpio_led eukrea_mbimxsd_leds[] = { { @@ -138,6 +212,50 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { }, }; +static struct fb_videomode fb_modedb[] = { + { + .name = "CMO-QVGA", + .refresh = 60, + .xres = 320, + .yres = 240, + .pixclock = KHZ2PICOS(6500), + .left_margin = 68, + .right_margin = 20, + .upper_margin = 15, + .lower_margin = 4, + .hsync_len = 30, + .vsync_len = 3, + .sync = FB_SYNC_OE_LOW_ACT, + .vmode = FB_VMODE_NONINTERLACED, + .flag = 0, + }, +}; + +static struct ipuv3_fb_platform_data eukrea_mbimxsd_fb0_data = { + .interface_pix_fmt = IPU_PIX_FMT_RGB666, + .flags = IMX_IPU_FB_USE_MODEDB, + .modes = fb_modedb, + .num_modes = ARRAY_SIZE(fb_modedb), + .display = 0, +}; + +static struct imx_ipuv3_platform_data ipu_data = { + .fb_head0_platform_data = &eukrea_mbimxsd_fb0_data, +}; + +static int screen_type; + +static int __init eukrea_mbimx51sd_screen_type(char *options) +{ + if (!strcmp(options, "dvi")) + screen_type = 1; + else if (!strcmp(options, "tft")) + screen_type = 0; + + return 0; +} +__setup("screen_type=", eukrea_mbimx51sd_screen_type); + static const struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = { .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, @@ -186,8 +304,21 @@ void __init eukrea_mbimxsd51_baseboard_init(void) gpio_direction_input(GPIO_SWITCH1); gpio_free(GPIO_SWITCH1); + gpio_request(GPIO_LCDRST, "LCDRST"); + gpio_direction_output(GPIO_LCDRST, 0); + gpio_free(GPIO_LCDRST); + gpio_request(GPIO_LCDBL, "LCDBL"); + gpio_direction_output(GPIO_LCDBL, 0); + gpio_free(GPIO_LCDBL); + if (!screen_type) { + platform_device_register(&eukrea_mbimxsd_bl_dev); + platform_device_register(&eukrea_mbimxsd_lcd_powerdev); + } + i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); + + imx51_add_ipuv3(&ipu_data); } -- 1.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 5/6] eukrea_mbimxsd51: add IPU support 2011-02-25 13:38 ` [PATCH 5/6] eukrea_mbimxsd51: add IPU support Eric Bénard @ 2011-02-25 14:04 ` Eric Bénard 0 siblings, 0 replies; 8+ messages in thread From: Eric Bénard @ 2011-02-25 14:04 UTC (permalink / raw) To: linux-arm-kernel - TFT lcd or DVI output selection - if a TFT is used, add backight and lcd platform data Signed-off-by: Eric B?nard <eric@eukrea.com> --- v2 : don't free gpio when lcd is selected arch/arm/mach-mx5/Kconfig | 1 + arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | 132 ++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index ded1d2d..c50089b 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig @@ -109,6 +109,7 @@ config MACH_EUKREA_MBIMXSD51_BASEBOARD bool select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX select IMX_HAVE_PLATFORM_IMX_SSI + select IMX_HAVE_PLATFORM_IMX_IPUV3 help This adds board specific devices that can be found on Eukrea's MBIMXSD evaluation board. diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c index 712061c..778adee 100644 --- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c @@ -30,6 +30,11 @@ #include <linux/gpio_keys.h> #include <linux/input.h> #include <linux/i2c.h> +#include <linux/mfd/imx-ipu-v3.h> +#include <linux/fb.h> +#include <linux/delay.h> +#include <video/platform_lcd.h> +#include <linux/backlight.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -41,6 +46,7 @@ #include <mach/imx-uart.h> #include <mach/iomux-mx51.h> #include <mach/audmux.h> +#include <mach/ipu-v3.h> #include "devices-imx51.h" #include "devices.h" @@ -72,10 +78,78 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { MX51_PAD_AUD3_BB_RXD__AUD3_RXD, MX51_PAD_AUD3_BB_CK__AUD3_TXC, MX51_PAD_AUD3_BB_FS__AUD3_TXFS, + /* LCD */ + MX51_PAD_DISP1_DAT0__DISP1_DAT0, + MX51_PAD_DISP1_DAT1__DISP1_DAT1, + MX51_PAD_DISP1_DAT2__DISP1_DAT2, + MX51_PAD_DISP1_DAT3__DISP1_DAT3, + MX51_PAD_DISP1_DAT4__DISP1_DAT4, + MX51_PAD_DISP1_DAT5__DISP1_DAT5, + MX51_PAD_DISP1_DAT6__DISP1_DAT6, + MX51_PAD_DISP1_DAT7__DISP1_DAT7, + MX51_PAD_DISP1_DAT8__DISP1_DAT8, + MX51_PAD_DISP1_DAT9__DISP1_DAT9, + MX51_PAD_DISP1_DAT10__DISP1_DAT10, + MX51_PAD_DISP1_DAT11__DISP1_DAT11, + MX51_PAD_DISP1_DAT12__DISP1_DAT12, + MX51_PAD_DISP1_DAT13__DISP1_DAT13, + MX51_PAD_DISP1_DAT14__DISP1_DAT14, + MX51_PAD_DISP1_DAT15__DISP1_DAT15, + MX51_PAD_DISP1_DAT16__DISP1_DAT16, + MX51_PAD_DISP1_DAT17__DISP1_DAT17, + MX51_PAD_DI1_PIN3__DI1_PIN3, + MX51_PAD_DI1_PIN2__DI1_PIN2, + /* LCD Backlight */ + MX51_PAD_DI1_D1_CS__GPIO3_4, + /* LCD RST */ + MX51_PAD_CSI1_D9__GPIO3_13, }; #define GPIO_LED1 IMX_GPIO_NR(3, 30) #define GPIO_SWITCH1 IMX_GPIO_NR(3, 31) +#define GPIO_LCDRST IMX_GPIO_NR(3, 13) +#define GPIO_LCDBL IMX_GPIO_NR(3, 4) + +static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd, + unsigned int power) +{ + if (power) + gpio_direction_output(GPIO_LCDRST, 1); + else + gpio_direction_output(GPIO_LCDRST, 0); +} + +static struct plat_lcd_data eukrea_mbimxsd_lcd_power_data = { + .set_power = eukrea_mbimxsd_lcd_power_set, +}; + +static struct platform_device eukrea_mbimxsd_lcd_powerdev = { + .name = "platform-lcd", + .dev.platform_data = &eukrea_mbimxsd_lcd_power_data, +}; + +static void eukrea_mbimxsd_bl_set_intensity(int intensity) +{ + if (intensity) + gpio_direction_output(GPIO_LCDBL, 1); + else + gpio_direction_output(GPIO_LCDBL, 0); +} + +static struct generic_bl_info eukrea_mbimxsd_bl_info = { + .name = "eukrea_mbimxsd-bl", + .max_intensity = 0xff, + .default_intensity = 0xff, + .set_bl_intensity = eukrea_mbimxsd_bl_set_intensity, +}; + +static struct platform_device eukrea_mbimxsd_bl_dev = { + .name = "generic-bl", + .id = 1, + .dev = { + .platform_data = &eukrea_mbimxsd_bl_info, + }, +}; static struct gpio_led eukrea_mbimxsd_leds[] = { { @@ -138,6 +212,50 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { }, }; +static struct fb_videomode fb_modedb[] = { + { + .name = "CMO-QVGA", + .refresh = 60, + .xres = 320, + .yres = 240, + .pixclock = KHZ2PICOS(6500), + .left_margin = 68, + .right_margin = 20, + .upper_margin = 15, + .lower_margin = 4, + .hsync_len = 30, + .vsync_len = 3, + .sync = FB_SYNC_OE_LOW_ACT, + .vmode = FB_VMODE_NONINTERLACED, + .flag = 0, + }, +}; + +static struct ipuv3_fb_platform_data eukrea_mbimxsd_fb0_data = { + .interface_pix_fmt = IPU_PIX_FMT_RGB666, + .flags = IMX_IPU_FB_USE_MODEDB, + .modes = fb_modedb, + .num_modes = ARRAY_SIZE(fb_modedb), + .display = 0, +}; + +static struct imx_ipuv3_platform_data ipu_data = { + .fb_head0_platform_data = &eukrea_mbimxsd_fb0_data, +}; + +static int screen_type; + +static int __init eukrea_mbimx51sd_screen_type(char *options) +{ + if (!strcmp(options, "dvi")) + screen_type = 1; + else if (!strcmp(options, "tft")) + screen_type = 0; + + return 0; +} +__setup("screen_type=", eukrea_mbimx51sd_screen_type); + static const struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = { .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, @@ -186,8 +304,22 @@ void __init eukrea_mbimxsd51_baseboard_init(void) gpio_direction_input(GPIO_SWITCH1); gpio_free(GPIO_SWITCH1); + gpio_request(GPIO_LCDRST, "LCDRST"); + gpio_direction_output(GPIO_LCDRST, 0); + gpio_request(GPIO_LCDBL, "LCDBL"); + gpio_direction_output(GPIO_LCDBL, 0); + if (!screen_type) { + platform_device_register(&eukrea_mbimxsd_bl_dev); + platform_device_register(&eukrea_mbimxsd_lcd_powerdev); + } else { + gpio_free(GPIO_LCDRST); + gpio_free(GPIO_LCDBL); + } + i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); + + imx51_add_ipuv3(&ipu_data); } -- 1.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 6/6] eukrea_mbimxsd51: add SD Card detect 2011-02-25 13:38 [PATCH 1/6] eukrea_mbimxsd: add audio support Eric Bénard ` (3 preceding siblings ...) 2011-02-25 13:38 ` [PATCH 5/6] eukrea_mbimxsd51: add IPU support Eric Bénard @ 2011-02-25 13:38 ` Eric Bénard 4 siblings, 0 replies; 8+ messages in thread From: Eric Bénard @ 2011-02-25 13:38 UTC (permalink / raw) To: linux-arm-kernel Signed-off-by: Eric B?nard <eric@eukrea.com> --- arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c index fe70e76..04927ff 100644 --- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c @@ -103,6 +103,10 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { MX51_PAD_DI1_D1_CS__GPIO3_4, /* LCD RST */ MX51_PAD_CSI1_D9__GPIO3_13, + /* SD1 CD */ + _MX51_PAD_GPIO1_0__SD1_CD | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP | + PAD_CTL_PKE | PAD_CTL_SRE_FAST | + PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), }; #define GPIO_LED1 IMX_GPIO_NR(3, 30) -- 1.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-02-25 14:04 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-02-25 13:38 [PATCH 1/6] eukrea_mbimxsd: add audio support Eric Bénard 2011-02-25 13:38 ` [PATCH 2/6] cpuimx51sd: add cpufreq support Eric Bénard 2011-02-25 13:38 ` [PATCH 3/6] cpuimx51sd: fix tsc2007 Eric Bénard 2011-02-25 14:04 ` [PATCH v2 " Eric Bénard 2011-02-25 13:38 ` [PATCH 4/6] cpuimx51sd: mcp2515 supports up to 10MHz SPI clock Eric Bénard 2011-02-25 13:38 ` [PATCH 5/6] eukrea_mbimxsd51: add IPU support Eric Bénard 2011-02-25 14:04 ` [PATCH v2 " Eric Bénard 2011-02-25 13:38 ` [PATCH 6/6] eukrea_mbimxsd51: add SD Card detect Eric Bénard
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).