diff options
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-gpio.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-gpio.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/ivtv/ivtv-gpio.c b/drivers/media/video/ivtv/ivtv-gpio.c index d8ac09f3cce6..bc22905ea20f 100644 --- a/drivers/media/video/ivtv/ivtv-gpio.c +++ b/drivers/media/video/ivtv/ivtv-gpio.c | |||
@@ -146,15 +146,20 @@ int ivtv_reset_tuner_gpio(void *dev, int cmd, int value) | |||
146 | 146 | ||
147 | void ivtv_gpio_init(struct ivtv *itv) | 147 | void ivtv_gpio_init(struct ivtv *itv) |
148 | { | 148 | { |
149 | if (itv->card->gpio_init.direction == 0) | 149 | u16 pin = 0; |
150 | |||
151 | if (itv->card->xceive_pin) | ||
152 | pin = 1 << itv->card->xceive_pin; | ||
153 | |||
154 | if ((itv->card->gpio_init.direction | pin) == 0) | ||
150 | return; | 155 | return; |
151 | 156 | ||
152 | IVTV_DEBUG_INFO("GPIO initial dir: %08x out: %08x\n", | 157 | IVTV_DEBUG_INFO("GPIO initial dir: %08x out: %08x\n", |
153 | read_reg(IVTV_REG_GPIO_DIR), read_reg(IVTV_REG_GPIO_OUT)); | 158 | read_reg(IVTV_REG_GPIO_DIR), read_reg(IVTV_REG_GPIO_OUT)); |
154 | 159 | ||
155 | /* init output data then direction */ | 160 | /* init output data then direction */ |
156 | write_reg(itv->card->gpio_init.initial_value, IVTV_REG_GPIO_OUT); | 161 | write_reg(itv->card->gpio_init.initial_value | pin, IVTV_REG_GPIO_OUT); |
157 | write_reg(itv->card->gpio_init.direction, IVTV_REG_GPIO_DIR); | 162 | write_reg(itv->card->gpio_init.direction | pin, IVTV_REG_GPIO_DIR); |
158 | } | 163 | } |
159 | 164 | ||
160 | static struct v4l2_queryctrl gpio_ctrl_mute = { | 165 | static struct v4l2_queryctrl gpio_ctrl_mute = { |