diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-04-26 13:16:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-29 17:41:36 -0400 |
commit | 136531dac435828c4aa9ca694a7693b63a573be1 (patch) | |
tree | 208e2df4a9a62e22da99f1c81ef534b493647a88 /drivers/media | |
parent | a0bdd273a2fdb2a0debc90d5f8826073e2ddea4d (diff) |
V4L/DVB (7763): ivtv: add tuner support for the AverMedia M116
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-cards.c | 20 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-cards.h | 1 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-gpio.c | 9 |
3 files changed, 18 insertions, 12 deletions
diff --git a/drivers/media/video/ivtv/ivtv-cards.c b/drivers/media/video/ivtv/ivtv-cards.c index 6266a09ea75f..4fb8faefe2ce 100644 --- a/drivers/media/video/ivtv/ivtv-cards.c +++ b/drivers/media/video/ivtv/ivtv-cards.c | |||
@@ -924,6 +924,7 @@ static const struct ivtv_card ivtv_card_club3d = { | |||
924 | }, | 924 | }, |
925 | .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 }, | 925 | .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 }, |
926 | .gpio_init = { .direction = 0x1000, .initial_value = 0x1000 }, /* tuner reset */ | 926 | .gpio_init = { .direction = 0x1000, .initial_value = 0x1000 }, /* tuner reset */ |
927 | .xceive_pin = 12, | ||
927 | .tuners = { | 928 | .tuners = { |
928 | { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 }, | 929 | { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 }, |
929 | }, | 930 | }, |
@@ -943,20 +944,26 @@ static const struct ivtv_card_pci_info ivtv_pci_avertv_mce116[] = { | |||
943 | static const struct ivtv_card ivtv_card_avertv_mce116 = { | 944 | static const struct ivtv_card ivtv_card_avertv_mce116 = { |
944 | .type = IVTV_CARD_AVERTV_MCE116, | 945 | .type = IVTV_CARD_AVERTV_MCE116, |
945 | .name = "AVerTV MCE 116 Plus", | 946 | .name = "AVerTV MCE 116 Plus", |
946 | .comment = "only Composite and S-Video inputs are supported, not the tuner\n", | ||
947 | .v4l2_capabilities = IVTV_CAP_ENCODER, | 947 | .v4l2_capabilities = IVTV_CAP_ENCODER, |
948 | .hw_video = IVTV_HW_CX25840, | 948 | .hw_video = IVTV_HW_CX25840, |
949 | .hw_audio = IVTV_HW_CX25840, | 949 | .hw_audio = IVTV_HW_CX25840, |
950 | .hw_audio_ctrl = IVTV_HW_CX25840, | 950 | .hw_audio_ctrl = IVTV_HW_CX25840, |
951 | .hw_all = IVTV_HW_CX25840 | IVTV_HW_WM8739, | 951 | .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER | IVTV_HW_WM8739, |
952 | .video_inputs = { | 952 | .video_inputs = { |
953 | { IVTV_CARD_INPUT_SVIDEO1, 0, CX25840_SVIDEO3 }, | 953 | { IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE2 }, |
954 | { IVTV_CARD_INPUT_COMPOSITE1, 0, CX25840_COMPOSITE1 }, | 954 | { IVTV_CARD_INPUT_SVIDEO1, 1, CX25840_SVIDEO3 }, |
955 | { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 }, | ||
955 | }, | 956 | }, |
956 | .audio_inputs = { | 957 | .audio_inputs = { |
958 | { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 }, | ||
957 | { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL, 1 }, | 959 | { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL, 1 }, |
958 | }, | 960 | }, |
959 | .gpio_init = { .direction = 0xe000, .initial_value = 0x4000 }, /* enable line-in */ | 961 | /* enable line-in */ |
962 | .gpio_init = { .direction = 0xe400, .initial_value = 0x4400 }, | ||
963 | .xceive_pin = 10, | ||
964 | .tuners = { | ||
965 | { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 }, | ||
966 | }, | ||
960 | .pci_list = ivtv_pci_avertv_mce116, | 967 | .pci_list = ivtv_pci_avertv_mce116, |
961 | .i2c = &ivtv_i2c_std, | 968 | .i2c = &ivtv_i2c_std, |
962 | }; | 969 | }; |
@@ -1095,7 +1102,8 @@ static const struct ivtv_card ivtv_card_aver_m104 = { | |||
1095 | }, | 1102 | }, |
1096 | .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO_SERIAL, 2 }, | 1103 | .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO_SERIAL, 2 }, |
1097 | /* enable line-in + reset tuner */ | 1104 | /* enable line-in + reset tuner */ |
1098 | .gpio_init = { .direction = 0xf000, .initial_value = 0x5000 }, | 1105 | .gpio_init = { .direction = 0xe400, .initial_value = 0x4000 }, |
1106 | .xceive_pin = 10, | ||
1099 | .tuners = { | 1107 | .tuners = { |
1100 | { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 }, | 1108 | { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 }, |
1101 | }, | 1109 | }, |
diff --git a/drivers/media/video/ivtv/ivtv-cards.h b/drivers/media/video/ivtv/ivtv-cards.h index 196c0445da63..748485dcebbd 100644 --- a/drivers/media/video/ivtv/ivtv-cards.h +++ b/drivers/media/video/ivtv/ivtv-cards.h | |||
@@ -258,6 +258,7 @@ struct ivtv_card { | |||
258 | int nof_outputs; | 258 | int nof_outputs; |
259 | const struct ivtv_card_output *video_outputs; | 259 | const struct ivtv_card_output *video_outputs; |
260 | u8 gr_config; /* config byte for the ghost reduction device */ | 260 | u8 gr_config; /* config byte for the ghost reduction device */ |
261 | u8 xceive_pin; /* XCeive tuner GPIO reset pin */ | ||
261 | 262 | ||
262 | /* GPIO card-specific settings */ | 263 | /* GPIO card-specific settings */ |
263 | struct ivtv_gpio_init gpio_init; | 264 | struct ivtv_gpio_init gpio_init; |
diff --git a/drivers/media/video/ivtv/ivtv-gpio.c b/drivers/media/video/ivtv/ivtv-gpio.c index 688cd3856685..d8ac09f3cce6 100644 --- a/drivers/media/video/ivtv/ivtv-gpio.c +++ b/drivers/media/video/ivtv/ivtv-gpio.c | |||
@@ -128,20 +128,17 @@ int ivtv_reset_tuner_gpio(void *dev, int cmd, int value) | |||
128 | { | 128 | { |
129 | struct i2c_algo_bit_data *algo = dev; | 129 | struct i2c_algo_bit_data *algo = dev; |
130 | struct ivtv *itv = algo->data; | 130 | struct ivtv *itv = algo->data; |
131 | int curdir, curout; | 131 | u32 curout; |
132 | 132 | ||
133 | if (cmd != XC2028_TUNER_RESET) | 133 | if (cmd != XC2028_TUNER_RESET) |
134 | return 0; | 134 | return 0; |
135 | IVTV_DEBUG_INFO("Resetting tuner\n"); | 135 | IVTV_DEBUG_INFO("Resetting tuner\n"); |
136 | curout = read_reg(IVTV_REG_GPIO_OUT); | 136 | curout = read_reg(IVTV_REG_GPIO_OUT); |
137 | curdir = read_reg(IVTV_REG_GPIO_DIR); | 137 | curout &= ~(1 << itv->card->xceive_pin); |
138 | curdir |= (1 << 12); /* GPIO bit 12 */ | ||
139 | |||
140 | curout &= ~(1 << 12); | ||
141 | write_reg(curout, IVTV_REG_GPIO_OUT); | 138 | write_reg(curout, IVTV_REG_GPIO_OUT); |
142 | schedule_timeout_interruptible(msecs_to_jiffies(1)); | 139 | schedule_timeout_interruptible(msecs_to_jiffies(1)); |
143 | 140 | ||
144 | curout |= (1 << 12); | 141 | curout |= 1 << itv->card->xceive_pin; |
145 | write_reg(curout, IVTV_REG_GPIO_OUT); | 142 | write_reg(curout, IVTV_REG_GPIO_OUT); |
146 | schedule_timeout_interruptible(msecs_to_jiffies(1)); | 143 | schedule_timeout_interruptible(msecs_to_jiffies(1)); |
147 | return 0; | 144 | return 0; |