From 5c5dccad31670faa716cbc9d8a6f918487f60a09 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Wed, 16 May 2007 08:52:05 -0700 Subject: [PATCH 1/6] ARM: OMAP: Fix 32k timer unsupported one-shot mode Fix unsupported one-shot mode in set_mode hook. Signed-off-by: Kevin Hilman Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/common.c | 2 +- arch/arm/plat-omap/timer32k.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index 7987aa6e95f8..4f0f9c4e938e 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c @@ -172,7 +172,7 @@ console_initcall(omap_add_serial_console); #if defined(CONFIG_ARCH_OMAP16XX) #define TIMER_32K_SYNCHRONIZED 0xfffbc410 #elif defined(CONFIG_ARCH_OMAP24XX) -#define TIMER_32K_SYNCHRONIZED 0x48004010 +#define TIMER_32K_SYNCHRONIZED (OMAP24XX_32KSYNCT_BASE + 0x10) #endif #ifdef TIMER_32K_SYNCHRONIZED diff --git a/arch/arm/plat-omap/timer32k.c b/arch/arm/plat-omap/timer32k.c index b0af014b0e2c..ea76f1979a3d 100644 --- a/arch/arm/plat-omap/timer32k.c +++ b/arch/arm/plat-omap/timer32k.c @@ -71,7 +71,7 @@ struct sys_timer omap_timer; #if defined(CONFIG_ARCH_OMAP16XX) #define TIMER_32K_SYNCHRONIZED 0xfffbc410 #elif defined(CONFIG_ARCH_OMAP24XX) -#define TIMER_32K_SYNCHRONIZED 0x48004010 +#define TIMER_32K_SYNCHRONIZED (OMAP24XX_32KSYNCT_BASE + 0x10) #else #error OMAP 32KHz timer does not currently work on 15XX! #endif @@ -147,14 +147,15 @@ static inline void omap_32k_timer_ack_irq(void) static void omap_32k_timer_set_mode(enum clock_event_mode mode, struct clock_event_device *evt) { + omap_32k_timer_stop(); + switch (mode) { - case CLOCK_EVT_MODE_ONESHOT: case CLOCK_EVT_MODE_PERIODIC: omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); break; + case CLOCK_EVT_MODE_ONESHOT: case CLOCK_EVT_MODE_UNUSED: case CLOCK_EVT_MODE_SHUTDOWN: - omap_32k_timer_stop(); break; case CLOCK_EVT_MODE_RESUME: break; @@ -194,8 +195,6 @@ omap_32k_ticks_to_nsecs(unsigned long ticks_32k) return (unsigned long long) ticks_32k * 1000 * 5*5*5*5*5*5 >> 9; } -static unsigned long omap_32k_last_tick = 0; - /* * Returns current time from boot in nsecs. It's OK for this to wrap * around for now, as it's just a relative time stamp. @@ -225,7 +224,6 @@ static __init void omap_init_32k_timer(void) { if (cpu_class_is_omap1()) setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); - omap_32k_last_tick = omap_32k_sync_timer_read(); #ifdef CONFIG_ARCH_OMAP2 /* REVISIT: Check 24xx TIOCP_CFG settings after idle works */ From 4e63915cbe4525beb9c0281f8e22945d88acc9bc Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 2 Apr 2007 12:45:50 -0700 Subject: [PATCH 2/6] ARM: OMAP: fix OMAP1 dmtimer build warning Remove the OMAP1 version of omap_dm_timer_get_fclk(), and its associated compile-time warning. It would only BUG() if called, while it's only called on OMAP2. Signed-off-by: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/dmtimer.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 36073dfaa4db..3856f5aedfc1 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -271,11 +271,6 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer) #if defined(CONFIG_ARCH_OMAP1) -struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) -{ - BUG(); -} - /** * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR * @inputmask: current value of idlect mask From eebdf7d7c478682756fd29d376223f350311f105 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 2 Apr 2007 12:48:10 -0700 Subject: [PATCH 3/6] ARM: OMAP: OSK led fixes Bugfixes for the OSK led support: - Fix Kconfig merge glitches: Mistral handles idle and timer leds just fine - Fix pm_suspend() runtime botch: can't sleep, so can't touch tps65010 leds Improvements: - Switch sense of Mistral idle led, so idle == off Probably the TPS65010 leds should be handled only by the "new led" API. Signed-off-by: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/Kconfig | 7 +++++-- arch/arm/mach-omap1/leds-osk.c | 6 +++--- arch/arm/mach-omap1/pm.c | 11 ----------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index d6145298a325..691aae309c8a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -721,7 +721,8 @@ config LEDS config LEDS_TIMER bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \ - MACH_OMAP_H2 || MACH_OMAP_PERSEUS2 + OMAP_OSK_MISTRAL || MACH_OMAP_H2 \ + || MACH_OMAP_PERSEUS2 depends on LEDS depends on !GENERIC_CLOCKEVENTS default y if ARCH_EBSA110 @@ -738,7 +739,9 @@ config LEDS_TIMER config LEDS_CPU bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110 && \ - !ARCH_OMAP) || MACH_OMAP_H2 || MACH_OMAP_PERSEUS2 + !ARCH_OMAP) \ + || OMAP_OSK_MISTRAL || MACH_OMAP_H2 \ + || MACH_OMAP_PERSEUS2 depends on LEDS help If you say Y here, the red LED will be used to give a good real diff --git a/arch/arm/mach-omap1/leds-osk.c b/arch/arm/mach-omap1/leds-osk.c index 0cbf1b0071f8..86de303ecab2 100644 --- a/arch/arm/mach-omap1/leds-osk.c +++ b/arch/arm/mach-omap1/leds-osk.c @@ -133,13 +133,13 @@ void osk_leds_event(led_event_t evt) mistral_setled(); break; - case led_idle_start: - hw_led_state |= IDLE_LED; + case led_idle_start: /* idle == off */ + hw_led_state &= ~IDLE_LED; mistral_setled(); break; case led_idle_end: - hw_led_state &= ~IDLE_LED; + hw_led_state |= IDLE_LED; mistral_setled(); break; diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 5bb348e2e315..2e68be607295 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -250,11 +249,6 @@ void omap_pm_suspend(void) omap_serial_wake_trigger(1); - if (machine_is_omap_osk()) { - /* Stop LED1 (D9) blink */ - tps65010_set_led(LED1, OFF); - } - if (!cpu_is_omap15xx()) omap_writew(0xffff, ULPD_SOFT_DISABLE_REQ_REG); @@ -447,11 +441,6 @@ void omap_pm_suspend(void) omap_serial_wake_trigger(0); printk("PM: OMAP%x is re-starting from deep sleep...\n", system_rev); - - if (machine_is_omap_osk()) { - /* Let LED1 (D9) blink again */ - tps65010_set_led(LED1, BLINK); - } } #if defined(DEBUG) && defined(CONFIG_PROC_FS) From 666cd174c451c172dd115b9d94f150efe627b609 Mon Sep 17 00:00:00 2001 From: Dirk Behme Date: Thu, 25 Jan 2007 16:26:46 -0800 Subject: [PATCH 4/6] ARM: OMAP: H3 workqueue fixes Signed-off-by: Dirk Behme Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/board-h3.c | 12 +++++++----- include/asm-arm/arch-omap/irda.h | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 7b260b7c537b..79d4ef4c54d4 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c @@ -294,9 +294,11 @@ static int h3_select_irda(struct device *dev, int state) return err; } -static void set_trans_mode(void *data) +static void set_trans_mode(struct work_struct *work) { - int *mode = data; + struct omap_irda_config *irda_config = + container_of(work, struct omap_irda_config, gpio_expa.work); + int mode = irda_config->mode; unsigned char expa; int err = 0; @@ -306,7 +308,7 @@ static void set_trans_mode(void *data) expa &= ~0x03; - if (*mode & IR_SIRMODE) { + if (mode & IR_SIRMODE) { expa |= 0x01; } else { /* MIR/FIR */ expa |= 0x03; @@ -321,9 +323,9 @@ static int h3_transceiver_mode(struct device *dev, int mode) { struct omap_irda_config *irda_config = dev->platform_data; + irda_config->mode = mode; cancel_delayed_work(&irda_config->gpio_expa); - PREPARE_WORK(&irda_config->gpio_expa, set_trans_mode, &mode); -#error this is not permitted - mode is an argument variable + PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode); schedule_delayed_work(&irda_config->gpio_expa, 0); return 0; diff --git a/include/asm-arm/arch-omap/irda.h b/include/asm-arm/arch-omap/irda.h index 345a649ec838..96bb12fab438 100644 --- a/include/asm-arm/arch-omap/irda.h +++ b/include/asm-arm/arch-omap/irda.h @@ -31,6 +31,7 @@ struct omap_irda_config { unsigned long src_start; int tx_trigger; int rx_trigger; + int mode; }; #endif From 1abc70fcd81b920dd7a1091ba8863dfe5463b130 Mon Sep 17 00:00:00 2001 From: Juha Yrjola Date: Wed, 6 Dec 2006 17:13:47 -0800 Subject: [PATCH 5/6] ARM: OMAP2: Force APLLs always active The APLLs are most efficiently idled by hardware. Signed-off-by: Juha Yrjola Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/clock.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 588adb5ab47f..d9af4367f8bb 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -1160,8 +1160,8 @@ int __init omap2_clk_init(void) clk_enable(&sync_32k_ick); clk_enable(&omapctrl_ick); - /* Force the APLLs active during bootup to avoid disabling and - * enabling them unnecessarily. */ + /* Force the APLLs always active. The clocks are idled + * automatically by hardware. */ clk_enable(&apll96_ck); clk_enable(&apll54_ck); @@ -1174,12 +1174,3 @@ int __init omap2_clk_init(void) return 0; } - -static int __init omap2_disable_aplls(void) -{ - clk_disable(&apll96_ck); - clk_disable(&apll54_ck); - - return 0; -} -late_initcall(omap2_disable_aplls); From 671c7235ccd537f828986ef5a4071bf477541dc0 Mon Sep 17 00:00:00 2001 From: Juha Yrjola Date: Wed, 6 Dec 2006 17:13:49 -0800 Subject: [PATCH 6/6] ARM: OMAP: Enable serial idling and wakeup features Enable serial idling and wakeup features Signed-off-by: Juha Yrjola Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index aaa5589e8169..e9c367fc9f61 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -84,7 +84,7 @@ static inline void __init omap_serial_reset(struct plat_serial8250_port *p) serial_write_reg(p, UART_OMAP_MDR1, 0x07); serial_write_reg(p, UART_OMAP_SCR, 0x08); serial_write_reg(p, UART_OMAP_MDR1, 0x00); - serial_write_reg(p, UART_OMAP_SYSC, 0x01); + serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0)); } void __init omap_serial_init()