diff options
| author | Fabio Estevam <fabio.estevam@freescale.com> | 2011-01-03 08:16:39 -0500 |
|---|---|---|
| committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-03 09:11:20 -0500 |
| commit | c67a3e09a5316bb34a14e2751cee719339934235 (patch) | |
| tree | 15fa8e191f5d75f05024b784f57873690d926527 | |
| parent | 711669e5b80b6f2d88f61ed8a9681f83d8cbd201 (diff) | |
ARM: imx/mx27_3ds: Add PMIC support
MX27_3DS board has a MC13783 PMIC connected to the CSPI2 port.
Add support for the PMIC.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| -rw-r--r-- | arch/arm/mach-imx/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/mach-imx/mach-mx27_3ds.c | 77 |
2 files changed, 78 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 0449b80a6092..17d2e608a214 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
| @@ -242,6 +242,7 @@ config MACH_MX27_3DS | |||
| 242 | select IMX_HAVE_PLATFORM_IMX_UART | 242 | select IMX_HAVE_PLATFORM_IMX_UART |
| 243 | select IMX_HAVE_PLATFORM_MXC_EHCI | 243 | select IMX_HAVE_PLATFORM_MXC_EHCI |
| 244 | select IMX_HAVE_PLATFORM_MXC_MMC | 244 | select IMX_HAVE_PLATFORM_MXC_MMC |
| 245 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
| 245 | select MXC_ULPI if USB_ULPI | 246 | select MXC_ULPI if USB_ULPI |
| 246 | help | 247 | help |
| 247 | Include support for MX27PDK platform. This includes specific | 248 | Include support for MX27PDK platform. This includes specific |
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index 0ee7a734832e..6fd0f8f6deb6 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
| @@ -26,6 +26,9 @@ | |||
| 26 | #include <linux/usb/otg.h> | 26 | #include <linux/usb/otg.h> |
| 27 | #include <linux/usb/ulpi.h> | 27 | #include <linux/usb/ulpi.h> |
| 28 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
| 29 | #include <linux/mfd/mc13783.h> | ||
| 30 | #include <linux/spi/spi.h> | ||
| 31 | #include <linux/regulator/machine.h> | ||
| 29 | 32 | ||
| 30 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
| 31 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
| @@ -39,6 +42,7 @@ | |||
| 39 | 42 | ||
| 40 | #define SD1_EN_GPIO (GPIO_PORTB + 25) | 43 | #define SD1_EN_GPIO (GPIO_PORTB + 25) |
| 41 | #define OTG_PHY_RESET_GPIO (GPIO_PORTB + 23) | 44 | #define OTG_PHY_RESET_GPIO (GPIO_PORTB + 23) |
| 45 | #define SPI2_SS0 (GPIO_PORTD + 21) | ||
| 42 | 46 | ||
| 43 | static const int mx27pdk_pins[] __initconst = { | 47 | static const int mx27pdk_pins[] __initconst = { |
| 44 | /* UART1 */ | 48 | /* UART1 */ |
| @@ -87,6 +91,10 @@ static const int mx27pdk_pins[] __initconst = { | |||
| 87 | PE2_PF_USBOTG_DIR, | 91 | PE2_PF_USBOTG_DIR, |
| 88 | PE24_PF_USBOTG_CLK, | 92 | PE24_PF_USBOTG_CLK, |
| 89 | PE25_PF_USBOTG_DATA7, | 93 | PE25_PF_USBOTG_DATA7, |
| 94 | /* CSPI2 */ | ||
| 95 | PD22_PF_CSPI2_SCLK, | ||
| 96 | PD23_PF_CSPI2_MISO, | ||
| 97 | PD24_PF_CSPI2_MOSI, | ||
| 90 | }; | 98 | }; |
| 91 | 99 | ||
| 92 | static const struct imxuart_platform_data uart_pdata __initconst = { | 100 | static const struct imxuart_platform_data uart_pdata __initconst = { |
| @@ -176,6 +184,72 @@ static int __init mx27_3ds_otg_mode(char *options) | |||
| 176 | } | 184 | } |
| 177 | __setup("otg_mode=", mx27_3ds_otg_mode); | 185 | __setup("otg_mode=", mx27_3ds_otg_mode); |
| 178 | 186 | ||
| 187 | /* Regulators */ | ||
| 188 | static struct regulator_consumer_supply vmmc1_consumers[] = { | ||
| 189 | REGULATOR_SUPPLY("lcd_2v8", NULL), | ||
| 190 | }; | ||
| 191 | |||
| 192 | static struct regulator_init_data vmmc1_init = { | ||
| 193 | .constraints = { | ||
| 194 | .min_uV = 2800000, | ||
| 195 | .max_uV = 2800000, | ||
| 196 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
| 197 | }, | ||
| 198 | .num_consumer_supplies = ARRAY_SIZE(vmmc1_consumers), | ||
| 199 | .consumer_supplies = vmmc1_consumers, | ||
| 200 | }; | ||
| 201 | |||
| 202 | static struct regulator_consumer_supply vgen_consumers[] = { | ||
| 203 | REGULATOR_SUPPLY("vdd_lcdio", NULL), | ||
| 204 | }; | ||
| 205 | |||
| 206 | static struct regulator_init_data vgen_init = { | ||
| 207 | .constraints = { | ||
| 208 | .min_uV = 1800000, | ||
| 209 | .max_uV = 1800000, | ||
| 210 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
| 211 | }, | ||
| 212 | .num_consumer_supplies = ARRAY_SIZE(vgen_consumers), | ||
| 213 | .consumer_supplies = vgen_consumers, | ||
| 214 | }; | ||
| 215 | |||
| 216 | static struct mc13783_regulator_init_data mx27_3ds_regulators[] = { | ||
| 217 | { | ||
| 218 | .id = MC13783_REGU_VMMC1, | ||
| 219 | .init_data = &vmmc1_init, | ||
| 220 | }, { | ||
| 221 | .id = MC13783_REGU_VGEN, | ||
| 222 | .init_data = &vgen_init, | ||
| 223 | }, | ||
| 224 | }; | ||
| 225 | |||
| 226 | /* MC13783 */ | ||
| 227 | static struct mc13783_platform_data mc13783_pdata __initdata = { | ||
| 228 | .regulators = mx27_3ds_regulators, | ||
| 229 | .num_regulators = ARRAY_SIZE(mx27_3ds_regulators), | ||
| 230 | .flags = MC13783_USE_REGULATOR, | ||
| 231 | }; | ||
| 232 | |||
| 233 | /* SPI */ | ||
| 234 | static int spi2_internal_chipselect[] = {SPI2_SS0}; | ||
| 235 | |||
| 236 | static const struct spi_imx_master spi2_pdata __initconst = { | ||
| 237 | .chipselect = spi2_internal_chipselect, | ||
| 238 | .num_chipselect = ARRAY_SIZE(spi2_internal_chipselect), | ||
| 239 | }; | ||
| 240 | |||
| 241 | static struct spi_board_info mx27_3ds_spi_devs[] __initdata = { | ||
| 242 | { | ||
| 243 | .modalias = "mc13783", | ||
| 244 | .max_speed_hz = 1000000, | ||
| 245 | .bus_num = 1, | ||
| 246 | .chip_select = 0, /* SS0 */ | ||
| 247 | .platform_data = &mc13783_pdata, | ||
| 248 | .irq = IRQ_GPIOC(14), | ||
| 249 | .mode = SPI_CS_HIGH, | ||
| 250 | }, | ||
| 251 | }; | ||
| 252 | |||
| 179 | 253 | ||
| 180 | static void __init mx27pdk_init(void) | 254 | static void __init mx27pdk_init(void) |
| 181 | { | 255 | { |
| @@ -199,6 +273,9 @@ static void __init mx27pdk_init(void) | |||
| 199 | if (!otg_mode_host) | 273 | if (!otg_mode_host) |
| 200 | imx27_add_fsl_usb2_udc(&otg_device_pdata); | 274 | imx27_add_fsl_usb2_udc(&otg_device_pdata); |
| 201 | 275 | ||
| 276 | imx27_add_spi_imx1(&spi2_pdata); | ||
| 277 | spi_register_board_info(mx27_3ds_spi_devs, | ||
| 278 | ARRAY_SIZE(mx27_3ds_spi_devs)); | ||
| 202 | } | 279 | } |
| 203 | 280 | ||
| 204 | static void __init mx27pdk_timer_init(void) | 281 | static void __init mx27pdk_timer_init(void) |
