···432 }433434 if (clk->flags & CLOCK_NO_IDLE_PARENT)435- if (!cpu_is_omap24xx())436- omap1_clk_deny_idle(clk->parent);437 }438439 ret = clk->enable(clk);···453 if (likely(clk->parent)) {454 omap1_clk_disable(clk->parent);455 if (clk->flags & CLOCK_NO_IDLE_PARENT)456- if (!cpu_is_omap24xx())457- omap1_clk_allow_idle(clk->parent);458 }459 }460}···469 if (unlikely(clk->enable_reg == 0)) {470 printk(KERN_ERR "clock.c: Enable for %s without enable code\n",471 clk->name);472- return 0;473 }474475 if (clk->flags & ENABLE_REG_32BIT) {···649 int crystal_type = 0; /* Default 12 MHz */650 u32 reg;6510000000652 /* USB_REQ_EN will be disabled later if necessary (usb_dc_ck) */653 reg = omap_readw(SOFT_REQ_REG) & (1 << 4);654 omap_writew(reg, SOFT_REQ_REG);655- omap_writew(0, SOFT_REQ_REG2);0656657 clk_init(&omap1_clk_functions);658···691692 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config);693 if (info != NULL) {694- if (!cpu_is_omap1510())695 crystal_type = info->system_clock_type;696 }697
···432 }433434 if (clk->flags & CLOCK_NO_IDLE_PARENT)435+ omap1_clk_deny_idle(clk->parent);0436 }437438 ret = clk->enable(clk);···454 if (likely(clk->parent)) {455 omap1_clk_disable(clk->parent);456 if (clk->flags & CLOCK_NO_IDLE_PARENT)457+ omap1_clk_allow_idle(clk->parent);0458 }459 }460}···471 if (unlikely(clk->enable_reg == 0)) {472 printk(KERN_ERR "clock.c: Enable for %s without enable code\n",473 clk->name);474+ return -EINVAL;475 }476477 if (clk->flags & ENABLE_REG_32BIT) {···651 int crystal_type = 0; /* Default 12 MHz */652 u32 reg;653654+#ifdef CONFIG_DEBUG_LL655+ /* Resets some clocks that may be left on from bootloader,656+ * but leaves serial clocks on.657+ */658+ omap_writel(0x3 << 29, MOD_CONF_CTRL_0);659+#endif660+661 /* USB_REQ_EN will be disabled later if necessary (usb_dc_ck) */662 reg = omap_readw(SOFT_REQ_REG) & (1 << 4);663 omap_writew(reg, SOFT_REQ_REG);664+ if (!cpu_is_omap15xx())665+ omap_writew(0, SOFT_REQ_REG2);666667 clk_init(&omap1_clk_functions);668···685686 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config);687 if (info != NULL) {688+ if (!cpu_is_omap15xx())689 crystal_type = info->system_clock_type;690 }691
+1-1
arch/arm/mach-omap1/irq.c
···238239 if (cpu_is_omap730())240 omap_unmask_irq(INT_730_IH2_IRQ);241- else if (cpu_is_omap1510())242 omap_unmask_irq(INT_1510_IH2_IRQ);243 else if (cpu_is_omap16xx())244 omap_unmask_irq(INT_1610_IH2_IRQ);
···238239 if (cpu_is_omap730())240 omap_unmask_irq(INT_730_IH2_IRQ);241+ else if (cpu_is_omap15xx())242 omap_unmask_irq(INT_1510_IH2_IRQ);243 else if (cpu_is_omap16xx())244 omap_unmask_irq(INT_1610_IH2_IRQ);
+9-3
arch/arm/mach-omap1/pm.c
···256 tps65010_set_led(LED1, OFF);257 }258259- omap_writew(0xffff, ULPD_SOFT_DISABLE_REQ_REG);0260261 /*262 * Step 1: turn off interrupts (FIXME: NOTE: already disabled)···435 MPUI1610_RESTORE(OMAP_IH2_3_MIR);436 }437438- omap_writew(0, ULPD_SOFT_DISABLE_REQ_REG);0439440 /*441 * Reenable interrupts···706707static int __init omap_pm_init(void)708{00709 printk("Power Management for TI OMAP.\n");710711 /*···764 omap_pm_init_proc();765#endif766767- subsys_create_file(&power_subsys, &sleep_while_idle_attr);00768769 if (cpu_is_omap16xx()) {770 /* configure LOW_PWR pin */
···256 tps65010_set_led(LED1, OFF);257 }258259+ if (!cpu_is_omap15xx())260+ omap_writew(0xffff, ULPD_SOFT_DISABLE_REQ_REG);261262 /*263 * Step 1: turn off interrupts (FIXME: NOTE: already disabled)···434 MPUI1610_RESTORE(OMAP_IH2_3_MIR);435 }436437+ if (!cpu_is_omap15xx())438+ omap_writew(0, ULPD_SOFT_DISABLE_REQ_REG);439440 /*441 * Reenable interrupts···704705static int __init omap_pm_init(void)706{707+ int error;708+709 printk("Power Management for TI OMAP.\n");710711 /*···760 omap_pm_init_proc();761#endif762763+ error = subsys_create_file(&power_subsys, &sleep_while_idle_attr);764+ if (error)765+ printk(KERN_ERR "subsys_create_file failed: %d\n", error);766767 if (cpu_is_omap16xx()) {768 /* configure LOW_PWR pin */
+9-9
arch/arm/mach-omap1/serial.c
···1/*2 * linux/arch/arm/mach-omap1/serial.c3 *4- * OMAP1 CPU identification code5 *6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License version 2 as···59 omap_serial_outp(p, UART_OMAP_SCR, 0x08); /* TX watermark */60 omap_serial_outp(p, UART_OMAP_MDR1, 0x00); /* enable UART */6162- if (!cpu_is_omap1510()) {63 omap_serial_outp(p, UART_OMAP_SYSC, 0x01);64 while (!(omap_serial_in(p, UART_OMAP_SYSC) & 0x01));65 }···121 serial_platform_data[1].irq = INT_730_UART_MODEM_IRDA_2;122 }123124- if (cpu_is_omap1510()) {125 serial_platform_data[0].uartclk = OMAP1510_BASE_BAUD * 16;126 serial_platform_data[1].uartclk = OMAP1510_BASE_BAUD * 16;127 serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16;···147 printk("Could not get uart1_ck\n");148 else {149 clk_enable(uart1_ck);150- if (cpu_is_omap1510())151 clk_set_rate(uart1_ck, 12000000);152 }153- if (cpu_is_omap1510()) {154 omap_cfg_reg(UART1_TX);155 omap_cfg_reg(UART1_RTS);156 if (machine_is_omap_innovator()) {···167 printk("Could not get uart2_ck\n");168 else {169 clk_enable(uart2_ck);170- if (cpu_is_omap1510())171 clk_set_rate(uart2_ck, 12000000);172 else173 clk_set_rate(uart2_ck, 48000000);174 }175- if (cpu_is_omap1510()) {176 omap_cfg_reg(UART2_TX);177 omap_cfg_reg(UART2_RTS);178 if (machine_is_omap_innovator()) {···189 printk("Could not get uart3_ck\n");190 else {191 clk_enable(uart3_ck);192- if (cpu_is_omap1510())193 clk_set_rate(uart3_ck, 12000000);194 }195- if (cpu_is_omap1510()) {196 omap_cfg_reg(UART3_TX);197 omap_cfg_reg(UART3_RX);198 }
···1/*2 * linux/arch/arm/mach-omap1/serial.c3 *4+ * OMAP1 serial support.5 *6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License version 2 as···59 omap_serial_outp(p, UART_OMAP_SCR, 0x08); /* TX watermark */60 omap_serial_outp(p, UART_OMAP_MDR1, 0x00); /* enable UART */6162+ if (!cpu_is_omap15xx()) {63 omap_serial_outp(p, UART_OMAP_SYSC, 0x01);64 while (!(omap_serial_in(p, UART_OMAP_SYSC) & 0x01));65 }···121 serial_platform_data[1].irq = INT_730_UART_MODEM_IRDA_2;122 }123124+ if (cpu_is_omap15xx()) {125 serial_platform_data[0].uartclk = OMAP1510_BASE_BAUD * 16;126 serial_platform_data[1].uartclk = OMAP1510_BASE_BAUD * 16;127 serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16;···147 printk("Could not get uart1_ck\n");148 else {149 clk_enable(uart1_ck);150+ if (cpu_is_omap15xx())151 clk_set_rate(uart1_ck, 12000000);152 }153+ if (cpu_is_omap15xx()) {154 omap_cfg_reg(UART1_TX);155 omap_cfg_reg(UART1_RTS);156 if (machine_is_omap_innovator()) {···167 printk("Could not get uart2_ck\n");168 else {169 clk_enable(uart2_ck);170+ if (cpu_is_omap15xx())171 clk_set_rate(uart2_ck, 12000000);172 else173 clk_set_rate(uart2_ck, 48000000);174 }175+ if (cpu_is_omap15xx()) {176 omap_cfg_reg(UART2_TX);177 omap_cfg_reg(UART2_RTS);178 if (machine_is_omap_innovator()) {···189 printk("Could not get uart3_ck\n");190 else {191 clk_enable(uart3_ck);192+ if (cpu_is_omap15xx())193 clk_set_rate(uart3_ck, 12000000);194 }195+ if (cpu_is_omap15xx()) {196 omap_cfg_reg(UART3_TX);197 omap_cfg_reg(UART3_RX);198 }
+7-6
arch/arm/mach-omap2/board-h4.c
···39#include "prcm-regs.h"4041#include <asm/io.h>42-#include <asm/delay.h>4344static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 };45static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 };···178 return err;179}180181-static void set_trans_mode(void *data)182{183- int *mode = data;00184 unsigned char expa;185 int err = 0;186···192193 expa &= ~0x01;194195- if (!(*mode & IR_SIRMODE)) { /* MIR/FIR */196 expa |= 0x01;197 }198···205{206 struct omap_irda_config *irda_config = dev->platform_data;2070208 cancel_delayed_work(&irda_config->gpio_expa);209- PREPARE_WORK(&irda_config->gpio_expa, set_trans_mode, &mode);210-#error this is not permitted - mode is an argument variable211 schedule_delayed_work(&irda_config->gpio_expa, 0);212213 return 0;
···557 omap_enable_channel_irq(free_ch);558 /* Clear the CSR register and IRQ status register */559 OMAP_DMA_CSR_REG(free_ch) = OMAP2_DMA_CSR_CLEAR_MASK;560- omap_writel(~0x0, OMAP_DMA4_IRQSTATUS_L0);561 }562563 *dma_ch_out = free_ch;···597598 /* Clear the CSR register and IRQ status register */599 OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK;600-601- val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);602- val |= 1 << lch;603- omap_writel(val, OMAP_DMA4_IRQSTATUS_L0);604605 /* Disable all DMA interrupts for the channel. */606 OMAP_DMA_CICR_REG(lch) = 0;···924static int omap2_dma_handle_ch(int ch)925{926 u32 status = OMAP_DMA_CSR_REG(ch);927- u32 val;928929 if (!status)930 return 0;···944 dma_chan[ch].dev_id);945946 OMAP_DMA_CSR_REG(ch) = OMAP2_DMA_CSR_CLEAR_MASK;947-948- val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);949- /* ch in this function is from 0-31 while in register it is 1-32 */950- val = 1 << (ch);951- omap_writel(val, OMAP_DMA4_IRQSTATUS_L0);952953 if (likely(dma_chan[ch].callback != NULL))954 dma_chan[ch].callback(ch, status, dma_chan[ch].data);
···557 omap_enable_channel_irq(free_ch);558 /* Clear the CSR register and IRQ status register */559 OMAP_DMA_CSR_REG(free_ch) = OMAP2_DMA_CSR_CLEAR_MASK;560+ omap_writel(1 << free_ch, OMAP_DMA4_IRQSTATUS_L0);561 }562563 *dma_ch_out = free_ch;···597598 /* Clear the CSR register and IRQ status register */599 OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK;600+ omap_writel(1 << lch, OMAP_DMA4_IRQSTATUS_L0);000601602 /* Disable all DMA interrupts for the channel. */603 OMAP_DMA_CICR_REG(lch) = 0;···927static int omap2_dma_handle_ch(int ch)928{929 u32 status = OMAP_DMA_CSR_REG(ch);0930931 if (!status)932 return 0;···948 dma_chan[ch].dev_id);949950 OMAP_DMA_CSR_REG(ch) = OMAP2_DMA_CSR_CLEAR_MASK;951+ omap_writel(1 << ch, OMAP_DMA4_IRQSTATUS_L0);0000952953 if (likely(dma_chan[ch].callback != NULL))954 dma_chan[ch].callback(ch, status, dma_chan[ch].data);
···65 int period; /* current transfer period */66 int periods; /* current count of periods registerd in the DMA engine */67 spinlock_t dma_lock; /* for locking in DMA operations */68- snd_pcm_substream_t *stream; /* the pcm stream */69 unsigned linked:1; /* dma channels linked */70 int offset; /* store start position of the last period in the alsa buffer */71 int (*hw_start)(void); /* interface to start HW interface, e.g. McBSP */···76 * Alsa card structure for aic2377 */78struct snd_card_omap_codec {79- snd_card_t *card;80- snd_pcm_t *pcm;81 long samplerate;82 struct audio_stream s[2]; /* playback & capture */83};···89struct omap_alsa_codec_config {90 char *name;91 struct omap_mcbsp_reg_cfg *mcbsp_regs_alsa;92- snd_pcm_hw_constraint_list_t *hw_constraints_rates;93- snd_pcm_hardware_t *snd_omap_alsa_playback;94- snd_pcm_hardware_t *snd_omap_alsa_capture;95 void (*codec_configure_dev)(void);96 void (*codec_set_samplerate)(long);97 void (*codec_clock_setup)(void);
···65 int period; /* current transfer period */66 int periods; /* current count of periods registerd in the DMA engine */67 spinlock_t dma_lock; /* for locking in DMA operations */68+ struct snd_pcm_substream *stream; /* the pcm stream */69 unsigned linked:1; /* dma channels linked */70 int offset; /* store start position of the last period in the alsa buffer */71 int (*hw_start)(void); /* interface to start HW interface, e.g. McBSP */···76 * Alsa card structure for aic2377 */78struct snd_card_omap_codec {79+ struct snd_card *card;80+ struct snd_pcm *pcm;81 long samplerate;82 struct audio_stream s[2]; /* playback & capture */83};···89struct omap_alsa_codec_config {90 char *name;91 struct omap_mcbsp_reg_cfg *mcbsp_regs_alsa;92+ struct snd_pcm_hw_constraint_list *hw_constraints_rates;93+ struct snd_pcm_hardware *snd_omap_alsa_playback;94+ struct snd_pcm_hardware *snd_omap_alsa_capture;95 void (*codec_configure_dev)(void);96 void (*codec_set_samplerate)(long);97 void (*codec_clock_setup)(void);