[PATCH] v4l: change the prefix of msp34xx and error while reading chip version
[sfrench/cifs-2.6.git] / drivers / media / video / msp3400.c
index b4ee9dfe6d4247e1cfcdc47ac8bcdb2082140290..01d567cf5c680c4f96337c246eadfe7f899efa11 100644 (file)
@@ -567,10 +567,6 @@ static void msp3400c_set_audmode(struct i2c_client *client, int audmode)
        switch (audmode) {
        case V4L2_TUNER_MODE_STEREO:
                src = 0x0020 | nicam;
-#if 0
-               /* spatial effect */
-               msp3400c_write(client,I2C_MSP3400C_DFP, 0x0005,0x4000);
-#endif
                break;
        case V4L2_TUNER_MODE_MONO:
                if (msp->mode == MSP_MODE_AM_NICAM) {
@@ -741,17 +737,13 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout)
                        set_current_state(TASK_INTERRUPTIBLE);
                        schedule();
                } else {
-#if 0
-                       /* hmm, that one doesn't return on wakeup ... */
-                       msleep_interruptible(timeout);
-#else
                        set_current_state(TASK_INTERRUPTIBLE);
                        schedule_timeout(msecs_to_jiffies(timeout));
-#endif
                }
        }
-       try_to_freeze();
+
        remove_wait_queue(&msp->wq, &wait);
+       try_to_freeze();
        return msp->restart;
 }
 
@@ -1154,17 +1146,10 @@ static int msp3410d_thread(void *data)
                                            MSP_CARRIER(10.7));
                        /* scart routing */
                        msp3400c_set_scart(client,SCART_IN2,0);
-#if 0
-                       /* radio from SCART_IN2 */
-                       msp3400c_write(client,I2C_MSP3400C_DFP, 0x08, 0x0220);
-                       msp3400c_write(client,I2C_MSP3400C_DFP, 0x09, 0x0220);
-                       msp3400c_write(client,I2C_MSP3400C_DFP, 0x0b, 0x0220);
-#else
                        /* msp34xx does radio decoding */
                        msp3400c_write(client,I2C_MSP3400C_DFP, 0x08, 0x0020);
                        msp3400c_write(client,I2C_MSP3400C_DFP, 0x09, 0x0020);
                        msp3400c_write(client,I2C_MSP3400C_DFP, 0x0b, 0x0020);
-#endif
                        break;
                case 0x0003:
                case 0x0004:
@@ -1431,7 +1416,7 @@ static int msp_detach(struct i2c_client *client);
 static int msp_probe(struct i2c_adapter *adap);
 static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg);
 
-static int msp_suspend(struct device * dev, u32 state, u32 level);
+static int msp_suspend(struct device * dev, pm_message_t state, u32 level);
 static int msp_resume(struct device * dev, u32 level);
 
 static void msp_wake_thread(struct i2c_client *client);
@@ -1452,7 +1437,7 @@ static struct i2c_driver driver = {
 
 static struct i2c_client client_template =
 {
-       I2C_DEVNAME("(unset)"),
+       .name      = "(unset)",
        .flags     = I2C_CLIENT_ALLOW_USE,
         .driver    = &driver,
 };
@@ -1467,7 +1452,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
         client_template.addr = addr;
 
         if (-1 == msp3400c_reset(&client_template)) {
-                dprintk("msp3400: no chip found\n");
+                dprintk("msp34xx: no chip found\n");
                 return -1;
         }
 
@@ -1493,7 +1478,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
        if (-1 == msp3400c_reset(c)) {
                kfree(msp);
                kfree(c);
-               dprintk("msp3400: no chip found\n");
+               dprintk("msp34xx: no chip found\n");
                return -1;
        }
 
@@ -1503,14 +1488,10 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
        if ((-1 == msp->rev1) || (0 == msp->rev1 && 0 == msp->rev2)) {
                kfree(msp);
                kfree(c);
-               printk("msp3400: error while reading chip version\n");
+               dprintk("msp34xx: error while reading chip version\n");
                return -1;
        }
 
-#if 0
-       /* this will turn on a 1kHz beep - might be useful for debugging... */
-       msp3400c_write(c,I2C_MSP3400C_DFP, 0x0014, 0x1040);
-#endif
        msp3400c_setvolume(c, msp->muted, msp->volume, msp->balance);
 
        snprintf(c->name, sizeof(c->name), "MSP34%02d%c-%c%d",
@@ -1528,7 +1509,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
        }
 
        /* hello world :-) */
-       printk(KERN_INFO "msp34xx: init: chip=%s",i2c_clientname(c));
+       printk(KERN_INFO "msp34xx: init: chip=%s", c->name);
        if (HAVE_NICAM(msp))
                printk(" +nicam");
        if (HAVE_SIMPLE(msp))
@@ -1836,7 +1817,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int msp_suspend(struct device * dev, u32 state, u32 level)
+static int msp_suspend(struct device * dev, pm_message_t state, u32 level)
 {
        struct i2c_client *c = container_of(dev, struct i2c_client, dev);