]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/zoran_card.c
Merge branch 'linus' into cpus4096-for-linus
[linux-2.6-omap-h63xx.git] / drivers / media / video / zoran_card.c
index 690281bb59ee616f71db4393d7b63a4080455284..0929edb2d4f182a3a79ddf051e97692912db2267 100644 (file)
@@ -59,8 +59,6 @@
 #include "zoran_device.h"
 #include "zoran_procfs.h"
 
-#define I2C_NAME(x) (x)->name
-
 extern const struct zoran_format zoran_formats[];
 
 static int card[BUZ_MAX] = { -1, -1, -1, -1 };
@@ -83,7 +81,7 @@ MODULE_PARM_DESC(decoder, "i2c TV decoder");
    or set in in a VIDIOCSFBUF ioctl
  */
 
-static unsigned long vidmem = 0;       /* Video memory base address */
+static unsigned long vidmem;   /* default = 0 - Video memory base address */
 module_param(vidmem, ulong, 0444);
 MODULE_PARM_DESC(vidmem, "Default video memory base address");
 
@@ -91,7 +89,7 @@ MODULE_PARM_DESC(vidmem, "Default video memory base address");
    Default input and video norm at startup of the driver.
 */
 
-static unsigned int default_input = 0; /* 0=Composite, 1=S-Video */
+static unsigned int default_input;     /* default 0 = Composite, 1 = S-Video */
 module_param(default_input, uint, 0444);
 MODULE_PARM_DESC(default_input,
                 "Default input (0=Composite, 1=S-Video, 2=Internal)");
@@ -101,7 +99,7 @@ module_param(default_mux, int, 0644);
 MODULE_PARM_DESC(default_mux,
                 "Default 6 Eyes mux setting (Input selection)");
 
-static int default_norm = 0;   /* 0=PAL, 1=NTSC 2=SECAM */
+static int default_norm;       /* default 0 = PAL, 1 = NTSC 2 = SECAM */
 module_param(default_norm, int, 0444);
 MODULE_PARM_DESC(default_norm, "Default norm (0=PAL, 1=NTSC, 2=SECAM)");
 
@@ -360,14 +358,6 @@ i2cid_to_modulename (u16 i2c_id)
        case I2C_DRIVERID_VPX3220:
                name = "vpx3220";
                break;
-/*     case I2C_DRIVERID_VPX3224:
-               name = "vpx3224";
-               break;
-       case I2C_DRIVERID_MSE3000:
-               name = "mse3000";
-               break;*/
-       default:
-               break;
        }
 
        return name;
@@ -388,8 +378,6 @@ codecid_to_modulename (u16 codecid)
        case CODEC_TYPE_ZR36016:
                name = "zr36016";
                break;
-       default:
-               break;
        }
 
        return name;
@@ -430,7 +418,6 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
                .type = DC10_old,
                .name = "DC10(old)",
                .i2c_decoder = I2C_DRIVERID_VPX3220,
-               /*.i2c_encoder = I2C_DRIVERID_MSE3000,*/
                .video_codec = CODEC_TYPE_ZR36050,
                .video_vfe = CODEC_TYPE_ZR36016,
 
@@ -809,7 +796,7 @@ clientunreg_unlock_and_return:
        return res;
 }
 
-static struct i2c_algo_bit_data zoran_i2c_bit_data_template = {
+static const struct i2c_algo_bit_data zoran_i2c_bit_data_template = {
        .setsda = zoran_i2c_setsda,
        .setscl = zoran_i2c_setscl,
        .getsda = zoran_i2c_getsda,
@@ -818,24 +805,17 @@ static struct i2c_algo_bit_data zoran_i2c_bit_data_template = {
        .timeout = 100,
 };
 
-static struct i2c_adapter zoran_i2c_adapter_template = {
-       .name = "zr36057",
-       .id = I2C_HW_B_ZR36067,
-       .algo = NULL,
-       .client_register = zoran_i2c_client_register,
-       .client_unregister = zoran_i2c_client_unregister,
-};
-
 static int
 zoran_register_i2c (struct zoran *zr)
 {
        memcpy(&zr->i2c_algo, &zoran_i2c_bit_data_template,
               sizeof(struct i2c_algo_bit_data));
        zr->i2c_algo.data = zr;
-       memcpy(&zr->i2c_adapter, &zoran_i2c_adapter_template,
-              sizeof(struct i2c_adapter));
-       strncpy(I2C_NAME(&zr->i2c_adapter), ZR_DEVNAME(zr),
-               sizeof(I2C_NAME(&zr->i2c_adapter)) - 1);
+       zr->i2c_adapter.id = I2C_HW_B_ZR36067;
+       zr->i2c_adapter.client_register = zoran_i2c_client_register;
+       zr->i2c_adapter.client_unregister = zoran_i2c_client_unregister;
+       strlcpy(zr->i2c_adapter.name, ZR_DEVNAME(zr),
+               sizeof(zr->i2c_adapter.name));
        i2c_set_adapdata(&zr->i2c_adapter, zr);
        zr->i2c_adapter.algo_data = &zr->i2c_algo;
        zr->i2c_adapter.dev.parent = &zr->pci_dev->dev;
@@ -1147,7 +1127,7 @@ zr36057_init (struct zoran *zr)
                goto exit_free;
        }
        for (j = 0; j < BUZ_NUM_STAT_COM; j++) {
-               zr->stat_com[j] = 1;    /* mark as unavailable to zr36057 */
+               zr->stat_com[j] = cpu_to_le32(1); /* mark as unavailable to zr36057 */
        }
 
        /*