diff options
26 files changed, 136 insertions, 447 deletions
diff --git a/arch/arm/mach-omap1/board-h2-mmc.c b/arch/arm/mach-omap1/board-h2-mmc.c index 44d4a966bed9..46098f546824 100644 --- a/arch/arm/mach-omap1/board-h2-mmc.c +++ b/arch/arm/mach-omap1/board-h2-mmc.c | |||
| @@ -26,19 +26,13 @@ | |||
| 26 | static int mmc_set_power(struct device *dev, int slot, int power_on, | 26 | static int mmc_set_power(struct device *dev, int slot, int power_on, |
| 27 | int vdd) | 27 | int vdd) |
| 28 | { | 28 | { |
| 29 | if (power_on) | 29 | gpio_set_value(H2_TPS_GPIO_MMC_PWR_EN, power_on); |
| 30 | gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 1); | ||
| 31 | else | ||
| 32 | gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0); | ||
| 33 | |||
| 34 | return 0; | 30 | return 0; |
| 35 | } | 31 | } |
| 36 | 32 | ||
| 37 | static int mmc_late_init(struct device *dev) | 33 | static int mmc_late_init(struct device *dev) |
| 38 | { | 34 | { |
| 39 | int ret; | 35 | int ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power"); |
| 40 | |||
| 41 | ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power"); | ||
| 42 | if (ret < 0) | 36 | if (ret < 0) |
| 43 | return ret; | 37 | return ret; |
| 44 | 38 | ||
| @@ -47,7 +41,7 @@ static int mmc_late_init(struct device *dev) | |||
| 47 | return ret; | 41 | return ret; |
| 48 | } | 42 | } |
| 49 | 43 | ||
| 50 | static void mmc_shutdown(struct device *dev) | 44 | static void mmc_cleanup(struct device *dev) |
| 51 | { | 45 | { |
| 52 | gpio_free(H2_TPS_GPIO_MMC_PWR_EN); | 46 | gpio_free(H2_TPS_GPIO_MMC_PWR_EN); |
| 53 | } | 47 | } |
| @@ -60,7 +54,7 @@ static void mmc_shutdown(struct device *dev) | |||
| 60 | static struct omap_mmc_platform_data mmc1_data = { | 54 | static struct omap_mmc_platform_data mmc1_data = { |
| 61 | .nr_slots = 1, | 55 | .nr_slots = 1, |
| 62 | .init = mmc_late_init, | 56 | .init = mmc_late_init, |
| 63 | .shutdown = mmc_shutdown, | 57 | .cleanup = mmc_cleanup, |
| 64 | .dma_mask = 0xffffffff, | 58 | .dma_mask = 0xffffffff, |
| 65 | .slots[0] = { | 59 | .slots[0] = { |
| 66 | .set_power = mmc_set_power, | 60 | .set_power = mmc_set_power, |
diff --git a/arch/arm/mach-omap1/board-h3-mmc.c b/arch/arm/mach-omap1/board-h3-mmc.c index 0d8a3c195e2e..5e8877ce35e0 100644 --- a/arch/arm/mach-omap1/board-h3-mmc.c +++ b/arch/arm/mach-omap1/board-h3-mmc.c | |||
| @@ -26,11 +26,7 @@ | |||
| 26 | static int mmc_set_power(struct device *dev, int slot, int power_on, | 26 | static int mmc_set_power(struct device *dev, int slot, int power_on, |
| 27 | int vdd) | 27 | int vdd) |
| 28 | { | 28 | { |
| 29 | if (power_on) | 29 | gpio_set_value(H3_TPS_GPIO_MMC_PWR_EN, power_on); |
| 30 | gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 1); | ||
| 31 | else | ||
| 32 | gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0); | ||
| 33 | |||
| 34 | return 0; | 30 | return 0; |
| 35 | } | 31 | } |
| 36 | 32 | ||
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 4695965114c4..f597968733b4 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
| @@ -39,12 +39,10 @@ | |||
| 39 | #include <asm/mach/flash.h> | 39 | #include <asm/mach/flash.h> |
| 40 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
| 41 | 41 | ||
| 42 | #include <mach/gpioexpander.h> | ||
| 43 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
| 44 | #include <mach/mux.h> | 43 | #include <mach/mux.h> |
| 45 | #include <mach/tc.h> | 44 | #include <mach/tc.h> |
| 46 | #include <mach/nand.h> | 45 | #include <mach/nand.h> |
| 47 | #include <mach/irda.h> | ||
| 48 | #include <mach/usb.h> | 46 | #include <mach/usb.h> |
| 49 | #include <mach/keypad.h> | 47 | #include <mach/keypad.h> |
| 50 | #include <mach/dma.h> | 48 | #include <mach/dma.h> |
| @@ -276,104 +274,6 @@ static struct platform_device h3_kp_device = { | |||
| 276 | .resource = h3_kp_resources, | 274 | .resource = h3_kp_resources, |
| 277 | }; | 275 | }; |
| 278 | 276 | ||
| 279 | |||
| 280 | /* Select between the IrDA and aGPS module | ||
| 281 | */ | ||
| 282 | static int h3_select_irda(struct device *dev, int state) | ||
| 283 | { | ||
| 284 | unsigned char expa; | ||
| 285 | int err = 0; | ||
| 286 | |||
| 287 | if ((err = read_gpio_expa(&expa, 0x26))) { | ||
| 288 | printk(KERN_ERR "Error reading from I/O EXPANDER \n"); | ||
| 289 | return err; | ||
| 290 | } | ||
| 291 | |||
| 292 | /* 'P6' enable/disable IRDA_TX and IRDA_RX */ | ||
| 293 | if (state & IR_SEL) { /* IrDA */ | ||
| 294 | if ((err = write_gpio_expa(expa | 0x40, 0x26))) { | ||
| 295 | printk(KERN_ERR "Error writing to I/O EXPANDER \n"); | ||
| 296 | return err; | ||
| 297 | } | ||
| 298 | } else { | ||
| 299 | if ((err = write_gpio_expa(expa & ~0x40, 0x26))) { | ||
| 300 | printk(KERN_ERR "Error writing to I/O EXPANDER \n"); | ||
| 301 | return err; | ||
| 302 | } | ||
| 303 | } | ||
| 304 | return err; | ||
| 305 | } | ||
| 306 | |||
| 307 | static void set_trans_mode(struct work_struct *work) | ||
| 308 | { | ||
| 309 | struct omap_irda_config *irda_config = | ||
| 310 | container_of(work, struct omap_irda_config, gpio_expa.work); | ||
| 311 | int mode = irda_config->mode; | ||
| 312 | unsigned char expa; | ||
| 313 | int err = 0; | ||
| 314 | |||
| 315 | if ((err = read_gpio_expa(&expa, 0x27)) != 0) { | ||
| 316 | printk(KERN_ERR "Error reading from I/O expander\n"); | ||
| 317 | } | ||
| 318 | |||
| 319 | expa &= ~0x03; | ||
| 320 | |||
| 321 | if (mode & IR_SIRMODE) { | ||
| 322 | expa |= 0x01; | ||
| 323 | } else { /* MIR/FIR */ | ||
| 324 | expa |= 0x03; | ||
| 325 | } | ||
| 326 | |||
| 327 | if ((err = write_gpio_expa(expa, 0x27)) != 0) { | ||
| 328 | printk(KERN_ERR "Error writing to I/O expander\n"); | ||
| 329 | } | ||
| 330 | } | ||
| 331 | |||
| 332 | static int h3_transceiver_mode(struct device *dev, int mode) | ||
| 333 | { | ||
| 334 | struct omap_irda_config *irda_config = dev->platform_data; | ||
| 335 | |||
| 336 | irda_config->mode = mode; | ||
| 337 | cancel_delayed_work(&irda_config->gpio_expa); | ||
| 338 | PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode); | ||
| 339 | schedule_delayed_work(&irda_config->gpio_expa, 0); | ||
| 340 | |||
| 341 | return 0; | ||
| 342 | } | ||
| 343 | |||
| 344 | static struct omap_irda_config h3_irda_data = { | ||
| 345 | .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, | ||
| 346 | .transceiver_mode = h3_transceiver_mode, | ||
| 347 | .select_irda = h3_select_irda, | ||
| 348 | .rx_channel = OMAP_DMA_UART3_RX, | ||
| 349 | .tx_channel = OMAP_DMA_UART3_TX, | ||
| 350 | .dest_start = UART3_THR, | ||
| 351 | .src_start = UART3_RHR, | ||
| 352 | .tx_trigger = 0, | ||
| 353 | .rx_trigger = 0, | ||
| 354 | }; | ||
| 355 | |||
| 356 | static struct resource h3_irda_resources[] = { | ||
| 357 | [0] = { | ||
| 358 | .start = INT_UART3, | ||
| 359 | .end = INT_UART3, | ||
| 360 | .flags = IORESOURCE_IRQ, | ||
| 361 | }, | ||
| 362 | }; | ||
| 363 | |||
| 364 | static u64 irda_dmamask = 0xffffffff; | ||
| 365 | |||
| 366 | static struct platform_device h3_irda_device = { | ||
| 367 | .name = "omapirda", | ||
| 368 | .id = 0, | ||
| 369 | .dev = { | ||
| 370 | .platform_data = &h3_irda_data, | ||
| 371 | .dma_mask = &irda_dmamask, | ||
| 372 | }, | ||
| 373 | .num_resources = ARRAY_SIZE(h3_irda_resources), | ||
| 374 | .resource = h3_irda_resources, | ||
| 375 | }; | ||
| 376 | |||
| 377 | static struct platform_device h3_lcd_device = { | 277 | static struct platform_device h3_lcd_device = { |
| 378 | .name = "lcd_h3", | 278 | .name = "lcd_h3", |
| 379 | .id = -1, | 279 | .id = -1, |
| @@ -395,7 +295,6 @@ static struct platform_device *devices[] __initdata = { | |||
| 395 | &nand_device, | 295 | &nand_device, |
| 396 | &smc91x_device, | 296 | &smc91x_device, |
| 397 | &intlat_device, | 297 | &intlat_device, |
| 398 | &h3_irda_device, | ||
| 399 | &h3_kp_device, | 298 | &h3_kp_device, |
| 400 | &h3_lcd_device, | 299 | &h3_lcd_device, |
| 401 | }; | 300 | }; |
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 7bc7a3cb9c51..d1ed1365319e 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c | |||
| @@ -181,11 +181,7 @@ static struct omap_usb_config nokia770_usb_config __initdata = { | |||
| 181 | static int nokia770_mmc_set_power(struct device *dev, int slot, int power_on, | 181 | static int nokia770_mmc_set_power(struct device *dev, int slot, int power_on, |
| 182 | int vdd) | 182 | int vdd) |
| 183 | { | 183 | { |
| 184 | if (power_on) | 184 | gpio_set_value(NOKIA770_GPIO_MMC_POWER, power_on); |
| 185 | gpio_set_value(NOKIA770_GPIO_MMC_POWER, 1); | ||
| 186 | else | ||
| 187 | gpio_set_value(NOKIA770_GPIO_MMC_POWER, 0); | ||
| 188 | |||
| 189 | return 0; | 185 | return 0; |
| 190 | } | 186 | } |
| 191 | 187 | ||
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c index d040c3f1027f..a2d7814896be 100644 --- a/arch/arm/mach-omap1/mcbsp.c +++ b/arch/arm/mach-omap1/mcbsp.c | |||
| @@ -40,8 +40,8 @@ static void omap1_mcbsp_request(unsigned int id) | |||
| 40 | */ | 40 | */ |
| 41 | if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { | 41 | if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { |
| 42 | if (dsp_use++ == 0) { | 42 | if (dsp_use++ == 0) { |
| 43 | api_clk = clk_get(NULL, "api_clk"); | 43 | api_clk = clk_get(NULL, "api_ck"); |
| 44 | dsp_clk = clk_get(NULL, "dsp_clk"); | 44 | dsp_clk = clk_get(NULL, "dsp_ck"); |
| 45 | if (!IS_ERR(api_clk) && !IS_ERR(dsp_clk)) { | 45 | if (!IS_ERR(api_clk) && !IS_ERR(dsp_clk)) { |
| 46 | clk_enable(api_clk); | 46 | clk_enable(api_clk); |
| 47 | clk_enable(dsp_clk); | 47 | clk_enable(dsp_clk); |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index a0267a9ab466..e7d017cdc438 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
| @@ -33,10 +33,8 @@ | |||
| 33 | 33 | ||
| 34 | #include <mach/control.h> | 34 | #include <mach/control.h> |
| 35 | #include <mach/gpio.h> | 35 | #include <mach/gpio.h> |
| 36 | #include <mach/gpioexpander.h> | ||
| 37 | #include <mach/mux.h> | 36 | #include <mach/mux.h> |
| 38 | #include <mach/usb.h> | 37 | #include <mach/usb.h> |
| 39 | #include <mach/irda.h> | ||
| 40 | #include <mach/board.h> | 38 | #include <mach/board.h> |
| 41 | #include <mach/common.h> | 39 | #include <mach/common.h> |
| 42 | #include <mach/keypad.h> | 40 | #include <mach/keypad.h> |
| @@ -138,98 +136,6 @@ static struct platform_device h4_flash_device = { | |||
| 138 | .resource = &h4_flash_resource, | 136 | .resource = &h4_flash_resource, |
| 139 | }; | 137 | }; |
| 140 | 138 | ||
| 141 | /* Select between the IrDA and aGPS module | ||
| 142 | */ | ||
| 143 | static int h4_select_irda(struct device *dev, int state) | ||
| 144 | { | ||
| 145 | unsigned char expa; | ||
| 146 | int err = 0; | ||
| 147 | |||
| 148 | if ((err = read_gpio_expa(&expa, 0x21))) { | ||
| 149 | printk(KERN_ERR "Error reading from I/O expander\n"); | ||
| 150 | return err; | ||
| 151 | } | ||
| 152 | |||
| 153 | /* 'P6' enable/disable IRDA_TX and IRDA_RX */ | ||
| 154 | if (state & IR_SEL) { /* IrDa */ | ||
| 155 | if ((err = write_gpio_expa(expa | 0x01, 0x21))) { | ||
| 156 | printk(KERN_ERR "Error writing to I/O expander\n"); | ||
| 157 | return err; | ||
| 158 | } | ||
| 159 | } else { | ||
| 160 | if ((err = write_gpio_expa(expa & ~0x01, 0x21))) { | ||
| 161 | printk(KERN_ERR "Error writing to I/O expander\n"); | ||
| 162 | return err; | ||
| 163 | } | ||
| 164 | } | ||
| 165 | return err; | ||
| 166 | } | ||
| 167 | |||
| 168 | static void set_trans_mode(struct work_struct *work) | ||
| 169 | { | ||
| 170 | struct omap_irda_config *irda_config = | ||
| 171 | container_of(work, struct omap_irda_config, gpio_expa.work); | ||
| 172 | int mode = irda_config->mode; | ||
| 173 | unsigned char expa; | ||
| 174 | int err = 0; | ||
| 175 | |||
| 176 | if ((err = read_gpio_expa(&expa, 0x20)) != 0) { | ||
| 177 | printk(KERN_ERR "Error reading from I/O expander\n"); | ||
| 178 | } | ||
| 179 | |||
| 180 | expa &= ~0x01; | ||
| 181 | |||
| 182 | if (!(mode & IR_SIRMODE)) { /* MIR/FIR */ | ||
| 183 | expa |= 0x01; | ||
| 184 | } | ||
| 185 | |||
| 186 | if ((err = write_gpio_expa(expa, 0x20)) != 0) { | ||
| 187 | printk(KERN_ERR "Error writing to I/O expander\n"); | ||
| 188 | } | ||
| 189 | } | ||
| 190 | |||
| 191 | static int h4_transceiver_mode(struct device *dev, int mode) | ||
| 192 | { | ||
| 193 | struct omap_irda_config *irda_config = dev->platform_data; | ||
| 194 | |||
| 195 | irda_config->mode = mode; | ||
| 196 | cancel_delayed_work(&irda_config->gpio_expa); | ||
| 197 | PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode); | ||
| 198 | schedule_delayed_work(&irda_config->gpio_expa, 0); | ||
| 199 | |||
| 200 | return 0; | ||
| 201 | } | ||
| 202 | |||
| 203 | static struct omap_irda_config h4_irda_data = { | ||
| 204 | .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, | ||
| 205 | .transceiver_mode = h4_transceiver_mode, | ||
| 206 | .select_irda = h4_select_irda, | ||
| 207 | .rx_channel = OMAP24XX_DMA_UART3_RX, | ||
| 208 | .tx_channel = OMAP24XX_DMA_UART3_TX, | ||
| 209 | .dest_start = OMAP_UART3_BASE, | ||
| 210 | .src_start = OMAP_UART3_BASE, | ||
| 211 | .tx_trigger = OMAP24XX_DMA_UART3_TX, | ||
| 212 | .rx_trigger = OMAP24XX_DMA_UART3_RX, | ||
| 213 | }; | ||
| 214 | |||
| 215 | static struct resource h4_irda_resources[] = { | ||
| 216 | [0] = { | ||
| 217 | .start = INT_24XX_UART3_IRQ, | ||
| 218 | .end = INT_24XX_UART3_IRQ, | ||
| 219 | .flags = IORESOURCE_IRQ, | ||
| 220 | }, | ||
| 221 | }; | ||
| 222 | |||
| 223 | static struct platform_device h4_irda_device = { | ||
| 224 | .name = "omapirda", | ||
| 225 | .id = -1, | ||
| 226 | .dev = { | ||
| 227 | .platform_data = &h4_irda_data, | ||
| 228 | }, | ||
| 229 | .num_resources = 1, | ||
| 230 | .resource = h4_irda_resources, | ||
| 231 | }; | ||
| 232 | |||
| 233 | static struct omap_kp_platform_data h4_kp_data = { | 139 | static struct omap_kp_platform_data h4_kp_data = { |
| 234 | .rows = 6, | 140 | .rows = 6, |
| 235 | .cols = 7, | 141 | .cols = 7, |
| @@ -255,7 +161,6 @@ static struct platform_device h4_lcd_device = { | |||
| 255 | 161 | ||
| 256 | static struct platform_device *h4_devices[] __initdata = { | 162 | static struct platform_device *h4_devices[] __initdata = { |
| 257 | &h4_flash_device, | 163 | &h4_flash_device, |
| 258 | &h4_irda_device, | ||
| 259 | &h4_kp_device, | 164 | &h4_kp_device, |
| 260 | &h4_lcd_device, | 165 | &h4_lcd_device, |
| 261 | }; | 166 | }; |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 744740ae1b9c..3a7a29d1f9a7 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | #include <mach/nand.h> | 42 | #include <mach/nand.h> |
| 43 | #include <mach/mux.h> | 43 | #include <mach/mux.h> |
| 44 | #include <mach/usb.h> | 44 | #include <mach/usb.h> |
| 45 | #include <mach/timer-gp.h> | ||
| 45 | 46 | ||
| 46 | #include "mmc-twl4030.h" | 47 | #include "mmc-twl4030.h" |
| 47 | 48 | ||
| @@ -186,6 +187,9 @@ static void __init omap3_beagle_init_irq(void) | |||
| 186 | { | 187 | { |
| 187 | omap2_init_common_hw(NULL); | 188 | omap2_init_common_hw(NULL); |
| 188 | omap_init_irq(); | 189 | omap_init_irq(); |
| 190 | #ifdef CONFIG_OMAP_32K_TIMER | ||
| 191 | omap2_gp_clockevent_set_gptimer(12); | ||
| 192 | #endif | ||
| 189 | omap_gpio_init(); | 193 | omap_gpio_init(); |
| 190 | } | 194 | } |
| 191 | 195 | ||
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 3a0daac6c839..374ff63c3eb2 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
| 16 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
| 17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
| 18 | #include <linux/delay.h> | ||
| 19 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
| 20 | 19 | ||
| 21 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c index 1e839c5a28c5..efc59c49341b 100644 --- a/arch/arm/mach-omap2/clock24xx.c +++ b/arch/arm/mach-omap2/clock24xx.c | |||
| @@ -60,12 +60,13 @@ struct omap_clk { | |||
| 60 | }, \ | 60 | }, \ |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | #define CK_243X (1 << 0) | 63 | #define CK_243X RATE_IN_243X |
| 64 | #define CK_242X (1 << 1) | 64 | #define CK_242X RATE_IN_242X |
| 65 | 65 | ||
| 66 | static struct omap_clk omap24xx_clks[] = { | 66 | static struct omap_clk omap24xx_clks[] = { |
| 67 | /* external root sources */ | 67 | /* external root sources */ |
| 68 | CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X | CK_242X), | 68 | CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X | CK_242X), |
| 69 | CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X | CK_242X), | ||
| 69 | CLK(NULL, "osc_ck", &osc_ck, CK_243X | CK_242X), | 70 | CLK(NULL, "osc_ck", &osc_ck, CK_243X | CK_242X), |
| 70 | CLK(NULL, "sys_ck", &sys_ck, CK_243X | CK_242X), | 71 | CLK(NULL, "sys_ck", &sys_ck, CK_243X | CK_242X), |
| 71 | CLK(NULL, "alt_ck", &alt_ck, CK_243X | CK_242X), | 72 | CLK(NULL, "alt_ck", &alt_ck, CK_243X | CK_242X), |
| @@ -711,7 +712,7 @@ int __init omap2_clk_init(void) | |||
| 711 | { | 712 | { |
| 712 | struct prcm_config *prcm; | 713 | struct prcm_config *prcm; |
| 713 | struct omap_clk *c; | 714 | struct omap_clk *c; |
| 714 | u32 clkrate, cpu_mask; | 715 | u32 clkrate; |
| 715 | 716 | ||
| 716 | if (cpu_is_omap242x()) | 717 | if (cpu_is_omap242x()) |
| 717 | cpu_mask = RATE_IN_242X; | 718 | cpu_mask = RATE_IN_242X; |
| @@ -720,21 +721,15 @@ int __init omap2_clk_init(void) | |||
| 720 | 721 | ||
| 721 | clk_init(&omap2_clk_functions); | 722 | clk_init(&omap2_clk_functions); |
| 722 | 723 | ||
| 724 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) | ||
| 725 | clk_init_one(c->lk.clk); | ||
| 726 | |||
| 723 | osc_ck.rate = omap2_osc_clk_recalc(&osc_ck); | 727 | osc_ck.rate = omap2_osc_clk_recalc(&osc_ck); |
| 724 | propagate_rate(&osc_ck); | 728 | propagate_rate(&osc_ck); |
| 725 | sys_ck.rate = omap2_sys_clk_recalc(&sys_ck); | 729 | sys_ck.rate = omap2_sys_clk_recalc(&sys_ck); |
| 726 | propagate_rate(&sys_ck); | 730 | propagate_rate(&sys_ck); |
| 727 | 731 | ||
| 728 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) | 732 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) |
| 729 | clk_init_one(c->lk.clk); | ||
| 730 | |||
| 731 | cpu_mask = 0; | ||
| 732 | if (cpu_is_omap2420()) | ||
| 733 | cpu_mask |= CK_242X; | ||
| 734 | if (cpu_is_omap2430()) | ||
| 735 | cpu_mask |= CK_243X; | ||
| 736 | |||
| 737 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) | ||
| 738 | if (c->cpu & cpu_mask) { | 733 | if (c->cpu & cpu_mask) { |
| 739 | clkdev_add(&c->lk); | 734 | clkdev_add(&c->lk); |
| 740 | clk_register(c->lk.clk); | 735 | clk_register(c->lk.clk); |
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h index 33c3e5b14323..88c5acb40fcf 100644 --- a/arch/arm/mach-omap2/clock24xx.h +++ b/arch/arm/mach-omap2/clock24xx.h | |||
| @@ -625,6 +625,14 @@ static struct clk func_32k_ck = { | |||
| 625 | .clkdm_name = "wkup_clkdm", | 625 | .clkdm_name = "wkup_clkdm", |
| 626 | }; | 626 | }; |
| 627 | 627 | ||
| 628 | static struct clk secure_32k_ck = { | ||
| 629 | .name = "secure_32k_ck", | ||
| 630 | .ops = &clkops_null, | ||
| 631 | .rate = 32768, | ||
| 632 | .flags = RATE_FIXED, | ||
| 633 | .clkdm_name = "wkup_clkdm", | ||
| 634 | }; | ||
| 635 | |||
| 628 | /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ | 636 | /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ |
| 629 | static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */ | 637 | static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */ |
| 630 | .name = "osc_ck", | 638 | .name = "osc_ck", |
| @@ -1790,7 +1798,7 @@ static struct clk gpt12_ick = { | |||
| 1790 | static struct clk gpt12_fck = { | 1798 | static struct clk gpt12_fck = { |
| 1791 | .name = "gpt12_fck", | 1799 | .name = "gpt12_fck", |
| 1792 | .ops = &clkops_omap2_dflt_wait, | 1800 | .ops = &clkops_omap2_dflt_wait, |
| 1793 | .parent = &func_32k_ck, | 1801 | .parent = &secure_32k_ck, |
| 1794 | .clkdm_name = "core_l4_clkdm", | 1802 | .clkdm_name = "core_l4_clkdm", |
| 1795 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1803 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1796 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, | 1804 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, |
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h index 70ec10deb654..6763b8f73028 100644 --- a/arch/arm/mach-omap2/clock34xx.h +++ b/arch/arm/mach-omap2/clock34xx.h | |||
| @@ -2052,7 +2052,7 @@ static struct clk dss_ick = { | |||
| 2052 | 2052 | ||
| 2053 | static struct clk cam_mclk = { | 2053 | static struct clk cam_mclk = { |
| 2054 | .name = "cam_mclk", | 2054 | .name = "cam_mclk", |
| 2055 | .ops = &clkops_omap2_dflt_wait, | 2055 | .ops = &clkops_omap2_dflt, |
| 2056 | .parent = &dpll4_m5x2_ck, | 2056 | .parent = &dpll4_m5x2_ck, |
| 2057 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN), | 2057 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN), |
| 2058 | .enable_bit = OMAP3430_EN_CAM_SHIFT, | 2058 | .enable_bit = OMAP3430_EN_CAM_SHIFT, |
| @@ -2063,7 +2063,7 @@ static struct clk cam_mclk = { | |||
| 2063 | static struct clk cam_ick = { | 2063 | static struct clk cam_ick = { |
| 2064 | /* Handles both L3 and L4 clocks */ | 2064 | /* Handles both L3 and L4 clocks */ |
| 2065 | .name = "cam_ick", | 2065 | .name = "cam_ick", |
| 2066 | .ops = &clkops_omap2_dflt_wait, | 2066 | .ops = &clkops_omap2_dflt, |
| 2067 | .parent = &l4_ick, | 2067 | .parent = &l4_ick, |
| 2068 | .init = &omap2_init_clk_clkdm, | 2068 | .init = &omap2_init_clk_clkdm, |
| 2069 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), | 2069 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), |
| @@ -2074,7 +2074,7 @@ static struct clk cam_ick = { | |||
| 2074 | 2074 | ||
| 2075 | static struct clk csi2_96m_fck = { | 2075 | static struct clk csi2_96m_fck = { |
| 2076 | .name = "csi2_96m_fck", | 2076 | .name = "csi2_96m_fck", |
| 2077 | .ops = &clkops_omap2_dflt_wait, | 2077 | .ops = &clkops_omap2_dflt, |
| 2078 | .parent = &core_96m_fck, | 2078 | .parent = &core_96m_fck, |
| 2079 | .init = &omap2_init_clk_clkdm, | 2079 | .init = &omap2_init_clk_clkdm, |
| 2080 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN), | 2080 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN), |
| @@ -2901,7 +2901,6 @@ static struct clk sr_l4_ick = { | |||
| 2901 | 2901 | ||
| 2902 | /* SECURE_32K_FCK clocks */ | 2902 | /* SECURE_32K_FCK clocks */ |
| 2903 | 2903 | ||
| 2904 | /* XXX This clock no longer exists in 3430 TRM rev F */ | ||
| 2905 | static struct clk gpt12_fck = { | 2904 | static struct clk gpt12_fck = { |
| 2906 | .name = "gpt12_fck", | 2905 | .name = "gpt12_fck", |
| 2907 | .ops = &clkops_null, | 2906 | .ops = &clkops_null, |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index d6b4b2f8722f..496983ade97e 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <mach/board.h> | 25 | #include <mach/board.h> |
| 26 | #include <mach/mux.h> | 26 | #include <mach/mux.h> |
| 27 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
| 28 | #include <mach/eac.h> | ||
| 29 | #include <mach/mmc.h> | 28 | #include <mach/mmc.h> |
| 30 | 29 | ||
| 31 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) | 30 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) |
| @@ -366,38 +365,6 @@ static void omap_init_mcspi(void) | |||
| 366 | static inline void omap_init_mcspi(void) {} | 365 | static inline void omap_init_mcspi(void) {} |
| 367 | #endif | 366 | #endif |
| 368 | 367 | ||
| 369 | #ifdef CONFIG_SND_OMAP24XX_EAC | ||
| 370 | |||
| 371 | #define OMAP2_EAC_BASE 0x48090000 | ||
| 372 | |||
| 373 | static struct resource omap2_eac_resources[] = { | ||
| 374 | { | ||
| 375 | .start = OMAP2_EAC_BASE, | ||
| 376 | .end = OMAP2_EAC_BASE + 0x109, | ||
| 377 | .flags = IORESOURCE_MEM, | ||
| 378 | }, | ||
| 379 | }; | ||
| 380 | |||
| 381 | static struct platform_device omap2_eac_device = { | ||
| 382 | .name = "omap24xx-eac", | ||
| 383 | .id = -1, | ||
| 384 | .num_resources = ARRAY_SIZE(omap2_eac_resources), | ||
| 385 | .resource = omap2_eac_resources, | ||
| 386 | .dev = { | ||
| 387 | .platform_data = NULL, | ||
| 388 | }, | ||
| 389 | }; | ||
| 390 | |||
| 391 | void omap_init_eac(struct eac_platform_data *pdata) | ||
| 392 | { | ||
| 393 | omap2_eac_device.dev.platform_data = pdata; | ||
| 394 | platform_device_register(&omap2_eac_device); | ||
| 395 | } | ||
| 396 | |||
| 397 | #else | ||
| 398 | void omap_init_eac(struct eac_platform_data *pdata) {} | ||
| 399 | #endif | ||
| 400 | |||
| 401 | #ifdef CONFIG_OMAP_SHA1_MD5 | 368 | #ifdef CONFIG_OMAP_SHA1_MD5 |
| 402 | static struct resource sha1_md5_resources[] = { | 369 | static struct resource sha1_md5_resources[] = { |
| 403 | { | 370 | { |
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index 9ba20d985dda..998c5c45587e 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c | |||
| @@ -73,9 +73,9 @@ static int omap_check_spurious(unsigned int irq) | |||
| 73 | u32 sir, spurious; | 73 | u32 sir, spurious; |
| 74 | 74 | ||
| 75 | sir = intc_bank_read_reg(&irq_banks[0], INTC_SIR); | 75 | sir = intc_bank_read_reg(&irq_banks[0], INTC_SIR); |
| 76 | spurious = sir >> 6; | 76 | spurious = sir >> 7; |
| 77 | 77 | ||
| 78 | if (spurious > 1) { | 78 | if (spurious) { |
| 79 | printk(KERN_WARNING "Spurious irq %i: 0x%08x, please flush " | 79 | printk(KERN_WARNING "Spurious irq %i: 0x%08x, please flush " |
| 80 | "posted write for irq %i\n", | 80 | "posted write for irq %i\n", |
| 81 | irq, sir, previous_irq); | 81 | irq, sir, previous_irq); |
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index 1cb2c0909c2b..f36aba12090e 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | * | 3 | * |
| 4 | * OMAP2 GP timer support. | 4 | * OMAP2 GP timer support. |
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2009 Nokia Corporation | ||
| 7 | * | ||
| 6 | * Update to use new clocksource/clockevent layers | 8 | * Update to use new clocksource/clockevent layers |
| 7 | * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com> | 9 | * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com> |
| 8 | * Copyright (C) 2007 MontaVista Software, Inc. | 10 | * Copyright (C) 2007 MontaVista Software, Inc. |
| @@ -36,8 +38,13 @@ | |||
| 36 | #include <asm/mach/time.h> | 38 | #include <asm/mach/time.h> |
| 37 | #include <mach/dmtimer.h> | 39 | #include <mach/dmtimer.h> |
| 38 | 40 | ||
| 41 | /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ | ||
| 42 | #define MAX_GPTIMER_ID 12 | ||
| 43 | |||
| 39 | static struct omap_dm_timer *gptimer; | 44 | static struct omap_dm_timer *gptimer; |
| 40 | static struct clock_event_device clockevent_gpt; | 45 | static struct clock_event_device clockevent_gpt; |
| 46 | static u8 __initdata gptimer_id = 1; | ||
| 47 | static u8 __initdata inited; | ||
| 41 | 48 | ||
| 42 | static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id) | 49 | static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id) |
| 43 | { | 50 | { |
| @@ -95,20 +102,53 @@ static struct clock_event_device clockevent_gpt = { | |||
| 95 | .set_mode = omap2_gp_timer_set_mode, | 102 | .set_mode = omap2_gp_timer_set_mode, |
| 96 | }; | 103 | }; |
| 97 | 104 | ||
| 105 | /** | ||
| 106 | * omap2_gp_clockevent_set_gptimer - set which GPTIMER is used for clockevents | ||
| 107 | * @id: GPTIMER to use (1..MAX_GPTIMER_ID) | ||
| 108 | * | ||
| 109 | * Define the GPTIMER that the system should use for the tick timer. | ||
| 110 | * Meant to be called from board-*.c files in the event that GPTIMER1, the | ||
| 111 | * default, is unsuitable. Returns -EINVAL on error or 0 on success. | ||
| 112 | */ | ||
| 113 | int __init omap2_gp_clockevent_set_gptimer(u8 id) | ||
| 114 | { | ||
| 115 | if (id < 1 || id > MAX_GPTIMER_ID) | ||
| 116 | return -EINVAL; | ||
| 117 | |||
| 118 | BUG_ON(inited); | ||
| 119 | |||
| 120 | gptimer_id = id; | ||
| 121 | |||
| 122 | return 0; | ||
| 123 | } | ||
| 124 | |||
| 98 | static void __init omap2_gp_clockevent_init(void) | 125 | static void __init omap2_gp_clockevent_init(void) |
| 99 | { | 126 | { |
| 100 | u32 tick_rate; | 127 | u32 tick_rate; |
| 128 | int src; | ||
| 129 | |||
| 130 | inited = 1; | ||
| 101 | 131 | ||
| 102 | gptimer = omap_dm_timer_request_specific(1); | 132 | gptimer = omap_dm_timer_request_specific(gptimer_id); |
| 103 | BUG_ON(gptimer == NULL); | 133 | BUG_ON(gptimer == NULL); |
| 104 | 134 | ||
| 105 | #if defined(CONFIG_OMAP_32K_TIMER) | 135 | #if defined(CONFIG_OMAP_32K_TIMER) |
| 106 | omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ); | 136 | src = OMAP_TIMER_SRC_32_KHZ; |
| 107 | #else | 137 | #else |
| 108 | omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_SYS_CLK); | 138 | src = OMAP_TIMER_SRC_SYS_CLK; |
| 139 | WARN(gptimer_id == 12, "WARNING: GPTIMER12 can only use the " | ||
| 140 | "secure 32KiHz clock source\n"); | ||
| 109 | #endif | 141 | #endif |
| 142 | |||
| 143 | if (gptimer_id != 12) | ||
| 144 | WARN(IS_ERR_VALUE(omap_dm_timer_set_source(gptimer, src)), | ||
| 145 | "timer-gp: omap_dm_timer_set_source() failed\n"); | ||
| 146 | |||
| 110 | tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer)); | 147 | tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer)); |
| 111 | 148 | ||
| 149 | pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n", | ||
| 150 | gptimer_id, tick_rate); | ||
| 151 | |||
| 112 | omap2_gp_timer_irq.dev_id = (void *)gptimer; | 152 | omap2_gp_timer_irq.dev_id = (void *)gptimer; |
| 113 | setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq); | 153 | setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq); |
| 114 | omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW); | 154 | omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW); |
| @@ -125,6 +165,8 @@ static void __init omap2_gp_clockevent_init(void) | |||
| 125 | clockevents_register_device(&clockevent_gpt); | 165 | clockevents_register_device(&clockevent_gpt); |
| 126 | } | 166 | } |
| 127 | 167 | ||
| 168 | /* Clocksource code */ | ||
| 169 | |||
| 128 | #ifdef CONFIG_OMAP_32K_TIMER | 170 | #ifdef CONFIG_OMAP_32K_TIMER |
| 129 | /* | 171 | /* |
| 130 | * When 32k-timer is enabled, don't use GPTimer for clocksource | 172 | * When 32k-timer is enabled, don't use GPTimer for clocksource |
diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c index 15e509013def..8df55f40f4c0 100644 --- a/arch/arm/mach-omap2/usb-tusb6010.c +++ b/arch/arm/mach-omap2/usb-tusb6010.c | |||
| @@ -187,7 +187,7 @@ int tusb6010_platform_retime(unsigned is_refclk) | |||
| 187 | unsigned sysclk_ps; | 187 | unsigned sysclk_ps; |
| 188 | int status; | 188 | int status; |
| 189 | 189 | ||
| 190 | if (!refclk_psec) | 190 | if (!refclk_psec || sysclk_ps == 0) |
| 191 | return -ENODEV; | 191 | return -ENODEV; |
| 192 | 192 | ||
| 193 | sysclk_ps = is_refclk ? refclk_psec : TUSB6010_OSCCLK_60; | 193 | sysclk_ps = is_refclk ? refclk_psec : TUSB6010_OSCCLK_60; |
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 2e0614552ac8..29efc279287a 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
| @@ -239,6 +239,13 @@ void recalculate_root_clocks(void) | |||
| 239 | } | 239 | } |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | /** | ||
| 243 | * clk_init_one - initialize any fields in the struct clk before clk init | ||
| 244 | * @clk: struct clk * to initialize | ||
| 245 | * | ||
| 246 | * Initialize any struct clk fields needed before normal clk initialization | ||
| 247 | * can run. No return value. | ||
| 248 | */ | ||
| 242 | void clk_init_one(struct clk *clk) | 249 | void clk_init_one(struct clk *clk) |
| 243 | { | 250 | { |
| 244 | INIT_LIST_HEAD(&clk->children); | 251 | INIT_LIST_HEAD(&clk->children); |
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 21cc0142b97a..7fc8c045ad5d 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
| @@ -760,19 +760,12 @@ void omap_free_dma(int lch) | |||
| 760 | { | 760 | { |
| 761 | unsigned long flags; | 761 | unsigned long flags; |
| 762 | 762 | ||
| 763 | spin_lock_irqsave(&dma_chan_lock, flags); | ||
| 764 | if (dma_chan[lch].dev_id == -1) { | 763 | if (dma_chan[lch].dev_id == -1) { |
| 765 | pr_err("omap_dma: trying to free unallocated DMA channel %d\n", | 764 | pr_err("omap_dma: trying to free unallocated DMA channel %d\n", |
| 766 | lch); | 765 | lch); |
| 767 | spin_unlock_irqrestore(&dma_chan_lock, flags); | ||
| 768 | return; | 766 | return; |
| 769 | } | 767 | } |
| 770 | 768 | ||
| 771 | dma_chan[lch].dev_id = -1; | ||
| 772 | dma_chan[lch].next_lch = -1; | ||
| 773 | dma_chan[lch].callback = NULL; | ||
| 774 | spin_unlock_irqrestore(&dma_chan_lock, flags); | ||
| 775 | |||
| 776 | if (cpu_class_is_omap1()) { | 769 | if (cpu_class_is_omap1()) { |
| 777 | /* Disable all DMA interrupts for the channel. */ | 770 | /* Disable all DMA interrupts for the channel. */ |
| 778 | dma_write(0, CICR(lch)); | 771 | dma_write(0, CICR(lch)); |
| @@ -798,6 +791,12 @@ void omap_free_dma(int lch) | |||
| 798 | dma_write(0, CCR(lch)); | 791 | dma_write(0, CCR(lch)); |
| 799 | omap_clear_dma(lch); | 792 | omap_clear_dma(lch); |
| 800 | } | 793 | } |
| 794 | |||
| 795 | spin_lock_irqsave(&dma_chan_lock, flags); | ||
| 796 | dma_chan[lch].dev_id = -1; | ||
| 797 | dma_chan[lch].next_lch = -1; | ||
| 798 | dma_chan[lch].callback = NULL; | ||
| 799 | spin_unlock_irqrestore(&dma_chan_lock, flags); | ||
| 801 | } | 800 | } |
| 802 | EXPORT_SYMBOL(omap_free_dma); | 801 | EXPORT_SYMBOL(omap_free_dma); |
| 803 | 802 | ||
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index bfd47570cc91..55bb99631292 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
| @@ -238,7 +238,7 @@ static struct omap_dm_timer omap3_dm_timers[] = { | |||
| 238 | { .phys_base = 0x49040000, .irq = INT_24XX_GPTIMER9 }, | 238 | { .phys_base = 0x49040000, .irq = INT_24XX_GPTIMER9 }, |
| 239 | { .phys_base = 0x48086000, .irq = INT_24XX_GPTIMER10 }, | 239 | { .phys_base = 0x48086000, .irq = INT_24XX_GPTIMER10 }, |
| 240 | { .phys_base = 0x48088000, .irq = INT_24XX_GPTIMER11 }, | 240 | { .phys_base = 0x48088000, .irq = INT_24XX_GPTIMER11 }, |
| 241 | { .phys_base = 0x48304000, .irq = INT_24XX_GPTIMER12 }, | 241 | { .phys_base = 0x48304000, .irq = INT_34XX_GPT12_IRQ }, |
| 242 | }; | 242 | }; |
| 243 | 243 | ||
| 244 | static const char *omap3_dm_source_names[] __initdata = { | 244 | static const char *omap3_dm_source_names[] __initdata = { |
| @@ -321,11 +321,9 @@ static void omap_dm_timer_reset(struct omap_dm_timer *timer) | |||
| 321 | l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */ | 321 | l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */ |
| 322 | 322 | ||
| 323 | /* | 323 | /* |
| 324 | * Enable wake-up only for GPT1 on OMAP2 CPUs. | 324 | * Enable wake-up on OMAP2 CPUs. |
| 325 | * FIXME: All timers should have wake-up enabled and clear | ||
| 326 | * PRCM status. | ||
| 327 | */ | 325 | */ |
| 328 | if (cpu_class_is_omap2() && (timer == &dm_timers[0])) | 326 | if (cpu_class_is_omap2()) |
| 329 | l |= 1 << 2; | 327 | l |= 1 << 2; |
| 330 | omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l); | 328 | omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l); |
| 331 | 329 | ||
| @@ -511,7 +509,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_stop); | |||
| 511 | 509 | ||
| 512 | #ifdef CONFIG_ARCH_OMAP1 | 510 | #ifdef CONFIG_ARCH_OMAP1 |
| 513 | 511 | ||
| 514 | void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) | 512 | int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) |
| 515 | { | 513 | { |
| 516 | int n = (timer - dm_timers) << 1; | 514 | int n = (timer - dm_timers) << 1; |
| 517 | u32 l; | 515 | u32 l; |
| @@ -519,23 +517,31 @@ void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) | |||
| 519 | l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n); | 517 | l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n); |
| 520 | l |= source << n; | 518 | l |= source << n; |
| 521 | omap_writel(l, MOD_CONF_CTRL_1); | 519 | omap_writel(l, MOD_CONF_CTRL_1); |
| 520 | |||
| 521 | return 0; | ||
| 522 | } | 522 | } |
| 523 | EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); | 523 | EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); |
| 524 | 524 | ||
| 525 | #else | 525 | #else |
| 526 | 526 | ||
| 527 | void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) | 527 | int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) |
| 528 | { | 528 | { |
| 529 | int ret = -EINVAL; | ||
| 530 | |||
| 529 | if (source < 0 || source >= 3) | 531 | if (source < 0 || source >= 3) |
| 530 | return; | 532 | return -EINVAL; |
| 531 | 533 | ||
| 532 | clk_disable(timer->fclk); | 534 | clk_disable(timer->fclk); |
| 533 | clk_set_parent(timer->fclk, dm_source_clocks[source]); | 535 | ret = clk_set_parent(timer->fclk, dm_source_clocks[source]); |
| 534 | clk_enable(timer->fclk); | 536 | clk_enable(timer->fclk); |
| 535 | 537 | ||
| 536 | /* When the functional clock disappears, too quick writes seem to | 538 | /* |
| 537 | * cause an abort. */ | 539 | * When the functional clock disappears, too quick writes seem |
| 540 | * to cause an abort. XXX Is this still necessary? | ||
| 541 | */ | ||
| 538 | __delay(150000); | 542 | __delay(150000); |
| 543 | |||
| 544 | return ret; | ||
| 539 | } | 545 | } |
| 540 | EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); | 546 | EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); |
| 541 | 547 | ||
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index d3fa41e3d8c5..17d7afe42b83 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
| @@ -758,8 +758,12 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask) | |||
| 758 | 758 | ||
| 759 | /* Workaround for clearing DSP GPIO interrupts to allow retention */ | 759 | /* Workaround for clearing DSP GPIO interrupts to allow retention */ |
| 760 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) | 760 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) |
| 761 | reg = bank->base + OMAP24XX_GPIO_IRQSTATUS2; | ||
| 761 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) | 762 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) |
| 762 | __raw_writel(gpio_mask, bank->base + OMAP24XX_GPIO_IRQSTATUS2); | 763 | __raw_writel(gpio_mask, reg); |
| 764 | |||
| 765 | /* Flush posted write for the irq status to avoid spurious interrupts */ | ||
| 766 | __raw_readl(reg); | ||
| 763 | #endif | 767 | #endif |
| 764 | } | 768 | } |
| 765 | 769 | ||
| @@ -921,13 +925,10 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) | |||
| 921 | case METHOD_MPUIO: | 925 | case METHOD_MPUIO: |
| 922 | case METHOD_GPIO_1610: | 926 | case METHOD_GPIO_1610: |
| 923 | spin_lock_irqsave(&bank->lock, flags); | 927 | spin_lock_irqsave(&bank->lock, flags); |
| 924 | if (enable) { | 928 | if (enable) |
| 925 | bank->suspend_wakeup |= (1 << gpio); | 929 | bank->suspend_wakeup |= (1 << gpio); |
| 926 | enable_irq_wake(bank->irq); | 930 | else |
| 927 | } else { | ||
| 928 | disable_irq_wake(bank->irq); | ||
| 929 | bank->suspend_wakeup &= ~(1 << gpio); | 931 | bank->suspend_wakeup &= ~(1 << gpio); |
| 930 | } | ||
| 931 | spin_unlock_irqrestore(&bank->lock, flags); | 932 | spin_unlock_irqrestore(&bank->lock, flags); |
| 932 | return 0; | 933 | return 0; |
| 933 | #endif | 934 | #endif |
| @@ -940,13 +941,10 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) | |||
| 940 | return -EINVAL; | 941 | return -EINVAL; |
| 941 | } | 942 | } |
| 942 | spin_lock_irqsave(&bank->lock, flags); | 943 | spin_lock_irqsave(&bank->lock, flags); |
| 943 | if (enable) { | 944 | if (enable) |
| 944 | bank->suspend_wakeup |= (1 << gpio); | 945 | bank->suspend_wakeup |= (1 << gpio); |
| 945 | enable_irq_wake(bank->irq); | 946 | else |
| 946 | } else { | ||
| 947 | disable_irq_wake(bank->irq); | ||
| 948 | bank->suspend_wakeup &= ~(1 << gpio); | 947 | bank->suspend_wakeup &= ~(1 << gpio); |
| 949 | } | ||
| 950 | spin_unlock_irqrestore(&bank->lock, flags); | 948 | spin_unlock_irqrestore(&bank->lock, flags); |
| 951 | return 0; | 949 | return 0; |
| 952 | #endif | 950 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/dmtimer.h b/arch/arm/plat-omap/include/mach/dmtimer.h index 6dc703138210..20f1054c0a80 100644 --- a/arch/arm/plat-omap/include/mach/dmtimer.h +++ b/arch/arm/plat-omap/include/mach/dmtimer.h | |||
| @@ -64,7 +64,7 @@ void omap_dm_timer_trigger(struct omap_dm_timer *timer); | |||
| 64 | void omap_dm_timer_start(struct omap_dm_timer *timer); | 64 | void omap_dm_timer_start(struct omap_dm_timer *timer); |
| 65 | void omap_dm_timer_stop(struct omap_dm_timer *timer); | 65 | void omap_dm_timer_stop(struct omap_dm_timer *timer); |
| 66 | 66 | ||
| 67 | void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source); | 67 | int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source); |
| 68 | void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value); | 68 | void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value); |
| 69 | void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, unsigned int value); | 69 | void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, unsigned int value); |
| 70 | void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match); | 70 | void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match); |
diff --git a/arch/arm/plat-omap/include/mach/eac.h b/arch/arm/plat-omap/include/mach/eac.h deleted file mode 100644 index 9e62cf030270..000000000000 --- a/arch/arm/plat-omap/include/mach/eac.h +++ /dev/null | |||
| @@ -1,100 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/plat-omap/include/mach2/eac.h | ||
| 3 | * | ||
| 4 | * Defines for Enhanced Audio Controller | ||
| 5 | * | ||
| 6 | * Contact: Jarkko Nikula <jarkko.nikula@nokia.com> | ||
| 7 | * | ||
| 8 | * Copyright (C) 2006 Nokia Corporation | ||
| 9 | * Copyright (C) 2004 Texas Instruments, Inc. | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or | ||
| 12 | * modify it under the terms of the GNU General Public License | ||
| 13 | * version 2 as published by the Free Software Foundation. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details. | ||
| 19 | * | ||
| 20 | * You should have received a copy of the GNU General Public License | ||
| 21 | * along with this program; if not, write to the Free Software | ||
| 22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 23 | * 02110-1301 USA | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef __ASM_ARM_ARCH_OMAP2_EAC_H | ||
| 28 | #define __ASM_ARM_ARCH_OMAP2_EAC_H | ||
| 29 | |||
| 30 | #include <mach/io.h> | ||
| 31 | #include <mach/hardware.h> | ||
| 32 | #include <asm/irq.h> | ||
| 33 | |||
| 34 | #include <sound/core.h> | ||
| 35 | |||
| 36 | /* master codec clock source */ | ||
| 37 | #define EAC_MCLK_EXT_MASK 0x100 | ||
| 38 | enum eac_mclk_src { | ||
| 39 | EAC_MCLK_INT_11290000, /* internal 96 MHz / 8.5 = 11.29 Mhz */ | ||
| 40 | EAC_MCLK_EXT_11289600 = EAC_MCLK_EXT_MASK, | ||
| 41 | EAC_MCLK_EXT_12288000, | ||
| 42 | EAC_MCLK_EXT_2x11289600, | ||
| 43 | EAC_MCLK_EXT_2x12288000, | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* codec port interface mode */ | ||
| 47 | enum eac_codec_mode { | ||
| 48 | EAC_CODEC_PCM, | ||
| 49 | EAC_CODEC_AC97, | ||
| 50 | EAC_CODEC_I2S_MASTER, /* codec port, I.e. EAC is the master */ | ||
| 51 | EAC_CODEC_I2S_SLAVE, | ||
| 52 | }; | ||
| 53 | |||
| 54 | /* configuration structure for I2S mode */ | ||
| 55 | struct eac_i2s_conf { | ||
| 56 | /* if enabled, then first data slot (left channel) is signaled as | ||
| 57 | * positive level of frame sync EAC.AC_FS */ | ||
| 58 | unsigned polarity_changed_mode:1; | ||
| 59 | /* if enabled, then serial data starts one clock cycle after the | ||
| 60 | * of EAC.AC_FS for first audio slot */ | ||
| 61 | unsigned sync_delay_enable:1; | ||
| 62 | }; | ||
| 63 | |||
| 64 | /* configuration structure for EAC codec port */ | ||
| 65 | struct eac_codec { | ||
| 66 | enum eac_mclk_src mclk_src; | ||
| 67 | |||
| 68 | enum eac_codec_mode codec_mode; | ||
| 69 | union { | ||
| 70 | struct eac_i2s_conf i2s; | ||
| 71 | } codec_conf; | ||
| 72 | |||
| 73 | int default_rate; /* audio sampling rate */ | ||
| 74 | |||
| 75 | int (* set_power)(void *private_data, int dac, int adc); | ||
| 76 | int (* register_controls)(void *private_data, | ||
| 77 | struct snd_card *card); | ||
| 78 | const char *short_name; | ||
| 79 | |||
| 80 | void *private_data; | ||
| 81 | }; | ||
| 82 | |||
| 83 | /* structure for passing platform dependent data to the EAC driver */ | ||
| 84 | struct eac_platform_data { | ||
| 85 | int (* init)(struct device *eac_dev); | ||
| 86 | void (* cleanup)(struct device *eac_dev); | ||
| 87 | /* these callbacks are used to configure & control external MCLK | ||
| 88 | * source. NULL if not used */ | ||
| 89 | int (* enable_ext_clocks)(struct device *eac_dev); | ||
| 90 | void (* disable_ext_clocks)(struct device *eac_dev); | ||
| 91 | }; | ||
| 92 | |||
| 93 | extern void omap_init_eac(struct eac_platform_data *pdata); | ||
| 94 | |||
| 95 | extern int eac_register_codec(struct device *eac_dev, struct eac_codec *codec); | ||
| 96 | extern void eac_unregister_codec(struct device *eac_dev); | ||
| 97 | |||
| 98 | extern int eac_set_mode(struct device *eac_dev, int play, int rec); | ||
| 99 | |||
| 100 | #endif /* __ASM_ARM_ARCH_OMAP2_EAC_H */ | ||
diff --git a/arch/arm/plat-omap/include/mach/gpioexpander.h b/arch/arm/plat-omap/include/mach/gpioexpander.h deleted file mode 100644 index 90444a0d6b1a..000000000000 --- a/arch/arm/plat-omap/include/mach/gpioexpander.h +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/plat-omap/include/mach/gpioexpander.h | ||
| 3 | * | ||
| 4 | * | ||
| 5 | * Copyright (C) 2004 Texas Instruments, Inc. | ||
| 6 | * | ||
| 7 | * This package is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | ||
| 12 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | ||
| 13 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __ASM_ARCH_OMAP_GPIOEXPANDER_H | ||
| 17 | #define __ASM_ARCH_OMAP_GPIOEXPANDER_H | ||
| 18 | |||
| 19 | /* Function Prototypes for GPIO Expander functions */ | ||
| 20 | |||
| 21 | #ifdef CONFIG_GPIOEXPANDER_OMAP | ||
| 22 | int read_gpio_expa(u8 *, int); | ||
| 23 | int write_gpio_expa(u8 , int); | ||
| 24 | #else | ||
| 25 | static inline int read_gpio_expa(u8 *val, int addr) | ||
| 26 | { | ||
| 27 | return 0; | ||
| 28 | } | ||
| 29 | static inline int write_gpio_expa(u8 val, int addr) | ||
| 30 | { | ||
| 31 | return 0; | ||
| 32 | } | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #endif /* __ASM_ARCH_OMAP_GPIOEXPANDER_H */ | ||
diff --git a/arch/arm/plat-omap/include/mach/irda.h b/arch/arm/plat-omap/include/mach/irda.h index 8372a00d8e0b..40f60339d1c6 100644 --- a/arch/arm/plat-omap/include/mach/irda.h +++ b/arch/arm/plat-omap/include/mach/irda.h | |||
| @@ -21,10 +21,6 @@ struct omap_irda_config { | |||
| 21 | int transceiver_cap; | 21 | int transceiver_cap; |
| 22 | int (*transceiver_mode)(struct device *dev, int mode); | 22 | int (*transceiver_mode)(struct device *dev, int mode); |
| 23 | int (*select_irda)(struct device *dev, int state); | 23 | int (*select_irda)(struct device *dev, int state); |
| 24 | /* Very specific to the needs of some platforms (h3,h4) | ||
| 25 | * having calls which can sleep in irda_set_speed. | ||
| 26 | */ | ||
| 27 | struct delayed_work gpio_expa; | ||
| 28 | int rx_channel; | 24 | int rx_channel; |
| 29 | int tx_channel; | 25 | int tx_channel; |
| 30 | unsigned long dest_start; | 26 | unsigned long dest_start; |
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/mach/mmc.h index 4435bd434e17..81d5b36534b3 100644 --- a/arch/arm/plat-omap/include/mach/mmc.h +++ b/arch/arm/plat-omap/include/mach/mmc.h | |||
| @@ -79,7 +79,6 @@ struct omap_mmc_platform_data { | |||
| 79 | 79 | ||
| 80 | /* use the internal clock */ | 80 | /* use the internal clock */ |
| 81 | unsigned internal_clock:1; | 81 | unsigned internal_clock:1; |
| 82 | s16 power_pin; | ||
| 83 | 82 | ||
| 84 | int switch_pin; /* gpio (card detect) */ | 83 | int switch_pin; /* gpio (card detect) */ |
| 85 | int gpio_wp; /* gpio (write protect) */ | 84 | int gpio_wp; /* gpio (write protect) */ |
diff --git a/arch/arm/plat-omap/include/mach/timer-gp.h b/arch/arm/plat-omap/include/mach/timer-gp.h new file mode 100644 index 000000000000..c88d346b59d9 --- /dev/null +++ b/arch/arm/plat-omap/include/mach/timer-gp.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* | ||
| 2 | * OMAP2/3 GPTIMER support.headers | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Nokia Corporation | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_TIMER_GP_H | ||
| 12 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_TIMER_GP_H | ||
| 13 | |||
| 14 | int __init omap2_gp_clockevent_set_gptimer(u8 id); | ||
| 15 | |||
| 16 | #endif | ||
| 17 | |||
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 5570849188cc..bfa25c01c872 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
| @@ -157,8 +157,6 @@ struct mmc_omap_host { | |||
| 157 | struct timer_list dma_timer; | 157 | struct timer_list dma_timer; |
| 158 | unsigned dma_len; | 158 | unsigned dma_len; |
| 159 | 159 | ||
| 160 | short power_pin; | ||
| 161 | |||
| 162 | struct mmc_omap_slot *slots[OMAP_MMC_MAX_SLOTS]; | 160 | struct mmc_omap_slot *slots[OMAP_MMC_MAX_SLOTS]; |
| 163 | struct mmc_omap_slot *current_slot; | 161 | struct mmc_omap_slot *current_slot; |
| 164 | spinlock_t slot_lock; | 162 | spinlock_t slot_lock; |
