* [PATCH 1/6] ARM: mach-imx/mx27_3ds: Use the standard i.MX macro for GPIO numbering
@ 2011-06-20 16:48 Fabio Estevam
2011-06-20 16:48 ` [PATCH 2/6] ARM: mach-imx/mx27_3ds: Fix regulator support Fabio Estevam
0 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2011-06-20 16:48 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
This patch series applies on Sascha's imx-for-2.6.40 tree.
arch/arm/mach-imx/mach-mx27_3ds.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 6e1accf..5b1e0fc 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -42,9 +42,9 @@
#include "devices-imx27.h"
-#define SD1_EN_GPIO (GPIO_PORTB + 25)
-#define OTG_PHY_RESET_GPIO (GPIO_PORTB + 23)
-#define SPI2_SS0 (GPIO_PORTD + 21)
+#define SD1_EN_GPIO IMX_GPIO_NR(2, 25)
+#define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23)
+#define SPI2_SS0 IMX_GPIO_NR(4, 21)
#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTC + 28)
static const int mx27pdk_pins[] __initconst = {
--
1.6.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/6] ARM: mach-imx/mx27_3ds: Fix regulator support
2011-06-20 16:48 [PATCH 1/6] ARM: mach-imx/mx27_3ds: Use the standard i.MX macro for GPIO numbering Fabio Estevam
@ 2011-06-20 16:48 ` Fabio Estevam
2011-06-20 16:48 ` [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support Fabio Estevam
0 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2011-06-20 16:48 UTC (permalink / raw)
To: linux-arm-kernel
Fix the 2.8V (VMMC1) and 1.8V (VGEN) voltage generation on mx27_3ds.
Also configure the IOMUX for the PMIC interrupt pin and for the CSPI chip select that is connected
to the MC13783 PMIC.
In order to get the voltage for the LCD (2.8V and 1.8V) it is also necessary to turn on GPO1 and GPO3
supplies because they are connected to switches that enable these two voltages.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-imx/mach-mx27_3ds.c | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 5b1e0fc..be68e2d 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -46,6 +46,7 @@
#define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23)
#define SPI2_SS0 IMX_GPIO_NR(4, 21)
#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTC + 28)
+#define PMIC_INT IMX_GPIO_NR(3, 14)
static const int mx27pdk_pins[] __initconst = {
/* UART1 */
@@ -193,6 +194,13 @@ static int __init mx27_3ds_otg_mode(char *options)
__setup("otg_mode=", mx27_3ds_otg_mode);
/* Regulators */
+static struct regulator_init_data gpo_init = {
+ .constraints = {
+ .boot_on = 1,
+ .always_on = 1,
+ }
+};
+
static struct regulator_consumer_supply vmmc1_consumers[] = {
REGULATOR_SUPPLY("lcd_2v8", NULL),
};
@@ -201,7 +209,9 @@ static struct regulator_init_data vmmc1_init = {
.constraints = {
.min_uV = 2800000,
.max_uV = 2800000,
- .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+ REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = ARRAY_SIZE(vmmc1_consumers),
.consumer_supplies = vmmc1_consumers,
@@ -215,7 +225,9 @@ static struct regulator_init_data vgen_init = {
.constraints = {
.min_uV = 1800000,
.max_uV = 1800000,
- .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+ REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = ARRAY_SIZE(vgen_consumers),
.consumer_supplies = vgen_consumers,
@@ -228,6 +240,12 @@ static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = {
}, {
.id = MC13783_REG_VGEN,
.init_data = &vgen_init,
+ }, {
+ .id = MC13783_REG_GPO1, /* Turn on 1.8V */
+ .init_data = &gpo_init,
+ }, {
+ .id = MC13783_REG_GPO3, /* Turn on 3.3V */
+ .init_data = &gpo_init,
},
};
@@ -287,6 +305,9 @@ static void __init mx27pdk_init(void)
if (!otg_mode_host)
imx27_add_fsl_usb2_udc(&otg_device_pdata);
+
+ mxc_gpio_mode(SPI2_SS0 | GPIO_GPIO | GPIO_OUT);
+ mxc_gpio_mode(PMIC_INT | GPIO_GPIO | GPIO_IN);
imx27_add_spi_imx1(&spi2_pdata);
spi_register_board_info(mx27_3ds_spi_devs,
--
1.6.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support
2011-06-20 16:48 ` [PATCH 2/6] ARM: mach-imx/mx27_3ds: Fix regulator support Fabio Estevam
@ 2011-06-20 16:48 ` Fabio Estevam
2011-06-20 16:48 ` [PATCH 4/6] ARM: mach-imx/mx27_3ds: Add touchscreen support Fabio Estevam
2011-06-21 12:11 ` [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support Sascha Hauer
0 siblings, 2 replies; 10+ messages in thread
From: Fabio Estevam @ 2011-06-20 16:48 UTC (permalink / raw)
To: linux-arm-kernel
On mx27_3ds board there is a l4f00242t03 LCD that is controlled via CSPI1.
Add support for CSPI1 and LCD.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-imx/Kconfig | 1 +
arch/arm/mach-imx/mach-mx27_3ds.c | 90 +++++++++++++++++++++++++++++++++++++
2 files changed, 91 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 59c97a3..8767c60 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -276,6 +276,7 @@ config MACH_MX27_3DS
select SOC_IMX27
select IMX_HAVE_PLATFORM_FSL_USB2_UDC
select IMX_HAVE_PLATFORM_IMX2_WDT
+ select IMX_HAVE_PLATFORM_IMX_FB
select IMX_HAVE_PLATFORM_IMX_I2C
select IMX_HAVE_PLATFORM_IMX_KEYPAD
select IMX_HAVE_PLATFORM_IMX_UART
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index be68e2d..de99c32 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -29,6 +29,7 @@
#include <linux/mfd/mc13783.h>
#include <linux/spi/spi.h>
#include <linux/regulator/machine.h>
+#include <linux/spi/l4f00242t03.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -47,6 +48,9 @@
#define SPI2_SS0 IMX_GPIO_NR(4, 21)
#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTC + 28)
#define PMIC_INT IMX_GPIO_NR(3, 14)
+#define SPI1_SS0 IMX_GPIO_NR(4, 28)
+#define LCD_RESET IMX_GPIO_NR(1, 3)
+#define LCD_ENABLE IMX_GPIO_NR(1, 31)
static const int mx27pdk_pins[] __initconst = {
/* UART1 */
@@ -95,6 +99,11 @@ static const int mx27pdk_pins[] __initconst = {
PE2_PF_USBOTG_DIR,
PE24_PF_USBOTG_CLK,
PE25_PF_USBOTG_DATA7,
+ /* CSPI1 */
+ PD31_PF_CSPI1_MOSI,
+ PD30_PF_CSPI1_MISO,
+ PD29_PF_CSPI1_SCLK,
+ PD25_PF_CSPI1_RDY,
/* CSPI2 */
PD22_PF_CSPI2_SCLK,
PD23_PF_CSPI2_MISO,
@@ -102,6 +111,29 @@ static const int mx27pdk_pins[] __initconst = {
/* I2C1 */
PD17_PF_I2C_DATA,
PD18_PF_I2C_CLK,
+ /* LCD */
+ PA5_PF_LSCLK,
+ PA6_PF_LD0,
+ PA7_PF_LD1,
+ PA8_PF_LD2,
+ PA9_PF_LD3,
+ PA10_PF_LD4,
+ PA11_PF_LD5,
+ PA12_PF_LD6,
+ PA13_PF_LD7,
+ PA14_PF_LD8,
+ PA15_PF_LD9,
+ PA16_PF_LD10,
+ PA17_PF_LD11,
+ PA18_PF_LD12,
+ PA19_PF_LD13,
+ PA20_PF_LD14,
+ PA21_PF_LD15,
+ PA22_PF_LD16,
+ PA23_PF_LD17,
+ PA28_PF_HSYNC,
+ PA29_PF_VSYNC,
+ PA30_PF_CONTRAST,
};
static const struct imxuart_platform_data uart_pdata __initconst = {
@@ -260,6 +292,13 @@ static struct mc13xxx_platform_data mc13783_pdata = {
};
/* SPI */
+static int spi1_chipselect[] = {SPI1_SS0};
+
+static const struct spi_imx_master spi1_pdata __initconst = {
+ .chipselect = spi1_chipselect,
+ .num_chipselect = ARRAY_SIZE(spi1_chipselect),
+};
+
static int spi2_internal_chipselect[] = {SPI2_SS0};
static const struct spi_imx_master spi2_pdata __initconst = {
@@ -267,6 +306,46 @@ static const struct spi_imx_master spi2_pdata __initconst = {
.num_chipselect = ARRAY_SIZE(spi2_internal_chipselect),
};
+static struct imx_fb_videomode mx27_3ds_modes[] = {
+ { /* 480x640 @ 60 Hz */
+ .mode = {
+ .name = "Epson-VGA",
+ .refresh = 60,
+ .xres = 480,
+ .yres = 640,
+ .pixclock = 41701,
+ .left_margin = 20,
+ .right_margin = 41,
+ .upper_margin = 10,
+ .lower_margin = 5,
+ .hsync_len = 20,
+ .vsync_len = 10,
+ .sync = FB_SYNC_OE_ACT_HIGH |
+ FB_SYNC_CLK_INVERT,
+ .vmode = FB_VMODE_NONINTERLACED,
+ .flag = 0,
+ },
+ .bpp = 16,
+ .pcr = 0xFAC08B82,
+ },
+};
+
+static const struct imx_fb_platform_data mx27_3ds_fb_data __initconst = {
+ .mode = mx27_3ds_modes,
+ .num_modes = ARRAY_SIZE(mx27_3ds_modes),
+ .pwmr = 0x00A903FF,
+ .lscr1 = 0x00120300,
+ .dmacr = 0x00020010,
+};
+
+/* LCD */
+static struct l4f00242t03_pdata mx27_3ds_lcd_pdata = {
+ .reset_gpio = LCD_RESET,
+ .data_enable_gpio = LCD_ENABLE,
+ .core_supply = "lcd_2v8",
+ .io_supply = "vdd_lcdio",
+};
+
static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
{
.modalias = "mc13783",
@@ -276,6 +355,12 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
.platform_data = &mc13783_pdata,
.irq = IRQ_GPIOC(14),
.mode = SPI_CS_HIGH,
+ }, {
+ .modalias = "l4f00242t03",
+ .max_speed_hz = 5000000,
+ .bus_num = 0,
+ .chip_select = 0, /* SS0 */
+ .platform_data = &mx27_3ds_lcd_pdata,
},
};
@@ -308,14 +393,19 @@ static void __init mx27pdk_init(void)
mxc_gpio_mode(SPI2_SS0 | GPIO_GPIO | GPIO_OUT);
mxc_gpio_mode(PMIC_INT | GPIO_GPIO | GPIO_IN);
+ mxc_gpio_mode(SPI1_SS0 | GPIO_GPIO | GPIO_OUT);
+ mxc_gpio_mode(LCD_ENABLE | GPIO_GPIO | GPIO_OUT);
+ mxc_gpio_mode(LCD_RESET | GPIO_GPIO | GPIO_OUT);
imx27_add_spi_imx1(&spi2_pdata);
+ imx27_add_spi_imx0(&spi1_pdata);
spi_register_board_info(mx27_3ds_spi_devs,
ARRAY_SIZE(mx27_3ds_spi_devs));
if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT))
pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n");
imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data);
+ imx27_add_imx_fb(&mx27_3ds_fb_data);
}
static void __init mx27pdk_timer_init(void)
--
1.6.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/6] ARM: mach-imx/mx27_3ds: Add touchscreen support
2011-06-20 16:48 ` [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support Fabio Estevam
@ 2011-06-20 16:48 ` Fabio Estevam
2011-06-20 16:48 ` [PATCH 5/6] ARM: mach-imx/mx27_3ds: Use the standard gpio_to_irq function Fabio Estevam
2011-06-21 12:11 ` [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support Sascha Hauer
1 sibling, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2011-06-20 16:48 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-imx/mach-mx27_3ds.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index de99c32..fb1ba43 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -288,7 +288,7 @@ static struct mc13xxx_platform_data mc13783_pdata = {
.num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
},
- .flags = MC13783_USE_REGULATOR,
+ .flags = MC13783_USE_REGULATOR | MC13783_USE_TOUCHSCREEN,
};
/* SPI */
--
1.6.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/6] ARM: mach-imx/mx27_3ds: Use the standard gpio_to_irq function
2011-06-20 16:48 ` [PATCH 4/6] ARM: mach-imx/mx27_3ds: Add touchscreen support Fabio Estevam
@ 2011-06-20 16:48 ` Fabio Estevam
2011-06-20 16:48 ` [PATCH 6/6] ARM: mach-imx/mx27_3ds: Do not annotate the chip select as internal Fabio Estevam
0 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2011-06-20 16:48 UTC (permalink / raw)
To: linux-arm-kernel
Use the standard gpio_to_irq function instead of a dedicated IRQ_GPIOx macro.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-imx/mach-mx27_3ds.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 3b05aa6..f56bf45 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -51,6 +51,7 @@
#define SPI1_SS0 IMX_GPIO_NR(4, 28)
#define LCD_RESET IMX_GPIO_NR(1, 3)
#define LCD_ENABLE IMX_GPIO_NR(1, 31)
+#define SD1_CD IMX_GPIO_NR(2, 26)
static const int mx27pdk_pins[] __initconst = {
/* UART1 */
@@ -164,13 +165,13 @@ static const struct matrix_keymap_data mx27_3ds_keymap_data __initconst = {
static int mx27_3ds_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
void *data)
{
- return request_irq(IRQ_GPIOB(26), detect_irq, IRQF_TRIGGER_FALLING |
- IRQF_TRIGGER_RISING, "sdhc1-card-detect", data);
+ return request_irq(gpio_to_irq(SD1_CD), detect_irq,
+ IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "sdhc1-card-detect", data);
}
static void mx27_3ds_sdhc1_exit(struct device *dev, void *data)
{
- free_irq(IRQ_GPIOB(26), data);
+ free_irq(gpio_to_irq(SD1_CD), data);
}
static const struct imxmmc_platform_data sdhc1_pdata __initconst = {
@@ -353,7 +354,7 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
.bus_num = 1,
.chip_select = 0, /* SS0 */
.platform_data = &mc13783_pdata,
- .irq = IRQ_GPIOC(14),
+ .irq = gpio_to_irq(PMIC_INT),
.mode = SPI_CS_HIGH,
}, {
.modalias = "l4f00242t03",
--
1.6.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/6] ARM: mach-imx/mx27_3ds: Do not annotate the chip select as internal
2011-06-20 16:48 ` [PATCH 5/6] ARM: mach-imx/mx27_3ds: Use the standard gpio_to_irq function Fabio Estevam
@ 2011-06-20 16:48 ` Fabio Estevam
0 siblings, 0 replies; 10+ messages in thread
From: Fabio Estevam @ 2011-06-20 16:48 UTC (permalink / raw)
To: linux-arm-kernel
On the i.MX SPI driver the chipselect pins can be of the following types:
- internal: when the chipselect pin is used as a dedicated CS pin of the CSPI controller
- GPIO: a generic GPIO can be used as a chipselect funtion
On the mx27_3ds the SPI2 chip select is a GPIO, so don't annotate 'internal' in the chip select
definition.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-imx/mach-mx27_3ds.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 5502611..5921aae 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -300,11 +300,11 @@ static const struct spi_imx_master spi1_pdata __initconst = {
.num_chipselect = ARRAY_SIZE(spi1_chipselect),
};
-static int spi2_internal_chipselect[] = {SPI2_SS0};
+static int spi2_chipselect[] = {SPI2_SS0};
static const struct spi_imx_master spi2_pdata __initconst = {
- .chipselect = spi2_internal_chipselect,
- .num_chipselect = ARRAY_SIZE(spi2_internal_chipselect),
+ .chipselect = spi2_chipselect,
+ .num_chipselect = ARRAY_SIZE(spi2_chipselect),
};
static struct imx_fb_videomode mx27_3ds_modes[] = {
--
1.6.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support
2011-06-20 16:48 ` [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support Fabio Estevam
2011-06-20 16:48 ` [PATCH 4/6] ARM: mach-imx/mx27_3ds: Add touchscreen support Fabio Estevam
@ 2011-06-21 12:11 ` Sascha Hauer
2011-06-21 12:59 ` Fabio Estevam
1 sibling, 1 reply; 10+ messages in thread
From: Sascha Hauer @ 2011-06-21 12:11 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jun 20, 2011 at 01:48:39PM -0300, Fabio Estevam wrote:
> On mx27_3ds board there is a l4f00242t03 LCD that is controlled via CSPI1.
>
> Add support for CSPI1 and LCD.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/mach-imx/Kconfig | 1 +
> arch/arm/mach-imx/mach-mx27_3ds.c | 90 +++++++++++++++++++++++++++++++++++++
> 2 files changed, 91 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 59c97a3..8767c60 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -276,6 +276,7 @@ config MACH_MX27_3DS
> select SOC_IMX27
> select IMX_HAVE_PLATFORM_FSL_USB2_UDC
> select IMX_HAVE_PLATFORM_IMX2_WDT
> + select IMX_HAVE_PLATFORM_IMX_FB
> select IMX_HAVE_PLATFORM_IMX_I2C
> select IMX_HAVE_PLATFORM_IMX_KEYPAD
> select IMX_HAVE_PLATFORM_IMX_UART
> diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
> index be68e2d..de99c32 100644
> --- a/arch/arm/mach-imx/mach-mx27_3ds.c
> +++ b/arch/arm/mach-imx/mach-mx27_3ds.c
> @@ -29,6 +29,7 @@
> #include <linux/mfd/mc13783.h>
> #include <linux/spi/spi.h>
> #include <linux/regulator/machine.h>
> +#include <linux/spi/l4f00242t03.h>
>
> #include <asm/mach-types.h>
> #include <asm/mach/arch.h>
> @@ -47,6 +48,9 @@
> #define SPI2_SS0 IMX_GPIO_NR(4, 21)
> #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTC + 28)
> #define PMIC_INT IMX_GPIO_NR(3, 14)
> +#define SPI1_SS0 IMX_GPIO_NR(4, 28)
> +#define LCD_RESET IMX_GPIO_NR(1, 3)
> +#define LCD_ENABLE IMX_GPIO_NR(1, 31)
>
> static const int mx27pdk_pins[] __initconst = {
> /* UART1 */
> @@ -95,6 +99,11 @@ static const int mx27pdk_pins[] __initconst = {
> PE2_PF_USBOTG_DIR,
> PE24_PF_USBOTG_CLK,
> PE25_PF_USBOTG_DATA7,
> + /* CSPI1 */
> + PD31_PF_CSPI1_MOSI,
> + PD30_PF_CSPI1_MISO,
> + PD29_PF_CSPI1_SCLK,
> + PD25_PF_CSPI1_RDY,
> /* CSPI2 */
> PD22_PF_CSPI2_SCLK,
> PD23_PF_CSPI2_MISO,
> @@ -102,6 +111,29 @@ static const int mx27pdk_pins[] __initconst = {
> /* I2C1 */
> PD17_PF_I2C_DATA,
> PD18_PF_I2C_CLK,
> + /* LCD */
> + PA5_PF_LSCLK,
> + PA6_PF_LD0,
> + PA7_PF_LD1,
> + PA8_PF_LD2,
> + PA9_PF_LD3,
> + PA10_PF_LD4,
> + PA11_PF_LD5,
> + PA12_PF_LD6,
> + PA13_PF_LD7,
> + PA14_PF_LD8,
> + PA15_PF_LD9,
> + PA16_PF_LD10,
> + PA17_PF_LD11,
> + PA18_PF_LD12,
> + PA19_PF_LD13,
> + PA20_PF_LD14,
> + PA21_PF_LD15,
> + PA22_PF_LD16,
> + PA23_PF_LD17,
> + PA28_PF_HSYNC,
> + PA29_PF_VSYNC,
> + PA30_PF_CONTRAST,
> };
>
> static const struct imxuart_platform_data uart_pdata __initconst = {
> @@ -260,6 +292,13 @@ static struct mc13xxx_platform_data mc13783_pdata = {
> };
>
> /* SPI */
> +static int spi1_chipselect[] = {SPI1_SS0};
> +
> +static const struct spi_imx_master spi1_pdata __initconst = {
> + .chipselect = spi1_chipselect,
> + .num_chipselect = ARRAY_SIZE(spi1_chipselect),
> +};
> +
> static int spi2_internal_chipselect[] = {SPI2_SS0};
>
> static const struct spi_imx_master spi2_pdata __initconst = {
> @@ -267,6 +306,46 @@ static const struct spi_imx_master spi2_pdata __initconst = {
> .num_chipselect = ARRAY_SIZE(spi2_internal_chipselect),
> };
>
> +static struct imx_fb_videomode mx27_3ds_modes[] = {
> + { /* 480x640 @ 60 Hz */
> + .mode = {
> + .name = "Epson-VGA",
> + .refresh = 60,
> + .xres = 480,
> + .yres = 640,
> + .pixclock = 41701,
> + .left_margin = 20,
> + .right_margin = 41,
> + .upper_margin = 10,
> + .lower_margin = 5,
> + .hsync_len = 20,
> + .vsync_len = 10,
> + .sync = FB_SYNC_OE_ACT_HIGH |
> + FB_SYNC_CLK_INVERT,
> + .vmode = FB_VMODE_NONINTERLACED,
> + .flag = 0,
> + },
> + .bpp = 16,
> + .pcr = 0xFAC08B82,
> + },
> +};
> +
> +static const struct imx_fb_platform_data mx27_3ds_fb_data __initconst = {
> + .mode = mx27_3ds_modes,
> + .num_modes = ARRAY_SIZE(mx27_3ds_modes),
> + .pwmr = 0x00A903FF,
> + .lscr1 = 0x00120300,
> + .dmacr = 0x00020010,
> +};
> +
> +/* LCD */
> +static struct l4f00242t03_pdata mx27_3ds_lcd_pdata = {
> + .reset_gpio = LCD_RESET,
> + .data_enable_gpio = LCD_ENABLE,
> + .core_supply = "lcd_2v8",
> + .io_supply = "vdd_lcdio",
> +};
> +
> static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
> {
> .modalias = "mc13783",
> @@ -276,6 +355,12 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
> .platform_data = &mc13783_pdata,
> .irq = IRQ_GPIOC(14),
> .mode = SPI_CS_HIGH,
> + }, {
> + .modalias = "l4f00242t03",
> + .max_speed_hz = 5000000,
> + .bus_num = 0,
> + .chip_select = 0, /* SS0 */
> + .platform_data = &mx27_3ds_lcd_pdata,
> },
> };
>
> @@ -308,14 +393,19 @@ static void __init mx27pdk_init(void)
>
> mxc_gpio_mode(SPI2_SS0 | GPIO_GPIO | GPIO_OUT);
> mxc_gpio_mode(PMIC_INT | GPIO_GPIO | GPIO_IN);
> + mxc_gpio_mode(SPI1_SS0 | GPIO_GPIO | GPIO_OUT);
> + mxc_gpio_mode(LCD_ENABLE | GPIO_GPIO | GPIO_OUT);
> + mxc_gpio_mode(LCD_RESET | GPIO_GPIO | GPIO_OUT);
You can add these to the static pin array instead.
Sascha
>
> imx27_add_spi_imx1(&spi2_pdata);
> + imx27_add_spi_imx0(&spi1_pdata);
> spi_register_board_info(mx27_3ds_spi_devs,
> ARRAY_SIZE(mx27_3ds_spi_devs));
>
> if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT))
> pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n");
> imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data);
> + imx27_add_imx_fb(&mx27_3ds_fb_data);
> }
>
> static void __init mx27pdk_timer_init(void)
> --
> 1.6.0.4
>
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support
2011-06-21 12:11 ` [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support Sascha Hauer
@ 2011-06-21 12:59 ` Fabio Estevam
2011-06-21 13:57 ` Fabio Estevam
0 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2011-06-21 12:59 UTC (permalink / raw)
To: linux-arm-kernel
Hi Sascha,
On Tue, Jun 21, 2011 at 9:11 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
...
>> ? ? ? mxc_gpio_mode(SPI2_SS0 | GPIO_GPIO | GPIO_OUT);
>> ? ? ? mxc_gpio_mode(PMIC_INT | GPIO_GPIO | GPIO_IN);
>> + ? ? mxc_gpio_mode(SPI1_SS0 | GPIO_GPIO | GPIO_OUT);
>> + ? ? mxc_gpio_mode(LCD_ENABLE | GPIO_GPIO | GPIO_OUT);
>> + ? ? mxc_gpio_mode(LCD_RESET | GPIO_GPIO | GPIO_OUT);
>
> You can add these to the static pin array instead.
I tried that initially and it caused all the gpio_request calls to fail.
The only way I could make gpio_request to work is when I define the
pin as gpio mode via mxc_gpio_mode.
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support
2011-06-21 12:59 ` Fabio Estevam
@ 2011-06-21 13:57 ` Fabio Estevam
2011-06-21 22:19 ` Sascha Hauer
0 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2011-06-21 13:57 UTC (permalink / raw)
To: linux-arm-kernel
Hi Sascha,
On Tue, Jun 21, 2011 at 9:59 AM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Sascha,
>
> On Tue, Jun 21, 2011 at 9:11 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> ...
>>> ? ? ? mxc_gpio_mode(SPI2_SS0 | GPIO_GPIO | GPIO_OUT);
>>> ? ? ? mxc_gpio_mode(PMIC_INT | GPIO_GPIO | GPIO_IN);
>>> + ? ? mxc_gpio_mode(SPI1_SS0 | GPIO_GPIO | GPIO_OUT);
>>> + ? ? mxc_gpio_mode(LCD_ENABLE | GPIO_GPIO | GPIO_OUT);
>>> + ? ? mxc_gpio_mode(LCD_RESET | GPIO_GPIO | GPIO_OUT);
>>
>> You can add these to the static pin array instead.
>
> I tried that initially and it caused all the gpio_request calls to fail.
>
> The only way I could make gpio_request to work is when I define the
> pin as gpio mode via mxc_gpio_mode.
I managed to put these definitions in the static pin array as you suggested.
In order to do so, I had to fix iomux-v1.c. I will send a v2 version
including the iomux-v1 fix.
Please let me know if you have any other comments in the other patches
so that I can consider them for v2.
Thanks,
Fabio Estevam
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support
2011-06-21 13:57 ` Fabio Estevam
@ 2011-06-21 22:19 ` Sascha Hauer
0 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-06-21 22:19 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jun 21, 2011 at 10:57:14AM -0300, Fabio Estevam wrote:
> Hi Sascha,
>
> On Tue, Jun 21, 2011 at 9:59 AM, Fabio Estevam <festevam@gmail.com> wrote:
> > Hi Sascha,
> >
> > On Tue, Jun 21, 2011 at 9:11 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > ...
> >>> ? ? ? mxc_gpio_mode(SPI2_SS0 | GPIO_GPIO | GPIO_OUT);
> >>> ? ? ? mxc_gpio_mode(PMIC_INT | GPIO_GPIO | GPIO_IN);
> >>> + ? ? mxc_gpio_mode(SPI1_SS0 | GPIO_GPIO | GPIO_OUT);
> >>> + ? ? mxc_gpio_mode(LCD_ENABLE | GPIO_GPIO | GPIO_OUT);
> >>> + ? ? mxc_gpio_mode(LCD_RESET | GPIO_GPIO | GPIO_OUT);
> >>
> >> You can add these to the static pin array instead.
> >
> > I tried that initially and it caused all the gpio_request calls to fail.
> >
> > The only way I could make gpio_request to work is when I define the
> > pin as gpio mode via mxc_gpio_mode.
>
>
> I managed to put these definitions in the static pin array as you suggested.
>
> In order to do so, I had to fix iomux-v1.c. I will send a v2 version
> including the iomux-v1 fix.
>
> Please let me know if you have any other comments in the other patches
> so that I can consider them for v2.
The other patches look fine.
Sascha
>
> Thanks,
>
> Fabio Estevam
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-06-21 22:19 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-20 16:48 [PATCH 1/6] ARM: mach-imx/mx27_3ds: Use the standard i.MX macro for GPIO numbering Fabio Estevam
2011-06-20 16:48 ` [PATCH 2/6] ARM: mach-imx/mx27_3ds: Fix regulator support Fabio Estevam
2011-06-20 16:48 ` [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support Fabio Estevam
2011-06-20 16:48 ` [PATCH 4/6] ARM: mach-imx/mx27_3ds: Add touchscreen support Fabio Estevam
2011-06-20 16:48 ` [PATCH 5/6] ARM: mach-imx/mx27_3ds: Use the standard gpio_to_irq function Fabio Estevam
2011-06-20 16:48 ` [PATCH 6/6] ARM: mach-imx/mx27_3ds: Do not annotate the chip select as internal Fabio Estevam
2011-06-21 12:11 ` [PATCH 3/6] ARM: mach-imx/mx27_3ds: Add LCD support Sascha Hauer
2011-06-21 12:59 ` Fabio Estevam
2011-06-21 13:57 ` Fabio Estevam
2011-06-21 22:19 ` Sascha Hauer
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).