Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6

* 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (26 commits)
OMAP2 clock: dynamically allocate CPUFreq frequency table
OMAP clock/CPUFreq: add clk_exit_cpufreq_table()
OMAP2xxx OPP: clean up comments in OPP data
OMAP2xxx clock: clk2xxx.c doesn't compile if CPUFREQ is enabled
OMAP1 clock: remove __initdata from struct clk_functions to prevent crash
OMAP1 clock: Add missing clocks for OMAP 7xx
OMAP clock: remove incorrect EXPORT_SYMBOL()s
OMAP3 clock: Add capability to change rate of dpll4_m5_ck
OMAP3 clock: McBSP 2, 3, 4 functional clock parent is PER_96M_FCLK, not CORE_96M_FCLK
OMAP3: clock: add clockdomains for UART1 & 2
OMAP2420 IO mapping: move IVA mapping virtual address out of vmalloc space
OMAP2xxx IO mapping: mark DSP mappings as being 2420-only
ARM: OMAP3: PM: Fix the Invalid CM_CLKSTCTRL reg access.
OMAP2: remove duplicated #include
omap3: EVM: Choose OMAP_PACKAGE_CBB
omap3: Fix booting if package is uninitialized
omap3: add missing parentheses
omap3: add missing parentheses
omap2/3: ZOOM: Correcting key mapping for few keys
omap2/3: make serial_in_override() address the right uart port
...

