[media] drx-j: get rid of function prototypes at drx_dap_fasi.c
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Mon, 27 Jan 2014 05:07:01 +0000 (02:07 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 4 Mar 2014 17:38:54 +0000 (14:38 -0300)
Reorder functions and data at drx_dap_fasi.c, in order to avoid
having function prototypes.

This is in preparation to merge this code inside drxj, removing
some duplicated bits there, and getting rid of yet another
abstraction layer.

Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/dvb-frontends/drx39xyj/drx_dap_fasi.c

index b81b4f9cd4b040f4d733fbff1898f12a3e831ee6..3e456ba780eb9d08b93351b3e9f9c0c767737409 100644 (file)
 
 /*============================================================================*/
 
-/* Function prototypes */
-static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,   /* address of I2C device        */
-                                         u32 addr,     /* address of register/memory   */
-                                         u16 datasize, /* size of data                 */
-                                         u8 *data,     /* data to send                 */
-                                         u32 flags);   /* special device flags         */
-
-static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,    /* address of I2C device        */
-                                        u32 addr,      /* address of register/memory   */
-                                        u16 datasize,  /* size of data                 */
-                                        u8 *data,      /* data to send                 */
-                                        u32 flags);    /* special device flags         */
-
-static int drxdap_fasi_write_reg8(struct i2c_device_addr *dev_addr,    /* address of I2C device        */
-                                        u32 addr,      /* address of register          */
-                                        u8 data,       /* data to write                */
-                                        u32 flags);    /* special device flags         */
-
-static int drxdap_fasi_read_reg8(struct i2c_device_addr *dev_addr,     /* address of I2C device        */
-                                       u32 addr,       /* address of register          */
-                                       u8 *data,       /* buffer to receive data       */
-                                       u32 flags);     /* special device flags         */
-
-static int drxdap_fasi_read_modify_write_reg8(struct i2c_device_addr *dev_addr,        /* address of I2C device        */
-                                                  u32 waddr,   /* address of register          */
-                                                  u32 raddr,   /* address to read back from    */
-                                                  u8 datain,   /* data to send                 */
-                                                  u8 *dataout);        /* data to receive back         */
-
-static int drxdap_fasi_write_reg16(struct i2c_device_addr *dev_addr,   /* address of I2C device        */
-                                         u32 addr,     /* address of register          */
-                                         u16 data,     /* data to write                */
-                                         u32 flags);   /* special device flags         */
-
-static int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr,    /* address of I2C device        */
-                                        u32 addr,      /* address of register          */
-                                        u16 *data,     /* buffer to receive data       */
-                                        u32 flags);    /* special device flags         */
-
-static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr,       /* address of I2C device        */
-                                                   u32 waddr,  /* address of register          */
-                                                   u32 raddr,  /* address to read back from    */
-                                                   u16 datain, /* data to send                 */
-                                                   u16 *dataout);      /* data to receive back         */
-
-static int drxdap_fasi_write_reg32(struct i2c_device_addr *dev_addr,   /* address of I2C device        */
-                                         u32 addr,     /* address of register          */
-                                         u32 data,     /* data to write                */
-                                         u32 flags);   /* special device flags         */
-
-static int drxdap_fasi_read_reg32(struct i2c_device_addr *dev_addr,    /* address of I2C device        */
-                                        u32 addr,      /* address of register          */
-                                        u32 *data,     /* buffer to receive data       */
-                                        u32 flags);    /* special device flags         */
-
-static int drxdap_fasi_read_modify_write_reg32(struct i2c_device_addr *dev_addr,       /* address of I2C device        */
-                                                   u32 waddr,  /* address of register          */
-                                                   u32 raddr,  /* address to read back from    */
-                                                   u32 datain, /* data to send                 */
-                                                   u32 *dataout);      /* data to receive back         */
-
-/* The structure containing the protocol interface */
-struct drx_access_func drx_dap_fasi_funct_g = {
-       drxdap_fasi_write_block,        /* Supported */
-       drxdap_fasi_read_block, /* Supported */
-       drxdap_fasi_write_reg8, /* Not supported */
-       drxdap_fasi_read_reg8,  /* Not supported */
-       drxdap_fasi_read_modify_write_reg8,     /* Not supported */
-       drxdap_fasi_write_reg16,        /* Supported */
-       drxdap_fasi_read_reg16, /* Supported */
-       drxdap_fasi_read_modify_write_reg16,    /* Supported */
-       drxdap_fasi_write_reg32,        /* Supported */
-       drxdap_fasi_read_reg32, /* Supported */
-       drxdap_fasi_read_modify_write_reg32     /* Not supported */
-};
-
 /*============================================================================*/
 
 /* Functions not supported by protocol*/
