From 7c12167bae57994e30cc5258e8aaa6fb06258f46 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Wed, 10 Feb 2010 22:14:54 -0300 Subject: V4L/DVB: ivtv: Add initial entry for Sony VAIO Giga Pocket (Kikyou) cards This is a slightly modified version of Eric Anderson's original patch for the Sony Giga Pocket board. It has been updated to apply to the latest ivtv driver version by Hans Verkuil and Andy Walls . Also Andy Walls modified the patch to use a new Sony BTF-Pnx01Z tuner entry based on Eric Anderson's experimental findings for the bandswitch. >From Eric Anderson's original email: 1. The tuner on the card doesn't seem to match any standard ones. I modified an existing tuner entry. Ideally a new tuner entry should be created. (The only difference from the one I modified is that the low-to-mid range frequency cut-off is slightly different, as are the bit config settings.) 2. It wasn't obvious how to choose a second audio input other than using "radio" as an option. Basically there's two GPIO audio inputs. Using radio allowed me to avoid major restructuring to the code. (perhaps other cards don't have this often...) 3. It's not clear that there's a mute setting that works. Not sure why. 4. I haven't had a chance to test the two Svideo inputs. I set them to COMPOSITE1 and SVIDEO2, but I'm not sure those are the correct settings. The standard composite video inputs seem to work. Signed-off-by: Andy Walls Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ivtv/ivtv-cards.c | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'drivers/media/video/ivtv/ivtv-cards.c') diff --git a/drivers/media/video/ivtv/ivtv-cards.c b/drivers/media/video/ivtv/ivtv-cards.c index 79d0fe4990d..79c1b7af882 100644 --- a/drivers/media/video/ivtv/ivtv-cards.c +++ b/drivers/media/video/ivtv/ivtv-cards.c @@ -1210,6 +1210,60 @@ static const struct ivtv_card ivtv_card_buffalo = { .i2c = &ivtv_i2c_std, }; +/* ------------------------------------------------------------------------- */ +/* Sony Kikyou */ + +static const struct ivtv_card_pci_info ivtv_pci_kikyou[] = { + { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_SONY, 0x813d }, + { 0, 0, 0 } +}; + +static const struct ivtv_card ivtv_card_kikyou = { + .type = IVTV_CARD_KIKYOU, + .name = "Sony VAIO Giga Pocket (ENX Kikyou)", + .v4l2_capabilities = IVTV_CAP_ENCODER, + .hw_video = IVTV_HW_SAA7115, + .hw_audio = IVTV_HW_GPIO, + .hw_audio_ctrl = IVTV_HW_GPIO, + .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA7115 | IVTV_HW_TUNER, + .video_inputs = { + { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE5 }, + { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE4 }, /* rear */ + { IVTV_CARD_INPUT_COMPOSITE2, 2, IVTV_SAA71XX_COMPOSITE1 }, /* front */ + { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO1 }, + { IVTV_CARD_INPUT_SVIDEO2, 2, IVTV_SAA71XX_SVIDEO2 }, + }, + .audio_inputs = { + { IVTV_CARD_INPUT_AUD_TUNER, IVTV_GPIO_TUNER }, + { IVTV_CARD_INPUT_LINE_IN1, IVTV_GPIO_LINE_IN }, + /* IVTV_GPIO_RADIO?? pretend to have "radio" for 2nd audio GPIO. */ + { IVTV_CARD_INPUT_LINE_IN2, 2 }, + }, + /* + * Sony windows software seems to set 0x200 when unmuting. + * Does it do anything? Not clear what 0x100 does either. + */ + .gpio_init = { .direction = 0x0381, .initial_value = 0x0320 }, + .gpio_audio_input = { .mask = 0x0060, + .tuner = 0x0000, + .linein = 0x0060, + .radio = 0x0020 }, + .gpio_audio_mute = { .mask = 0x0000, + .mute = 0x0000 }, /* 0x200? Disable for now. */ + .gpio_audio_mode = { .mask = 0x0080, + .mono = 0x0000, + .stereo = 0x0000, /* SAP */ + .lang1 = 0x0080, + .lang2 = 0x0000, + .both = 0x0080 }, + .tuners = { + { .std = V4L2_STD_ALL, .tuner = TUNER_SONY_BTF_PXN01Z }, + }, + .pci_list = ivtv_pci_kikyou, + .i2c = &ivtv_i2c_std, +}; + + static const struct ivtv_card *ivtv_card_list[] = { &ivtv_card_pvr250, &ivtv_card_pvr350, @@ -1238,6 +1292,7 @@ static const struct ivtv_card *ivtv_card_list[] = { &ivtv_card_aver_m104, &ivtv_card_buffalo, &ivtv_card_aver_ultra1500mce, + &ivtv_card_kikyou, /* Variations of standard cards but with the same PCI IDs. These cards must come last in this list. */ -- cgit v1.2.3 From c1ea5b7424e4d1d3f56de1504a257ec2419259e8 Mon Sep 17 00:00:00 2001 From: Andy Walls Date: Sat, 20 Feb 2010 21:28:39 -0300 Subject: V4L/DVB: ivtv: Tweak Sony GigaPocket Kikyou card entry based on experiments Based on experiments by Eric Wescott, edit the Sony GigaPocket (Kikyou) card entry video and audio mux settings. Signed-off-by: Andy Walls Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ivtv/ivtv-cards.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'drivers/media/video/ivtv/ivtv-cards.c') diff --git a/drivers/media/video/ivtv/ivtv-cards.c b/drivers/media/video/ivtv/ivtv-cards.c index 79c1b7af882..ca1fd3227a9 100644 --- a/drivers/media/video/ivtv/ivtv-cards.c +++ b/drivers/media/video/ivtv/ivtv-cards.c @@ -1227,27 +1227,20 @@ static const struct ivtv_card ivtv_card_kikyou = { .hw_audio_ctrl = IVTV_HW_GPIO, .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA7115 | IVTV_HW_TUNER, .video_inputs = { - { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE5 }, - { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE4 }, /* rear */ - { IVTV_CARD_INPUT_COMPOSITE2, 2, IVTV_SAA71XX_COMPOSITE1 }, /* front */ + { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE1 }, + { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE1 }, { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO1 }, - { IVTV_CARD_INPUT_SVIDEO2, 2, IVTV_SAA71XX_SVIDEO2 }, }, .audio_inputs = { { IVTV_CARD_INPUT_AUD_TUNER, IVTV_GPIO_TUNER }, { IVTV_CARD_INPUT_LINE_IN1, IVTV_GPIO_LINE_IN }, - /* IVTV_GPIO_RADIO?? pretend to have "radio" for 2nd audio GPIO. */ - { IVTV_CARD_INPUT_LINE_IN2, 2 }, - }, - /* - * Sony windows software seems to set 0x200 when unmuting. - * Does it do anything? Not clear what 0x100 does either. - */ - .gpio_init = { .direction = 0x0381, .initial_value = 0x0320 }, + { IVTV_CARD_INPUT_LINE_IN2, IVTV_GPIO_LINE_IN }, + }, + .gpio_init = { .direction = 0x03e1, .initial_value = 0x0320 }, .gpio_audio_input = { .mask = 0x0060, - .tuner = 0x0000, - .linein = 0x0060, - .radio = 0x0020 }, + .tuner = 0x0020, + .linein = 0x0000, + .radio = 0x0060 }, .gpio_audio_mute = { .mask = 0x0000, .mute = 0x0000 }, /* 0x200? Disable for now. */ .gpio_audio_mode = { .mask = 0x0080, -- cgit v1.2.3