diff options
Diffstat (limited to 'arch/arm/mach-mx2')
| -rw-r--r-- | arch/arm/mach-mx2/clock_imx27.c | 8 | ||||
| -rw-r--r-- | arch/arm/mach-mx2/pcm038.c | 96 | ||||
| -rw-r--r-- | arch/arm/mach-mx2/pcm970-baseboard.c | 2 |
3 files changed, 99 insertions, 7 deletions
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c index 4089951acb47..ff5e33298914 100644 --- a/arch/arm/mach-mx2/clock_imx27.c +++ b/arch/arm/mach-mx2/clock_imx27.c | |||
| @@ -638,9 +638,9 @@ static struct clk_lookup lookups[] = { | |||
| 638 | _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk) | 638 | _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk) |
| 639 | _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk) | 639 | _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk) |
| 640 | _REGISTER_CLOCK("mxc-mmc.2", NULL, sdhc3_clk) | 640 | _REGISTER_CLOCK("mxc-mmc.2", NULL, sdhc3_clk) |
| 641 | _REGISTER_CLOCK(NULL, "cspi1", cspi1_clk) | 641 | _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) |
| 642 | _REGISTER_CLOCK(NULL, "cspi2", cspi2_clk) | 642 | _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk) |
| 643 | _REGISTER_CLOCK(NULL, "cspi3", cspi3_clk) | 643 | _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk) |
| 644 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) | 644 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) |
| 645 | _REGISTER_CLOCK(NULL, "csi", csi_clk) | 645 | _REGISTER_CLOCK(NULL, "csi", csi_clk) |
| 646 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk) | 646 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk) |
| @@ -665,7 +665,7 @@ static struct clk_lookup lookups[] = { | |||
| 665 | _REGISTER_CLOCK(NULL, "sahara2", sahara2_clk) | 665 | _REGISTER_CLOCK(NULL, "sahara2", sahara2_clk) |
| 666 | _REGISTER_CLOCK(NULL, "ata", ata_clk) | 666 | _REGISTER_CLOCK(NULL, "ata", ata_clk) |
| 667 | _REGISTER_CLOCK(NULL, "mstick", mstick_clk) | 667 | _REGISTER_CLOCK(NULL, "mstick", mstick_clk) |
| 668 | _REGISTER_CLOCK(NULL, "wdog", wdog_clk) | 668 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk) |
| 669 | _REGISTER_CLOCK(NULL, "gpio", gpio_clk) | 669 | _REGISTER_CLOCK(NULL, "gpio", gpio_clk) |
| 670 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) | 670 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) |
| 671 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) | 671 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) |
diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index ee65dda584cf..906d59b0a7aa 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c | |||
| @@ -23,6 +23,10 @@ | |||
| 23 | #include <linux/mtd/plat-ram.h> | 23 | #include <linux/mtd/plat-ram.h> |
| 24 | #include <linux/mtd/physmap.h> | 24 | #include <linux/mtd/physmap.h> |
| 25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/regulator/machine.h> | ||
| 27 | #include <linux/mfd/mc13783.h> | ||
| 28 | #include <linux/spi/spi.h> | ||
| 29 | #include <linux/irq.h> | ||
| 26 | 30 | ||
| 27 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
| 28 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
| @@ -35,6 +39,7 @@ | |||
| 35 | #include <mach/iomux.h> | 39 | #include <mach/iomux.h> |
| 36 | #include <mach/imx-uart.h> | 40 | #include <mach/imx-uart.h> |
| 37 | #include <mach/mxc_nand.h> | 41 | #include <mach/mxc_nand.h> |
| 42 | #include <mach/spi.h> | ||
| 38 | 43 | ||
| 39 | #include "devices.h" | 44 | #include "devices.h" |
| 40 | 45 | ||
| @@ -78,8 +83,6 @@ static int pcm038_pins[] = { | |||
| 78 | PC6_PF_I2C2_SCL, | 83 | PC6_PF_I2C2_SCL, |
| 79 | /* SPI1 */ | 84 | /* SPI1 */ |
| 80 | PD25_PF_CSPI1_RDY, | 85 | PD25_PF_CSPI1_RDY, |
| 81 | PD27_PF_CSPI1_SS1, | ||
| 82 | PD28_PF_CSPI1_SS0, | ||
| 83 | PD29_PF_CSPI1_SCLK, | 86 | PD29_PF_CSPI1_SCLK, |
| 84 | PD30_PF_CSPI1_MISO, | 87 | PD30_PF_CSPI1_MISO, |
| 85 | PD31_PF_CSPI1_MOSI, | 88 | PD31_PF_CSPI1_MOSI, |
| @@ -196,6 +199,86 @@ static struct i2c_board_info pcm038_i2c_devices[] = { | |||
| 196 | } | 199 | } |
| 197 | }; | 200 | }; |
| 198 | 201 | ||
| 202 | static int pcm038_spi_cs[] = {GPIO_PORTD + 28}; | ||
| 203 | |||
| 204 | static struct spi_imx_master pcm038_spi_0_data = { | ||
| 205 | .chipselect = pcm038_spi_cs, | ||
| 206 | .num_chipselect = ARRAY_SIZE(pcm038_spi_cs), | ||
| 207 | }; | ||
| 208 | |||
| 209 | static struct regulator_consumer_supply sdhc1_consumers[] = { | ||
| 210 | { | ||
| 211 | .dev = &mxc_sdhc_device1.dev, | ||
| 212 | .supply = "sdhc_vcc", | ||
| 213 | }, | ||
| 214 | }; | ||
| 215 | |||
| 216 | static struct regulator_init_data sdhc1_data = { | ||
| 217 | .constraints = { | ||
| 218 | .min_uV = 3000000, | ||
| 219 | .max_uV = 3400000, | ||
| 220 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | | ||
| 221 | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, | ||
| 222 | .valid_modes_mask = REGULATOR_MODE_NORMAL | | ||
| 223 | REGULATOR_MODE_FAST, | ||
| 224 | .always_on = 0, | ||
| 225 | .boot_on = 0, | ||
| 226 | }, | ||
| 227 | .num_consumer_supplies = ARRAY_SIZE(sdhc1_consumers), | ||
| 228 | .consumer_supplies = sdhc1_consumers, | ||
| 229 | }; | ||
| 230 | |||
| 231 | static struct regulator_consumer_supply cam_consumers[] = { | ||
| 232 | { | ||
| 233 | .dev = NULL, | ||
| 234 | .supply = "imx_cam_vcc", | ||
| 235 | }, | ||
| 236 | }; | ||
| 237 | |||
| 238 | static struct regulator_init_data cam_data = { | ||
| 239 | .constraints = { | ||
| 240 | .min_uV = 3000000, | ||
| 241 | .max_uV = 3400000, | ||
| 242 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | | ||
| 243 | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, | ||
| 244 | .valid_modes_mask = REGULATOR_MODE_NORMAL | | ||
| 245 | REGULATOR_MODE_FAST, | ||
| 246 | .always_on = 0, | ||
| 247 | .boot_on = 0, | ||
| 248 | }, | ||
| 249 | .num_consumer_supplies = ARRAY_SIZE(cam_consumers), | ||
| 250 | .consumer_supplies = cam_consumers, | ||
| 251 | }; | ||
| 252 | |||
| 253 | struct mc13783_regulator_init_data pcm038_regulators[] = { | ||
| 254 | { | ||
| 255 | .id = MC13783_REGU_VCAM, | ||
| 256 | .init_data = &cam_data, | ||
| 257 | }, { | ||
| 258 | .id = MC13783_REGU_VMMC1, | ||
| 259 | .init_data = &sdhc1_data, | ||
| 260 | }, | ||
| 261 | }; | ||
| 262 | |||
| 263 | static struct mc13783_platform_data pcm038_pmic = { | ||
| 264 | .regulators = pcm038_regulators, | ||
| 265 | .num_regulators = ARRAY_SIZE(pcm038_regulators), | ||
| 266 | .flags = MC13783_USE_ADC | MC13783_USE_REGULATOR | | ||
| 267 | MC13783_USE_TOUCHSCREEN, | ||
| 268 | }; | ||
| 269 | |||
| 270 | static struct spi_board_info pcm038_spi_board_info[] __initdata = { | ||
| 271 | { | ||
| 272 | .modalias = "mc13783", | ||
| 273 | .irq = IRQ_GPIOB(23), | ||
| 274 | .max_speed_hz = 300000, | ||
| 275 | .bus_num = 0, | ||
| 276 | .chip_select = 0, | ||
| 277 | .platform_data = &pcm038_pmic, | ||
| 278 | .mode = SPI_CS_HIGH, | ||
| 279 | } | ||
| 280 | }; | ||
| 281 | |||
| 199 | static void __init pcm038_init(void) | 282 | static void __init pcm038_init(void) |
| 200 | { | 283 | { |
| 201 | mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins), | 284 | mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins), |
| @@ -219,6 +302,15 @@ static void __init pcm038_init(void) | |||
| 219 | /* PE18 for user-LED D40 */ | 302 | /* PE18 for user-LED D40 */ |
| 220 | mxc_gpio_mode(GPIO_PORTE | 18 | GPIO_GPIO | GPIO_OUT); | 303 | mxc_gpio_mode(GPIO_PORTE | 18 | GPIO_GPIO | GPIO_OUT); |
| 221 | 304 | ||
| 305 | mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT); | ||
| 306 | |||
| 307 | /* MC13783 IRQ */ | ||
| 308 | mxc_gpio_mode(GPIO_PORTB | 23 | GPIO_GPIO | GPIO_IN); | ||
| 309 | |||
| 310 | mxc_register_device(&mxc_spi_device0, &pcm038_spi_0_data); | ||
| 311 | spi_register_board_info(pcm038_spi_board_info, | ||
| 312 | ARRAY_SIZE(pcm038_spi_board_info)); | ||
| 313 | |||
| 222 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 314 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
| 223 | 315 | ||
| 224 | #ifdef CONFIG_MACH_PCM970_BASEBOARD | 316 | #ifdef CONFIG_MACH_PCM970_BASEBOARD |
diff --git a/arch/arm/mach-mx2/pcm970-baseboard.c b/arch/arm/mach-mx2/pcm970-baseboard.c index c261f59b0b4c..3cb7f457e5d0 100644 --- a/arch/arm/mach-mx2/pcm970-baseboard.c +++ b/arch/arm/mach-mx2/pcm970-baseboard.c | |||
| @@ -39,7 +39,6 @@ static int pcm970_pins[] = { | |||
| 39 | PB7_PF_SD2_D3, | 39 | PB7_PF_SD2_D3, |
| 40 | PB8_PF_SD2_CMD, | 40 | PB8_PF_SD2_CMD, |
| 41 | PB9_PF_SD2_CLK, | 41 | PB9_PF_SD2_CLK, |
| 42 | GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN, /* card detect */ | ||
| 43 | /* display */ | 42 | /* display */ |
| 44 | PA5_PF_LSCLK, | 43 | PA5_PF_LSCLK, |
| 45 | PA6_PF_LD0, | 44 | PA6_PF_LD0, |
| @@ -228,6 +227,7 @@ void __init pcm970_baseboard_init(void) | |||
| 228 | "PCM970"); | 227 | "PCM970"); |
| 229 | 228 | ||
| 230 | mxc_register_device(&mxc_fb_device, &pcm038_fb_data); | 229 | mxc_register_device(&mxc_fb_device, &pcm038_fb_data); |
| 230 | mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN); | ||
| 231 | mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); | 231 | mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); |
| 232 | platform_device_register(&pcm970_sja1000); | 232 | platform_device_register(&pcm970_sja1000); |
| 233 | } | 233 | } |
