public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "Andrea.Amorosi76@gmail.com" <Andrea.Amorosi76@gmail.com>
To: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: [PATCH] em28xx: add Dikom DK300 hybrid USB tuner
Date: Tue, 09 Feb 2010 19:43:20 +0100	[thread overview]
Message-ID: <4B71ACC8.600@gmail.com> (raw)
In-Reply-To: <829197380911140634j49c05cd0s90aed57b9ae61436@mail.gmail.com>

This patch add the Dikom DK300 hybrid usb card.

The patch adds digital and analogue tv support.

Not working: remote controller

To be done: it seems that with the proposed patch the digital
demodulator remains activated if the tuner is switched from digital to
analogue mode.
Workaorund is to unplug and replug the device when switching from
digital to analogue.
If someone can explain how to verify the gpio settings using the
usbsnoop, the above issue perhaps can be resolved.

Signed-off-by: Andrea Amorosi <Andrea.Amorosi76@gmail.com>

diff -r d6520e486ee6 linux/drivers/media/video/em28xx/em28xx-cards.c
--- a/linux/drivers/media/video/em28xx/em28xx-cards.c	Sat Jan 30
01:27:34 2010 -0200
+++ b/linux/drivers/media/video/em28xx/em28xx-cards.c	Sat Jan 30
18:04:13 2010 +0100
@@ -245,6 +245,12 @@
   	{	-1,		-1,	-1,		-1},
   };

+static struct em28xx_reg_seq dikom_dk300_digital[] = {
+	{EM28XX_R08_GPIO,	0x6e,	~EM_GPIO_4,	10},
+	{EM2880_R04_GPO,	0x08,	0xff,		10},
+	{ -1,			-1,	-1,		-1},
+};
+

   /*
    *  Board definitions
@@ -1673,6 +1679,22 @@
   		.tuner_gpio    = reddo_dvb_c_usb_box,
   		.has_dvb       = 1,
   	},
+	[EM2882_BOARD_DIKOM_DK300] = {
+		.name         = "Dikom DK300",
+		.valid        = EM28XX_BOARD_NOT_VALIDATED,
+		.tuner_type   = TUNER_XC2028,
+		.tuner_gpio   = default_tuner_gpio,
+		.decoder      = EM28XX_TVP5150,
+		.mts_firmware = 1,
+		.has_dvb      = 1,
+		.dvb_gpio     = dikom_dk300_digital,
+		.input        = { {
+			.type     = EM28XX_VMUX_TELEVISION,
+			.vmux     = TVP5150_COMPOSITE0,
+			.amux     = EM28XX_AMUX_VIDEO,
+			.gpio     = default_analog,
+		} },
+	},
   };
   const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);

@@ -1812,6 +1834,7 @@
   	{0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
   	{0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
   	{0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
+	{0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
   };

   /* I2C devicelist hash table for devices with generic USB IDs */
@@ -2168,6 +2191,7 @@
   		ctl->demod = XC3028_FE_DEFAULT;
   		break;
   	case EM2883_BOARD_KWORLD_HYBRID_330U:
+	case EM2882_BOARD_DIKOM_DK300:
   		ctl->demod = XC3028_FE_CHINA;
   		ctl->fname = XC2028_DEFAULT_FIRMWARE;
   		break;
@@ -2480,6 +2504,31 @@
   		em28xx_gpio_set(dev, dev->board.tuner_gpio);
   		em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
   		break;
+
+/*
+		 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
+		 *
+		 * This occurs because they share identical USB vendor and
+		 * product IDs.
+		 *
+		 * What we do here is look up the EEPROM hash of the Dikom
+		 * and if it is found then we decide that we do not have
+		 * a Kworld and reset the device to the Dikom instead.
+		 *
+		 * This solution is only valid if they do not share eeprom
+		 * hash identities which has not been determined as yet.
+		 */
+	case EM2882_BOARD_KWORLD_VS_DVBT:
+		if (!em28xx_hint_board(dev))
+			em28xx_set_model(dev);
+
+		/* In cases where we had to use a board hint, the call to
+		   em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
+		   so make the call now so the analog GPIOs are set properly
+		   before probing the i2c bus. */
+		em28xx_gpio_set(dev, dev->board.tuner_gpio);
+		em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
+		break;
   	}

   #if defined(CONFIG_MODULES) && defined(MODULE)
