Re: I2C: Fix unhandled fault in i2c-omap controller

2008-03-17 Thread Tony Lindgren
* Jean Delvare [EMAIL PROTECTED] [080314 19:52]:
 On Thu, 13 Mar 2008 17:51:24 +0200, Tony Lindgren wrote:
  Hi Jean,
  
  Here's an omap I2C fix that would be nice to get into 2.6.25 if still
  possible.
 
 Review:

Thanks for looking throught it.

 
  commit 8e4f19286e68d38d589451ad2a10545f2c40032d
  Author: Tony Lindgren [EMAIL PROTECTED]
  Date:   Mon Feb 18 20:16:00 2008 -0800
  
  I2C: Fix unhandled fault in i2c-omap controller
  
  If an I2C interrupt happens between disabling interface clock
  and functional clock, the interrupt handler will produce an
  external abort on non-linefetch error when trying to access
  driver registers while interface clock is disabled.
  
  This patch fixes the problem by saving and disabling i2c-omap
  interrupt before turning off the clocks. Also disable functional
  clock before the interface clock as suggested by Paul Walmsley.
  
  Patch also renames enable/disable_clocks functions to unidle/idle
  functions. Note that the driver is currently not taking advantage
  of the idle interrupts. To use the idle interrupts, driver would
  have to enable interface clock based on the idle interrupt
  and dev-idle flag.
  
  Cc: Paul Walmsley [EMAIL PROTECTED]
  Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
  
  diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
  index da66397..862dd69 100644
  --- a/drivers/i2c/busses/i2c-omap.c
  +++ b/drivers/i2c/busses/i2c-omap.c
  @@ -128,6 +128,8 @@ struct omap_i2c_dev {
  size_t  buf_len;
  struct i2c_adapter  adapter;
  unsignedrev1:1;
  +   unsignedidle:1;
  +   u16 iestate;/* Saved interrupt register */
   };
   
   static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev,
  @@ -174,18 +176,30 @@ static void omap_i2c_put_clocks(struct omap_i2c_dev 
  *dev)
  }
   }
   
  -static void omap_i2c_enable_clocks(struct omap_i2c_dev *dev)
  +static void omap_i2c_unidle(struct omap_i2c_dev *dev)
   {
  if (dev-iclk != NULL)
  clk_enable(dev-iclk);
  clk_enable(dev-fclk);
  +   if (dev-iestate)
  +   omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev-iestate);
  +   dev-idle = 0;
   }
   
  -static void omap_i2c_disable_clocks(struct omap_i2c_dev *dev)
  +static void omap_i2c_idle(struct omap_i2c_dev *dev)
   {
  +   u16 iv;
  +
  +   dev-idle = 1;
  +   dev-iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
  +   omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, 0);
  +   if (dev-rev1)
  +   iv = omap_i2c_read_reg(dev, OMAP_I2C_IV_REG);
 
 Reading OMAP_I2C_IV_REG but not doing anything with the value? This
 deserves at least a comment if this is done on purpose (but then I
 don't think you need the iv variable at all.)

Yeah for rev1 of the controller reading of IV (Interrupt Vector)
clears the interrupts. I'll add a comment there.

 
  +   else
  +   omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, dev-iestate);
  +   clk_disable(dev-fclk);
  if (dev-iclk != NULL)
  clk_disable(dev-iclk);
  -   clk_disable(dev-fclk);
   }
   
   static int omap_i2c_init(struct omap_i2c_dev *dev)
  @@ -360,7 +374,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg 
  msgs[], int num)
  int i;
  int r;
   
  -   omap_i2c_enable_clocks(dev);
  +   omap_i2c_unidle(dev);
   
  if ((r = omap_i2c_wait_for_bb(dev))  0)
  goto out;
  @@ -374,7 +388,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg 
  msgs[], int num)
  if (r == 0)
  r = num;
   out:
  -   omap_i2c_disable_clocks(dev);
  +   omap_i2c_idle(dev);
  return r;
   }
   
  @@ -403,6 +417,9 @@ omap_i2c_rev1_isr(int this_irq, void *dev_id)
  struct omap_i2c_dev *dev = dev_id;
  u16 iv, w;
   
  +   if (dev-idle)
  +   return IRQ_NONE;
  +
  iv = omap_i2c_read_reg(dev, OMAP_I2C_IV_REG);
  switch (iv) {
  case 0x00:  /* None */
  @@ -457,6 +474,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
  u16 stat, w;
  int count = 0;
   
  +   if (dev-idle)
  +   return IRQ_NONE;
  +
  bits = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
  while ((stat = (omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG)))  bits) {
  dev_dbg(dev-dev, IRQ (ISR = 0x%04x)\n, stat);
  @@ -575,7 +595,7 @@ omap_i2c_probe(struct platform_device *pdev)
  if ((r = omap_i2c_get_clocks(dev)) != 0)
  goto err_free_mem;
   
  -   omap_i2c_enable_clocks(dev);
  +   omap_i2c_unidle(dev);
   
  if (cpu_is_omap15xx())
  dev-rev1 = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG)  0x20;
  @@ -610,7 +630,7 @@ omap_i2c_probe(struct platform_device *pdev)
  goto err_free_irq;
  }
   
  -   omap_i2c_disable_clocks(dev);
  +   omap_i2c_idle(dev);
   
  return 0;
   
  @@ -618,7 +638,7 @@ err_free_irq:
  free_irq(dev-irq, dev);
   err_unuse_clocks:
  

