The patch number 12339 was added via Mauro Carvalho Chehab <mche...@redhat.com>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Mauro Carvalho Chehab  <mche...@redhat.com>
merge: http://linuxtv.org/hg/~awalls/v4l-dvb


Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>


---

 linux/Documentation/video4linux/CARDLIST.tuner  |    1 
 linux/drivers/media/common/tuners/tuner-types.c |   25 ++++
 linux/drivers/media/video/cx18/cx18-controls.c  |    3 
 linux/drivers/media/video/ivtv/ivtv-cards.c     |   95 ++++++++--------
 linux/drivers/media/video/ivtv/ivtv-controls.c  |    3 
 linux/drivers/media/video/ivtv/ivtv-gpio.c      |   13 --
 linux/include/media/tuner.h                     |    1 
 7 files changed, 81 insertions(+), 60 deletions(-)

diff -r 26dc2ccd00b2 -r f8f134705b65 
linux/Documentation/video4linux/CARDLIST.tuner
--- a/linux/Documentation/video4linux/CARDLIST.tuner    Fri Jul 24 16:11:31 
2009 -0300
+++ b/linux/Documentation/video4linux/CARDLIST.tuner    Fri Jul 24 16:19:39 
2009 -0300
@@ -78,3 +78,4 @@ tuner=78 - Philips FMD1216MEX MK3 Hybrid
 tuner=78 - Philips FMD1216MEX MK3 Hybrid Tuner
 tuner=79 - Philips PAL/SECAM multi (FM1216 MK5)
 tuner=80 - Philips FQ1216LME MK3 PAL/SECAM w/active loopthrough
+tuner=81 - Partsnic (Daewoo) PTI-5NF05
diff -r 26dc2ccd00b2 -r f8f134705b65 
linux/drivers/media/common/tuners/tuner-types.c
--- a/linux/drivers/media/common/tuners/tuner-types.c   Fri Jul 24 16:11:31 
2009 -0300
+++ b/linux/drivers/media/common/tuners/tuner-types.c   Fri Jul 24 16:19:39 
2009 -0300
@@ -1302,6 +1302,25 @@ static struct tuner_params tuner_fq1216l
        },
 };
 
+/* ----- TUNER_PARTSNIC_PTI_5NF05 - Partsnic (Daewoo) PTI-5NF05 NTSC ----- */
+
+static struct tuner_range tuner_partsnic_pti_5nf05_ranges[] = {
+       /* The datasheet specified channel ranges and the bandswitch byte */
+       /* The control byte value of 0x8e is just a guess */
+       { 16 * 133.25 /*MHz*/, 0x8e, 0x01, }, /* Channels    2 -    B */
+       { 16 * 367.25 /*MHz*/, 0x8e, 0x02, }, /* Channels    C - W+11 */
+       { 16 * 999.99        , 0x8e, 0x08, }, /* Channels W+12 -   69 */
+};
+
+static struct tuner_params tuner_partsnic_pti_5nf05_params[] = {
+       {
+               .type   = TUNER_PARAM_TYPE_NTSC,
+               .ranges = tuner_partsnic_pti_5nf05_ranges,
+               .count  = ARRAY_SIZE(tuner_partsnic_pti_5nf05_ranges),
+               .cb_first_if_lower_freq = 1, /* not specified but safe to do */
+       },
+};
+
 /* --------------------------------------------------------------------- */
 
 struct tunertype tuners[] = {
@@ -1754,6 +1773,12 @@ struct tunertype tuners[] = {
                .params = tuner_fq1216lme_mk3_params,
                .count  = ARRAY_SIZE(tuner_fq1216lme_mk3_params),
        },
+
+       [TUNER_PARTSNIC_PTI_5NF05] = {
+               .name = "Partsnic (Daewoo) PTI-5NF05",
+               .params = tuner_partsnic_pti_5nf05_params,
+               .count  = ARRAY_SIZE(tuner_partsnic_pti_5nf05_params),
+       },
 };
 EXPORT_SYMBOL(tuners);
 