diff -r d6520e486ee6 linux/drivers/media/video/em28xx/em28xx-dvb.c
--- a/linux/drivers/media/video/em28xx/em28xx-dvb.c	Sat Jan 30 01:27:34
2010 -0200
+++ b/linux/drivers/media/video/em28xx/em28xx-dvb.c	Sat Jan 30 18:04:13
2010 +0100
@@ -504,6 +504,7 @@
   		break;
   	case EM2880_BOARD_TERRATEC_HYBRID_XS:
   	case EM2881_BOARD_PINNACLE_HYBRID_PRO:
+	case EM2882_BOARD_DIKOM_DK300:
   		dvb->frontend = dvb_attach(zl10353_attach,
   					   &em28xx_zl10353_xc3028_no_i2c_gate,
   					   &dev->i2c_adap);
diff -r d6520e486ee6 linux/drivers/media/video/em28xx/em28xx.h
--- a/linux/drivers/media/video/em28xx/em28xx.h	Sat Jan 30 01:27:34 2010
-0200
+++ b/linux/drivers/media/video/em28xx/em28xx.h	Sat Jan 30 18:04:13 2010
+0100
@@ -112,6 +112,7 @@
   #define EM2861_BOARD_GADMEI_UTV330PLUS           72
   #define EM2870_BOARD_REDDO_DVB_C_USB_BOX          73
   #define EM2800_BOARD_VC211A			  74
+#define EM2882_BOARD_DIKOM_DK300		75

   /* Limits minimum and default number of buffers */
   #define EM28XX_MIN_BUF 4







  parent reply	other threads:[~2010-02-09 18:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-14 11:22 [PATCH] em28xx: fix for Dikom DK300 hybrid USB tuner (aka Kworld VS-DVB-T 323UR ) (digital mode) Andrea.Amorosi76
2009-11-14 13:05 ` Andrea.Amorosi76
2009-11-14 14:34   ` Devin Heitmueller
2009-11-14 22:21     ` [PATCH] em28xx: fix for Dikom DK300 hybrid USB tuner (aka Kworld VS-DVB-T 323UR ) Andrea.Amorosi76
2009-11-14 22:47       ` Andrea.Amorosi76
     [not found]     ` <4AFF1203.3080401@gmail.com>
     [not found]       ` <829197380911150719w7ea0749ei2a1350f1e12b866d@mail.gmail.com>
     [not found]         ` <4B001ECD.9030609@gmail.com>
     [not found]           ` <829197380911152055w233edf18ve36b821571198d04@mail.gmail.com>
     [not found]             ` <4B01B168.50403@gmail.com>
2009-11-16 20:28               ` [PATCH] em28xx: fix for Dikom DK300 hybrid USB tuner (aka Kworld VS-DVB-T 323UR ) (digital mode) Devin Heitmueller
     [not found]                 ` <4B01B841.7000506@gmail.com>
2009-11-16 20:47                   ` Devin Heitmueller
     [not found]                 ` <4B01BABE.4060609@gmail.com>
2009-11-16 20:56                   ` Devin Heitmueller
2009-11-18 18:59                     ` Andrea.Amorosi76
2009-11-22 11:02     ` [PATCH] em28xx: fix for Dikom DK300 hybrid USB tuner (aka Kworld VS-DVB-T 323UR ) Andrea.Amorosi76
2010-01-30 17:10     ` [PATCH] em28xx: add Dikom DK300 hybrid USB tuner Andrea.Amorosi76
2010-02-03 18:45     ` Andrea.Amorosi76
2010-02-09 18:43     ` Andrea.Amorosi76 [this message]
2010-02-09 19:21       ` Mauro Carvalho Chehab
2010-02-09 20:10         ` Andrea.Amorosi76
2010-02-09 21:04           ` Mauro Carvalho Chehab
2010-02-09 20:53         ` Andrea.Amorosi76
2010-02-09 21:13           ` Mauro Carvalho Chehab
2010-02-10 23:15           ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B71ACC8.600@gmail.com \
    --to=andrea.amorosi76@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox