[PATCH] V4L: 913: saa713x cards with i2c remotes now autoload ir-kbd-i2c
authorRicardo Cerqueira <v4l@cerqueira.org>
Wed, 9 Nov 2005 05:38:47 +0000 (21:38 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 9 Nov 2005 15:56:30 +0000 (07:56 -0800)
SAA713x cards with i2c remotes now autoload ir-kbd-i2c (disable_ir works, as
it does for GPIO remotes)

Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-core.c
drivers/media/video/saa7134/saa7134-input.c
drivers/media/video/saa7134/saa7134.h

index ac361858901a9e86b90cd2d4d1ce8be73287a72e..135fd59a6b20ff3b21f21c44a906b5e82cce1a14 100644 (file)
@@ -3038,7 +3038,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
        switch (dev->board) {
        case SAA7134_BOARD_FLYVIDEO2000:
        case SAA7134_BOARD_FLYVIDEO3000:
-               dev->has_remote = 1;
+               dev->has_remote = SAA7134_REMOTE_GPIO;
                board_flyvideo(dev);
                break;
        case SAA7134_BOARD_FLYTVPLATINUM_MINI2:
@@ -3068,7 +3068,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
        case SAA7134_BOARD_GOTVIEW_7135:
        case SAA7134_BOARD_KWORLD_TERMINATOR:
        case SAA7134_BOARD_PCTV_CARDBUS:
-               dev->has_remote = 1;
+               dev->has_remote = SAA7134_REMOTE_GPIO;
                break;
        case SAA7134_BOARD_MD5044:
                printk("%s: seems there are two different versions of the MD5044\n"
@@ -3108,6 +3108,11 @@ int saa7134_board_init1(struct saa7134_dev *dev)
 
                saa_writeb (SAA7134_PRODUCTION_TEST_MODE, 0x00);
                break;
+       /* i2c remotes */
+       case SAA7134_BOARD_PINNACLE_PCTV_110i:
+       case SAA7134_BOARD_UPMOST_PURPLE_TV:
+               dev->has_remote = SAA7134_REMOTE_I2C;
+               break;
        }
        return 0;
 }
index afa0cfce657802983553c66e4bd35450afe38de3..454b8a86c83000e1fd49122e14b52b8ab159c02c 100644 (file)
@@ -712,10 +712,12 @@ static int saa7134_hwinit2(struct saa7134_dev *dev)
                SAA7134_IRQ2_INTE_PE      |
                SAA7134_IRQ2_INTE_AR;
 
-       if (dev->has_remote)
+       if (dev->has_remote == SAA7134_REMOTE_GPIO)
                irq2_mask |= (SAA7134_IRQ2_INTE_GPIO18  |
                              SAA7134_IRQ2_INTE_GPIO18A |
                              SAA7134_IRQ2_INTE_GPIO16  );
+       else if (dev->has_remote == SAA7134_REMOTE_I2C)
+               request_module("ir-kbd-i2c");
 
        saa_writel(SAA7134_IRQ1, 0);
        saa_writel(SAA7134_IRQ2, irq2_mask);
index 2aba72de55d6c276aa8e83eb6ee33b4cd81fc0d5..b792401712bae2ec1f4bc09437ab651a2068c969 100644 (file)
@@ -716,7 +716,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
        int polling      = 0;
        int ir_type      = IR_TYPE_OTHER;
 
-       if (!dev->has_remote)
+       if (dev->has_remote != SAA7134_REMOTE_GPIO)
                return -ENODEV;
        if (disable_ir)
                return -ENODEV;
@@ -877,6 +877,7 @@ void saa7134_input_fini(struct saa7134_dev *dev)
 void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir)
 {
        if (disable_ir) {
+               dprintk("Found supported i2c remote, but IR has been disabled\n");
                ir->get_key=NULL;
                return;
        }
index a82468a07676470ceb23c74e4340dc702f1c2394..14a83b82ab234763822a8a125be75819eb5cf230 100644 (file)
@@ -212,6 +212,12 @@ struct saa7134_format {
 #define SAA7134_MAXBOARDS 8
 #define SAA7134_INPUT_MAX 8
 
+/* ----------------------------------------------------------- */
+/* Since we support 2 remote types, lets tell them apart       */
+
+#define SAA7134_REMOTE_GPIO  1
+#define SAA7134_REMOTE_I2C   2
+
 /* ----------------------------------------------------------- */
 /* Video Output Port Register Initialization Options           */