From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: timf <timf@iinet.net.au>
Cc: Hackmann <hartmut.hackmann@t-online.de>,
lucarasp <lucarasp@inwind.it>,
linux-dvb@linuxtv.org, "Richard \(MQ\)" <osl2008@googlemail.com>
Subject: Re: [linux-dvb] Any chance of help with v4l-dvb-experimental / Avermedia A16D please?
Date: Sat, 22 Mar 2008 13:28:46 -0300 [thread overview]
Message-ID: <20080322132846.74cd99bd@gaivota> (raw)
In-Reply-To: <1206200253.6403.11.camel@ubuntu>
[-- Attachment #1: Type: text/plain, Size: 2315 bytes --]
On Sun, 23 Mar 2008 00:37:33 +0900
timf <timf@iinet.net.au> wrote:
> Hi again,
>
> Something strange happening here:
>
> [ 24.528000] mt352_read_register: readreg error (reg=127, ret==-5)
> [ 24.528000] xc2028: Xcv2028/3028 init called!
> [ 24.528000] xc2028: No frontend!
> [ 24.528000] saa7133[0]/2: xc3028 attach failed
> [ 24.528000] BUG: unable to handle kernel NULL pointer dereference at
> virtual address 000000ac
> [ 24.528000] printing eip:
> [ 24.528000] f8b70074
> [ 24.528000] *pde = 00000000
> [ 24.528000] Oops: 0000 [#1]
>
> Regards,
> Tim
Complementing my previous e-mail, the enclosed patch fixes the OOPS. It also
forks the mt352 tables.
The first point is: I don't have this board. All I know about it is what I've
seen at the net. Could you double check if this is using an mt352 chip? Maybe
it uses another demod, instead.
If the board is really based on mt352, and for DVB to work, you'll need to
figure-out the proper parameters for mt352 initialization:
+static int mt352_aver_a16d_init(struct dvb_frontend* fe)
+{
+ static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x2d };
+ static u8 reset [] = { RESET, 0x80 };
+ static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
+ static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0xa0 };
+ static u8 capt_range_cfg[] = { CAPT_RANGE, 0x33 };
+
+ mt352_write(fe, clock_config, sizeof(clock_config));
+ udelay(200);
+ mt352_write(fe, reset, sizeof(reset));
+ mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
+ mt352_write(fe, agc_cfg, sizeof(agc_cfg));
+ mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
+
+ return 0;
+}
The above routine contains mt352 initialization procedure.
...
+static struct mt352_config avermedia_16d = {
+ .demod_address = 0xf,
+ .demod_init = mt352_aver_a16d_init,
+};
The above struct contains the demod address for mt352 (address 0x1e, at 8-bit
notation - or 0x0f, at 7bit notation). The demod could be on another address.
For example, Pinnacle 300i has it at address 0x3c (8bit notation).
You'll need to make sure that mt352 address is 0x1e on your board. Modprobing
saa7134 with i2c_scan=1 will allow you to see what i2c addresses are in use.
Cheers,
Mauro
[-- Attachment #2: add_aver_a16d.patch --]
[-- Type: text/x-patch, Size: 3628 bytes --]
saa7134: Add DTV support for Avermedia A16D
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---
linux/drivers/media/video/saa7134/saa7134-cards.c | 13 ++++++--
linux/drivers/media/video/saa7134/saa7134-dvb.c | 35 ++++++++++++++++++++++
2 files changed, 45 insertions(+), 3 deletions(-)
--- master.orig/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ master/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -4142,6 +4142,7 @@ struct saa7134_board saa7134_boards[] =
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
+ .mpeg = SAA7134_MPEG_DVB,
.inputs = {{
.name = name_tv,
.vmux = 1,
@@ -5512,6 +5513,7 @@ int saa7134_board_init1(struct saa7134_d
case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
case SAA7134_BOARD_AVERMEDIA_M115:
case SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM:
+ case SAA7134_BOARD_AVERMEDIA_A16D:
/* power-up tuner chip */
saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0xffffffff, 0xffffffff);
saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0xffffffff);
@@ -5808,9 +5810,14 @@ int saa7134_board_init2(struct saa7134_d
ctl.fname = XC2028_DEFAULT_FIRMWARE;
ctl.max_len = 64;
- /* FIXME: This should be device-dependent */
- ctl.demod = XC3028_FE_OREN538;
- ctl.mts = 1;
+ switch (dev->board) {
+ case SAA7134_BOARD_AVERMEDIA_A16D:
+ ctl.demod = XC3028_FE_ZARLINK456;
+ break;
+ default:
+ ctl.demod = XC3028_FE_OREN538;
+ ctl.mts = 1;
+ }
xc2028_cfg.tuner = TUNER_XC2028;
xc2028_cfg.priv = &ctl;
--- master.orig/linux/drivers/media/video/saa7134/saa7134-dvb.c
+++ master/linux/drivers/media/video/saa7134/saa7134-dvb.c
@@ -150,6 +150,26 @@ static int mt352_aver777_init(struct dvb
return 0;
}
+static int mt352_aver_a16d_init(struct dvb_frontend* fe)
+{
+ static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x2d };
+ static u8 reset [] = { RESET, 0x80 };
+ static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
+ static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0xa0 };
+ static u8 capt_range_cfg[] = { CAPT_RANGE, 0x33 };
+
+ mt352_write(fe, clock_config, sizeof(clock_config));
+ udelay(200);
+ mt352_write(fe, reset, sizeof(reset));
+ mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
+ mt352_write(fe, agc_cfg, sizeof(agc_cfg));
+ mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
+
+ return 0;
+}
+
+
+
static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
struct dvb_frontend_parameters* params)
{
@@ -192,6 +212,11 @@ static struct mt352_config avermedia_777
.demod_init = mt352_aver777_init,
};
+static struct mt352_config avermedia_16d = {
+ .demod_address = 0xf,
+ .demod_init = mt352_aver_a16d_init,
+};
+
static struct mt352_config avermedia_e506r_mt352_dev = {
.demod_address = (0x1e >> 1),
#if 0
@@ -936,6 +961,12 @@ static int dvb_init(struct saa7134_dev *
NULL, DVB_PLL_PHILIPS_TD1316);
}
break;
+ case SAA7134_BOARD_AVERMEDIA_A16D:
+ dprintk("avertv A16D dvb setup\n");
+ dev->dvb.frontend = dvb_attach(mt352_attach, &avermedia_16d,
+ &dev->i2c_adap);
+ attach_xc3028 = 1;
+ break;
case SAA7134_BOARD_MD7134:
dev->dvb.frontend = dvb_attach(tda10046_attach,
&medion_cardbus,
@@ -1207,6 +1238,10 @@ static int dvb_init(struct saa7134_dev *
.i2c_adap = &dev->i2c_adap,
.i2c_addr = 0x61,
};
+
+ if (!dev->dvb.frontend)
+ return -1;
+
fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg);
if (!fe) {
printk(KERN_ERR "%s/2: xc3028 attach failed\n",
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
next prev parent reply other threads:[~2008-03-22 16:29 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-03 15:07 [linux-dvb] Any chance of help with v4l-dvb-experimental / Avermedia A16D please? Richard (MQ)
2008-02-05 9:50 ` Mauro Carvalho Chehab
[not found] ` <47A8CE7E.6020908@googlemail.com>
[not found] ` <20080205222437.1397896d@gaivota>
[not found] ` <47AA014F.2090608@googlemail.com>
2008-02-07 11:26 ` Mauro Carvalho Chehab
[not found] ` <47AAF0C4.8030804@googlemail.com>
[not found] ` <47AB6A1B.5090100@googlemail.com>
2008-02-07 20:42 ` Mauro Carvalho Chehab
[not found] ` <47ACA9AA.4090702@googlemail.com>
[not found] ` <47AE20BD.7090503@googlemail.com>
2008-02-12 14:47 ` Mauro Carvalho Chehab
[not found] ` <47B1E22D.4090901@googlemail.com>
2008-03-13 14:46 ` Mauro Carvalho Chehab
[not found] ` <1205457408.6358.5.camel@ubuntu>
2008-03-14 15:14 ` Mauro Carvalho Chehab
[not found] ` <1205518856.6094.14.camel@ubuntu>
2008-03-14 18:58 ` Mauro Carvalho Chehab
[not found] ` <1205523274.6364.5.camel@ubuntu>
2008-03-14 20:21 ` Mauro Carvalho Chehab
[not found] ` <1205573636.5941.1.camel@ubuntu>
2008-03-18 13:30 ` Mauro Carvalho Chehab
[not found] ` <1205864312.11231.11.camel@ubuntu>
2008-03-18 19:17 ` Mauro Carvalho Chehab
[not found] ` <1205873332.11231.17.camel@ubuntu>
2008-03-18 21:04 ` Mauro Carvalho Chehab
[not found] ` <1205877331.11231.38.camel@ubuntu>
2008-03-18 23:25 ` Darren Salt
[not found] ` <47DEC660.3080005@googlemail.com>
2008-03-18 13:10 ` Mauro Carvalho Chehab
[not found] ` <1205875868.3385.133.camel@pc08.localdom.local>
[not found] ` <1205904196.6510.3.camel@ubuntu>
2008-03-19 8:14 ` Matthias Schwarzott
2008-03-20 14:55 ` Mauro Carvalho Chehab
[not found] ` <1206030503.5997.2.camel@ubuntu>
2008-03-20 17:07 ` Mauro Carvalho Chehab
[not found] ` <1206061004.6988.3.camel@ubuntu>
2008-03-21 1:53 ` Mauro Carvalho Chehab
2008-03-21 11:31 ` Mauro Carvalho Chehab
[not found] ` <20080322083435.2432256b@gaivota>
[not found] ` <47E51CBD.1000906@googlemail.com>
2008-03-22 14:59 ` Mauro Carvalho Chehab
[not found] ` <1206200253.6403.11.camel@ubuntu>
2008-03-22 16:13 ` Mauro Carvalho Chehab
2008-03-22 16:28 ` Mauro Carvalho Chehab [this message]
[not found] ` <47E79DE5.1050404@googlemail.com>
[not found] ` <47E7D4B0.30706@googlemail.com>
[not found] ` <20080326134500.34a245be@gaivota>
[not found] ` <47EAA833.7050507@googlemail.com>
[not found] ` <20080326171546.37b819ad@gaivota>
[not found] ` <47EABCF3.7070605@googlemail.com>
[not found] ` <20080326183336.0cbd04a4@gaivota>
[not found] ` <c09aacb50804250142h49fd47edia96ca3ae830c2354@mail.gmail.com>
2008-04-25 10:52 ` Mauro Carvalho Chehab
[not found] <47E030C1.2000805@inwind.it>
2008-03-18 21:28 ` Mauro Carvalho Chehab
[not found] ` <47E9A539.1050706@inwind.it>
2008-03-26 16:49 ` Mauro Carvalho Chehab
-- strict thread matches above, loose matches on Subject: below --
2008-03-21 5:49 Igor Alexeiuk
2008-03-26 3:11 Cheng-Min Lien
[not found] <1206604694.6098.14.camel@ubuntu>
2008-03-27 16:37 ` Mauro Carvalho Chehab
[not found] <1206635698.5965.5.camel@ubuntu>
2008-03-27 17:42 ` Mauro Carvalho Chehab
[not found] ` <1206683274.5986.6.camel@ubuntu>
2008-03-28 17:59 ` 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=20080322132846.74cd99bd@gaivota \
--to=mchehab@infradead.org \
--cc=hartmut.hackmann@t-online.de \
--cc=linux-dvb@linuxtv.org \
--cc=lucarasp@inwind.it \
--cc=osl2008@googlemail.com \
--cc=timf@iinet.net.au \
/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