@@ -346,49 +270,6 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,
        return rc;
 }
 
-/******************************
-*
-* int drxdap_fasi_read_modify_write_reg16 (
-*      struct i2c_device_addr *dev_addr,   -- address of I2C device
-*      u32 waddr,     -- address of chip register/memory
-*      u32 raddr,     -- chip address to read back from
-*      u16            wdata,     -- data to send
-*      u16 *rdata)     -- data to receive back
-*
-* Write 16-bit data, then read back the original contents of that location.
-* Requires long addressing format to be allowed.
-*
-* Before sending data, the data is converted to little endian. The
-* data received back is converted back to the target platform's endianness.
-*
-* WARNING: This function is only guaranteed to work if there is one
-* master on the I2C bus.
-*
-* Output:
-* - 0     if reading was successful
-*                  in that case: read back data is at *rdata
-* - -EIO  if anything went wrong
-*
-******************************/
-
-static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr,
-                                                   u32 waddr,
-                                                   u32 raddr,
-                                                   u16 wdata, u16 *rdata)
-{
-       int rc = -EIO;
-
-#if (DRXDAPFASI_LONG_ADDR_ALLOWED == 1)
-       if (rdata == NULL)
-               return -EINVAL;
-
-       rc = drxdap_fasi_write_reg16(dev_addr, waddr, wdata, DRXDAP_FASI_RMW);
-       if (rc == 0)
-               rc = drxdap_fasi_read_reg16(dev_addr, raddr, rdata, 0);
-#endif
-
-       return rc;
-}
 
 /******************************
 *
@@ -626,6 +507,50 @@ static int drxdap_fasi_write_reg16(struct i2c_device_addr *dev_addr,
        return drxdap_fasi_write_block(dev_addr, addr, sizeof(data), buf, flags);
 }
 
+/******************************
+*
+* int drxdap_fasi_read_modify_write_reg16 (
+*      struct i2c_device_addr *dev_addr,   -- address of I2C device
+*      u32 waddr,     -- address of chip register/memory
+*      u32 raddr,     -- chip address to read back from
+*      u16            wdata,     -- data to send
+*      u16 *rdata)     -- data to receive back
+*
+* Write 16-bit data, then read back the original contents of that location.
+* Requires long addressing format to be allowed.
+*
+* Before sending data, the data is converted to little endian. The
+* data received back is converted back to the target platform's endianness.
+*
+* WARNING: This function is only guaranteed to work if there is one
+* master on the I2C bus.
+*
+* Output:
+* - 0     if reading was successful
+*                  in that case: read back data is at *rdata
+* - -EIO  if anything went wrong
+*
+******************************/
+
+static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr,
+                                                   u32 waddr,
+                                                   u32 raddr,
+                                                   u16 wdata, u16 *rdata)
+{
+       int rc = -EIO;
+
+#if (DRXDAPFASI_LONG_ADDR_ALLOWED == 1)
+       if (rdata == NULL)
+               return -EINVAL;
+
+       rc = drxdap_fasi_write_reg16(dev_addr, waddr, wdata, DRXDAP_FASI_RMW);
+       if (rc == 0)
+               rc = drxdap_fasi_read_reg16(dev_addr, raddr, rdata, 0);
+#endif
+
+       return rc;
+}
+
 /******************************
 *
 * int drxdap_fasi_write_reg32 (
@@ -656,3 +581,18 @@ static int drxdap_fasi_write_reg32(struct i2c_device_addr *dev_addr,
 
        return drxdap_fasi_write_block(dev_addr, addr, sizeof(data), buf, flags);
 }
+
+/* The structure containing the protocol interface */
+struct drx_access_func drx_dap_fasi_funct_g = {
+       drxdap_fasi_write_block,        /* Supported */
+       drxdap_fasi_read_block, /* Supported */
+       drxdap_fasi_write_reg8, /* Not supported */
+       drxdap_fasi_read_reg8,  /* Not supported */
+       drxdap_fasi_read_modify_write_reg8,     /* Not supported */
+       drxdap_fasi_write_reg16,        /* Supported */
+       drxdap_fasi_read_reg16, /* Supported */
+       drxdap_fasi_read_modify_write_reg16,    /* Supported */
+       drxdap_fasi_write_reg32,        /* Supported */
+       drxdap_fasi_read_reg32, /* Supported */
+       drxdap_fasi_read_modify_write_reg32     /* Not supported */
+};