diff -r 26dc2ccd00b2 -r f8f134705b65 
linux/drivers/media/video/cx18/cx18-controls.c
--- a/linux/drivers/media/video/cx18/cx18-controls.c    Fri Jul 24 16:11:31 
2009 -0300
+++ b/linux/drivers/media/video/cx18/cx18-controls.c    Fri Jul 24 16:19:39 
2009 -0300
@@ -20,6 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  *  02111-1307  USA
  */
+#include <linux/kernel.h>
 
 #include "cx18-driver.h"
 #include "cx18-cards.h"
@@ -317,7 +318,7 @@ int cx18_s_ext_ctrls(struct file *file, 
                idx = p.audio_properties & 0x03;
                /* The audio clock of the digitizer must match the codec sample
                   rate otherwise you get some very strange effects. */
-               if (idx < sizeof(freqs))
+               if (idx < ARRAY_SIZE(freqs))
                        cx18_call_all(cx, audio, s_clock_freq, freqs[idx]);
                return err;
        }
diff -r 26dc2ccd00b2 -r f8f134705b65 linux/drivers/media/video/ivtv/ivtv-cards.c
--- a/linux/drivers/media/video/ivtv/ivtv-cards.c       Fri Jul 24 16:11:31 
2009 -0300
+++ b/linux/drivers/media/video/ivtv/ivtv-cards.c       Fri Jul 24 16:19:39 
2009 -0300
@@ -977,55 +977,17 @@ static const struct ivtv_card ivtv_card_
 
 /* ------------------------------------------------------------------------- */
 
