diff options
author | Antti Palosaari <crope@iki.fi> | 2007-01-21 13:56:10 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:35:30 -0500 |
commit | 4c7e3ea92da379c4f31500a65680862d8c898dee (patch) | |
tree | a0d1fa553ce9bb32aa41b05e7035f5c54cc79bc1 | |
parent | 5decdd2729066c5c155d0f6e7fdf89b844fbfc27 (diff) |
V4L/DVB (5237): Dvb: add new qt1010 tuner module
gl861: (MSI Megasky)
- hack for enable ZL10353 / QT1010 I2C gate
- use new QT1010 module instead of old code
au6610: (Sigmatek DVB-110)
- hack for enable ZL10353 / QT1010 I2C gate
- use new QT1010 module instead of old code
Tested successfully with au6610 and gl861 devices against fi-Yllas
frequencies. Now it locks perfectly with both devices.
There is a "hack" to enable probable i2c gate in zl10535
demodulator. QT1010 doesn't respond to any i2c messages before we
write 0x1a to demodulator register 0x62. In my understanding this
should be fixed to demodulator code.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/dvb/dvb-usb/au6610.c | 29 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/gl861.c | 25 |
2 files changed, 49 insertions, 5 deletions
diff --git a/drivers/media/dvb/dvb-usb/au6610.c b/drivers/media/dvb/dvb-usb/au6610.c index 1796a7d63aa1..1c0160dfc2af 100644 --- a/drivers/media/dvb/dvb-usb/au6610.c +++ b/drivers/media/dvb/dvb-usb/au6610.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* DVB USB compliant linux driver for Sigmatek DVB-110 DVB-T USB2.0 receiver | 1 | /* DVB USB compliant linux driver for Sigmatek DVB-110 DVB-T USB2.0 receiver |
2 | * | 2 | * |
3 | * Copyright (C) 2006 Antti Palosaari (crope@iki.fi) | 3 | * Copyright (C) 2006 Antti Palosaari <crope@iki.fi> |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License as published by the Free | 6 | * under the terms of the GNU General Public License as published by the Free |
@@ -19,7 +19,6 @@ static int dvb_usb_au6610_debug; | |||
19 | module_param_named(debug, dvb_usb_au6610_debug, int, 0644); | 19 | module_param_named(debug, dvb_usb_au6610_debug, int, 0644); |
20 | MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); | 20 | MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); |
21 | 21 | ||
22 | |||
23 | static int au6610_usb_msg(struct dvb_usb_device *d, u8 operation, u8 addr, | 22 | static int au6610_usb_msg(struct dvb_usb_device *d, u8 operation, u8 addr, |
24 | u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) | 23 | u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) |
25 | { | 24 | { |
@@ -127,7 +126,6 @@ static struct zl10353_config au6610_zl10353_config = { | |||
127 | .parallel_ts = 1, | 126 | .parallel_ts = 1, |
128 | }; | 127 | }; |
129 | 128 | ||
130 | |||
131 | static int au6610_zl10353_frontend_attach(struct dvb_usb_adapter *adap) | 129 | static int au6610_zl10353_frontend_attach(struct dvb_usb_adapter *adap) |
132 | { | 130 | { |
133 | if ((adap->fe = dvb_attach(zl10353_attach, &au6610_zl10353_config, | 131 | if ((adap->fe = dvb_attach(zl10353_attach, &au6610_zl10353_config, |
@@ -138,6 +136,29 @@ static int au6610_zl10353_frontend_attach(struct dvb_usb_adapter *adap) | |||
138 | return -EIO; | 136 | return -EIO; |
139 | } | 137 | } |
140 | 138 | ||
139 | static struct qt1010_config au6610_qt1010_config = { | ||
140 | .i2c_address = 0xc4 | ||
141 | }; | ||
142 | |||
143 | static int au6610_qt1010_tuner_attach(struct dvb_usb_adapter *adap) | ||
144 | { | ||
145 | /* TODO FIXME; probably I2C gate. | ||
146 | QT1010 tuner does not respond before we write 0x1a to ZL10353 demodulator | ||
147 | register 0x62. This ought to be done somewhere in demodulator initialization. | ||
148 | This solution is temporary hack. */ | ||
149 | u8 buf[2] = { 0x62, 0x1a }; | ||
150 | struct i2c_msg msg = { | ||
151 | .addr = au6610_zl10353_config.demod_address, .flags = 0, .buf = buf, .len = 2 | ||
152 | }; | ||
153 | if (i2c_transfer(&adap->dev->i2c_adap, &msg, 1) != 1) { | ||
154 | printk(KERN_WARNING "au6610 tuner attach failed\n"); | ||
155 | return -EREMOTEIO; | ||
156 | } | ||
157 | return dvb_attach(qt1010_attach, | ||
158 | adap->fe, &adap->dev->i2c_adap, | ||
159 | &au6610_qt1010_config) == NULL ? -ENODEV : 0; | ||
160 | } | ||
161 | |||
141 | /* DVB USB Driver stuff */ | 162 | /* DVB USB Driver stuff */ |
142 | static struct dvb_usb_device_properties au6610_properties; | 163 | static struct dvb_usb_device_properties au6610_properties; |
143 | 164 | ||
@@ -180,7 +201,7 @@ static struct dvb_usb_device_properties au6610_properties = { | |||
180 | .adapter = { | 201 | .adapter = { |
181 | { | 202 | { |
182 | .frontend_attach = au6610_zl10353_frontend_attach, | 203 | .frontend_attach = au6610_zl10353_frontend_attach, |
183 | .tuner_attach = qt1010_tuner_attach, | 204 | .tuner_attach = au6610_qt1010_tuner_attach, |
184 | 205 | ||
185 | .stream = { | 206 | .stream = { |
186 | .type = USB_ISOC, | 207 | .type = USB_ISOC, |
diff --git a/drivers/media/dvb/dvb-usb/gl861.c b/drivers/media/dvb/dvb-usb/gl861.c index 7dbfc7927880..200ba13d1d19 100644 --- a/drivers/media/dvb/dvb-usb/gl861.c +++ b/drivers/media/dvb/dvb-usb/gl861.c | |||
@@ -116,6 +116,29 @@ static int gl861_frontend_attach(struct dvb_usb_adapter *adap) | |||
116 | return -EIO; | 116 | return -EIO; |
117 | } | 117 | } |
118 | 118 | ||
119 | static struct qt1010_config gl861_qt1010_config = { | ||
120 | .i2c_address = 0xc4 | ||
121 | }; | ||
122 | |||
123 | static int gl861_tuner_attach(struct dvb_usb_adapter *adap) | ||
124 | { | ||
125 | /* TODO FIXME; probably I2C gate. | ||
126 | QT1010 tuner does not respond before we write 0x1a to ZL10353 demodulator | ||
127 | register 0x62. This ought to be done somewhere in demodulator initialization. | ||
128 | This solution is temporary hack. */ | ||
129 | u8 buf[2] = { 0x62, 0x1a }; | ||
130 | struct i2c_msg msg = { | ||
131 | .addr = gl861_zl10353_config.demod_address, .flags = 0, .buf = buf, .len = 2 | ||
132 | }; | ||
133 | if (i2c_transfer(&adap->dev->i2c_adap, &msg, 1) != 1) { | ||
134 | printk(KERN_WARNING "gl861 tuner attach failed\n"); | ||
135 | return -EREMOTEIO; | ||
136 | } | ||
137 | return dvb_attach(qt1010_attach, | ||
138 | adap->fe, &adap->dev->i2c_adap, | ||
139 | &gl861_qt1010_config) == NULL ? -ENODEV : 0; | ||
140 | } | ||
141 | |||
119 | /* DVB USB Driver stuff */ | 142 | /* DVB USB Driver stuff */ |
120 | static struct dvb_usb_device_properties gl861_properties; | 143 | static struct dvb_usb_device_properties gl861_properties; |
121 | 144 | ||
@@ -161,7 +184,7 @@ static struct dvb_usb_device_properties gl861_properties = { | |||
161 | .adapter = {{ | 184 | .adapter = {{ |
162 | 185 | ||
163 | .frontend_attach = gl861_frontend_attach, | 186 | .frontend_attach = gl861_frontend_attach, |
164 | .tuner_attach = qt1010_tuner_attach, | 187 | .tuner_attach = gl861_tuner_attach, |
165 | 188 | ||
166 | .stream = { | 189 | .stream = { |
167 | .type = USB_BULK, | 190 | .type = USB_BULK, |