[PATCH 12/14] ARM: OMAP1: Timer32K: Fix timer32K for clockevents and clean it up

2008-03-17 Thread Tony Lindgren
This patch fixes timer32k for clockevents and syncs it with
linux-omap tree.

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/timer32k.c |   20 ++--
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 1f7365f..c4af39a 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -1,5 +1,5 @@
 /*
- * linux/arch/arm/plat-omap/timer32k.c
+ * linux/arch/arm/mach-omap1/timer32k.c
  *
  * OMAP 32K Timer
  *
@@ -40,7 +40,6 @@
 #include linux/interrupt.h
 #include linux/sched.h
 #include linux/spinlock.h
-
 #include linux/err.h
 #include linux/clk.h
 #include linux/clocksource.h
@@ -71,8 +70,6 @@ struct sys_timer omap_timer;
 
 #if defined(CONFIG_ARCH_OMAP16XX)
 #define TIMER_32K_SYNCHRONIZED 0xfffbc410
-#elif defined(CONFIG_ARCH_OMAP24XX)
-#define TIMER_32K_SYNCHRONIZED (OMAP24XX_32KSYNCT_BASE + 0x10)
 #else
 #error OMAP 32KHz timer does not currently work on 15XX!
 #endif
@@ -119,6 +116,14 @@ static inline void omap_32k_timer_stop(void)
 
 #define omap_32k_timer_ack_irq()
 
+static int omap_32k_timer_set_next_event(unsigned long delta,
+struct clock_event_device *dev)
+{
+   omap_32k_timer_start(delta);
+
+   return 0;
+}
+
 static void omap_32k_timer_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt)
 {
@@ -126,9 +131,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode 
mode,
 
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
+   case CLOCK_EVT_MODE_ONESHOT:
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:
break;
@@ -139,8 +144,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode 
mode,
 
 static struct clock_event_device clockevent_32k_timer = {
.name   = 32k-timer,
-   .features   = CLOCK_EVT_FEAT_PERIODIC,
+   .features   = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
.shift  = 32,
+   .set_next_event = omap_32k_timer_set_next_event,
.set_mode   = omap_32k_timer_set_mode,
 };
 
@@ -171,6 +177,8 @@ static struct irqaction omap_32k_timer_irq = {
 
 static __init void omap_init_32k_timer(void)
 {
+   setup_irq(INT_OS_TIMER, omap_32k_timer_irq);
+
clockevent_32k_timer.mult = div_sc(OMAP_32K_TICKS_PER_SEC,
   NSEC_PER_SEC,
   clockevent_32k_timer.shift);
-- 
1.5.3.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/14] ARM: OMAP: Use gpiolib with tps65010 for OSK 5912

2008-03-17 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Convert OSK board to use new tps65010 gpiolib support.  This
includes moving its LED support from leds-osk to gpio-leds,
giving more trigger options and a net platform code shrink.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-osk.c   |  108 +
 arch/arm/mach-omap1/leds-osk.c|   80 +
 include/asm-arm/arch-omap/board-osk.h |   11 +++
 3 files changed, 82 insertions(+), 117 deletions(-)

diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index dd9ece8..4f9baba 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -32,6 +32,7 @@
 #include linux/interrupt.h
 #include linux/irq.h
 #include linux/i2c.h
+#include linux/leds.h
 
 #include linux/mtd/mtd.h
 #include linux/mtd/partitions.h
@@ -183,11 +184,80 @@ static struct platform_device *osk5912_devices[] 
__initdata = {
osk5912_mcbsp1_device,
 };
 
+static struct gpio_led tps_leds[] = {
+   /* NOTE:  D9 and D2 have hardware blink support.
+* Also, D9 requires non-battery power.
+*/
+   { .gpio = OSK_TPS_GPIO_LED_D9, .name = d9, },
+   { .gpio = OSK_TPS_GPIO_LED_D2, .name = d2, },
+   { .gpio = OSK_TPS_GPIO_LED_D3, .name = d3, .active_low = 1,
+   .default_trigger = heartbeat, },
+};
+
+static struct gpio_led_platform_data tps_leds_data = {
+   .num_leds   = 3,
+   .leds   = tps_leds,
+};
+
+static struct platform_device osk5912_tps_leds = {
+   .name   = leds-gpio,
+   .id = 0,
+   .dev.platform_data  = tps_leds_data,
+};
+
+static int osk_tps_setup(struct i2c_client *client, void *context)
+{
+   /* Set GPIO 1 HIGH to disable VBUS power supply;
+* OHCI driver powers it up/down as needed.
+*/
+   gpio_request(OSK_TPS_GPIO_USB_PWR_EN, n_vbus_en);
+   gpio_direction_output(OSK_TPS_GPIO_USB_PWR_EN, 1);
+
+   /* Set GPIO 2 high so LED D3 is off by default */
+   tps65010_set_gpio_out_value(GPIO2, HIGH);
+
+   /* Set GPIO 3 low to take ethernet out of reset */
+   gpio_request(OSK_TPS_GPIO_LAN_RESET, smc_reset);
+   gpio_direction_output(OSK_TPS_GPIO_LAN_RESET, 0);
+
+   /* GPIO4 is VDD_DSP */
+   gpio_request(OSK_TPS_GPIO_DSP_PWR_EN, dsp_power);
+   gpio_direction_output(OSK_TPS_GPIO_DSP_PWR_EN, 1);
+   /* REVISIT if DSP support isn't configured, power it off ... */
+
+   /* Let LED1 (D9) blink; leds-gpio may override it */
+   tps65010_set_led(LED1, BLINK);
+
+   /* Set LED2 off by default */
+   tps65010_set_led(LED2, OFF);
+
+   /* Enable LOW_PWR handshake */
+   tps65010_set_low_pwr(ON);
+
+   /* Switch VLDO2 to 3.0V for AIC23 */
+   tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V
+   | TPS_LDO1_ENABLE);
+
+   /* register these three LEDs */
+   osk5912_tps_leds.dev.parent = client-dev;
+   platform_device_register(osk5912_tps_leds);
+
+   return 0;
+}
+
+static struct tps65010_board tps_board = {
+   .base   = OSK_TPS_GPIO_BASE,
+   .outmask= 0x0f,
+   .setup  = osk_tps_setup,
+};
+
 static struct i2c_board_info __initdata osk_i2c_board_info[] = {
{
I2C_BOARD_INFO(tps65010, 0x48),
.type   = tps65010,
.irq= OMAP_GPIO_IRQ(OMAP_MPUIO(1)),
+   .platform_data  = tps_board,
+
},
/* TODO when driver support is ready:
 *  - aic23 audio chip at 0x1a
@@ -488,44 +558,6 @@ static void __init osk_map_io(void)
omap1_map_common_io();
 }
 
-#ifdef CONFIG_TPS65010
-static int __init osk_tps_init(void)
-{
-   if (!machine_is_omap_osk())
-   return 0;
-
-   /* Let LED1 (D9) blink */
-   tps65010_set_led(LED1, BLINK);
-
-   /* Disable LED 2 (D2) */
-   tps65010_set_led(LED2, OFF);
-
-   /* Set GPIO 1 HIGH to disable VBUS power supply;
-* OHCI driver powers it up/down as needed.
-*/
-   tps65010_set_gpio_out_value(GPIO1, HIGH);
-
-   /* Set GPIO 2 low to turn on LED D3 */
-   tps65010_set_gpio_out_value(GPIO2, HIGH);
-
-   /* Set GPIO 3 low to take ethernet out of reset */
-   tps65010_set_gpio_out_value(GPIO3, LOW);
-
-   /* gpio4 for VDD_DSP */
-   /* FIXME send power to DSP iff it's configured */
-
-   /* Enable LOW_PWR */
-   tps65010_set_low_pwr(ON);
-
-   /* Switch VLDO2 to 3.0V for AIC23 */
-   tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V
-   | TPS_LDO1_ENABLE);
-
-   return 0;
-}
-fs_initcall(osk_tps_init);
-#endif
-
 MACHINE_START(OMAP_OSK, TI-OSK)