+296 -111
+7 -3
arch/arm/mach-omap1/clock_data.c
··· 599 599 static struct omap_clk omap_clks[] = { 600 600 /* non-ULPD clocks */ 601 601 CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310 | CK_7XX), 602 - CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310), 602 + CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310 | CK_7XX), 603 603 /* CK_GEN1 clocks */ 604 604 CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX), 605 605 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX), ··· 627 627 CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX), 628 628 CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310), 629 629 CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX), 630 - CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310), 630 + CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX), 631 631 CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310), 632 632 CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX), 633 633 CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX), ··· 658 658 CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX), 659 659 CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX), 660 660 CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX), 661 + CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX), 662 + CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX), 663 + CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX), 664 + CLK("omap1_spi100k.2", "ick", &dummy_ck, CK_7XX), 661 665 CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310), 662 666 CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX), 663 667 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310), ··· 678 674 * init 679 675 */ 680 676 681 - static struct clk_functions omap1_clk_functions __initdata = { 677 + static struct clk_functions omap1_clk_functions = { 682 678 .clk_enable = omap1_clk_enable, 683 679 .clk_disable = omap1_clk_disable, 684 680 .clk_round_rate = omap1_clk_round_rate,
+35
arch/arm/mach-omap1/devices.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/io.h> 17 + #include <linux/spi/spi.h> 17 18 18 19 #include <mach/hardware.h> 19 20 #include <asm/mach/map.h> ··· 24 23 #include <plat/mux.h> 25 24 #include <mach/gpio.h> 26 25 #include <plat/mmc.h> 26 + #include <plat/omap7xx.h> 27 27 28 28 /*-------------------------------------------------------------------------*/ 29 29 ··· 198 196 199 197 /*-------------------------------------------------------------------------*/ 200 198 199 + /* OMAP7xx SPI support */ 200 + #if defined(CONFIG_SPI_OMAP_100K) || defined(CONFIG_SPI_OMAP_100K_MODULE) 201 + 202 + struct platform_device omap_spi1 = { 203 + .name = "omap1_spi100k", 204 + .id = 1, 205 + }; 206 + 207 + struct platform_device omap_spi2 = { 208 + .name = "omap1_spi100k", 209 + .id = 2, 210 + }; 211 + 212 + static void omap_init_spi100k(void) 213 + { 214 + omap_spi1.dev.platform_data = ioremap(OMAP7XX_SPI1_BASE, 0x7ff); 215 + if (omap_spi1.dev.platform_data) 216 + platform_device_register(&omap_spi1); 217 + 218 + omap_spi2.dev.platform_data = ioremap(OMAP7XX_SPI2_BASE, 0x7ff); 219 + if (omap_spi2.dev.platform_data) 220 + platform_device_register(&omap_spi2); 221 + } 222 + 223 + #else 224 + static inline void omap_init_spi100k(void) 225 + { 226 + } 227 + #endif 228 + 229 + /*-------------------------------------------------------------------------*/ 230 + 201 231 #if defined(CONFIG_OMAP_STI) 202 232 203 233 #define OMAP1_STI_BASE 0xfffea000 ··· 297 263 298 264 omap_init_mbox(); 299 265 omap_init_rtc(); 266 + omap_init_spi100k(); 300 267 omap_init_sti(); 301 268 302 269 return 0;
+8
arch/arm/mach-omap1/mux.c
··· 62 62 /* I2C interface */ 63 63 MUX_CFG_7XX("I2C_7XX_SCL", 5, 1, 0, 0, 1, 0) 64 64 MUX_CFG_7XX("I2C_7XX_SDA", 5, 5, 0, 0, 1, 0) 65 + 66 + /* SPI pins */ 67 + MUX_CFG_7XX("SPI_7XX_1", 6, 5, 4, 4, 1, 0) 68 + MUX_CFG_7XX("SPI_7XX_2", 6, 9, 4, 8, 1, 0) 69 + MUX_CFG_7XX("SPI_7XX_3", 6, 13, 4, 12, 1, 0) 70 + MUX_CFG_7XX("SPI_7XX_4", 6, 17, 4, 16, 1, 0) 71 + MUX_CFG_7XX("SPI_7XX_5", 8, 25, 0, 24, 0, 0) 72 + MUX_CFG_7XX("SPI_7XX_6", 9, 5, 0, 4, 0, 0) 65 73 }; 66 74 #define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins) 67 75 #else
+1
arch/arm/mach-omap2/Kconfig
··· 80 80 config MACH_OMAP3EVM 81 81 bool "OMAP 3530 EVM board" 82 82 depends on ARCH_OMAP3 && ARCH_OMAP34XX 83 + select OMAP_PACKAGE_CBB 83 84 84 85 config MACH_OMAP3517EVM 85 86 bool "OMAP3517/ AM3517 EVM board"
+4 -4
arch/arm/mach-omap2/board-zoom-peripherals.c
··· 63 63 KEY(5, 1, KEY_H), 64 64 KEY(5, 2, KEY_J), 65 65 KEY(5, 3, KEY_F3), 66 + KEY(5, 4, KEY_UNKNOWN), 66 67 KEY(5, 5, KEY_VOLUMEDOWN), 67 68 KEY(5, 6, KEY_M), 68 - KEY(5, 7, KEY_ENTER), 69 + KEY(5, 7, KEY_RIGHT), 69 70 KEY(6, 0, KEY_Q), 70 71 KEY(6, 1, KEY_A), 71 72 KEY(6, 2, KEY_N), 72 73 KEY(6, 3, KEY_BACKSPACE), 73 74 KEY(6, 6, KEY_P), 74 - KEY(6, 7, KEY_SELECT), 75 + KEY(6, 7, KEY_UP), 75 76 KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */ 76 77 KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */ 77 78 KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */ 78 79 KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */ 79 - KEY(7, 5, KEY_RIGHT), 80 - KEY(7, 6, KEY_UP), 80 + KEY(7, 6, KEY_SELECT), 81 81 KEY(7, 7, KEY_DOWN) 82 82 }; 83 83
+48 -9
arch/arm/mach-omap2/clock2xxx.c
··· 449 449 #ifdef CONFIG_CPU_FREQ 450 450 /* 451 451 * Walk PRCM rate table and fillout cpufreq freq_table 452 + * XXX This should be replaced by an OPP layer in the near future 452 453 */ 453 - static struct cpufreq_frequency_table freq_table[ARRAY_SIZE(rate_table)]; 454 + static struct cpufreq_frequency_table *freq_table; 454 455 455 456 void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) 456 457 { 457 - struct prcm_config *prcm; 458 + const struct prcm_config *prcm; 459 + long sys_ck_rate; 458 460 int i = 0; 461 + int tbl_sz = 0; 462 + 463 + sys_ck_rate = clk_get_rate(sclk); 459 464 460 465 for (prcm = rate_table; prcm->mpu_speed; prcm++) { 461 466 if (!(prcm->flags & cpu_mask)) 462 467 continue; 463 - if (prcm->xtal_speed != sys_ck.rate) 468 + if (prcm->xtal_speed != sys_ck_rate) 469 + continue; 470 + 471 + /* don't put bypass rates in table */ 472 + if (prcm->dpll_speed == prcm->xtal_speed) 473 + continue; 474 + 475 + tbl_sz++; 476 + } 477 + 478 + /* 479 + * XXX Ensure that we're doing what CPUFreq expects for this error 480 + * case and the following one 481 + */ 482 + if (tbl_sz == 0) { 483 + pr_warning("%s: no matching entries in rate_table\n", 484 + __func__); 485 + return; 486 + } 487 + 488 + /* Include the CPUFREQ_TABLE_END terminator entry */ 489 + tbl_sz++; 490 + 491 + freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) * tbl_sz, 492 + GFP_ATOMIC); 493 + if (!freq_table) { 494 + pr_err("%s: could not kzalloc frequency table\n", __func__); 495 + return; 496 + } 497 + 498 + for (prcm = rate_table; prcm->mpu_speed; prcm++) { 499 + if (!(prcm->flags & cpu_mask)) 500 + continue; 501 + if (prcm->xtal_speed != sys_ck_rate) 464 502 continue; 465 503 466 504 /* don't put bypass rates in table */ ··· 510 472 i++; 511 473 } 512 474 513 - if (i == 0) { 514 - printk(KERN_WARNING "%s: failed to initialize frequency " 515 - "table\n", __func__); 516 - return; 517 - } 518 - 519 475 freq_table[i].index = i; 520 476 freq_table[i].frequency = CPUFREQ_TABLE_END; 521 477 522 478 *table = &freq_table[0]; 523 479 } 480 + 481 + void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) 482 + { 483 + kfree(freq_table); 484 + } 485 + 524 486 #endif 525 487 526 488 struct clk_functions omap2_clk_functions = { ··· 532 494 .clk_disable_unused = omap2_clk_disable_unused, 533 495 #ifdef CONFIG_CPU_FREQ 534 496 .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table, 497 + .clk_exit_cpufreq_table = omap2_clk_exit_cpufreq_table, 535 498 #endif 536 499 }; 537 500
-1
arch/arm/mach-omap2/clock34xx.c
··· 34 34 #include <asm/div64.h> 35 35 #include <asm/clkdev.h> 36 36 37 - #include <plat/sdrc.h> 38 37 #include "clock.h" 39 38 #include "clock34xx.h" 40 39 #include "sdrc.h"
+5 -1
arch/arm/mach-omap2/clock34xx_data.c
··· 776 776 .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, 777 777 .clksel = div16_dpll4_clksel, 778 778 .clkdm_name = "dpll4_clkdm", 779 + .set_rate = &omap2_clksel_set_rate, 780 + .round_rate = &omap2_clksel_round_rate, 779 781 .recalc = &omap2_clksel_recalc, 780 782 }; 781 783 ··· 1502 1500 .parent = &core_48m_fck, 1503 1501 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1504 1502 .enable_bit = OMAP3430_EN_UART2_SHIFT, 1503 + .clkdm_name = "core_l4_clkdm", 1505 1504 .recalc = &followparent_recalc, 1506 1505 }; 1507 1506 ··· 1512 1509 .parent = &core_48m_fck, 1513 1510 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1514 1511 .enable_bit = OMAP3430_EN_UART1_SHIFT, 1512 + .clkdm_name = "core_l4_clkdm", 1515 1513 .recalc = &followparent_recalc, 1516 1514 }; 1517 1515 ··· 2749 2745 }; 2750 2746 2751 2747 static const struct clksel mcbsp_234_clksel[] = { 2752 - { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates }, 2748 + { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates }, 2753 2749 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, 2754 2750 { .parent = NULL } 2755 2751 };
+2 -2
arch/arm/mach-omap2/clockdomain.c
··· 559 559 * downstream clocks for debugging purposes? 560 560 */ 561 561 562 - if (!clkdm || !clk) 562 + if (!clkdm || !clk || !clkdm->clktrctrl_mask) 563 563 return -EINVAL; 564 564 565 565 if (atomic_inc_return(&clkdm->usecount) > 1) ··· 610 610 * downstream clocks for debugging purposes? 611 611 */ 612 612 613 - if (!clkdm || !clk) 613 + if (!clkdm || !clk || !clkdm->clktrctrl_mask) 614 614 return -EINVAL; 615 615 616 616 #ifdef DEBUG
+9 -10
arch/arm/mach-omap2/io.c
··· 33 33 #include <plat/sdrc.h> 34 34 #include <plat/gpmc.h> 35 35 #include <plat/serial.h> 36 - #include <plat/mux.h> 37 36 #include <plat/vram.h> 38 37 39 38 #include "clock.h" ··· 72 73 #ifdef CONFIG_ARCH_OMAP2420 73 74 static struct map_desc omap242x_io_desc[] __initdata = { 74 75 { 75 - .virtual = DSP_MEM_24XX_VIRT, 76 - .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS), 77 - .length = DSP_MEM_24XX_SIZE, 76 + .virtual = DSP_MEM_2420_VIRT, 77 + .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS), 78 + .length = DSP_MEM_2420_SIZE, 78 79 .type = MT_DEVICE 79 80 }, 80 81 { 81 - .virtual = DSP_IPI_24XX_VIRT, 82 - .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS), 83 - .length = DSP_IPI_24XX_SIZE, 82 + .virtual = DSP_IPI_2420_VIRT, 83 + .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS), 84 + .length = DSP_IPI_2420_SIZE, 84 85 .type = MT_DEVICE 85 86 }, 86 87 { 87 - .virtual = DSP_MMU_24XX_VIRT, 88 - .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS), 89 - .length = DSP_MMU_24XX_SIZE, 88 + .virtual = DSP_MMU_2420_VIRT, 89 + .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS), 90 + .length = DSP_MMU_2420_SIZE, 90 91 .type = MT_DEVICE 91 92 }, 92 93 };
+4 -2
arch/arm/mach-omap2/mux.c
··· 994 994 } 995 995 996 996 #ifdef CONFIG_OMAP_MUX 997 - omap_mux_package_fixup(package_subset, superset); 998 - omap_mux_package_init_balls(package_balls, superset); 997 + if (package_subset) 998 + omap_mux_package_fixup(package_subset, superset); 999 + if (package_balls) 1000 + omap_mux_package_init_balls(package_balls, superset); 999 1001 omap_mux_set_cmdline_signals(); 1000 1002 omap_mux_set_board_signals(board_mux); 1001 1003 #endif
+20 -18
arch/arm/mach-omap2/opp2420_data.c
··· 9 9 * The OMAP2 processor can be run at several discrete 'PRCM configurations'. 10 10 * These configurations are characterized by voltage and speed for clocks. 11 11 * The device is only validated for certain combinations. One way to express 12 - * these combinations is via the 'ratio's' which the clocks operate with 12 + * these combinations is via the 'ratios' which the clocks operate with 13 13 * respect to each other. These ratio sets are for a given voltage/DPLL 14 - * setting. All configurations can be described by a DPLL setting and a ratio 15 - * There are 3 ratio sets for the 2430 and X ratio sets for 2420. 16 - * 17 - * 2430 differs from 2420 in that there are no more phase synchronizers used. 18 - * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs 19 - * 2430 (iva2.1, NOdsp, mdm) 14 + * setting. All configurations can be described by a DPLL setting and a ratio. 20 15 * 21 16 * XXX Missing voltage data. 17 + * XXX Missing 19.2MHz sys_clk rate sets (needed for N800/N810) 22 18 * 23 19 * THe format described in this file is deprecated. Once a reasonable 24 20 * OPP API exists, the data in this file should be converted to use it. 25 21 * 26 22 * This is technically part of the OMAP2xxx clock code. 23 + * 24 + * Considerable work is still needed to fully support dynamic frequency 25 + * changes on OMAP2xxx-series chips. Readers interested in such a 26 + * project are encouraged to review the Maemo Diablo RX-34 and RX-44 27 + * kernel source at: 28 + * http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/ 27 29 */ 28 30 29 31 #include "opp2xxx.h" 30 32 #include "sdrc.h" 31 33 #include "clock.h" 32 34 33 - /*------------------------------------------------------------------------- 34 - * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 35 + /* 36 + * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated. 35 37 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, 36 38 * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, 37 39 * CM_CLKSEL2_PLL, CM_CLKSEL_MDM 38 40 * 39 - * Filling in table based on H4 boards and 2430-SDPs variants available. 40 - * There are quite a few more rates combinations which could be defined. 41 + * Filling in table based on H4 boards available. There are quite a 42 + * few more rate combinations which could be defined. 41 43 * 42 - * When multiple values are defined the start up will try and choose the 43 - * fastest one. If a 'fast' value is defined, then automatically, the /2 44 - * one should be included as it can be used. Generally having more that 45 - * one fast set does not make sense, as static timings need to be changed 46 - * to change the set. The exception is the bypass setting which is 47 - * availble for low power bypass. 44 + * When multiple values are defined the start up will try and choose 45 + * the fastest one. If a 'fast' value is defined, then automatically, 46 + * the /2 one should be included as it can be used. Generally having 47 + * more than one fast set does not make sense, as static timings need 48 + * to be changed to change the set. The exception is the bypass 49 + * setting which is available for low power bypass. 48 50 * 49 51 * Note: This table needs to be sorted, fastest to slowest. 50 - *-------------------------------------------------------------------------*/ 52 + **/ 51 53 const struct prcm_config omap2420_rate_table[] = { 52 54 /* PRCM I - FAST */ 53 55 {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */
+15 -15
arch/arm/mach-omap2/opp2430_data.c
··· 1 1 /* 2 - * opp2420_data.c - old-style "OPP" table for OMAP2420 2 + * opp2430_data.c - old-style "OPP" table for OMAP2430 3 3 * 4 4 * Copyright (C) 2005-2009 Texas Instruments, Inc. 5 5 * Copyright (C) 2004-2009 Nokia Corporation ··· 9 9 * The OMAP2 processor can be run at several discrete 'PRCM configurations'. 10 10 * These configurations are characterized by voltage and speed for clocks. 11 11 * The device is only validated for certain combinations. One way to express 12 - * these combinations is via the 'ratio's' which the clocks operate with 12 + * these combinations is via the 'ratios' which the clocks operate with 13 13 * respect to each other. These ratio sets are for a given voltage/DPLL 14 - * setting. All configurations can be described by a DPLL setting and a ratio 15 - * There are 3 ratio sets for the 2430 and X ratio sets for 2420. 14 + * setting. All configurations can be described by a DPLL setting and a ratio. 16 15 * 17 16 * 2430 differs from 2420 in that there are no more phase synchronizers used. 18 17 * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs 19 18 * 2430 (iva2.1, NOdsp, mdm) 20 19 * 21 20 * XXX Missing voltage data. 21 + * XXX Missing 19.2MHz sys_clk rate sets. 22 22 * 23 23 * THe format described in this file is deprecated. Once a reasonable 24 24 * OPP API exists, the data in this file should be converted to use it. ··· 30 30 #include "sdrc.h" 31 31 #include "clock.h" 32 32 33 - /*------------------------------------------------------------------------- 34 - * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 33 + /* 34 + * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated. 35 35 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, 36 36 * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, 37 37 * CM_CLKSEL2_PLL, CM_CLKSEL_MDM 38 38 * 39 - * Filling in table based on H4 boards and 2430-SDPs variants available. 40 - * There are quite a few more rates combinations which could be defined. 39 + * Filling in table based on 2430-SDPs variants available. There are 40 + * quite a few more rate combinations which could be defined. 41 41 * 42 - * When multiple values are defined the start up will try and choose the 43 - * fastest one. If a 'fast' value is defined, then automatically, the /2 44 - * one should be included as it can be used. Generally having more that 45 - * one fast set does not make sense, as static timings need to be changed 46 - * to change the set. The exception is the bypass setting which is 47 - * availble for low power bypass. 42 + * When multiple values are defined the start up will try and choose 43 + * the fastest one. If a 'fast' value is defined, then automatically, 44 + * the /2 one should be included as it can be used. Generally having 45 + * more than one fast set does not make sense, as static timings need 46 + * to be changed to change the set. The exception is the bypass 47 + * setting which is available for low power bypass. 48 48 * 49 49 * Note: This table needs to be sorted, fastest to slowest. 50 - *-------------------------------------------------------------------------*/ 50 + */ 51 51 const struct prcm_config omap2430_rate_table[] = { 52 52 /* PRCM #4 - ratio2 (ES2.1) - FAST */ 53 53 {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* 399MHz ARM */
+2 -2
arch/arm/mach-omap2/pm34xx.c
··· 124 124 control_padconf_off |= START_PADCONF_SAVE; 125 125 omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF); 126 126 /* wait for the save to complete */ 127 - while (!omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) 128 - & PADCONF_SAVE_DONE) 127 + while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) 128 + & PADCONF_SAVE_DONE)) 129 129 ; 130 130 /* Save the Interrupt controller context */ 131 131 omap_intc_save_context();
+10 -2
arch/arm/mach-omap2/serial.c
··· 125 125 } 126 126 }; 127 127 #endif 128 + static inline unsigned int __serial_read_reg(struct uart_port *up, 129 + int offset) 130 + { 131 + offset <<= up->regshift; 132 + return (unsigned int)__raw_readb(up->membase + offset); 133 + } 134 + 128 135 static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, 129 136 int offset) 130 137 { ··· 590 583 { 591 584 if (UART_RX == offset) { 592 585 unsigned int lsr; 593 - lsr = serial_read_reg(omap_uart[up->line].p, UART_LSR); 586 + lsr = __serial_read_reg(up, UART_LSR); 594 587 if (!(lsr & UART_LSR_DR)) 595 588 return -EPERM; 596 589 } 597 - return serial_read_reg(omap_uart[up->line].p, offset); 590 + 591 + return __serial_read_reg(up, offset); 598 592 } 599 593 600 594 void __init omap_serial_early_init(void)
+10 -6
arch/arm/plat-omap/clock.c
··· 36 36 * Standard clock functions defined in include/linux/clk.h 37 37 *-------------------------------------------------------------------------*/ 38 38 39 - /* This functions is moved to arch/arm/common/clkdev.c. For OMAP4 since 40 - * clock framework is not up , it is defined here to avoid rework in 41 - * every driver. Also dummy prcm reset function is added */ 42 - 43 39 int clk_enable(struct clk *clk) 44 40 { 45 41 unsigned long flags; ··· 301 305 clk_enable(clkp); 302 306 } 303 307 } 304 - EXPORT_SYMBOL(clk_enable_init_clocks); 305 308 306 309 /* 307 310 * Low level helpers ··· 329 334 arch_clock->clk_init_cpufreq_table(table); 330 335 spin_unlock_irqrestore(&clockfw_lock, flags); 331 336 } 332 - EXPORT_SYMBOL(clk_init_cpufreq_table); 337 + 338 + void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) 339 + { 340 + unsigned long flags; 341 + 342 + spin_lock_irqsave(&clockfw_lock, flags); 343 + if (arch_clock->clk_exit_cpufreq_table) 344 + arch_clock->clk_exit_cpufreq_table(table); 345 + spin_unlock_irqrestore(&clockfw_lock, flags); 346 + } 333 347 #endif 334 348 335 349 /*-------------------------------------------------------------------------*/
+1
arch/arm/plat-omap/cpu-omap.c
··· 134 134 135 135 static int omap_cpu_exit(struct cpufreq_policy *policy) 136 136 { 137 + clk_exit_cpufreq_table(&freq_table); 137 138 clk_put(mpu_clk); 138 139 return 0; 139 140 }
+61 -2
arch/arm/plat-omap/gpio.c
··· 192 192 u32 saved_risingdetect; 193 193 #endif 194 194 u32 level_mask; 195 + u32 toggle_mask; 195 196 spinlock_t lock; 196 197 struct gpio_chip chip; 197 198 struct clk *dbck; ··· 750 749 } 751 750 #endif 752 751 752 + /* 753 + * This only applies to chips that can't do both rising and falling edge 754 + * detection at once. For all other chips, this function is a noop. 755 + */ 756 + static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio) 757 + { 758 + void __iomem *reg = bank->base; 759 + u32 l = 0; 760 + 761 + switch (bank->method) { 762 + #ifdef CONFIG_ARCH_OMAP1 763 + case METHOD_MPUIO: 764 + reg += OMAP_MPUIO_GPIO_INT_EDGE; 765 + break; 766 + #endif 767 + #ifdef CONFIG_ARCH_OMAP15XX 768 + case METHOD_GPIO_1510: 769 + reg += OMAP1510_GPIO_INT_CONTROL; 770 + break; 771 + #endif 772 + #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 773 + case METHOD_GPIO_7XX: 774 + reg += OMAP7XX_GPIO_INT_CONTROL; 775 + break; 776 + #endif 777 + default: 778 + return; 779 + } 780 + 781 + l = __raw_readl(reg); 782 + if ((l >> gpio) & 1) 783 + l &= ~(1 << gpio); 784 + else 785 + l |= 1 << gpio; 786 + 787 + __raw_writel(l, reg); 788 + } 789 + 753 790 static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) 754 791 { 755 792 void __iomem *reg = bank->base; ··· 798 759 case METHOD_MPUIO: 799 760 reg += OMAP_MPUIO_GPIO_INT_EDGE; 800 761 l = __raw_readl(reg); 762 + if (trigger & IRQ_TYPE_EDGE_BOTH) 763 + bank->toggle_mask |= 1 << gpio; 801 764 if (trigger & IRQ_TYPE_EDGE_RISING) 802 765 l |= 1 << gpio; 803 766 else if (trigger & IRQ_TYPE_EDGE_FALLING) ··· 812 771 case METHOD_GPIO_1510: 813 772 reg += OMAP1510_GPIO_INT_CONTROL; 814 773 l = __raw_readl(reg); 774 + if (trigger & IRQ_TYPE_EDGE_BOTH) 775 + bank->toggle_mask |= 1 << gpio; 815 776 if (trigger & IRQ_TYPE_EDGE_RISING) 816 777 l |= 1 << gpio; 817 778 else if (trigger & IRQ_TYPE_EDGE_FALLING) ··· 846 803 case METHOD_GPIO_7XX: 847 804 reg += OMAP7XX_GPIO_INT_CONTROL; 848 805 l = __raw_readl(reg); 806 + if (trigger & IRQ_TYPE_EDGE_BOTH) 807 + bank->toggle_mask |= 1 << gpio; 849 808 if (trigger & IRQ_TYPE_EDGE_RISING) 850 809 l |= 1 << gpio; 851 810 else if (trigger & IRQ_TYPE_EDGE_FALLING) ··· 1117 1072 */ 1118 1073 static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) 1119 1074 { 1120 - unsigned long flags; 1075 + unsigned long uninitialized_var(flags); 1121 1076 1122 1077 switch (bank->method) { 1123 1078 #ifdef CONFIG_ARCH_OMAP16XX ··· 1262 1217 { 1263 1218 void __iomem *isr_reg = NULL; 1264 1219 u32 isr; 1265 - unsigned int gpio_irq; 1220 + unsigned int gpio_irq, gpio_index; 1266 1221 struct gpio_bank *bank; 1267 1222 u32 retrigger = 0; 1268 1223 int unmasked = 0; ··· 1329 1284 1330 1285 gpio_irq = bank->virtual_irq_start; 1331 1286 for (; isr != 0; isr >>= 1, gpio_irq++) { 1287 + gpio_index = get_gpio_index(irq_to_gpio(gpio_irq)); 1288 + 1332 1289 if (!(isr & 1)) 1333 1290 continue; 1291 + 1292 + #ifdef CONFIG_ARCH_OMAP1 1293 + /* 1294 + * Some chips can't respond to both rising and falling 1295 + * at the same time. If this irq was requested with 1296 + * both flags, we need to flip the ICR data for the IRQ 1297 + * to respond to the IRQ for the opposite direction. 1298 + * This will be indicated in the bank toggle_mask. 1299 + */ 1300 + if (bank->toggle_mask & (1 << gpio_index)) 1301 + _toggle_gpio_edge_triggering(bank, gpio_index); 1302 + #endif 1334 1303 1335 1304 generic_handle_irq(gpio_irq); 1336 1305 }
-1
arch/arm/plat-omap/include/plat/board.h
··· 99 99 struct omap_backlight_config { 100 100 int default_intensity; 101 101 int (*set_power)(struct device *dev, int state); 102 - int (*check_fb)(struct fb_info *fb); 103 102 }; 104 103 105 104 struct omap_fbmem_config {
+2
arch/arm/plat-omap/include/plat/clock.h
··· 119 119 void (*clk_disable_unused)(struct clk *clk); 120 120 #ifdef CONFIG_CPU_FREQ 121 121 void (*clk_init_cpufreq_table)(struct cpufreq_frequency_table **); 122 + void (*clk_exit_cpufreq_table)(struct cpufreq_frequency_table **); 122 123 #endif 123 124 }; 124 125 ··· 136 135 extern void clk_enable_init_clocks(void); 137 136 #ifdef CONFIG_CPU_FREQ 138 137 extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); 138 + extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); 139 139 #endif 140 140 141 141 extern const struct clkops clkops_null;
+1 -1
arch/arm/plat-omap/include/plat/control.h
··· 147 147 #define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) 148 148 #define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) 149 149 #define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \ 150 - + ((i) >> 1) * 4 + (!(i) & 1) * 2) 150 + + ((i) >> 1) * 4 + (!((i) & 1)) * 2) 151 151 #define OMAP343X_CONTROL_PROG_IO0 (OMAP2_CONTROL_GENERAL + 0x01D4) 152 152 #define OMAP343X_CONTROL_PROG_IO1 (OMAP2_CONTROL_GENERAL + 0x01D8) 153 153 #define OMAP343X_CONTROL_DSS_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E0)
+16 -20
arch/arm/plat-omap/include/plat/io.h
··· 122 122 #define OMAP243X_SMS_VIRT (OMAP243X_SMS_PHYS + OMAP2_L3_IO_OFFSET) 123 123 #define OMAP243X_SMS_SIZE SZ_1M 124 124 125 - /* DSP */ 126 - #define DSP_MEM_24XX_PHYS OMAP2420_DSP_MEM_BASE /* 0x58000000 */ 127 - #define DSP_MEM_24XX_VIRT 0xe0000000 128 - #define DSP_MEM_24XX_SIZE 0x28000 129 - #define DSP_IPI_24XX_PHYS OMAP2420_DSP_IPI_BASE /* 0x59000000 */ 130 - #define DSP_IPI_24XX_VIRT 0xe1000000 131 - #define DSP_IPI_24XX_SIZE SZ_4K 132 - #define DSP_MMU_24XX_PHYS OMAP2420_DSP_MMU_BASE /* 0x5a000000 */ 133 - #define DSP_MMU_24XX_VIRT 0xe2000000 134 - #define DSP_MMU_24XX_SIZE SZ_4K 125 + /* 2420 IVA */ 126 + #define DSP_MEM_2420_PHYS OMAP2420_DSP_MEM_BASE 127 + /* 0x58000000 --> 0xfc100000 */ 128 + #define DSP_MEM_2420_VIRT 0xfc100000 129 + #define DSP_MEM_2420_SIZE 0x28000 130 + #define DSP_IPI_2420_PHYS OMAP2420_DSP_IPI_BASE 131 + /* 0x59000000 --> 0xfc128000 */ 132 + #define DSP_IPI_2420_VIRT 0xfc128000 133 + #define DSP_IPI_2420_SIZE SZ_4K 134 + #define DSP_MMU_2420_PHYS OMAP2420_DSP_MMU_BASE 135 + /* 0x5a000000 --> 0xfc129000 */ 136 + #define DSP_MMU_2420_VIRT 0xfc129000 137 + #define DSP_MMU_2420_SIZE SZ_4K 138 + 139 + /* 2430 IVA2.1 - currently unmapped */ 135 140 136 141 /* 137 142 * ---------------------------------------------------------------------------- ··· 187 182 #define OMAP343X_SDRC_VIRT (OMAP343X_SDRC_PHYS + OMAP2_L3_IO_OFFSET) 188 183 #define OMAP343X_SDRC_SIZE SZ_1M 189 184 190 - /* DSP */ 191 - #define DSP_MEM_34XX_PHYS OMAP34XX_DSP_MEM_BASE /* 0x58000000 */ 192 - #define DSP_MEM_34XX_VIRT 0xe0000000 193 - #define DSP_MEM_34XX_SIZE 0x28000 194 - #define DSP_IPI_34XX_PHYS OMAP34XX_DSP_IPI_BASE /* 0x59000000 */ 195 - #define DSP_IPI_34XX_VIRT 0xe1000000 196 - #define DSP_IPI_34XX_SIZE SZ_4K 197 - #define DSP_MMU_34XX_PHYS OMAP34XX_DSP_MMU_BASE /* 0x5a000000 */ 198 - #define DSP_MMU_34XX_VIRT 0xe2000000 199 - #define DSP_MMU_34XX_SIZE SZ_4K 185 + /* 3430 IVA - currently unmapped */ 200 186 201 187 /* 202 188 * ----------------------------------------------------------------------------
+8
arch/arm/plat-omap/include/plat/mux.h
··· 183 183 /* I2C */ 184 184 I2C_7XX_SCL, 185 185 I2C_7XX_SDA, 186 + 187 + /* SPI */ 188 + SPI_7XX_1, 189 + SPI_7XX_2, 190 + SPI_7XX_3, 191 + SPI_7XX_4, 192 + SPI_7XX_5, 193 + SPI_7XX_6, 186 194 }; 187 195 188 196 enum omap1xxx_index {
+3
arch/arm/plat-omap/include/plat/omap7xx.h
··· 46 46 #define OMAP7XX_DSPREG_SIZE SZ_128K 47 47 #define OMAP7XX_DSPREG_START 0xE1000000 48 48 49 + #define OMAP7XX_SPI1_BASE 0xfffc0800 50 + #define OMAP7XX_SPI2_BASE 0xfffc1000 51 + 49 52 /* 50 53 * ---------------------------------------------------------------------------- 51 54 * OMAP7XX specific configuration registers
+6 -6
arch/arm/plat-omap/io.c
··· 66 66 return XLATE(p, L4_24XX_PHYS, L4_24XX_VIRT); 67 67 } 68 68 if (cpu_is_omap2420()) { 69 - if (BETWEEN(p, DSP_MEM_24XX_PHYS, DSP_MEM_24XX_SIZE)) 70 - return XLATE(p, DSP_MEM_24XX_PHYS, DSP_MEM_24XX_VIRT); 71 - if (BETWEEN(p, DSP_IPI_24XX_PHYS, DSP_IPI_24XX_SIZE)) 72 - return XLATE(p, DSP_IPI_24XX_PHYS, DSP_IPI_24XX_SIZE); 73 - if (BETWEEN(p, DSP_MMU_24XX_PHYS, DSP_MMU_24XX_SIZE)) 74 - return XLATE(p, DSP_MMU_24XX_PHYS, DSP_MMU_24XX_VIRT); 69 + if (BETWEEN(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_SIZE)) 70 + return XLATE(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_VIRT); 71 + if (BETWEEN(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE)) 72 + return XLATE(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE); 73 + if (BETWEEN(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_SIZE)) 74 + return XLATE(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_VIRT); 75 75 } 76 76 if (cpu_is_omap2430()) { 77 77 if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE))
+1 -1
arch/arm/plat-omap/iommu.c
··· 827 827 **/ 828 828 void iommu_put(struct iommu *obj) 829 829 { 830 - if (!obj && IS_ERR(obj)) 830 + if (!obj || IS_ERR(obj)) 831 831 return; 832 832 833 833 mutex_lock(&obj->iommu_lock);
+17 -3
arch/arm/plat-omap/mcbsp.c
··· 436 436 dev_err(mcbsp->dev, "Unable to request TX IRQ %d " 437 437 "for McBSP%d\n", mcbsp->tx_irq, 438 438 mcbsp->id); 439 - return err; 439 + goto error; 440 440 } 441 441 442 442 init_completion(&mcbsp->rx_irq_completion); ··· 446 446 dev_err(mcbsp->dev, "Unable to request RX IRQ %d " 447 447 "for McBSP%d\n", mcbsp->rx_irq, 448 448 mcbsp->id); 449 - free_irq(mcbsp->tx_irq, (void *)mcbsp); 450 - return err; 449 + goto tx_irq; 451 450 } 452 451 } 453 452 454 453 return 0; 454 + tx_irq: 455 + free_irq(mcbsp->tx_irq, (void *)mcbsp); 456 + error: 457 + if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) 458 + mcbsp->pdata->ops->free(id); 459 + 460 + /* Do procedure specific to omap34xx arch, if applicable */ 461 + omap34xx_mcbsp_free(mcbsp); 462 + 463 + clk_disable(mcbsp->fclk); 464 + clk_disable(mcbsp->iclk); 465 + 466 + mcbsp->free = 1; 467 + 468 + return err; 455 469 } 456 470 EXPORT_SYMBOL(omap_mcbsp_request); 457 471
-2
drivers/video/backlight/omap1_bl.c
··· 139 139 if (!pdata) 140 140 return -ENXIO; 141 141 142 - omapbl_ops.check_fb = pdata->check_fb; 143 - 144 142 bl = kzalloc(sizeof(struct omap_backlight), GFP_KERNEL); 145 143 if (unlikely(!bl)) 146 144 return -ENOMEM;