Various minor DaVinci updates:

 - fix warnings in dma.c, i2c-davinci.c (irq handler signature changes)
 - gpio bugfix (wouldn't clear except with constant gpio#)
 - whitespace fixes in i2c-davinci.c (most of the patch, by volume)

Signed-off-by: David Brownell <[EMAIL PROTECTED]>

----
There are other build warnings that still need to be removed, like:

 * davinci_mmc.c won't build at all (config.h, api updates)
 * davinci_emac.c ignoring the return value for that sysfs "version" file.
   (Best fix probably just removes that pointless file; clearly it's "the
   version associated with this kernel, you have the source").


Index: d26-rc3/arch/arm/mach-davinci/dma.c
===================================================================
--- d26-rc3.orig/arch/arm/mach-davinci/dma.c    2006-10-31 10:27:16.000000000 
-0800
+++ d26-rc3/arch/arm/mach-davinci/dma.c 2006-10-31 11:09:24.000000000 -0800
@@ -1649,43 +1649,37 @@ void davinci_clean_channel(int ch_no)
  * DMA interrupt handlers
  *
  *****************************************************************************/
-static int dma_irq_handler_l(int sound_curr_lch, void
-                            *ch_status, struct
-                            pt_regs
-                            *data)
+static int dma_irq_handler_l(int sound_curr_lch, void *ch_status)
 {
        dev_dbg(&edma_dev.dev, "dma_irq_handler\n");
        (*cb[0]) ();
        return IRQ_HANDLED;
 }
 
-static int
-    dma_ccerr_handler_l
-    (int sound_curr_lch, void *ch_status, struct pt_regs *data) {
+static int dma_ccerr_handler_l(int sound_curr_lch, void *ch_status)
+{
        dev_dbg(&edma_dev.dev, "dma_ccerr_handler\n");
        (*cb[1]) ();
        return IRQ_HANDLED;
 }
 
-static int
-    dma_tc1err_handler_l
-    (int sound_curr_lch, void *ch_status, struct pt_regs *data) {
+static int dma_tc1err_handler_l (int sound_curr_lch, void *ch_status)
+{
        dev_dbg(&edma_dev.dev, "dma_tc1err_handler\n");
        (*cb[2]) ();
        return IRQ_HANDLED;
 }
 
-static int
-    dma_tc2err_handler_l
-    (int sound_curr_lch, void *ch_status, struct pt_regs *data) {
+static int dma_tc2err_handler_l(int sound_curr_lch, void *ch_status)
+{
        dev_dbg(&edma_dev.dev, "dma_tc2err_handler\n");
        (*cb[3]) ();
        return IRQ_HANDLED;
 }
 
-int register_dma_interrupts
-    (intr_callback cb1,
-     intr_callback cb2, intr_callback cb3, intr_callback cb4) {
+int register_dma_interrupts(intr_callback cb1, intr_callback cb2,
+                       intr_callback cb3, intr_callback cb4)
+{
        cb[0] = cb1;
        cb[1] = cb2;
        cb[2] = cb3;
Index: d26-rc3/include/asm-arm/arch-davinci/gpio.h
===================================================================
--- d26-rc3.orig/include/asm-arm/arch-davinci/gpio.h    2006-10-31 
10:28:34.000000000 -0800
+++ d26-rc3/include/asm-arm/arch-davinci/gpio.h 2006-10-31 11:11:10.000000000 
-0800
@@ -101,7 +101,7 @@ static inline int gpio_clear(unsigned gp
        struct gpio_controller  *__iomem g;
 
        if (!__builtin_constant_p(gpio))
-               return __gpio_set(gpio, 1);
+               return __gpio_set(gpio, 0);
 
        if (gpio >= DAVINCI_N_GPIO)
                return __error_inval_gpio();
Index: d26-rc3/drivers/i2c/busses/i2c-davinci.c
===================================================================
--- d26-rc3.orig/drivers/i2c/busses/i2c-davinci.c       2006-10-31 
10:27:49.000000000 -0800
+++ d26-rc3/drivers/i2c/busses/i2c-davinci.c    2006-10-31 11:17:42.000000000 
-0800
@@ -55,12 +55,12 @@
 MODULE_AUTHOR("Texas Instruments India");
 MODULE_DESCRIPTION("TI DaVinci I2C bus adapter");
 MODULE_LICENSE("GPL");
-  
+
 static int bus_freq;
 module_param(bus_freq, int, 0);
 MODULE_PARM_DESC(bus_freq,
   "Set I2C bus frequency in KHz: 100 (Standard Mode) or 400 (Fast Mode)");
-  
+
 /* ----- global defines ----------------------------------------------- */
 static const char driver_name[] = "i2c_davinci";
 
@@ -106,21 +106,21 @@ static int i2c_davinci_reset(struct i2c_
        dev->regs->icmdr &= ~DAVINCI_I2C_ICMDR_IRS_MASK;
 
         /* NOTE: I2C Clock divider programming info
-        * As per I2C specs the following formulas provide prescalar
+        * As per I2C specs the following formulas provide prescalar
          * and low/high divider values
-        *
-        * input clk --> PSC Div -----------> ICCL/H Div --> output clock
-        *                       module clk
-        *
-        * output clk = module clk / (PSC + 1) [ (ICCL + d) + (ICCH + d) ]
-        *
-        * Thus,
-        * (ICCL + ICCH) = clk = (input clk / ((psc +1) * output clk)) - 2d;
-        *
-        * where if PSC == 0, d = 7,
-        *       if PSC == 1, d = 6
-        *       if PSC > 1 , d = 5
-        */
+        *
+        * input clk --> PSC Div -----------> ICCL/H Div --> output clock
+        *                       module clk
+        *
+        * output clk = module clk / (PSC + 1) [ (ICCL + d) + (ICCH + d) ]
+        *
+        * Thus,
+        * (ICCL + ICCH) = clk = (input clk / ((psc +1) * output clk)) - 2d;
+        *
+        * where if PSC == 0, d = 7,
+        *       if PSC == 1, d = 6
+        *       if PSC > 1 , d = 5
+        */
 
        psc = 26; /* To get 1MHz clock */
 
@@ -154,8 +154,8 @@ static int i2c_davinci_wait_for_bb(struc
                                   char allow_sleep)
 {
        unsigned long timeout;
-       int i;
-       static  char to_cnt = 0;
+       int i;
+       static  char to_cnt = 0;
 
        timeout = jiffies + DAVINCI_I2C_TIMEOUT;
        while ((i2c_davinci_dev.regs->icstr) & DAVINCI_I2C_ICSTR_BB_MASK) {
@@ -340,7 +340,7 @@ i2c_davinci_xfer(struct i2c_adapter *ada
        }
 
        for (count = 0; count < num; count++) {
-               dev_dbg(dev->dev, 
+               dev_dbg(dev->dev,
                        "%s: %d, addr: 0x%04x, len: %d, flags: 0x%x\n",
                        __FUNCTION__,
                        count, msgs[count].addr, msgs[count].len,
@@ -348,7 +348,7 @@ i2c_davinci_xfer(struct i2c_adapter *ada
 
                do {
                        ret = i2c_davinci_xfer_msg(adap, &msgs[count],
-                                                  (count == (num - 1)));
+                                                  (count == (num - 1)));
 
                        if (ret < 0) {
                                dev_dbg(dev->dev, "Retrying ...\n");
@@ -358,7 +358,7 @@ i2c_davinci_xfer(struct i2c_adapter *ada
                                break;
                } while (retries);
 
-               dev_dbg(dev->dev, "%s:%d ret: %d\n", 
+               dev_dbg(dev->dev, "%s:%d ret: %d\n",
                        __FUNCTION__, __LINE__, ret);
 
                if (ret != msgs[count].len)
@@ -368,7 +368,7 @@ i2c_davinci_xfer(struct i2c_adapter *ada
        if (ret >= 0 && num > 1)
                ret = num;
 
-       dev_dbg(dev->dev, "%s:%d ret: %d\n", 
+       dev_dbg(dev->dev, "%s:%d ret: %d\n",
                __FUNCTION__, __LINE__, ret);
 
        return ret;
@@ -393,14 +393,14 @@ static inline void i2c_davinci_complete_
  * occurs.
  */
 static irqreturn_t
-i2c_davinci_isr(int this_irq, void *dev_id, struct pt_regs *reg)
+i2c_davinci_isr(int this_irq, void *dev_id)
 {
        struct i2c_davinci_device *dev = dev_id;
        u32 stat;
 
        while ((stat = dev->regs->icivr) != 0) {
                dev_dbg(dev->dev, "%s: stat=0x%x\n", __FUNCTION__, stat);
-       
+
                switch (stat) {
                case DAVINCI_I2C_ICIVR_INTCODE_AL:
                        dev->cmd_err |= DAVINCI_I2C_ICSTR_AL_MASK;
@@ -507,9 +507,9 @@ davinci_i2c_probe(struct platform_device
        else
                bus_freq = 100; /* Standard mode */
 
-       dev->clk = clk_get (&pdev->dev, "I2CCLK");      
+       dev->clk = clk_get (&pdev->dev, "I2CCLK");
        if (IS_ERR(dev->clk))
-               return -1;
+               return -1;
        clk_enable(dev->clk);
 
        dev->regs = (davinci_i2cregsovly)mem->start;
@@ -578,7 +578,7 @@ davinci_i2c_remove(struct platform_devic
 static struct platform_driver davinci_i2c_driver = {
        .probe          = davinci_i2c_probe,
        .remove         = davinci_i2c_remove,
-       .driver         = {
+       .driver         = {
                .name   = (char *)driver_name,
        },
 };
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to