* [PATCH 0/5] dvb-usb: support VP-7049 Twinhan DVB-T USB Stick and other fixes
@ 2012-11-05 23:28 Antonio Ospite
2012-11-05 23:28 ` [PATCH 1/5] [media] dvb-usb: add a pre_init hook to struct dvb_usb_device_properties Antonio Ospite
` (5 more replies)
0 siblings, 6 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-11-05 23:28 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Antti Palosaari, Michael Krufky,
Patrick Boettcher, Antonio Ospite
Hi,
with this series I am adding support for the VP-7049 Twinhan DVB-T USB stick,
the device comes also under other names as specified in the appropriate commit
messages.
Patch 1 extends the initialization sequence to support this particular
hardware, it's a dependency for patch 3. I am open to alternative solutions.
Patches 2 and 3 add support for the hardware, all the pieces were already in
linux, thanks a lot!
Patches 4 and 5 are trivial fixes for stuff I noticed while looking at the
code, feel free to ignore especially patch 4 if you find it too intrusive.
Please note that I arbitrarily ignored checkpatch.pl warnings and errors
because I preferred to stick with the code style in use in the dvb-usb files,
let me know if you want me to do otherwise.
Thanks,
Antonio
Antonio Ospite (5):
[media] dvb-usb: add a pre_init hook to struct
dvb_usb_device_properties
[media] get_dvb_firmware: add dvb-usb-vp7049-0.95.fw
[media] m920x: Add support for the VP-7049 Twinhan DVB-T USB Stick
[media] dvb-usb: fix indentation of a for loop
[media] m920x: fix a typo in a comment
drivers/media/dvb-core/dvb-usb-ids.h | 1 +
drivers/media/usb/dvb-usb/dvb-usb.h | 5 +
drivers/media/usb/dvb-usb/dvb-usb-init.c | 66 ++++++-----
drivers/media/usb/dvb-usb/m920x.c | 191 +++++++++++++++++++++++++++++-
Documentation/dvb/get_dvb_firmware | 15 ++-
5 files changed, 246 insertions(+), 32 deletions(-)
--
Antonio Ospite
http://ao2.it
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 1/5] [media] dvb-usb: add a pre_init hook to struct dvb_usb_device_properties
2012-11-05 23:28 [PATCH 0/5] dvb-usb: support VP-7049 Twinhan DVB-T USB Stick and other fixes Antonio Ospite
@ 2012-11-05 23:28 ` Antonio Ospite
2012-11-06 0:07 ` Antti Palosaari
2012-11-05 23:28 ` [PATCH 2/5] [media] get_dvb_firmware: add dvb-usb-vp7049-0.95.fw Antonio Ospite
` (4 subsequent siblings)
5 siblings, 1 reply; 19+ messages in thread
From: Antonio Ospite @ 2012-11-05 23:28 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Antti Palosaari, Michael Krufky,
Patrick Boettcher, Antonio Ospite
Some devices need to issue a pre-initialization command sequence via
i2c in order to "enable" the communication with some adapter components.
This happens for instance in the vp7049 USB DVB-T stick on which the
frontend cannot be detected without first sending a certain sequence of
commands via i2c.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
If this approach is OK I can send a similar patch for dvb-usb-v2.
Are all the dvb-usb drivers going to be ported to dvb-usb-v2 eventually?
drivers/media/usb/dvb-usb/dvb-usb.h | 5 +++++
drivers/media/usb/dvb-usb/dvb-usb-init.c | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/drivers/media/usb/dvb-usb/dvb-usb.h b/drivers/media/usb/dvb-usb/dvb-usb.h
index aab0f99..1fcea68 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb.h
+++ b/drivers/media/usb/dvb-usb/dvb-usb.h
@@ -233,6 +233,9 @@ enum dvb_usb_mode {
* @size_of_priv: how many bytes shall be allocated for the private field
* of struct dvb_usb_device.
*
+ * @pre_init: function executed after i2c initialization but
+ * before the adapters get initialized
+ *
* @power_ctrl: called to enable/disable power of the device.
* @read_mac_address: called to read the MAC address of the device.
* @identify_state: called to determine the state (cold or warm), when it
@@ -274,6 +277,8 @@ struct dvb_usb_device_properties {
int size_of_priv;
+ int (*pre_init) (struct dvb_usb_device *);
+
int num_adapters;
struct dvb_usb_adapter_properties adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
index 169196e..8ab916e 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
@@ -31,6 +31,12 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
struct dvb_usb_adapter *adap;
int ret, n, o;
+ if (d->props.pre_init) {
+ ret = d->props.pre_init(d);
+ if (ret < 0)
+ return ret;
+ }
+
for (n = 0; n < d->props.num_adapters; n++) {
adap = &d->adapter[n];
adap->dev = d;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/5] [media] get_dvb_firmware: add dvb-usb-vp7049-0.95.fw
2012-11-05 23:28 [PATCH 0/5] dvb-usb: support VP-7049 Twinhan DVB-T USB Stick and other fixes Antonio Ospite
2012-11-05 23:28 ` [PATCH 1/5] [media] dvb-usb: add a pre_init hook to struct dvb_usb_device_properties Antonio Ospite
@ 2012-11-05 23:28 ` Antonio Ospite
2012-11-05 23:28 ` [PATCH 3/5] [media] m920x: Add support for the VP-7049 Twinhan DVB-T USB Stick Antonio Ospite
` (3 subsequent siblings)
5 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-11-05 23:28 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Antti Palosaari, Michael Krufky,
Patrick Boettcher, Antonio Ospite
Firmware for vp7049 based design, known actual devices are:
Twinhan/Azurewave DTV-DVB UDTT7049
Digicom Digitune-S
Think Xtra Hollywood DVB-T USB2.0
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
I tried to contact the original manufacturer (Twinhan) but it does not exists
anymore, Azurewave didn't reply and Digicom told me that they could not
provide explicit permission to host the firmware on linuxtv.org;
I decided to put it on my web space for now, let me know if you think it's
safe to host it on linuxtv.org anyways.
Thanks,
Antonio
Documentation/dvb/get_dvb_firmware | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index 32bc56b..0cdb157 100755
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -23,7 +23,7 @@ use IO::Handle;
@components = ( "sp8870", "sp887x", "tda10045", "tda10046",
"tda10046lifeview", "av7110", "dec2000t", "dec2540t",
- "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
+ "dec3000s", "vp7041", "vp7049", "dibusb", "nxt2002", "nxt2004",
"or51211", "or51132_qam", "or51132_vsb", "bluebird",
"opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
"af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",
@@ -289,6 +289,19 @@ sub vp7041 {
$outfile;
}
+sub vp7049 {
+ my $fwfile = "dvb-usb-vp7049-0.95.fw";
+ my $url = "http://ao2.it/sites/default/files/blog/2012/11/06/linux-support-digicom-digitune-s-vp7049-udtt7049/$fwfile";
+ my $hash = "5609fd295168aea88b25ff43a6f79c36";
+
+ checkstandard();
+
+ wgetfile($fwfile, $url);
+ verify($fwfile, $hash);
+
+ $fwfile;
+}
+
sub dibusb {
my $url = "http://www.linuxtv.org/downloads/firmware/dvb-usb-dibusb-5.0.0.11.fw";
my $outfile = "dvb-dibusb-5.0.0.11.fw";
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 3/5] [media] m920x: Add support for the VP-7049 Twinhan DVB-T USB Stick
2012-11-05 23:28 [PATCH 0/5] dvb-usb: support VP-7049 Twinhan DVB-T USB Stick and other fixes Antonio Ospite
2012-11-05 23:28 ` [PATCH 1/5] [media] dvb-usb: add a pre_init hook to struct dvb_usb_device_properties Antonio Ospite
2012-11-05 23:28 ` [PATCH 2/5] [media] get_dvb_firmware: add dvb-usb-vp7049-0.95.fw Antonio Ospite
@ 2012-11-05 23:28 ` Antonio Ospite
2012-11-05 23:28 ` [PATCH 4/5] [media] dvb-usb: fix indentation of a for loop Antonio Ospite
` (2 subsequent siblings)
5 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-11-05 23:28 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Antti Palosaari, Michael Krufky,
Patrick Boettcher, Antonio Ospite
This device was originally made by Twinhan/Azurewave[1] sometimes named
DTV-DVB UDTT7049, it could be also found in Italy under the name of
Digicom Digitune-S[2], or Think Xtra Hollywood DVB-T USB2.0[3].
Components:
Usb bridge: ULi M9206
Frontend: MT352CG
Tuner: MT2060F
The firmware can be downloaded with:
$ ./Documentation/dvb/get_dvb_firmware vp7049
[1] http://www.azurewave.com/Support_Utility_Driver.asp
[2] http://www.digicom.it/digisit/driver_link.nsf/driverprodotto?openform&prodotto=DigiTuneS
[3] http://www.txitalia.it/prodotto.asp?prodotto=txhollywooddvttv
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/dvb-core/dvb-usb-ids.h | 1 +
drivers/media/usb/dvb-usb/m920x.c | 189 ++++++++++++++++++++++++++++++++++
2 files changed, 190 insertions(+)
diff --git a/drivers/media/dvb-core/dvb-usb-ids.h b/drivers/media/dvb-core/dvb-usb-ids.h
index 58e0220..faeaadd 100644
--- a/drivers/media/dvb-core/dvb-usb-ids.h
+++ b/drivers/media/dvb-core/dvb-usb-ids.h
@@ -172,6 +172,7 @@
#define USB_PID_TWINHAN_VP7045_WARM 0x3206
#define USB_PID_TWINHAN_VP7021_COLD 0x3207
#define USB_PID_TWINHAN_VP7021_WARM 0x3208
+#define USB_PID_TWINHAN_VP7049 0x3219
#define USB_PID_TINYTWIN 0x3226
#define USB_PID_TINYTWIN_2 0xe402
#define USB_PID_TINYTWIN_3 0x9016
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index 661bb75..ec820ec 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -16,6 +16,7 @@
#include "qt1010.h"
#include "tda1004x.h"
#include "tda827x.h"
+#include "mt2060.h"
#include <media/tuner.h>
#include "tuner-simple.h"
@@ -496,6 +497,12 @@ static struct qt1010_config m920x_qt1010_config = {
.i2c_address = 0x62
};
+static struct mt2060_config m920x_mt2060_config = {
+ .i2c_address = 0x60, /* 0xc0 */
+ .clock_out = 0,
+};
+
+
/* Callbacks for DVB USB */
static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
{
@@ -574,6 +581,18 @@ static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
return 0;
}
+static int m920x_mt2060_tuner_attach(struct dvb_usb_adapter *adap)
+{
+ deb("%s\n",__func__);
+
+ if (dvb_attach(mt2060_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
+ &m920x_mt2060_config, 1220) == NULL)
+ return -ENODEV;
+
+ return 0;
+}
+
+
/* device-specific initialization */
static struct m920x_inits megasky_rc_init [] = {
{ M9206_RC_INIT2, 0xa8 },
@@ -602,6 +621,15 @@ static struct m920x_inits pinnacle310e_init[] = {
{ } /* terminating entry */
};
+static struct m920x_inits vp7049_rc_init[] = {
+ { 0xff28, 0x00 },
+ { 0xff23, 0x00 },
+ { 0xff21, 0x70 },
+ { M9206_RC_INIT2, 0x00 },
+ { M9206_RC_INIT1, 0xff },
+ { } /* terminating entry */
+};
+
/* ir keymaps */
static struct rc_map_table rc_map_megasky_table[] = {
{ 0x0012, KEY_POWER },
@@ -698,12 +726,69 @@ static struct rc_map_table rc_map_pinnacle310e_table[] = {
{ 0x5f, KEY_BLUE }, /* Blue */
};
+static struct rc_map_table rc_map_vp7049_table[] = {
+ { 0x16, KEY_POWER },
+ { 0x17, KEY_FAVORITES },
+ { 0x0f, KEY_TEXT },
+ { 0x48, KEY_PROGRAM }, /* preview */
+ { 0x1c, KEY_EPG },
+ { 0x04, KEY_LIST }, /* record list */
+ { 0x03, KEY_1 },
+ { 0x01, KEY_2 },
+ { 0x06, KEY_3 },
+ { 0x09, KEY_4 },
+ { 0x1d, KEY_5 },
+ { 0x1f, KEY_6 },
+ { 0x0d, KEY_7 },
+ { 0x19, KEY_8 },
+ { 0x1b, KEY_9 },
+ { 0x15, KEY_0 },
+ { 0x0c, KEY_CANCEL },
+ { 0x4a, KEY_CLEAR },
+ { 0x13, KEY_BACK },
+ { 0x00, KEY_TAB },
+ { 0x4b, KEY_UP },
+ { 0x4e, KEY_LEFT },
+ { 0x52, KEY_RIGHT },
+ { 0x51, KEY_DOWN },
+ { 0x4f, KEY_ENTER }, /* could also be KEY_OK */
+ { 0x1e, KEY_VOLUMEUP },
+ { 0x0a, KEY_VOLUMEDOWN },
+ { 0x05, KEY_CHANNELUP },
+ { 0x02, KEY_CHANNELDOWN },
+ { 0x11, KEY_RECORD },
+ { 0x14, KEY_PLAY },
+ { 0x4c, KEY_PAUSE },
+ { 0x1a, KEY_STOP },
+ { 0x40, KEY_REWIND },
+ { 0x12, KEY_FASTFORWARD },
+ { 0x41, KEY_PREVIOUS }, /* Replay */
+ { 0x42, KEY_NEXT }, /* Skip */
+ { 0x54, KEY_CAMERA }, /* Capture */
+ { 0x50, KEY_LANGUAGE }, /* SAP (Separate Audio Program) */
+ { 0x47, KEY_CYCLEWINDOWS }, /* Pip */
+ { 0x4d, KEY_SCREEN }, /* FullScreen */
+ { 0x43, KEY_SUBTITLE },
+ { 0x10, KEY_MUTE },
+ { 0x49, KEY_AB }, /* L/R */
+ { 0x07, KEY_SLEEP }, /* Hibernate */
+ { 0x08, KEY_VIDEO }, /* A/V */
+ { 0x0e, KEY_MENU }, /* Recall */
+ { 0x45, KEY_ZOOMIN },
+ { 0x46, KEY_ZOOMOUT },
+ { 0x18, KEY_RED }, /* Red */
+ { 0x53, KEY_GREEN }, /* Green */
+ { 0x5e, KEY_YELLOW }, /* Yellow */
+ { 0x5f, KEY_BLUE }, /* Blue */
+};
+
/* DVB USB Driver stuff */
static struct dvb_usb_device_properties megasky_properties;
static struct dvb_usb_device_properties digivox_mini_ii_properties;
static struct dvb_usb_device_properties tvwalkertwin_properties;
static struct dvb_usb_device_properties dposh_properties;
static struct dvb_usb_device_properties pinnacle_pctv310e_properties;
+static struct dvb_usb_device_properties vp7049_properties;
static int m920x_probe(struct usb_interface *intf,
const struct usb_device_id *id)
@@ -756,6 +841,13 @@ static int m920x_probe(struct usb_interface *intf,
goto found;
}
+ ret = dvb_usb_device_init(intf, &vp7049_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
+ rc_init_seq = vp7049_rc_init;
+ goto found;
+ }
+
return ret;
} else {
/* Another interface on a multi-tuner device */
@@ -787,6 +879,7 @@ static struct usb_device_id m920x_table [] = {
{ USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) },
{ USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) },
{ USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_PINNACLE_PCTV310E) },
+ { USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_TWINHAN_VP7049) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, m920x_table);
@@ -1079,6 +1172,102 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = {
}
};
+static struct m920x_inits vp7049_pre_init_seq[] = {
+ /* XXX without these commands the frontend cannot be detected,
+ * they must be sent BEFORE the frontend is attached */
+ { 0xff28, 0x00 },
+ { 0xff23, 0x00 },
+ { 0xff28, 0x00 },
+ { 0xff23, 0x00 },
+ { 0xff21, 0x20 },
+ { 0xff21, 0x60 },
+ { 0xff28, 0x00 },
+ { 0xff22, 0x00 },
+ { 0xff20, 0x30 },
+ { 0xff20, 0x20 },
+ { 0xff20, 0x30 },
+ { } /* terminating entry */
+};
+
+static int vp7049_pre_init(struct dvb_usb_device *d)
+{
+ struct m920x_inits *pre_init_seq = vp7049_pre_init_seq;
+ struct usb_device *udev = d->udev;
+ int ret;
+
+ deb("Pre-initialising vp7049\n");
+ while (pre_init_seq->address) {
+ if ((ret = m920x_write(udev, M9206_CORE,
+ pre_init_seq->data,
+ pre_init_seq->address)) != 0) {
+ deb("Pre-initialising vp7049 failed\n");
+ return ret;
+ }
+
+ pre_init_seq++;
+ }
+
+ deb("Pre-initialising vp7049 success\n");
+ return 0;
+}
+
+static struct dvb_usb_device_properties vp7049_properties = {
+ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+
+ .usb_ctrl = DEVICE_SPECIFIC,
+ .firmware = "dvb-usb-vp7049-0.95.fw",
+ .download_firmware = m920x_firmware_download,
+
+ .pre_init = vp7049_pre_init,
+
+ .rc.legacy = {
+ .rc_interval = 100,
+ .rc_map_table = rc_map_vp7049_table,
+ .rc_map_size = ARRAY_SIZE(rc_map_vp7049_table),
+ .rc_query = m920x_rc_query,
+ },
+
+ .size_of_priv = sizeof(struct m920x_state),
+
+ .identify_state = m920x_identify_state,
+ .num_adapters = 1,
+ .adapter = {{
+ .num_frontends = 1,
+ .fe = {{
+
+ .caps = DVB_USB_ADAP_HAS_PID_FILTER |
+ DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
+
+ .pid_filter_count = 8,
+ .pid_filter = m920x_pid_filter,
+ .pid_filter_ctrl = m920x_pid_filter_ctrl,
+
+ .frontend_attach = m920x_mt352_frontend_attach,
+ .tuner_attach = m920x_mt2060_tuner_attach,
+
+ .stream = {
+ .type = USB_BULK,
+ .count = 8,
+ .endpoint = 0x81,
+ .u = {
+ .bulk = {
+ .buffersize = 512,
+ }
+ }
+ },
+ }},
+ }},
+ .i2c_algo = &m920x_i2c_algo,
+
+ .num_device_descs = 1,
+ .devices = {
+ { "DTV-DVB UDTT7049",
+ { &m920x_table[7], NULL },
+ { NULL },
+ }
+ }
+};
+
static struct usb_driver m920x_driver = {
.name = "dvb_usb_m920x",
.probe = m920x_probe,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 4/5] [media] dvb-usb: fix indentation of a for loop
2012-11-05 23:28 [PATCH 0/5] dvb-usb: support VP-7049 Twinhan DVB-T USB Stick and other fixes Antonio Ospite
` (2 preceding siblings ...)
2012-11-05 23:28 ` [PATCH 3/5] [media] m920x: Add support for the VP-7049 Twinhan DVB-T USB Stick Antonio Ospite
@ 2012-11-05 23:28 ` Antonio Ospite
2012-11-05 23:28 ` [PATCH 5/5] [media] m920x: fix a typo in a comment Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
5 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-11-05 23:28 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Antti Palosaari, Michael Krufky,
Patrick Boettcher, Antonio Ospite
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/usb/dvb-usb/dvb-usb-init.c | 60 +++++++++++++++---------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
index 8ab916e..619a7f0 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
@@ -44,41 +44,41 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
memcpy(&adap->props, &d->props.adapter[n], sizeof(struct dvb_usb_adapter_properties));
- for (o = 0; o < adap->props.num_frontends; o++) {
- struct dvb_usb_adapter_fe_properties *props = &adap->props.fe[o];
- /* speed - when running at FULL speed we need a HW PID filter */
- if (d->udev->speed == USB_SPEED_FULL && !(props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) {
- err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)");
- return -ENODEV;
- }
+ for (o = 0; o < adap->props.num_frontends; o++) {
+ struct dvb_usb_adapter_fe_properties *props = &adap->props.fe[o];
+ /* speed - when running at FULL speed we need a HW PID filter */
+ if (d->udev->speed == USB_SPEED_FULL && !(props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) {
+ err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)");
+ return -ENODEV;
+ }
- if ((d->udev->speed == USB_SPEED_FULL && props->caps & DVB_USB_ADAP_HAS_PID_FILTER) ||
- (props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) {
- info("will use the device's hardware PID filter (table count: %d).", props->pid_filter_count);
- adap->fe_adap[o].pid_filtering = 1;
- adap->fe_adap[o].max_feed_count = props->pid_filter_count;
- } else {
- info("will pass the complete MPEG2 transport stream to the software demuxer.");
- adap->fe_adap[o].pid_filtering = 0;
- adap->fe_adap[o].max_feed_count = 255;
- }
+ if ((d->udev->speed == USB_SPEED_FULL && props->caps & DVB_USB_ADAP_HAS_PID_FILTER) ||
+ (props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) {
+ info("will use the device's hardware PID filter (table count: %d).", props->pid_filter_count);
+ adap->fe_adap[o].pid_filtering = 1;
+ adap->fe_adap[o].max_feed_count = props->pid_filter_count;
+ } else {
+ info("will pass the complete MPEG2 transport stream to the software demuxer.");
+ adap->fe_adap[o].pid_filtering = 0;
+ adap->fe_adap[o].max_feed_count = 255;
+ }
- if (!adap->fe_adap[o].pid_filtering &&
- dvb_usb_force_pid_filter_usage &&
- props->caps & DVB_USB_ADAP_HAS_PID_FILTER) {
- info("pid filter enabled by module option.");
- adap->fe_adap[o].pid_filtering = 1;
- adap->fe_adap[o].max_feed_count = props->pid_filter_count;
- }
+ if (!adap->fe_adap[o].pid_filtering &&
+ dvb_usb_force_pid_filter_usage &&
+ props->caps & DVB_USB_ADAP_HAS_PID_FILTER) {
+ info("pid filter enabled by module option.");
+ adap->fe_adap[o].pid_filtering = 1;
+ adap->fe_adap[o].max_feed_count = props->pid_filter_count;
+ }
- if (props->size_of_priv > 0) {
- adap->fe_adap[o].priv = kzalloc(props->size_of_priv, GFP_KERNEL);
- if (adap->fe_adap[o].priv == NULL) {
- err("no memory for priv for adapter %d fe %d.", n, o);
- return -ENOMEM;
+ if (props->size_of_priv > 0) {
+ adap->fe_adap[o].priv = kzalloc(props->size_of_priv, GFP_KERNEL);
+ if (adap->fe_adap[o].priv == NULL) {
+ err("no memory for priv for adapter %d fe %d.", n, o);
+ return -ENOMEM;
+ }
}
}
- }
if (adap->props.size_of_priv > 0) {
adap->priv = kzalloc(adap->props.size_of_priv, GFP_KERNEL);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 5/5] [media] m920x: fix a typo in a comment
2012-11-05 23:28 [PATCH 0/5] dvb-usb: support VP-7049 Twinhan DVB-T USB Stick and other fixes Antonio Ospite
` (3 preceding siblings ...)
2012-11-05 23:28 ` [PATCH 4/5] [media] dvb-usb: fix indentation of a for loop Antonio Ospite
@ 2012-11-05 23:28 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
5 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-11-05 23:28 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Antti Palosaari, Michael Krufky,
Patrick Boettcher, Antonio Ospite
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/usb/dvb-usb/m920x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index ec820ec..c66c78c 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -610,7 +610,7 @@ static struct m920x_inits tvwalkertwin_rc_init [] = {
};
static struct m920x_inits pinnacle310e_init[] = {
- /* without these the tuner don't work */
+ /* without these the tuner doesn't work */
{ 0xff20, 0x9b },
{ 0xff22, 0x70 },
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 1/5] [media] dvb-usb: add a pre_init hook to struct dvb_usb_device_properties
2012-11-05 23:28 ` [PATCH 1/5] [media] dvb-usb: add a pre_init hook to struct dvb_usb_device_properties Antonio Ospite
@ 2012-11-06 0:07 ` Antti Palosaari
2012-11-13 17:35 ` Antonio Ospite
0 siblings, 1 reply; 19+ messages in thread
From: Antti Palosaari @ 2012-11-06 0:07 UTC (permalink / raw)
To: Antonio Ospite
Cc: linux-media, Mauro Carvalho Chehab, Michael Krufky,
Patrick Boettcher
On 11/06/2012 01:28 AM, Antonio Ospite wrote:
> Some devices need to issue a pre-initialization command sequence via
> i2c in order to "enable" the communication with some adapter components.
>
> This happens for instance in the vp7049 USB DVB-T stick on which the
> frontend cannot be detected without first sending a certain sequence of
> commands via i2c.
I looked patch 3 and it is not I2C communication but direct M9206 memory
access you did. I could guess it is GPIO sequence to reset & power demod
and tuner. Due to that, correct place for this kind of initialization is
inside demod and tuner attach.
With a USB power meter, some trial & error testing, and maybe fw disasm
you could even detect those GPIOS :)
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> ---
>
> If this approach is OK I can send a similar patch for dvb-usb-v2.
There is already such callbacks - but no callback between I2C init and
FE attach. There is read_config() which is called first, good place to
make probing device and detect hw config. Another new callback is
.init() which is called after demod and tuner attach. Stuff like USB
interface config should remain here. On USB power management case
reset_resume() that function is called too in order re-configure reseted
USB IF.
I don't see need yet another new callback.
> Are all the dvb-usb drivers going to be ported to dvb-usb-v2 eventually?
There is still quite many drivers to convert, so maybe it is not happen
anytime soon or even later. Feel free to convert that driver. For bonus
you will get for example power-management support for free.
>
>
> drivers/media/usb/dvb-usb/dvb-usb.h | 5 +++++
> drivers/media/usb/dvb-usb/dvb-usb-init.c | 6 ++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/drivers/media/usb/dvb-usb/dvb-usb.h b/drivers/media/usb/dvb-usb/dvb-usb.h
> index aab0f99..1fcea68 100644
> --- a/drivers/media/usb/dvb-usb/dvb-usb.h
> +++ b/drivers/media/usb/dvb-usb/dvb-usb.h
> @@ -233,6 +233,9 @@ enum dvb_usb_mode {
> * @size_of_priv: how many bytes shall be allocated for the private field
> * of struct dvb_usb_device.
> *
> + * @pre_init: function executed after i2c initialization but
> + * before the adapters get initialized
> + *
> * @power_ctrl: called to enable/disable power of the device.
> * @read_mac_address: called to read the MAC address of the device.
> * @identify_state: called to determine the state (cold or warm), when it
> @@ -274,6 +277,8 @@ struct dvb_usb_device_properties {
>
> int size_of_priv;
>
> + int (*pre_init) (struct dvb_usb_device *);
> +
> int num_adapters;
> struct dvb_usb_adapter_properties adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
>
> diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
> index 169196e..8ab916e 100644
> --- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
> +++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
> @@ -31,6 +31,12 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
> struct dvb_usb_adapter *adap;
> int ret, n, o;
>
> + if (d->props.pre_init) {
> + ret = d->props.pre_init(d);
> + if (ret < 0)
> + return ret;
> + }
> +
> for (n = 0; n < d->props.num_adapters; n++) {
> adap = &d->adapter[n];
> adap->dev = d;
>
regards
Antti
--
http://palosaari.fi/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/5] [media] dvb-usb: add a pre_init hook to struct dvb_usb_device_properties
2012-11-06 0:07 ` Antti Palosaari
@ 2012-11-13 17:35 ` Antonio Ospite
0 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-11-13 17:35 UTC (permalink / raw)
To: Antti Palosaari
Cc: linux-media, Mauro Carvalho Chehab, Michael Krufky,
Patrick Boettcher
On Tue, 06 Nov 2012 02:07:19 +0200
Antti Palosaari <crope@iki.fi> wrote:
> On 11/06/2012 01:28 AM, Antonio Ospite wrote:
> > Some devices need to issue a pre-initialization command sequence via
> > i2c in order to "enable" the communication with some adapter components.
> >
> > This happens for instance in the vp7049 USB DVB-T stick on which the
> > frontend cannot be detected without first sending a certain sequence of
> > commands via i2c.
>
> I looked patch 3 and it is not I2C communication but direct M9206 memory
> access you did. I could guess it is GPIO sequence to reset & power demod
> and tuner. Due to that, correct place for this kind of initialization is
> inside demod and tuner attach.
>
You are right it's not I2C, it's just usb communication with the bridge,
sorry.
An approach like the following would work for me, but it is rather dirty.
/* Callbacks for DVB USB */
static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
{
deb("%s\n",__func__);
+ if (strncmp(adap->dev->desc->name, "DTV-DVB UDTT7049",
+ strlen(adap->dev->desc->name)) == 0) {
+ int ret = vp7049_pre_init(adap->dev);
+ if (ret < 0)
+ return ret;
+ }
+
adap->fe_adap[0].fe = dvb_attach(mt352_attach,
&m920x_mt352_config,
&adap->dev->i2c_adap);
>From a semantic point of view doing it in fe attach looks strange tho,
because the communication itself is strictly with the bridge (m920x) and
not with the frontend (mt352), even if the frontend is affected in this
case.
To me it still looks like something to do in dvb_usb_init() _before_
dvb_usb_adapter_init(), can you please help me understand better your
point of view?
> With a USB power meter, some trial & error testing, and maybe fw disasm
> you could even detect those GPIOS :)
>
I don't have the equipment, and maybe I don't have the disassembling
skills either, I might try to isolate the minimum required sequence by
commenting in and out register changes but I feel more confident with
sending the sequence just like it was captured from the windows driver.
> > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > ---
> >
> > If this approach is OK I can send a similar patch for dvb-usb-v2.
>
> There is already such callbacks - but no callback between I2C init and
> FE attach. There is read_config() which is called first, good place to
> make probing device and detect hw config. Another new callback is
> .init() which is called after demod and tuner attach. Stuff like USB
> interface config should remain here. On USB power management case
> reset_resume() that function is called too in order re-configure reseted
> USB IF.
>
> I don't see need yet another new callback.
>
OK, after I solve the issue on dvb-usb in a way you like it, I'll have a
clearer picture of how this will have to be solved in dvb-usb-v2 too.
> > Are all the dvb-usb drivers going to be ported to dvb-usb-v2 eventually?
>
> There is still quite many drivers to convert, so maybe it is not happen
> anytime soon or even later. Feel free to convert that driver. For bonus
> you will get for example power-management support for free.
>
Good to know about the power management, but it's unlikely I can work on
porting the driver to dvb-usb-v2.
Regards,
Antonio
--
Antonio Ospite
http://ao2.it
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes
2012-11-05 23:28 [PATCH 0/5] dvb-usb: support VP-7049 Twinhan DVB-T USB Stick and other fixes Antonio Ospite
` (4 preceding siblings ...)
2012-11-05 23:28 ` [PATCH 5/5] [media] m920x: fix a typo in a comment Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 1/9] [media] dvb-usb: fix indentation of a for loop Antonio Ospite
` (9 more replies)
5 siblings, 10 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
Hi,
Here is a second iteration of the patchset to add support for the
Twinhan VP7049 DVB-T USB Stick, v1 is at:
http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/56714
Patches from 1 to 7 are small fixes or refactorings to make the addition
of the new device easier.
Patches 8 and 9 are specific to the device.
Changes since v1:
- Patches 1-7: more refactorings
- Patch 9: don't add a .pre_init callback to dvb-usb, Antti convinced
me that the initialization is better done just before the frontend
attach is called.
- Patch 9: use the RC core infrastructure, the keymap I needed was
already here: I could reuse the rc-twinhan1027 driver without
touching anything in it.
Again I deliberately ignored some checkpatch.pl warnings and errors
because I preferred to stick with the code style in use in the
dvb-usb/m920x files, let me know if you want me to do otherwise.
Thanks,
Antonio
Antonio Ospite (9):
[media] dvb-usb: fix indentation of a for loop
[media] m920x: fix a typo in a comment
[media] m920x: factor out a m920x_write_seq() function
[media] m920x: factor out a m920x_parse_rc_state() function
[media] m920x: avoid repeating RC state parsing at each keycode
[media] m920x: introduce m920x_rc_core_query()
[media] m920x: send the RC init sequence also when rc.core is used
[media] get_dvb_firmware: add entry for the vp7049 firmware
[media] m920x: add support for the VP-7049 Twinhan DVB-T USB Stick
Documentation/dvb/get_dvb_firmware | 15 +-
drivers/media/dvb-core/dvb-usb-ids.h | 1 +
drivers/media/usb/dvb-usb/dvb-usb-init.c | 60 +++----
drivers/media/usb/dvb-usb/m920x.c | 269 ++++++++++++++++++++++++------
4 files changed, 266 insertions(+), 79 deletions(-)
--
Antonio Ospite
http://ao2.it
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCHv2 1/9] [media] dvb-usb: fix indentation of a for loop
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 2/9] [media] m920x: fix a typo in a comment Antonio Ospite
` (8 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/usb/dvb-usb/dvb-usb-init.c | 60 +++++++++++++++---------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
index 169196e..1adf325 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
@@ -38,41 +38,41 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
memcpy(&adap->props, &d->props.adapter[n], sizeof(struct dvb_usb_adapter_properties));
- for (o = 0; o < adap->props.num_frontends; o++) {
- struct dvb_usb_adapter_fe_properties *props = &adap->props.fe[o];
- /* speed - when running at FULL speed we need a HW PID filter */
- if (d->udev->speed == USB_SPEED_FULL && !(props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) {
- err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)");
- return -ENODEV;
- }
+ for (o = 0; o < adap->props.num_frontends; o++) {
+ struct dvb_usb_adapter_fe_properties *props = &adap->props.fe[o];
+ /* speed - when running at FULL speed we need a HW PID filter */
+ if (d->udev->speed == USB_SPEED_FULL && !(props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) {
+ err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)");
+ return -ENODEV;
+ }
- if ((d->udev->speed == USB_SPEED_FULL && props->caps & DVB_USB_ADAP_HAS_PID_FILTER) ||
- (props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) {
- info("will use the device's hardware PID filter (table count: %d).", props->pid_filter_count);
- adap->fe_adap[o].pid_filtering = 1;
- adap->fe_adap[o].max_feed_count = props->pid_filter_count;
- } else {
- info("will pass the complete MPEG2 transport stream to the software demuxer.");
- adap->fe_adap[o].pid_filtering = 0;
- adap->fe_adap[o].max_feed_count = 255;
- }
+ if ((d->udev->speed == USB_SPEED_FULL && props->caps & DVB_USB_ADAP_HAS_PID_FILTER) ||
+ (props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) {
+ info("will use the device's hardware PID filter (table count: %d).", props->pid_filter_count);
+ adap->fe_adap[o].pid_filtering = 1;
+ adap->fe_adap[o].max_feed_count = props->pid_filter_count;
+ } else {
+ info("will pass the complete MPEG2 transport stream to the software demuxer.");
+ adap->fe_adap[o].pid_filtering = 0;
+ adap->fe_adap[o].max_feed_count = 255;
+ }
- if (!adap->fe_adap[o].pid_filtering &&
- dvb_usb_force_pid_filter_usage &&
- props->caps & DVB_USB_ADAP_HAS_PID_FILTER) {
- info("pid filter enabled by module option.");
- adap->fe_adap[o].pid_filtering = 1;
- adap->fe_adap[o].max_feed_count = props->pid_filter_count;
- }
+ if (!adap->fe_adap[o].pid_filtering &&
+ dvb_usb_force_pid_filter_usage &&
+ props->caps & DVB_USB_ADAP_HAS_PID_FILTER) {
+ info("pid filter enabled by module option.");
+ adap->fe_adap[o].pid_filtering = 1;
+ adap->fe_adap[o].max_feed_count = props->pid_filter_count;
+ }
- if (props->size_of_priv > 0) {
- adap->fe_adap[o].priv = kzalloc(props->size_of_priv, GFP_KERNEL);
- if (adap->fe_adap[o].priv == NULL) {
- err("no memory for priv for adapter %d fe %d.", n, o);
- return -ENOMEM;
+ if (props->size_of_priv > 0) {
+ adap->fe_adap[o].priv = kzalloc(props->size_of_priv, GFP_KERNEL);
+ if (adap->fe_adap[o].priv == NULL) {
+ err("no memory for priv for adapter %d fe %d.", n, o);
+ return -ENOMEM;
+ }
}
}
- }
if (adap->props.size_of_priv > 0) {
adap->priv = kzalloc(adap->props.size_of_priv, GFP_KERNEL);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCHv2 2/9] [media] m920x: fix a typo in a comment
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 1/9] [media] dvb-usb: fix indentation of a for loop Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 3/9] [media] m920x: factor out a m920x_write_seq() function Antonio Ospite
` (7 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/usb/dvb-usb/m920x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index 661bb75..433696d 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -591,7 +591,7 @@ static struct m920x_inits tvwalkertwin_rc_init [] = {
};
static struct m920x_inits pinnacle310e_init[] = {
- /* without these the tuner don't work */
+ /* without these the tuner doesn't work */
{ 0xff20, 0x9b },
{ 0xff22, 0x70 },
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCHv2 3/9] [media] m920x: factor out a m920x_write_seq() function
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 1/9] [media] dvb-usb: fix indentation of a for loop Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 2/9] [media] m920x: fix a typo in a comment Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 4/9] [media] m920x: factor out a m920x_parse_rc_state() function Antonio Ospite
` (6 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
This is in preparation for the vp7049 frontend attach function which is
going to set a sequence of registers as well.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/usb/dvb-usb/m920x.c | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index 433696d..23416fb 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -63,6 +63,21 @@ static inline int m920x_write(struct usb_device *udev, u8 request,
return ret;
}
+static inline int m920x_write_seq(struct usb_device *udev, u8 request,
+ struct m920x_inits *seq)
+{
+ int ret;
+ while (seq->address) {
+ ret = m920x_write(udev, request, seq->data, seq->address);
+ if (ret != 0)
+ return ret;
+
+ seq++;
+ }
+
+ return ret;
+}
+
static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
{
int ret = 0, i, epi, flags = 0;
@@ -71,15 +86,10 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
/* Remote controller init. */
if (d->props.rc.legacy.rc_query) {
deb("Initialising remote control\n");
- while (rc_seq->address) {
- if ((ret = m920x_write(d->udev, M9206_CORE,
- rc_seq->data,
- rc_seq->address)) != 0) {
- deb("Initialising remote control failed\n");
- return ret;
- }
-
- rc_seq++;
+ ret = m920x_write_seq(d->udev, M9206_CORE, rc_seq);
+ if (ret != 0) {
+ deb("Initialising remote control failed\n");
+ return ret;
}
deb("Initialising remote control success\n");
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCHv2 4/9] [media] m920x: factor out a m920x_parse_rc_state() function
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
` (2 preceding siblings ...)
2012-12-10 21:37 ` [PATCHv2 3/9] [media] m920x: factor out a m920x_write_seq() function Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 5/9] [media] m920x: avoid repeating RC state parsing at each keycode Antonio Ospite
` (5 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
This is in preparation to using RC core infrastructure for some devices,
the RC button state parsing logic can be shared berween rc.legacy and
rc.core callbacks as it is independent from the mechanism used for RC
handling.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/usb/dvb-usb/m920x.c | 81 ++++++++++++++++++++-----------------
1 file changed, 44 insertions(+), 37 deletions(-)
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index 23416fb..581c5de 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -140,9 +140,50 @@ static int m920x_init_ep(struct usb_interface *intf)
alt->desc.bAlternateSetting);
}
-static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
+static inline void m920x_parse_rc_state(struct dvb_usb_device *d, u8 rc_state,
+ int *state)
{
struct m920x_state *m = d->priv;
+
+ switch (rc_state) {
+ case 0x80:
+ *state = REMOTE_NO_KEY_PRESSED;
+ break;
+
+ case 0x88: /* framing error or "invalid code" */
+ case 0x99:
+ case 0xc0:
+ case 0xd8:
+ *state = REMOTE_NO_KEY_PRESSED;
+ m->rep_count = 0;
+ break;
+
+ case 0x93:
+ case 0x92:
+ case 0x83: /* pinnacle PCTV310e */
+ case 0x82:
+ m->rep_count = 0;
+ *state = REMOTE_KEY_PRESSED;
+ break;
+
+ case 0x91:
+ case 0x81: /* pinnacle PCTV310e */
+ /* prevent immediate auto-repeat */
+ if (++m->rep_count > 2)
+ *state = REMOTE_KEY_REPEAT;
+ else
+ *state = REMOTE_NO_KEY_PRESSED;
+ break;
+
+ default:
+ deb("Unexpected rc state %02x\n", rc_state);
+ *state = REMOTE_NO_KEY_PRESSED;
+ break;
+ }
+}
+
+static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
+{
int i, ret = 0;
u8 *rc_state;
@@ -159,42 +200,8 @@ static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
if (rc5_data(&d->props.rc.legacy.rc_map_table[i]) == rc_state[1]) {
*event = d->props.rc.legacy.rc_map_table[i].keycode;
-
- switch(rc_state[0]) {
- case 0x80:
- *state = REMOTE_NO_KEY_PRESSED;
- goto out;
-
- case 0x88: /* framing error or "invalid code" */
- case 0x99:
- case 0xc0:
- case 0xd8:
- *state = REMOTE_NO_KEY_PRESSED;
- m->rep_count = 0;
- goto out;
-
- case 0x93:
- case 0x92:
- case 0x83: /* pinnacle PCTV310e */
- case 0x82:
- m->rep_count = 0;
- *state = REMOTE_KEY_PRESSED;
- goto out;
-
- case 0x91:
- case 0x81: /* pinnacle PCTV310e */
- /* prevent immediate auto-repeat */
- if (++m->rep_count > 2)
- *state = REMOTE_KEY_REPEAT;
- else
- *state = REMOTE_NO_KEY_PRESSED;
- goto out;
-
- default:
- deb("Unexpected rc state %02x\n", rc_state[0]);
- *state = REMOTE_NO_KEY_PRESSED;
- goto out;
- }
+ m920x_parse_rc_state(d, rc_state[0], state);
+ goto out;
}
if (rc_state[1] != 0)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCHv2 5/9] [media] m920x: avoid repeating RC state parsing at each keycode
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
` (3 preceding siblings ...)
2012-12-10 21:37 ` [PATCHv2 4/9] [media] m920x: factor out a m920x_parse_rc_state() function Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 6/9] [media] m920x: introduce m920x_rc_core_query() Antonio Ospite
` (4 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
Parsing the RC press state is invariant wrt. the keycode, take it out of
the keycode scanning loop.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/usb/dvb-usb/m920x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index 581c5de..5f6ca75 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -197,10 +197,11 @@ static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, rc_state + 1, 1)) != 0)
goto out;
+ m920x_parse_rc_state(d, rc_state[0], state);
+
for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
if (rc5_data(&d->props.rc.legacy.rc_map_table[i]) == rc_state[1]) {
*event = d->props.rc.legacy.rc_map_table[i].keycode;
- m920x_parse_rc_state(d, rc_state[0], state);
goto out;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCHv2 6/9] [media] m920x: introduce m920x_rc_core_query()
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
` (4 preceding siblings ...)
2012-12-10 21:37 ` [PATCHv2 5/9] [media] m920x: avoid repeating RC state parsing at each keycode Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 7/9] [media] m920x: send the RC init sequence also when rc.core is used Antonio Ospite
` (3 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
Add an m920x_rc_core_query() function for drivers which want to use the
linux RC core infrastructure.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/usb/dvb-usb/m920x.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index 5f6ca75..bddd763 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -215,6 +215,38 @@ static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
return ret;
}
+static int m920x_rc_core_query(struct dvb_usb_device *d)
+{
+ int ret = 0;
+ u8 *rc_state;
+ int state;
+
+ rc_state = kmalloc(2, GFP_KERNEL);
+ if (!rc_state)
+ return -ENOMEM;
+
+ if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, &rc_state[0], 1)) != 0)
+ goto out;
+
+ if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, &rc_state[1], 1)) != 0)
+ goto out;
+
+ deb("state=0x%02x keycode=0x%02x\n", rc_state[0], rc_state[1]);
+
+ m920x_parse_rc_state(d, rc_state[0], &state);
+
+ if (state == REMOTE_NO_KEY_PRESSED)
+ rc_keyup(d->rc_dev);
+ else if (state == REMOTE_KEY_REPEAT)
+ rc_repeat(d->rc_dev);
+ else
+ rc_keydown(d->rc_dev, rc_state[1], 0);
+
+out:
+ kfree(rc_state);
+ return ret;
+}
+
/* I2C */
static int m920x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
{
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCHv2 7/9] [media] m920x: send the RC init sequence also when rc.core is used
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
` (5 preceding siblings ...)
2012-12-10 21:37 ` [PATCHv2 6/9] [media] m920x: introduce m920x_rc_core_query() Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 8/9] [media] get_dvb_firmware: add entry for the vp7049 firmware Antonio Ospite
` (2 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/usb/dvb-usb/m920x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index bddd763..531a681 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -84,7 +84,7 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
/* Remote controller init. */
- if (d->props.rc.legacy.rc_query) {
+ if (d->props.rc.legacy.rc_query || d->props.rc.core.rc_query) {
deb("Initialising remote control\n");
ret = m920x_write_seq(d->udev, M9206_CORE, rc_seq);
if (ret != 0) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCHv2 8/9] [media] get_dvb_firmware: add entry for the vp7049 firmware
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
` (6 preceding siblings ...)
2012-12-10 21:37 ` [PATCHv2 7/9] [media] m920x: send the RC init sequence also when rc.core is used Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 9/9] [media] m920x: add support for the VP-7049 Twinhan DVB-T USB Stick Antonio Ospite
2012-12-27 12:23 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
Add an entry to download the dvb-usb-vp7049-0.95.fw firmware for the
Twinhan vp7049 and similar devices.
Known devices of this kind are:
Twinhan/Azurewave DTV-DVB UDTT7049
Digicom Digitune-S
Think Xtra Hollywood DVB-T USB2.0
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
Documentation/dvb/get_dvb_firmware | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index 32bc56b..0cdb157 100755
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -23,7 +23,7 @@ use IO::Handle;
@components = ( "sp8870", "sp887x", "tda10045", "tda10046",
"tda10046lifeview", "av7110", "dec2000t", "dec2540t",
- "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
+ "dec3000s", "vp7041", "vp7049", "dibusb", "nxt2002", "nxt2004",
"or51211", "or51132_qam", "or51132_vsb", "bluebird",
"opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
"af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",
@@ -289,6 +289,19 @@ sub vp7041 {
$outfile;
}
+sub vp7049 {
+ my $fwfile = "dvb-usb-vp7049-0.95.fw";
+ my $url = "http://ao2.it/sites/default/files/blog/2012/11/06/linux-support-digicom-digitune-s-vp7049-udtt7049/$fwfile";
+ my $hash = "5609fd295168aea88b25ff43a6f79c36";
+
+ checkstandard();
+
+ wgetfile($fwfile, $url);
+ verify($fwfile, $hash);
+
+ $fwfile;
+}
+
sub dibusb {
my $url = "http://www.linuxtv.org/downloads/firmware/dvb-usb-dibusb-5.0.0.11.fw";
my $outfile = "dvb-dibusb-5.0.0.11.fw";
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCHv2 9/9] [media] m920x: add support for the VP-7049 Twinhan DVB-T USB Stick
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
` (7 preceding siblings ...)
2012-12-10 21:37 ` [PATCHv2 8/9] [media] get_dvb_firmware: add entry for the vp7049 firmware Antonio Ospite
@ 2012-12-10 21:37 ` Antonio Ospite
2012-12-27 12:23 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-10 21:37 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
This device was originally made by Twinhan/Azurewave[1] and sometimes
named DTV-DVB UDTT7049, it could be also found in Italy under the name
of Digicom Digitune-S[2], or Think Xtra Hollywood DVB-T USB2.0[3].
Components:
Usb bridge: ULi M9206
Frontend: MT352CG
Tuner: MT2060F
The firmware can be downloaded with:
$ ./Documentation/dvb/get_dvb_firmware vp7049
[1] http://www.azurewave.com/Support_Utility_Driver.asp
[2] http://www.digicom.it/digisit/driver_link.nsf/driverprodotto?openform&prodotto=DigiTuneS
[3] http://www.txitalia.it/prodotto.asp?prodotto=txhollywooddvttv
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
drivers/media/dvb-core/dvb-usb-ids.h | 1 +
drivers/media/usb/dvb-usb/m920x.c | 123 ++++++++++++++++++++++++++++++++++
2 files changed, 124 insertions(+)
diff --git a/drivers/media/dvb-core/dvb-usb-ids.h b/drivers/media/dvb-core/dvb-usb-ids.h
index 58e0220..faeaadd 100644
--- a/drivers/media/dvb-core/dvb-usb-ids.h
+++ b/drivers/media/dvb-core/dvb-usb-ids.h
@@ -172,6 +172,7 @@
#define USB_PID_TWINHAN_VP7045_WARM 0x3206
#define USB_PID_TWINHAN_VP7021_COLD 0x3207
#define USB_PID_TWINHAN_VP7021_WARM 0x3208
+#define USB_PID_TWINHAN_VP7049 0x3219
#define USB_PID_TINYTWIN 0x3226
#define USB_PID_TINYTWIN_2 0xe402
#define USB_PID_TINYTWIN_3 0x9016
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index 531a681..02facc6 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -16,6 +16,7 @@
#include "qt1010.h"
#include "tda1004x.h"
#include "tda827x.h"
+#include "mt2060.h"
#include <media/tuner.h>
#include "tuner-simple.h"
@@ -546,6 +547,12 @@ static struct qt1010_config m920x_qt1010_config = {
.i2c_address = 0x62
};
+static struct mt2060_config m920x_mt2060_config = {
+ .i2c_address = 0x60, /* 0xc0 */
+ .clock_out = 0,
+};
+
+
/* Callbacks for DVB USB */
static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
{
@@ -560,6 +567,37 @@ static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
return 0;
}
+static int m920x_mt352_frontend_attach_vp7049(struct dvb_usb_adapter *adap)
+{
+ struct m920x_inits vp7049_fe_init_seq[] = {
+ /* XXX without these commands the frontend cannot be detected,
+ * they must be sent BEFORE the frontend is attached */
+ { 0xff28, 0x00 },
+ { 0xff23, 0x00 },
+ { 0xff28, 0x00 },
+ { 0xff23, 0x00 },
+ { 0xff21, 0x20 },
+ { 0xff21, 0x60 },
+ { 0xff28, 0x00 },
+ { 0xff22, 0x00 },
+ { 0xff20, 0x30 },
+ { 0xff20, 0x20 },
+ { 0xff20, 0x30 },
+ { } /* terminating entry */
+ };
+ int ret;
+
+ deb("%s\n",__func__);
+
+ ret = m920x_write_seq(adap->dev->udev, M9206_CORE, vp7049_fe_init_seq);
+ if (ret != 0) {
+ deb("Initialization of vp7049 frontend failed.");
+ return ret;
+ }
+
+ return m920x_mt352_frontend_attach(adap);
+}
+
static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap)
{
deb("%s\n",__func__);
@@ -624,6 +662,18 @@ static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
return 0;
}
+static int m920x_mt2060_tuner_attach(struct dvb_usb_adapter *adap)
+{
+ deb("%s\n",__func__);
+
+ if (dvb_attach(mt2060_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
+ &m920x_mt2060_config, 1220) == NULL)
+ return -ENODEV;
+
+ return 0;
+}
+
+
/* device-specific initialization */
static struct m920x_inits megasky_rc_init [] = {
{ M9206_RC_INIT2, 0xa8 },
@@ -652,6 +702,15 @@ static struct m920x_inits pinnacle310e_init[] = {
{ } /* terminating entry */
};
+static struct m920x_inits vp7049_rc_init[] = {
+ { 0xff28, 0x00 },
+ { 0xff23, 0x00 },
+ { 0xff21, 0x70 },
+ { M9206_RC_INIT2, 0x00 },
+ { M9206_RC_INIT1, 0xff },
+ { } /* terminating entry */
+};
+
/* ir keymaps */
static struct rc_map_table rc_map_megasky_table[] = {
{ 0x0012, KEY_POWER },
@@ -754,6 +813,7 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties;
static struct dvb_usb_device_properties tvwalkertwin_properties;
static struct dvb_usb_device_properties dposh_properties;
static struct dvb_usb_device_properties pinnacle_pctv310e_properties;
+static struct dvb_usb_device_properties vp7049_properties;
static int m920x_probe(struct usb_interface *intf,
const struct usb_device_id *id)
@@ -806,6 +866,13 @@ static int m920x_probe(struct usb_interface *intf,
goto found;
}
+ ret = dvb_usb_device_init(intf, &vp7049_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
+ rc_init_seq = vp7049_rc_init;
+ goto found;
+ }
+
return ret;
} else {
/* Another interface on a multi-tuner device */
@@ -837,6 +904,7 @@ static struct usb_device_id m920x_table [] = {
{ USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) },
{ USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) },
{ USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_PINNACLE_PCTV310E) },
+ { USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_TWINHAN_VP7049) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, m920x_table);
@@ -1129,6 +1197,61 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = {
}
};
+static struct dvb_usb_device_properties vp7049_properties = {
+ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+
+ .usb_ctrl = DEVICE_SPECIFIC,
+ .firmware = "dvb-usb-vp7049-0.95.fw",
+ .download_firmware = m920x_firmware_download,
+
+ .rc.core = {
+ .rc_interval = 150,
+ .rc_codes = RC_MAP_TWINHAN_VP1027_DVBS,
+ .rc_query = m920x_rc_core_query,
+ .allowed_protos = RC_TYPE_UNKNOWN,
+ },
+
+ .size_of_priv = sizeof(struct m920x_state),
+
+ .identify_state = m920x_identify_state,
+ .num_adapters = 1,
+ .adapter = {{
+ .num_frontends = 1,
+ .fe = {{
+
+ .caps = DVB_USB_ADAP_HAS_PID_FILTER |
+ DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
+
+ .pid_filter_count = 8,
+ .pid_filter = m920x_pid_filter,
+ .pid_filter_ctrl = m920x_pid_filter_ctrl,
+
+ .frontend_attach = m920x_mt352_frontend_attach_vp7049,
+ .tuner_attach = m920x_mt2060_tuner_attach,
+
+ .stream = {
+ .type = USB_BULK,
+ .count = 8,
+ .endpoint = 0x81,
+ .u = {
+ .bulk = {
+ .buffersize = 512,
+ }
+ }
+ },
+ }},
+ }},
+ .i2c_algo = &m920x_i2c_algo,
+
+ .num_device_descs = 1,
+ .devices = {
+ { "DTV-DVB UDTT7049",
+ { &m920x_table[7], NULL },
+ { NULL },
+ }
+ }
+};
+
static struct usb_driver m920x_driver = {
.name = "dvb_usb_m920x",
.probe = m920x_probe,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
` (8 preceding siblings ...)
2012-12-10 21:37 ` [PATCHv2 9/9] [media] m920x: add support for the VP-7049 Twinhan DVB-T USB Stick Antonio Ospite
@ 2012-12-27 12:23 ` Antonio Ospite
9 siblings, 0 replies; 19+ messages in thread
From: Antonio Ospite @ 2012-12-27 12:23 UTC (permalink / raw)
To: linux-media; +Cc: Antonio Ospite, Antti Palosaari
On Mon, 10 Dec 2012 22:37:08 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:
> Hi,
>
Ping.
> Here is a second iteration of the patchset to add support for the
> Twinhan VP7049 DVB-T USB Stick, v1 is at:
> http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/56714
>
> Patches from 1 to 7 are small fixes or refactorings to make the addition
> of the new device easier.
>
> Patches 8 and 9 are specific to the device.
>
> Changes since v1:
> - Patches 1-7: more refactorings
>
> - Patch 9: don't add a .pre_init callback to dvb-usb, Antti convinced
> me that the initialization is better done just before the frontend
> attach is called.
>
> - Patch 9: use the RC core infrastructure, the keymap I needed was
> already here: I could reuse the rc-twinhan1027 driver without
> touching anything in it.
>
> Again I deliberately ignored some checkpatch.pl warnings and errors
> because I preferred to stick with the code style in use in the
> dvb-usb/m920x files, let me know if you want me to do otherwise.
>
> Thanks,
> Antonio
>
> Antonio Ospite (9):
> [media] dvb-usb: fix indentation of a for loop
> [media] m920x: fix a typo in a comment
> [media] m920x: factor out a m920x_write_seq() function
> [media] m920x: factor out a m920x_parse_rc_state() function
> [media] m920x: avoid repeating RC state parsing at each keycode
> [media] m920x: introduce m920x_rc_core_query()
> [media] m920x: send the RC init sequence also when rc.core is used
> [media] get_dvb_firmware: add entry for the vp7049 firmware
> [media] m920x: add support for the VP-7049 Twinhan DVB-T USB Stick
>
> Documentation/dvb/get_dvb_firmware | 15 +-
> drivers/media/dvb-core/dvb-usb-ids.h | 1 +
> drivers/media/usb/dvb-usb/dvb-usb-init.c | 60 +++----
> drivers/media/usb/dvb-usb/m920x.c | 269 ++++++++++++++++++++++++------
> 4 files changed, 266 insertions(+), 79 deletions(-)
>
> --
> Antonio Ospite
> http://ao2.it
>
> A: Because it messes up the order in which people normally read text.
> See http://en.wikipedia.org/wiki/Posting_style
> Q: Why is top-posting such a bad thing?
>
--
Antonio Ospite
http://ao2.it
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2012-12-27 12:23 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05 23:28 [PATCH 0/5] dvb-usb: support VP-7049 Twinhan DVB-T USB Stick and other fixes Antonio Ospite
2012-11-05 23:28 ` [PATCH 1/5] [media] dvb-usb: add a pre_init hook to struct dvb_usb_device_properties Antonio Ospite
2012-11-06 0:07 ` Antti Palosaari
2012-11-13 17:35 ` Antonio Ospite
2012-11-05 23:28 ` [PATCH 2/5] [media] get_dvb_firmware: add dvb-usb-vp7049-0.95.fw Antonio Ospite
2012-11-05 23:28 ` [PATCH 3/5] [media] m920x: Add support for the VP-7049 Twinhan DVB-T USB Stick Antonio Ospite
2012-11-05 23:28 ` [PATCH 4/5] [media] dvb-usb: fix indentation of a for loop Antonio Ospite
2012-11-05 23:28 ` [PATCH 5/5] [media] m920x: fix a typo in a comment Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 1/9] [media] dvb-usb: fix indentation of a for loop Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 2/9] [media] m920x: fix a typo in a comment Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 3/9] [media] m920x: factor out a m920x_write_seq() function Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 4/9] [media] m920x: factor out a m920x_parse_rc_state() function Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 5/9] [media] m920x: avoid repeating RC state parsing at each keycode Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 6/9] [media] m920x: introduce m920x_rc_core_query() Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 7/9] [media] m920x: send the RC init sequence also when rc.core is used Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 8/9] [media] get_dvb_firmware: add entry for the vp7049 firmware Antonio Ospite
2012-12-10 21:37 ` [PATCHv2 9/9] [media] m920x: add support for the VP-7049 Twinhan DVB-T USB Stick Antonio Ospite
2012-12-27 12:23 ` [PATCHv2 0/9] dvb-usb/m920x: support VP-7049 DVB-T USB Stick and other fixes Antonio Ospite
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.