/* Maintainer: Dirk Behme [EMAIL PROTECTED] */
.phys_io= 0xfff0,
diff --git 

[PATCH 0/14] Omap patches for post 2.6.25

2008-03-17 Thread Tony Lindgren
Hi all,

Attached are patches for common omap code and omap1 specific code for
post 2.6.25 for review. The patches contain updates for gpiolib,
timers and pin multiplexing.

The patch for TPS65010 I2C driver is included in this series as it involves
some board updates also. This has been discussed already on the I2C list,
and it's OK with Jean [1].

I'm still working on patch set for arch/arm/mach-omap2, and will post it
within next few days.

Regards,

Tony

[1] http://lists.lm-sensors.org/pipermail/i2c/2008-March/003031.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/14] ARM: OMAP: use edge/level handlers from generic IRQ framework

2008-03-17 Thread Tony Lindgren
From: Kevin Hilman [EMAIL PROTECTED]

Currently, the GPIO interrupt handling is duplicating some of the work
done by the generic IRQ handlers (handle_edge_irq, handle_level_irq)
such as detecting nesting, handling re-triggers etc.  Remove this
duplication and use generic hooks based on IRQ type.

Using generic IRQ handlers ensures correct behavior when using
threaded interrupts introduced by the -rt patch.

Signed-off-by: Kevin Hilman [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |   42 +++---
 1 files changed, 7 insertions(+), 35 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 4f104e4..1903a34 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -542,10 +542,6 @@ static inline void set_24xx_gpio_triggering(struct 
gpio_bank *bank, int gpio,
bank-level_mask =
__raw_readl(bank-base + OMAP24XX_GPIO_LEVELDETECT0) |
__raw_readl(bank-base + OMAP24XX_GPIO_LEVELDETECT1);
-   /*
-* FIXME: Possibly do 'set_irq_handler(j, handle_level_irq)' if only
-* level triggering requested.
-*/
 }
 #endif
 
@@ -656,6 +652,12 @@ static int gpio_irq_type(unsigned irq, unsigned type)
irq_desc[irq].status |= type;
}
spin_unlock_irqrestore(bank-lock, flags);
+
+   if (type  (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
+   __set_irq_handler_unlocked(irq, handle_level_irq);
+   else if (type  (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
+   __set_irq_handler_unlocked(irq, handle_edge_irq);
+
return retval;
 }
 
@@ -1050,42 +1052,12 @@ static void gpio_irq_handler(unsigned int irq, struct 
irq_desc *desc)
gpio_irq = bank-virtual_irq_start;
for (; isr != 0; isr = 1, gpio_irq++) {
struct irq_desc *d;
-   int irq_mask;
+
if (!(isr  1))
continue;
d = irq_desc + gpio_irq;
-   /* Don't run the handler if it's already running
-* or was disabled lazely.
-*/
-   if (unlikely((d-depth ||
- (d-status  IRQ_INPROGRESS {
-   irq_mask = 1 
-   (gpio_irq - bank-virtual_irq_start);
-   /* The unmasking will be done by
-* enable_irq in case it is disabled or
-* after returning from the handler if
-* it's already running.
-*/
-   _enable_gpio_irqbank(bank, irq_mask, 0);
-   if (!d-depth) {
-   /* Level triggered interrupts
-* won't ever be reentered
-*/
-   BUG_ON(level_mask  irq_mask);
-   d-status |= IRQ_PENDING;
-   }
-   continue;
-   }
 
desc_handle_irq(gpio_irq, d);
-
-   if (unlikely((d-status  IRQ_PENDING)  !d-depth)) {
-   irq_mask = 1 
-   (gpio_irq - bank-virtual_irq_start);
-   d-status = ~IRQ_PENDING;
-   _enable_gpio_irqbank(bank, irq_mask, 1);
-   retrigger |= irq_mask;
-   }
}
}
/* if bank has any level sensitive GPIO pin interrupt
-- 
1.5.3.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 13/14] ARM: OMAP: TimerMPU: Remove unused cycles-to-nsec conversions

2008-03-17 Thread Tony Lindgren
From: Kevin Hilman [EMAIL PROTECTED]

These are no longer used and similar conversions are provided
by the clocksource/clockevent code.

Signed-off-by: Kevin Hilman [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/time.c |   33 -
 1 files changed, 0 insertions(+), 33 deletions(-)

diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index a4f8b20..f6cf2b7 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -56,37 +56,6 @@
 #define OMAP_MPU_TIMER_BASEOMAP_MPU_TIMER1_BASE
 #define OMAP_MPU_TIMER_OFFSET  0x100
 
-/* cycles to nsec conversions taken from arch/i386/kernel/timers/timer_tsc.c,
- * converted to use kHz by Kevin Hilman */
-/* convert from cycles(64bits) = nanoseconds (64bits)
- *  basic equation:
- * ns = cycles / (freq / ns_per_sec)
- * ns = cycles * (ns_per_sec / freq)
- * ns = cycles * (10^9 / (cpu_khz * 10^3))
- * ns = cycles * (10^6 / cpu_khz)
- *
- * Then we use scaling math (suggested by george at mvista.com) to get:
- * ns = cycles * (10^6 * SC / cpu_khz / SC
- * ns = cycles * cyc2ns_scale / SC
- *
- * And since SC is a constant power of two, we can convert the div
- *  into a shift.
- * -johnstul at us.ibm.com math is hard, lets go 
shopping!
- */
-static unsigned long cyc2ns_scale;
-#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
-
-static inline void set_cyc2ns_scale(unsigned long cpu_khz)
-{
-   cyc2ns_scale = (100  CYC2NS_SCALE_FACTOR)/cpu_khz;
-}
-
-static inline unsigned long long cycles_2_ns(unsigned long long cyc)
-{
-   return (cyc * cyc2ns_scale)  CYC2NS_SCALE_FACTOR;
-}
-
-
 typedef struct {
u32 cntl;   /* CNTL_TIMER, R/W */
u32 load_tim;   /* LOAD_TIM,   W */
@@ -194,8 +163,6 @@ static struct irqaction omap_mpu_timer1_irq = {
 
 static __init void omap_init_mpu_timer(unsigned long rate)
 {
-   set_cyc2ns_scale(rate / 1000);
-
setup_irq(INT_TIMER1, omap_mpu_timer1_irq);
omap_mpu_timer_start(0, (rate / HZ) - 1, 1);
 
-- 
1.5.3.6

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Fix compile issues for DSP

2008-03-17 Thread Felipe Balbi
Signed-off-by: Felipe Balbi [EMAIL PROTECTED]

diff --git a/include/asm-arm/arch-omap/dsp_common.h 
b/include/asm-arm/arch-omap/dsp_common.h
index e515801..0c7565e 100644
--- a/include/asm-arm/arch-omap/dsp_common.h
+++ b/include/asm-arm/arch-omap/dsp_common.h
@@ -49,7 +49,7 @@ struct omap_dsp {
int initialized;
 };
 
-if defined(CONFIG_ARCH_OMAP1)  defined(CONFIG_OMAP_MMU_FWK)
+#if defined(CONFIG_ARCH_OMAP1)  defined(CONFIG_OMAP_MMU_FWK)
 extern void omap_dsp_request_mpui(void);
 extern void omap_dsp_release_mpui(void);
 extern int omap_dsp_request_mem(void);


-- 
- Balbi
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: OMAP: DMA: Fix incorrect channel linking

2008-03-17 Thread Tony Lindgren
* Jarkko Nikula [EMAIL PROTECTED] [080317 17:04]:
 Function enable_lnk does incorrect channel link on non-omap1 builds if chain
 is created manually with omap_request_dma and omap_dma_link_lch functions.
 
 Fix this by making sure that next_linked_ch field is initialized to -1 just
 in omap_request_dma.
 
 Signed-off-by: Jarkko Nikula [EMAIL PROTECTED]
 ---
  arch/arm/plat-omap/dma.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
 index 7937406..c00eda5 100644
 --- a/arch/arm/plat-omap/dma.c
 +++ b/arch/arm/plat-omap/dma.c
 @@ -604,6 +604,7 @@ int omap_request_dma(int dev_id, const char *dev_name,
   chan-data = data;
  #ifndef CONFIG_ARCH_OMAP1
   chan-chain_id = -1;
 + chan-next_linked_ch = -1;
  #endif
   chan-enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ;
  
 @@ -1087,7 +1088,6 @@ int omap_request_dma_chain(int dev_id, const char 
 *dev_name,
   printk(KERN_ERR omap_dma: Request failed %d\n, err);
   return err;
   }
 - dma_chan[channels[i]].next_linked_ch = -1;
   dma_chan[channels[i]].prev_linked_ch = -1;
   dma_chan[channels[i]].state = DMA_CH_NOTSTARTED;
  

Pushing today.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


another dsp build fix ...

2008-03-17 Thread David Brownell
Another compile fix for DSP code ... these symbols are defined
as NOPs in a header.

Signed-off-by: David Brownell [EMAIL PROTECTED]
---
 drivers/dsp/dspgateway/dsp_common.c |4 
 1 files changed, 4 insertions(+)

--- osk2.orig/drivers/dsp/dspgateway/dsp_common.c   2008-03-17 
21:03:13.0 -0700
+++ osk2/drivers/dsp/dspgateway/dsp_common.c2008-03-17 21:03:16.0 
-0700
@@ -502,6 +502,7 @@ void omap_dsp_release_mpui(void)
mutex_unlock(cpustat.lock);
 }
 
+#if defined(CONFIG_ARCH_OMAP1)  defined(CONFIG_OMAP_MMU_FWK)
 int omap_dsp_request_mem(void)
 {
int ret = 0;
@@ -564,6 +565,7 @@ int omap_dsp_release_mem(void)
 
return 0;
 }
+#endif
 
 void dsp_register_mem_cb(int (*req_cb)(void), void (*rel_cb)(void))
 {
@@ -597,8 +599,10 @@ arch_initcall(omap_dsp_init);
 #ifdef CONFIG_ARCH_OMAP1
 EXPORT_SYMBOL(omap_dsp_request_mpui);
 EXPORT_SYMBOL(omap_dsp_release_mpui);
+#if defined(CONFIG_ARCH_OMAP1)  defined(CONFIG_OMAP_MMU_FWK)
 EXPORT_SYMBOL(omap_dsp_request_mem);
 EXPORT_SYMBOL(omap_dsp_release_mem);
+#endif
 #endif /* CONFIG_ARCH_OMAP1 */
 
 #ifdef CONFIG_OMAP_DSP_MODULE
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html