[media] cx231xx: Only change gpio direction when needed
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 26 Sep 2010 23:48:38 +0000 (20:48 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 03:17:42 +0000 (01:17 -0200)
Acked-by: Sri Deevi <Srinivasa.Deevi@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx231xx/cx231xx-cards.c
drivers/media/video/cx231xx/cx231xx.h

index 8e088db1a56848a61311ccd70a9420cf9e6690eb..28f77a7f6572f4d60ea980eca8433267a2ffe9ed 100644 (file)
@@ -495,10 +495,11 @@ void cx231xx_pre_card_setup(struct cx231xx *dev)
        if (dev->board.tuner_gpio) {
                cx231xx_set_gpio_direction(dev, dev->board.tuner_gpio->bit, 1);
                cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit, 1);
+       }
+       if (dev->board.tuner_sif_gpio >= 0)
                cx231xx_set_gpio_direction(dev, dev->board.tuner_sif_gpio, 1);
 
-               /* request some modules if any required */
-       }
+       /* request some modules if any required */
 
        /* set the mode to Analog mode initially */
        cx231xx_set_mode(dev, CX231XX_ANALOG_MODE);
index b4859a0afd8ce28aefacf63575e95528c1bbd595..d0794332114cd43927767a1edcd7281372df96f4 100644 (file)
@@ -333,9 +333,10 @@ struct cx231xx_board {
        struct cx231xx_reg_seq *dvb_gpio;
        struct cx231xx_reg_seq *suspend_gpio;
        struct cx231xx_reg_seq *tuner_gpio;
-       u8 tuner_sif_gpio;
-       u8 tuner_scl_gpio;
-       u8 tuner_sda_gpio;
+               /* Negative means don't use it */
+       s8 tuner_sif_gpio;
+       s8 tuner_scl_gpio;
+       s8 tuner_sda_gpio;
 
        /* PIN ctrl */
        u32 ctl_pin_status_mask;