aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGianluca Gennari <gennarone@gmail.com>2012-03-06 07:47:46 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-03-19 13:26:03 -0400
commitabfac0b64876294aaf1aab01df56041a3995a91f (patch)
treec33d938fa3d9a6e2d52d690f286f90aea9624872 /drivers
parentabf9d005375d6c6160cc9c17e5dcac32e412c8dc (diff)
[media] as102: set optimal eLNA config values for each device
Ryley and me tested several eLNA configuration values with both a rooftop and a portable antenna. Ryley fuond out that the best value for his Elgato stick is indeed the current default value 0xC0. Instead, my stick is not capable of tuning VHF channels with 0xC0. With 0x80, VHF works but the tuner sensitivity with the portable antenna is poor. Instead, the value 0xA0 works with VHF and also gives good performance with both the rooftop and the portable antenna. So we concluded that devices built on the reference design work best with 0xA0, while custom designs (Elgato, PCTV) seem to require 0xC0. I also removed the unused parameter "minor" in struct as102_dev_t. Signed-off-by: Gianluca Gennari <gennarone@gmail.com> Signed-off-by: Ryley Angus <rangus@student.unimelb.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/media/as102/as102_drv.h2
-rw-r--r--drivers/staging/media/as102/as102_fe.c2
-rw-r--r--drivers/staging/media/as102/as102_usb_drv.c15
3 files changed, 16 insertions, 3 deletions
diff --git a/drivers/staging/media/as102/as102_drv.h b/drivers/staging/media/as102/as102_drv.h
index 957f0ed0d81..b0e5a23bd53 100644
--- a/drivers/staging/media/as102/as102_drv.h
+++ b/drivers/staging/media/as102/as102_drv.h
@@ -76,7 +76,7 @@ struct as102_dev_t {
76 struct as10x_bus_adapter_t bus_adap; 76 struct as10x_bus_adapter_t bus_adap;
77 struct list_head device_entry; 77 struct list_head device_entry;
78 struct kref kref; 78 struct kref kref;
79 unsigned long minor; 79 uint8_t elna_cfg;
80 80
81 struct dvb_adapter dvb_adap; 81 struct dvb_adapter dvb_adap;
82 struct dvb_frontend dvb_fe; 82 struct dvb_frontend dvb_fe;
diff --git a/drivers/staging/media/as102/as102_fe.c b/drivers/staging/media/as102/as102_fe.c
index bdc5a38cddf..043c520183d 100644
--- a/drivers/staging/media/as102/as102_fe.c
+++ b/drivers/staging/media/as102/as102_fe.c
@@ -265,7 +265,7 @@ static int as102_fe_ts_bus_ctrl(struct dvb_frontend *fe, int acquire)
265 265
266 if (acquire) { 266 if (acquire) {
267 if (elna_enable) 267 if (elna_enable)
268 as10x_cmd_set_context(&dev->bus_adap, 1010, 0xC0); 268 as10x_cmd_set_context(&dev->bus_adap, CONTEXT_LNA, dev->elna_cfg);
269 269
270 ret = as10x_cmd_turn_on(&dev->bus_adap); 270 ret = as10x_cmd_turn_on(&dev->bus_adap);
271 } else { 271 } else {
diff --git a/drivers/staging/media/as102/as102_usb_drv.c b/drivers/staging/media/as102/as102_usb_drv.c
index 8d2c84c36a5..0f6bfe7eccb 100644
--- a/drivers/staging/media/as102/as102_usb_drv.c
+++ b/drivers/staging/media/as102/as102_usb_drv.c
@@ -57,6 +57,17 @@ static const char * const as102_device_names[] = {
57 NULL /* Terminating entry */ 57 NULL /* Terminating entry */
58}; 58};
59 59
60/* eLNA configuration: devices built on the reference design work best
61 with 0xA0, while custom designs seem to require 0xC0 */
62static uint8_t const as102_elna_cfg[] = {
63 0xA0,
64 0xC0,
65 0xC0,
66 0xA0,
67 0xA0,
68 0x00 /* Terminating entry */
69};
70
60struct usb_driver as102_usb_driver = { 71struct usb_driver as102_usb_driver = {
61 .name = DRIVER_FULL_NAME, 72 .name = DRIVER_FULL_NAME,
62 .probe = as102_usb_probe, 73 .probe = as102_usb_probe,
@@ -371,8 +382,10 @@ static int as102_usb_probe(struct usb_interface *intf,
371 /* Assign the user-friendly device name */ 382 /* Assign the user-friendly device name */
372 for (i = 0; i < (sizeof(as102_usb_id_table) / 383 for (i = 0; i < (sizeof(as102_usb_id_table) /
373 sizeof(struct usb_device_id)); i++) { 384 sizeof(struct usb_device_id)); i++) {
374 if (id == &as102_usb_id_table[i]) 385 if (id == &as102_usb_id_table[i]) {
375 as102_dev->name = as102_device_names[i]; 386 as102_dev->name = as102_device_names[i];
387 as102_dev->elna_cfg = as102_elna_cfg[i];
388 }
376 } 389 }
377 390
378 if (as102_dev->name == NULL) 391 if (as102_dev->name == NULL)