* Avermedia dvb-t hybrid A188 @ 2010-08-06 11:43 Davor Emard 2010-08-10 21:57 ` Davor Emard 0 siblings, 1 reply; 4+ messages in thread From: Davor Emard @ 2010-08-06 11:43 UTC (permalink / raw) To: linux-media HI For the card AVerTV Duo Hybrid PCI-E II (A188) I have compiled correctly saa716x driver with kernel 2.6.32.17 I have to modify a card id with this patch: --- linux/drivers/media/common/saa716x/saa716x_hybrid.h~ 2010-06-20 --- 13:24:18.000000000 +0200 +++ linux/drivers/media/common/saa716x/saa716x_hybrid.h 2010-08-06 12:34:49.795695203 +0200 @@ -6,6 +6,6 @@ #define TWINHAN_VP_6090 0x0027 #define AVERMEDIA_HC82 0x2355 -#define AVERMEDIA_H788 0x1455 +#define AVERMEDIA_H788 0x1855 #endif /* __SAA716x_HYBRID_H */ And the driver cleanly compiles with make and installs with make install also it cleanly loads: Aug 6 13:25:49 elf kernel: SAA716x Hybrid 0000:02:00.0: PCI INT A -> Link[LN0A] -> GSI 19 (level, low) -> IRQ 19 Aug 6 13:25:49 elf kernel: SAA716x Hybrid 0000:02:00.0: setting latency timer to 64 Aug 6 13:25:49 elf kernel: DVB: registering new adapter (SAA716x dvb adapter) Card registers dvb demux entries, but there's no frontend: ls -al /dev/dvb/adapter0/ total 0 drwxr-xr-x 2 root root 100 2010-08-06 13:25 . drwxr-xr-x 3 root root 60 2010-08-06 13:25 .. crw-rw----+ 1 root video 212, 0 2010-08-06 13:25 demux0 crw-rw----+ 1 root video 212, 1 2010-08-06 13:25 dvr0 crw-rw----+ 1 root video 212, 2 2010-08-06 13:25 net0 Maybe someone has idea how to get frontend working.... :) d. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Avermedia dvb-t hybrid A188 2010-08-06 11:43 Avermedia dvb-t hybrid A188 Davor Emard @ 2010-08-10 21:57 ` Davor Emard 2010-10-17 20:10 ` Mauro Carvalho Chehab 0 siblings, 1 reply; 4+ messages in thread From: Davor Emard @ 2010-08-10 21:57 UTC (permalink / raw) To: linux-media HI This is my second attempt on Avermedia A188. The hardware on this card is: 1x Philips SAA7160 pci-e bridge 2x NXP SAA7136 multistandard 10-bit A/V decoder 2x Afatech AF9013S demodulator 2x NXP TDA18271 silicon tuner ic (digital/analog) I've written af9013 frontend attach code but I'm having problems with loading firmware. If someone can scan the card on window$ and see what the driver does, are there some gpios that turn on the frontend would be nice (maybe also extract correct firmware) What I did ----------- started from saa716x tree hg clone http://www.jusst.de/hg/saa716x/ and added the af9013 frontend. It compiles fine, loads af9013 module and requests firmware but it won't load Firmware was downloaded from http://www.otit.fi/~crope/v4l-dvb/af9015/dvb-fe-af9013.fw Also tried another firmware for af9015 usb sticks In the code I made a loop to try i2c addresses from 0x00-0x7f for af9013 but so far not found the correct one The patch avermedia-005.diff --------- diff -pur saa716x.orig/linux/drivers/media/common/saa716x/saa716x_hybrid.c saa716x/linux/drivers/media/common/saa716x/saa716x_hybrid.c --- saa716x.orig/linux/drivers/media/common/saa716x/saa716x_hybrid.c 2010-06-20 13:24:18.000000000 +0200 +++ saa716x/linux/drivers/media/common/saa716x/saa716x_hybrid.c 2010-08-10 23:34:42.901211071 +0200 @@ -35,6 +35,9 @@ #include "zl10353.h" #include "mb86a16.h" #include "tda1004x.h" +#include "af9013.h" +#include "tda18271.h" + unsigned int verbose; module_param(verbose, int, 0644); @@ -540,6 +543,82 @@ static struct saa716x_config saa716x_ave .i2c_rate = SAA716x_I2C_RATE_100, }; +#define SAA716x_MODEL_AVERMEDIA_A188 "Avermedia AVerTV Duo Hybrid PCI-E II A188" +#define SAA716x_DEV_AVERMEDIA_A188 "2x DVB-T + 2x Analaog" + +static int load_config_avera188(struct saa716x_dev *saa716x) +{ + int ret = 0; + return ret; +} + +/* probably af9013 is used in parallel mode +** common demod_address are 0x38 and 0x3a +** tuner is nxp tda18271 +*/ +struct af9013_config avera188_af9013_config = { + .demod_address = 0x38, + .output_mode = AF9013_OUTPUT_MODE_PARALLEL, + .api_version = { 0, 1, 9, 0 }, + .gpio[0] = AF9013_GPIO_HI, + .gpio[3] = AF9013_GPIO_TUNER_ON, + +/* + .demod_address = 0x3a, + .output_mode = AF9013_OUTPUT_MODE_SERIAL, + .api_version = { 0, 1, 9, 0 }, + .gpio[0] = AF9013_GPIO_TUNER_ON, + .gpio[1] = AF9013_GPIO_LO, +*/ +}; + + +static int saa716x_avera188_frontend_attach(struct saa716x_adapter *adapter, int count) +{ + struct saa716x_dev *saa716x = adapter->saa716x; + struct saa716x_i2c *i2c = &saa716x->i2c[count]; + int i; + + if (count == 0) { + dprintk(SAA716x_DEBUG, 1, "Adapter (%d) SAA716x frontend Init", count); + dprintk(SAA716x_DEBUG, 1, "Adapter (%d) Device ID=%02x", count, saa716x->pdev->subsystem_device); + dprintk(SAA716x_ERROR, 1, "Adapter (%d) Power ON", count); + saa716x_gpio_write(saa716x, GPIO_14, 1); + msleep(100); + + for(i = 0; i < 1; i++) + { /* try all addresses in a loop */ + /* avera188_af9013_config.demod_address = i; */ + + printk("Trying af9013 frontend on I2C address 0x%02x", avera188_af9013_config.demod_address); + adapter->fe = af9013_attach(&avera188_af9013_config, &i2c->i2c_adapter); + if (adapter->fe == NULL) { + dprintk(SAA716x_ERROR, 1, "Frontend attach failed"); + /* return -ENODEV; */ + } else { + dprintk(SAA716x_ERROR, 1, "Done!"); + return 0; + } + } + return -ENODEV; + + } + + return 0; +} + +static struct saa716x_config saa716x_avera188_config = { + .model_name = SAA716x_MODEL_AVERMEDIA_A188, + .dev_type = SAA716x_DEV_AVERMEDIA_A188, + .boot_mode = SAA716x_EXT_BOOT, + .load_config = &load_config_avera188, + .adapters = 1, + .frontend_attach = saa716x_avera188_frontend_attach, + .irq_handler = saa716x_hybrid_pci_irq, + .i2c_rate = SAA716x_I2C_RATE_100, +}; + + static struct pci_device_id saa716x_hybrid_pci_table[] = { MAKE_ENTRY(TWINHAN_TECHNOLOGIES, TWINHAN_VP_6090, SAA7162, &saa716x_vp6090_config), @@ -547,6 +626,7 @@ static struct pci_device_id saa716x_hybr MAKE_ENTRY(NXP_REFERENCE_BOARD, PCI_ANY_ID, SAA7160, &saa716x_nemo_config), MAKE_ENTRY(AVERMEDIA, AVERMEDIA_HC82, SAA7160, &saa716x_averhc82_config), MAKE_ENTRY(AVERMEDIA, AVERMEDIA_H788, SAA7160, &saa716x_averh788_config), + MAKE_ENTRY(AVERMEDIA, AVERMEDIA_A188, SAA7160, &saa716x_avera188_config), { } }; MODULE_DEVICE_TABLE(pci, saa716x_hybrid_pci_table); Only in saa716x/linux/drivers/media/common/saa716x: saa716x_hybrid.c~ diff -pur saa716x.orig/linux/drivers/media/common/saa716x/saa716x_hybrid.h saa716x/linux/drivers/media/common/saa716x/saa716x_hybrid.h --- saa716x.orig/linux/drivers/media/common/saa716x/saa716x_hybrid.h 2010-06-20 13:24:18.000000000 +0200 +++ saa716x/linux/drivers/media/common/saa716x/saa716x_hybrid.h 2010-08-10 21:02:40.587592396 +0200 @@ -7,5 +7,6 @@ #define TWINHAN_VP_6090 0x0027 #define AVERMEDIA_HC82 0x2355 #define AVERMEDIA_H788 0x1455 +#define AVERMEDIA_A188 0x1855 #endif /* __SAA716x_HYBRID_H */ Only in saa716x/linux/drivers/media/dvb/frontends: af9013.c~ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Avermedia dvb-t hybrid A188 2010-08-10 21:57 ` Davor Emard @ 2010-10-17 20:10 ` Mauro Carvalho Chehab 2010-10-17 20:25 ` Luca Tettamanti 0 siblings, 1 reply; 4+ messages in thread From: Mauro Carvalho Chehab @ 2010-10-17 20:10 UTC (permalink / raw) To: Davor Emard; +Cc: linux-media Em 10-08-2010 18:57, Davor Emard escreveu: > HI > > This is my second attempt on Avermedia A188. > The hardware on this card is: > > 1x Philips SAA7160 pci-e bridge > 2x NXP SAA7136 multistandard 10-bit A/V decoder > 2x Afatech AF9013S demodulator > 2x NXP TDA18271 silicon tuner ic (digital/analog) > > I've written af9013 frontend attach code but I'm having > problems with loading firmware. > > If someone can scan the card on window$ and see what the > driver does, are there some gpios that turn on the frontend > would be nice (maybe also extract correct firmware) > > What I did > ----------- > started from saa716x tree > hg clone http://www.jusst.de/hg/saa716x/ > and added the af9013 frontend. > > It compiles fine, loads af9013 module and requests > firmware but it won't load > > Firmware was downloaded from http://www.otit.fi/~crope/v4l-dvb/af9015/dvb-fe-af9013.fw > Also tried another firmware for af9015 usb sticks > > In the code I made a loop to try i2c addresses from 0x00-0x7f > for af9013 but so far not found the correct one Hi Emard, I'm not sure why, but there are two drivers for saa716x chips, one out of the tree (never submitted upstream), and the otherone that were submited and is already merged at the kernel tree. The patch you've done is for the other driver. So, I can't apply it. If you want to base it in the top of the driver found at the kernel tree, at drivers/media/video/saa7164/, I can apply it. Otherwise, I will just discard your patch. Sorry. Cheers, Mauro. > > The patch avermedia-005.diff > --------- > diff -pur saa716x.orig/linux/drivers/media/common/saa716x/saa716x_hybrid.c saa716x/linux/drivers/media/common/saa716x/saa716x_hybrid.c > --- saa716x.orig/linux/drivers/media/common/saa716x/saa716x_hybrid.c 2010-06-20 13:24:18.000000000 +0200 > +++ saa716x/linux/drivers/media/common/saa716x/saa716x_hybrid.c 2010-08-10 23:34:42.901211071 +0200 > @@ -35,6 +35,9 @@ > #include "zl10353.h" > #include "mb86a16.h" > #include "tda1004x.h" > +#include "af9013.h" > +#include "tda18271.h" > + > > unsigned int verbose; > module_param(verbose, int, 0644); > @@ -540,6 +543,82 @@ static struct saa716x_config saa716x_ave > .i2c_rate = SAA716x_I2C_RATE_100, > }; > > +#define SAA716x_MODEL_AVERMEDIA_A188 "Avermedia AVerTV Duo Hybrid PCI-E II A188" > +#define SAA716x_DEV_AVERMEDIA_A188 "2x DVB-T + 2x Analaog" > + > +static int load_config_avera188(struct saa716x_dev *saa716x) > +{ > + int ret = 0; > + return ret; > +} > + > +/* probably af9013 is used in parallel mode > +** common demod_address are 0x38 and 0x3a > +** tuner is nxp tda18271 > +*/ > +struct af9013_config avera188_af9013_config = { > + .demod_address = 0x38, > + .output_mode = AF9013_OUTPUT_MODE_PARALLEL, > + .api_version = { 0, 1, 9, 0 }, > + .gpio[0] = AF9013_GPIO_HI, > + .gpio[3] = AF9013_GPIO_TUNER_ON, > + > +/* > + .demod_address = 0x3a, > + .output_mode = AF9013_OUTPUT_MODE_SERIAL, > + .api_version = { 0, 1, 9, 0 }, > + .gpio[0] = AF9013_GPIO_TUNER_ON, > + .gpio[1] = AF9013_GPIO_LO, > +*/ > +}; > + > + > +static int saa716x_avera188_frontend_attach(struct saa716x_adapter *adapter, int count) > +{ > + struct saa716x_dev *saa716x = adapter->saa716x; > + struct saa716x_i2c *i2c = &saa716x->i2c[count]; > + int i; > + > + if (count == 0) { > + dprintk(SAA716x_DEBUG, 1, "Adapter (%d) SAA716x frontend Init", count); > + dprintk(SAA716x_DEBUG, 1, "Adapter (%d) Device ID=%02x", count, saa716x->pdev->subsystem_device); > + dprintk(SAA716x_ERROR, 1, "Adapter (%d) Power ON", count); > + saa716x_gpio_write(saa716x, GPIO_14, 1); > + msleep(100); > + > + for(i = 0; i < 1; i++) > + { /* try all addresses in a loop */ > + /* avera188_af9013_config.demod_address = i; */ > + > + printk("Trying af9013 frontend on I2C address 0x%02x", avera188_af9013_config.demod_address); > + adapter->fe = af9013_attach(&avera188_af9013_config, &i2c->i2c_adapter); > + if (adapter->fe == NULL) { > + dprintk(SAA716x_ERROR, 1, "Frontend attach failed"); > + /* return -ENODEV; */ > + } else { > + dprintk(SAA716x_ERROR, 1, "Done!"); > + return 0; > + } > + } > + return -ENODEV; > + > + } > + > + return 0; > +} > + > +static struct saa716x_config saa716x_avera188_config = { > + .model_name = SAA716x_MODEL_AVERMEDIA_A188, > + .dev_type = SAA716x_DEV_AVERMEDIA_A188, > + .boot_mode = SAA716x_EXT_BOOT, > + .load_config = &load_config_avera188, > + .adapters = 1, > + .frontend_attach = saa716x_avera188_frontend_attach, > + .irq_handler = saa716x_hybrid_pci_irq, > + .i2c_rate = SAA716x_I2C_RATE_100, > +}; > + > + > static struct pci_device_id saa716x_hybrid_pci_table[] = { > > MAKE_ENTRY(TWINHAN_TECHNOLOGIES, TWINHAN_VP_6090, SAA7162, &saa716x_vp6090_config), > @@ -547,6 +626,7 @@ static struct pci_device_id saa716x_hybr > MAKE_ENTRY(NXP_REFERENCE_BOARD, PCI_ANY_ID, SAA7160, &saa716x_nemo_config), > MAKE_ENTRY(AVERMEDIA, AVERMEDIA_HC82, SAA7160, &saa716x_averhc82_config), > MAKE_ENTRY(AVERMEDIA, AVERMEDIA_H788, SAA7160, &saa716x_averh788_config), > + MAKE_ENTRY(AVERMEDIA, AVERMEDIA_A188, SAA7160, &saa716x_avera188_config), > { } > }; > MODULE_DEVICE_TABLE(pci, saa716x_hybrid_pci_table); > Only in saa716x/linux/drivers/media/common/saa716x: saa716x_hybrid.c~ > diff -pur saa716x.orig/linux/drivers/media/common/saa716x/saa716x_hybrid.h saa716x/linux/drivers/media/common/saa716x/saa716x_hybrid.h > --- saa716x.orig/linux/drivers/media/common/saa716x/saa716x_hybrid.h 2010-06-20 13:24:18.000000000 +0200 > +++ saa716x/linux/drivers/media/common/saa716x/saa716x_hybrid.h 2010-08-10 21:02:40.587592396 +0200 > @@ -7,5 +7,6 @@ > #define TWINHAN_VP_6090 0x0027 > #define AVERMEDIA_HC82 0x2355 > #define AVERMEDIA_H788 0x1455 > +#define AVERMEDIA_A188 0x1855 > > #endif /* __SAA716x_HYBRID_H */ > Only in saa716x/linux/drivers/media/dvb/frontends: af9013.c~ > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Avermedia dvb-t hybrid A188 2010-10-17 20:10 ` Mauro Carvalho Chehab @ 2010-10-17 20:25 ` Luca Tettamanti 0 siblings, 0 replies; 4+ messages in thread From: Luca Tettamanti @ 2010-10-17 20:25 UTC (permalink / raw) To: Mauro Carvalho Chehab; +Cc: Davor Emard, linux-media On Sun, Oct 17, 2010 at 10:10 PM, Mauro Carvalho Chehab <mchehab@redhat.com> wrote: > I'm not sure why, but there are two drivers for saa716x chips, one out of the tree > (never submitted upstream), and the otherone that were submited and is already merged > at the kernel tree. > > The patch you've done is for the other driver. So, I can't apply it. If you want > to base it in the top of the driver found at the kernel tree, at > drivers/media/video/saa7164/, I can apply it. Unless I'm mistaken this driver cannot handle the SAA7162; AFAIK they are two very different chips. Luca ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-17 20:25 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-08-06 11:43 Avermedia dvb-t hybrid A188 Davor Emard 2010-08-10 21:57 ` Davor Emard 2010-10-17 20:10 ` Mauro Carvalho Chehab 2010-10-17 20:25 ` Luca Tettamanti
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox