]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/ir-kbd-i2c.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
[linux-2.6-omap-h63xx.git] / drivers / media / video / ir-kbd-i2c.c
index 9851987b95fbed200c94fa0207817271f3e728d0..7b65f5e537f803355593a85cf73b984843d851c3 100644 (file)
@@ -40,7 +40,6 @@
 #include <linux/i2c.h>
 #include <linux/i2c-id.h>
 #include <linux/workqueue.h>
-#include <asm/semaphore.h>
 
 #include <media/ir-common.h>
 #include <media/ir-kbd-i2c.h>
@@ -51,7 +50,7 @@
 static int debug;
 module_param(debug, int, 0644);    /* debug level (0,1,2) */
 
-static int hauppauge = 0;
+static int hauppauge;
 module_param(hauppauge, int, 0644);    /* Choose Hauppauge remote */
 MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)");
 
@@ -154,7 +153,7 @@ static int get_key_fusionhdtv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
        }
 
        if(buf[0] !=0 || buf[1] !=0 || buf[2] !=0 || buf[3] != 0)
-               dprintk(2, "%s: 0x%2x 0x%2x 0x%2x 0x%2x\n", __FUNCTION__,
+               dprintk(2, "%s: 0x%2x 0x%2x 0x%2x 0x%2x\n", __func__,
                        buf[0], buf[1], buf[2], buf[3]);
 
        /* no key pressed or signal from other ir remote */
@@ -509,10 +508,13 @@ static int ir_probe(struct i2c_adapter *adap)
        static const int probe_em28XX[] = { 0x30, 0x47, -1 };
        static const int probe_cx88[] = { 0x18, 0x6b, 0x71, -1 };
        static const int probe_cx23885[] = { 0x6b, -1 };
-       const int *probe = NULL;
-       struct i2c_client c;
-       unsigned char buf;
-       int i,rc;
+       const int *probe;
+       struct i2c_msg msg = {
+               .flags = I2C_M_RD,
+               .len = 0,
+               .buf = NULL,
+       };
+       int i, rc;
 
        switch (adap->id) {
        case I2C_HW_B_BT848:
@@ -533,20 +535,18 @@ static int ir_probe(struct i2c_adapter *adap)
        case I2C_HW_B_CX23885:
                probe = probe_cx23885;
                break;
-       }
-       if (NULL == probe)
+       default:
                return 0;
+       }
 
-       memset(&c,0,sizeof(c));
-       c.adapter = adap;
        for (i = 0; -1 != probe[i]; i++) {
-               c.addr = probe[i];
-               rc = i2c_master_recv(&c,&buf,0);
+               msg.addr = probe[i];
+               rc = i2c_transfer(adap, &msg, 1);
                dprintk(1,"probe 0x%02x @ %s: %s\n",
                        probe[i], adap->name,
-                       (0 == rc) ? "yes" : "no");
-               if (0 == rc) {
-                       ir_attach(adap,probe[i],0,0);
+                       (1 == rc) ? "yes" : "no");
+               if (1 == rc) {
+                       ir_attach(adap, probe[i], 0, 0);
                        break;
                }
        }