aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-gpio.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-05-20 05:24:04 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:06:47 -0400
commit4451342db5b5b779add112c6b15d676f07c73b33 (patch)
tree961e438324ed26f4d55030f273d1e6365bd336d1 /drivers/media/video/ivtv/ivtv-gpio.c
parentd56eebfbdc11d1a3809d8bd793a118da5058ffa8 (diff)
V4L/DVB (7927): ivtv: simplify gpio initialization for XCeive tuners.
Separate gpio_init field and xceive_pin and combine the two when the gpio is initialized. So there is no longer any need to set the xceive pin in the gpio_init values, simplifying the creation of a new card definition. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-gpio.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-gpio.c11
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
147void ivtv_gpio_init(struct ivtv *itv) 147void 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
160static struct v4l2_queryctrl gpio_ctrl_mute = { 165static struct v4l2_queryctrl gpio_ctrl_mute = {