Hola,
Ya sé que la respuesta es un poco tardía, pero es la que tengo.
He preferido contestar en lugar de crear tema nuevo, porque buscando el driver de linux para "la susodicha" acabé aquí. Y puede que algún otro caiga también.
Una vez pasada la introducción, vamos al lío:
Yo me compré el mismo sintonizador que tat (unos tres meses después) para vet la tele en el portátil. Pronto ví que el kernel de linux no tiene soporte para este trasto. Así que entre instalar un XP en mi netbook o rascarme el driver, opté por la segunda. Y lo tengo funcionando, aunque no muy probado con Me TV y con Kaffeine. Tengo que agradecer públicamente el soporte recibido de Antti Palosaari (creador del driver tanto del chipset AF9035 como del sintonizador TDA18218).
La verdad es que no sé cómo adjuntar un fichero que he escrito para documentar "el evento" y que en pdf queda más majo.
Lo voy a pegar a continuación; pero si alguien quiere, le puedo mandar el fuente completo para que lo pruebe con su kernel.
----- Doc -----
Encontré que el trasto tiene 2 chips AF9035 (controlador y demodulador) y TDA18218 (sintonizador), así que descargué el fuente de v4l: tda18218-40e288163c8d.
Luego apliqué el parche que viene en
https://patchwork.kernel.org/patch/61950/ (en plan manual fichero a fichero, porque me daba muchos errores).
luego el código del sintonizador me lo pasó Antti y está en
http://git.linuxtv.org/anttip/media_tree.git?a=shortlog;h=refs/heads/tda18218Un poco de cortar y pegar, pelearme y aprender a capturar los datos desde el programa de windows y al final funciona.
Estas son las modificaciones a los ficheros específicas para esta sintonizadora.
dvb/dvb-usb/dvb-usb-ids.h
Stick labeled Avermedia AverTV Volar HD (A835) with USB ID 07ca:b835
#define USB_PID_AVERMEDIA_B835 0xb835
dvb/dvb-usb/af9035.c
First: includes and structures (mostly copied from af9015)
#include "tda18218.h"
/* define structure */
static struct tda18218_config af9035_tda18218_config = {
.i2c_address = 0xc0,
.i2c_wr_max = 17,
};
static struct usb_device_id af9035_usb_table[] = {
/* 0 */{USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_1000)},
{USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_1001)},
{USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_1002)},
{USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_1003)},
{USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_9035)},
/* 5 */{USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_STICK)},
{USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_A825)},
{USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_B835)},
{0},
};
static struct dvb_usb_device_properties af9035_properties[] = {
{
...
.num_device_descs = 4,
.devices = {
{
.name = "Afatech AF9035 DVB-T USB2.0 stick",
.cold_ids = {&af9035_usb_table[0],
&af9035_usb_table[1],
&af9035_usb_table[2],
&af9035_usb_table[3],
&af9035_usb_table[4], NULL},
.warm_ids = {NULL},
},
{
.name = "TerraTec Cinergy T Stick",
.cold_ids = {&af9035_usb_table[5], NULL},
.warm_ids = {NULL},
},
{
.name = "Avermedia TwinStar",
.cold_ids = {&af9035_usb_table[6], NULL},
.warm_ids = {NULL},
},
{
.name = "Avermedia AverTV Volar HD (A835)",
.cold_ids = {&af9035_usb_table[7], NULL},
.warm_ids = {NULL},
},
}
},
};
Second: it’s the same (more or less) that TUA 9001 tuner
In function:
static int af9035_read_config(struct usb_device *udev)
...
case AF9033_TUNER_TUA9001:
case AF9033_TUNER_TDA18218:
af9035_af9033_config
.rf_spec_inv = 1;
break;
...
/* With a Volar HD, the same as with a TwinStar*/
if (le16_to_cpu(udev->descriptor.idVendor) == USB_VID_AVERMEDIA &&
(le16_to_cpu(udev->descriptor.idProduct) == USB_PID_AVERMEDIA_A825 ||
le16_to_cpu(udev->descriptor.idProduct) == USB_PID_AVERMEDIA_B835)) {
deb_info("%s: AverMedia A825/B835: overriding config\n", __func__);
/* set correct IF */
for (i = 0; i < af9035_properties[0].num_adapters; i++) {
af9035_af9033_config.if_freq = 4570000;
}
}
In function:
static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
...
case AF9033_TUNER_TDA18218:
af9035_af9033_config[adap->id].tuner_address = af9035_tua9001_config[adap->id].i2c_address;
af9035_af9033_config[adap->id].tuner_address += adap->id;
if (adap->id == 0) {
/* gpiot3 TUA9001 RESETN
gpiot2 TUA9001 RXEN */
ret = af9035_write_reg_bits(adap->dev, LINK,
p_reg_top_gpiot2_en, reg_top_gpiot2_en_pos,
reg_top_gpiot2_en_len, 1);
ret = af9035_write_reg_bits(adap->dev, LINK,
p_reg_top_gpiot2_on, reg_top_gpiot2_on_pos,
reg_top_gpiot2_on_len, 1);
ret = af9035_write_reg_bits(adap->dev, LINK,
p_reg_top_gpiot3_en, reg_top_gpiot3_en_pos,
reg_top_gpiot3_en_len, 1);
ret = af9035_write_reg_bits(adap->dev, LINK,
p_reg_top_gpiot3_on, reg_top_gpiot3_on_pos,
reg_top_gpiot3_on_len, 1);
/* reset tuner */
ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot3_o,
reg_top_gpiot3_o_pos, reg_top_gpiot3_o_len, 0);
msleep(1);
ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot3_o,
reg_top_gpiot3_o_pos, reg_top_gpiot3_o_len, 1);
/* activate tuner - TODO: do that like I2C gate control */
ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot2_o,
reg_top_gpiot2_o_pos, reg_top_gpiot2_o_len, 1);
}
ret = dvb_attach(tda18218_attach, adap->fe, &adap->dev->i2c_adap,
&af9035_tda18218_config) == NULL ? -ENODEV : 0;
break;
dvb/frontends/af9033.h
Define tuner ID
enum af9033_tuner {
AF9033_TUNER_TUA9001 = 0x27, /* Infineon TUA 9001 */
AF9033_TUNER_FC0011 = 0x28, /* Fitipower FC0011 */
AF9033_TUNER_MXL5007t = 0xa0, /* Maxlinear MXL5007t */
AF9033_TUNER_TDA18218 = 0xa1, /* NXP TDA 18218HN */
};
dvb/frontends/af9033_priv.h
Define tuner_init struct (values extracted from your commented parsed USBSniff file).
/* NXP TDA18218 tuner init
AF9033_TUNER_TDA18218 = 161 */
static struct regdesc tuner_init_tda18218[] = {
{0x0046, 0x27},
{0x0071, 0x05},
{0x0072, 0x02},
{0x0074, 0x01},
{0x0075, 0x03},
{0x0076, 0x02},
{0x0077, 0x00},
{0x0078, 0x01},
{0x007a, 0x7e},
{0x007b, 0x3e},
{0x0098, 0x0a},
{0x00b3, 0x00},
{0xf007, 0x00},
{0xf01f, 0x82},
{0xf020, 0x00},
{0xf047, 0x00},
{0xf077, 0x01},
{0xf1e6, 0x00},
{0x0057, 0x00},
{0x0058, 0x01},
{0x005f, 0x00},
{0x0060, 0x00},
{0x006d, 0x00},
{0x0079, 0x00},
{0x0093, 0x00},
{0x0094, 0x01},
{0x0095, 0x02},
{0x0096, 0x01},
{0x009b, 0x05},
{0x009c, 0x80},
{0x00c1, 0x01},
{0x00c2, 0x00},
{0xf029, 0x82},
{0xf02a, 0x00},
{0xf054, 0x00},
{0xf055, 0x00},
};
dvb/frontends/af9033.c
In function:
static int af9033_init(struct dvb_frontend *fe)
... add tuner
case AF9033_TUNER_TDA18218:
len = ARRAY_SIZE(tuner_init_tda18218);
init = tuner_init_tda18218;
break;