diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-05-20 11:24:04 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 12:06:47 +0200 |
commit | 4451342db5b5b779add112c6b15d676f07c73b33 (patch) | |
tree | 961e438324ed26f4d55030f273d1e6365bd336d1 /drivers/media/video/ivtv/ivtv-gpio.c | |
parent | V4L/DVB (7926): ivtv: add support for the Buffalo PC-MV5L/PCI card. (diff) | |
download | linux-4451342db5b5b779add112c6b15d676f07c73b33.tar.xz linux-4451342db5b5b779add112c6b15d676f07c73b33.zip |
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.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) void ivtv_gpio_init(struct ivtv *itv) { - if (itv->card->gpio_init.direction == 0) + u16 pin = 0; + + if (itv->card->xceive_pin) + pin = 1 << itv->card->xceive_pin; + + if ((itv->card->gpio_init.direction | pin) == 0) return; IVTV_DEBUG_INFO("GPIO initial dir: %08x out: %08x\n", read_reg(IVTV_REG_GPIO_DIR), read_reg(IVTV_REG_GPIO_OUT)); /* init output data then direction */ - write_reg(itv->card->gpio_init.initial_value, IVTV_REG_GPIO_OUT); - write_reg(itv->card->gpio_init.direction, IVTV_REG_GPIO_DIR); + write_reg(itv->card->gpio_init.initial_value | pin, IVTV_REG_GPIO_OUT); + write_reg(itv->card->gpio_init.direction | pin, IVTV_REG_GPIO_DIR); } static struct v4l2_queryctrl gpio_ctrl_mute = { |