-/* AVerMedia PVR-150 Plus (M113) card */
+/* AVerMedia PVR-150 Plus / AVerTV M113 cards with a Daewoo/Partsnic Tuner */
 
 static const struct ivtv_card_pci_info ivtv_pci_aver_pvr150[] = {
-       { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_AVERMEDIA, 0xc035 },
+       { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_AVERMEDIA, 0xc034 }, /* NTSC */
+       { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_AVERMEDIA, 0xc035 }, /* NTSC FM */
        { 0, 0, 0 }
 };
 
 static const struct ivtv_card ivtv_card_aver_pvr150 = {
        .type = IVTV_CARD_AVER_PVR150PLUS,
-       .name = "AVerMedia PVR-150 Plus",
-       .v4l2_capabilities = IVTV_CAP_ENCODER,
-       .hw_video = IVTV_HW_CX25840,
-       .hw_audio = IVTV_HW_CX25840,
-       .hw_audio_ctrl = IVTV_HW_CX25840,
-       .hw_muxer = IVTV_HW_GPIO,
-       .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER,
-       .video_inputs = {
-               { IVTV_CARD_INPUT_VID_TUNER,  0, CX25840_COMPOSITE2 },
-               { IVTV_CARD_INPUT_SVIDEO1,    1,
-                 CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
-               { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 },
-       },
-       .audio_inputs = {
-               { IVTV_CARD_INPUT_AUD_TUNER,  CX25840_AUDIO5,       0 },
-               { IVTV_CARD_INPUT_LINE_IN1,   CX25840_AUDIO_SERIAL, 1 },
-       },
-       .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO_SERIAL, 2 },
-       .gpio_init = { .direction = 0x0800, .initial_value = 0 },
-       .gpio_audio_input  = { .mask = 0x0800, .tuner = 0, .linein = 0, .radio 
= 0x0800 },
-       .tuners = {
-               /* This card has a Partsnic PTI-5NF05 tuner */
-               { .std = V4L2_STD_MN, .tuner = TUNER_TCL_2002N },
-       },
-       .pci_list = ivtv_pci_aver_pvr150,
-       .i2c = &ivtv_i2c_radio,
-};
-
-/* ------------------------------------------------------------------------- */
-
-/* AVerMedia UltraTV 1500 MCE (newer non-cx88 version, M113 variant) card */
-
-static const struct ivtv_card_pci_info ivtv_pci_aver_ultra1500mce[] = {
-       { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_AVERMEDIA, 0xc019 },
-       { 0, 0, 0 }
-};
-
-static const struct ivtv_card ivtv_card_aver_ultra1500mce = {
-       .type = IVTV_CARD_AVER_ULTRA1500MCE,
-       .name = "AVerMedia UltraTV 1500 MCE / AVerTV M113",
+       .name = "AVerMedia PVR-150 Plus / AVerTV M113 Partsnic (Daewoo) Tuner",
        .v4l2_capabilities = IVTV_CAP_ENCODER,
        .hw_video = IVTV_HW_CX25840,
        .hw_audio = IVTV_HW_CX25840,
@@ -1035,8 +997,7 @@ static const struct ivtv_card ivtv_card_
                  IVTV_HW_WM8739 | IVTV_HW_GPIO,
        .video_inputs = {
                { IVTV_CARD_INPUT_VID_TUNER,  0, CX25840_COMPOSITE2 },
-               { IVTV_CARD_INPUT_SVIDEO1,    1,
-                 CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
+               { IVTV_CARD_INPUT_SVIDEO1,    1, CX25840_SVIDEO3    },
                { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 },
        },
        .audio_inputs = {
@@ -1044,7 +1005,51 @@ static const struct ivtv_card ivtv_card_
                { IVTV_CARD_INPUT_LINE_IN1,   CX25840_AUDIO_SERIAL, 1 },
        },
        .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO_SERIAL, 2 },
-       /* The 74HC4502 Dual 4:1 multiplexer is controlled by 2 GPIO lines */
+       /* The 74HC4052 Dual 4:1 multiplexer is controlled by 2 GPIO lines */
+       .gpio_init = { .direction = 0xc000, .initial_value = 0 },
+       .gpio_audio_input  = { .mask   = 0xc000,
+                              .tuner  = 0x0000,
+                              .linein = 0x4000,
+                              .radio  = 0x8000 },
+       .tuners = {
+               /* Subsystem ID's 0xc03[45] have a Partsnic PTI-5NF05 tuner */
+               { .std = V4L2_STD_MN, .tuner = TUNER_PARTSNIC_PTI_5NF05 },
+       },
+       .pci_list = ivtv_pci_aver_pvr150,
+       /* Subsystem ID 0xc035 has a TEA5767(?) FM tuner, 0xc034 does not */
+       .i2c = &ivtv_i2c_radio,
+};
+
+/* ------------------------------------------------------------------------- */
+
+/* AVerMedia UltraTV 1500 MCE (newer non-cx88 version, M113 variant) card */
+
+static const struct ivtv_card_pci_info ivtv_pci_aver_ultra1500mce[] = {
+       { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_AVERMEDIA, 0xc019 },
+       { 0, 0, 0 }
+};
+
+static const struct ivtv_card ivtv_card_aver_ultra1500mce = {
+       .type = IVTV_CARD_AVER_ULTRA1500MCE,
+       .name = "AVerMedia UltraTV 1500 MCE / AVerTV M113 Philips Tuner",
+       .v4l2_capabilities = IVTV_CAP_ENCODER,
+       .hw_video = IVTV_HW_CX25840,
+       .hw_audio = IVTV_HW_CX25840,
+       .hw_audio_ctrl = IVTV_HW_CX25840,
+       .hw_muxer = IVTV_HW_GPIO,
+       .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER |
+                 IVTV_HW_WM8739 | IVTV_HW_GPIO,
+       .video_inputs = {
+               { IVTV_CARD_INPUT_VID_TUNER,  0, CX25840_COMPOSITE2 },
+               { IVTV_CARD_INPUT_SVIDEO1,    1, CX25840_SVIDEO3    },
+               { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 },
+       },
+       .audio_inputs = {
+               { IVTV_CARD_INPUT_AUD_TUNER,  CX25840_AUDIO5,       0 },
+               { IVTV_CARD_INPUT_LINE_IN1,   CX25840_AUDIO_SERIAL, 1 },
+       },
+       .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO_SERIAL, 2 },
+       /* The 74HC4052 Dual 4:1 multiplexer is controlled by 2 GPIO lines */
        .gpio_init = { .direction = 0xc000, .initial_value = 0 },
        .gpio_audio_input  = { .mask   = 0xc000,
                               .tuner  = 0x0000,
diff -r 26dc2ccd00b2 -r f8f134705b65 
linux/drivers/media/video/ivtv/ivtv-controls.c
--- a/linux/drivers/media/video/ivtv/ivtv-controls.c    Fri Jul 24 16:11:31 
2009 -0300
+++ b/linux/drivers/media/video/ivtv/ivtv-controls.c    Fri Jul 24 16:19:39 
2009 -0300
@@ -17,6 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#include <linux/kernel.h>
 
 #include "ivtv-driver.h"
 #include "ivtv-cards.h"
@@ -281,7 +282,7 @@ int ivtv_s_ext_ctrls(struct file *file, 
                idx = p.audio_properties & 0x03;
                /* The audio clock of the digitizer must match the codec sample
                   rate otherwise you get some very strange effects. */
-               if (idx < sizeof(freqs))
+               if (idx < ARRAY_SIZE(freqs))
                        ivtv_call_all(itv, audio, s_clock_freq, freqs[idx]);
                return err;
        }
diff -r 26dc2ccd00b2 -r f8f134705b65 linux/drivers/media/video/ivtv/ivtv-gpio.c
--- a/linux/drivers/media/video/ivtv/ivtv-gpio.c        Fri Jul 24 16:11:31 
2009 -0300
+++ b/linux/drivers/media/video/ivtv/ivtv-gpio.c        Fri Jul 24 16:19:39 
2009 -0300
@@ -236,18 +236,6 @@ static int subdev_s_radio(struct v4l2_su
        return 0;
 }
 
-static int subdev_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
-{
-       struct ivtv *itv = sd_to_ivtv(sd);
-       u16 mask, data;
-
-       mask = itv->card->gpio_audio_input.mask;
-       data = itv->card->gpio_audio_input.tuner;
-       if (mask)
-               write_reg((read_reg(IVTV_REG_GPIO_OUT) & ~mask) | (data & 
mask), IVTV_REG_GPIO_OUT);
-       return 0;
-}
-
 static int subdev_s_audio_routing(struct v4l2_subdev *sd,
                                  u32 input, u32 output, u32 config)
 {
@@ -344,7 +332,6 @@ static const struct v4l2_subdev_core_ops
        .g_ctrl = subdev_g_ctrl,
        .s_ctrl = subdev_s_ctrl,
        .queryctrl = subdev_queryctrl,
-       .s_std = subdev_s_std,
 };
 
 static const struct v4l2_subdev_tuner_ops subdev_tuner_ops = {
diff -r 26dc2ccd00b2 -r f8f134705b65 linux/include/media/tuner.h
--- a/linux/include/media/tuner.h       Fri Jul 24 16:11:31 2009 -0300
+++ b/linux/include/media/tuner.h       Fri Jul 24 16:19:39 2009 -0300
@@ -126,6 +126,7 @@
 #define TUNER_PHILIPS_FMD1216MEX_MK3   78
 #define TUNER_PHILIPS_FM1216MK5                79
 #define TUNER_PHILIPS_FQ1216LME_MK3    80      /* Active loopthrough, no FM */
+#define TUNER_PARTSNIC_PTI_5NF05       81
 
 /* tv card specific */
 #define TDA9887_PRESENT                (1<<0)


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/f8f134705b65d2d88f98d37f04e95da267d25a35

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to