aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 15:57:16 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 15:57:16 -0400
commit57a44415beee38d1afcd8e1b5fad66f3414d2dac (patch)
tree365eada15165e37e153b6d304142db16f251438b /drivers/media/dvb/dvb-usb
parent2a383c63ff933a496f19d6559ab54ac14871b7f3 (diff)
parentbbe2486fe3bd6c7cffaf4123b7e86a55c209ed44 (diff)
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (44 commits) V4L/DVB (5571): V4l1-compat: Make VIDIOCSPICT return errors in a useful way V4L/DVB (5624): Radio-maestro.c cleanup V4L/DVB (5623): Dsbr100.c Replace usb_dsbr100_do_ioctl to use video_ioctl2 V4L/DVB (5622): Radio-zoltrix.c cleanup V4L/DVB (5621): Radio-cadet.c Replace cadet_do_ioctl to use video_ioctl2 V4L/DVB (5619): Dvb-usb: fix typo V4L/DVB (5618): Cx88: Drop the generic i2c client from cx88-vp3054-i2c V4L/DVB (5617): V4L2: videodev, allow debugging V4L/DVB (5614): M920x: Disable second adapter on LifeView TV Walker Twin V4L/DVB (5613): M920x: loosen up 80-col limit V4L/DVB (5612): M920x: rename function prefixes from m9206_foo to m920x_foo V4L/DVB (5611): M920x: replace deb_rc with deb V4L/DVB (5610): M920x: remove duplicated code V4L/DVB (5609): M920x: group like functions together V4L/DVB (5608): M920x: various whitespace cleanups V4L/DVB (5607): M920x: Initial support for devices likely manufactured by Dposh V4L/DVB (5606): M920x: add "c-basic-offset: 8" to help emacs to enforce tabbing V4L/DVB (5605): M920x: Add support for LifeView TV Walker Twin V4L/DVB (5603): V4L: Prevent queueing queued buffers. V4L/DVB (5602): Enable DiSEqC in Starbox II (vp7021a) ...
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-ids.h5
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h2
-rw-r--r--drivers/media/dvb/dvb-usb/m920x.c565
-rw-r--r--drivers/media/dvb/dvb-usb/m920x.h13
-rw-r--r--drivers/media/dvb/dvb-usb/vp702x-fe.c14
5 files changed, 441 insertions, 158 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 97715f7514d6..403081689de1 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -19,6 +19,7 @@
19#define USB_VID_COMPRO_UNK 0x145f 19#define USB_VID_COMPRO_UNK 0x145f
20#define USB_VID_CYPRESS 0x04b4 20#define USB_VID_CYPRESS 0x04b4
21#define USB_VID_DIBCOM 0x10b8 21#define USB_VID_DIBCOM 0x10b8
22#define USB_VID_DPOSH 0x1498
22#define USB_VID_DVICO 0x0fe9 23#define USB_VID_DVICO 0x0fe9
23#define USB_VID_EMPIA 0xeb1a 24#define USB_VID_EMPIA 0xeb1a
24#define USB_VID_GENPIX 0x09c0 25#define USB_VID_GENPIX 0x09c0
@@ -61,6 +62,8 @@
61#define USB_PID_DIBCOM_STK7700P 0x1e14 62#define USB_PID_DIBCOM_STK7700P 0x1e14
62#define USB_PID_DIBCOM_STK7700P_PC 0x1e78 63#define USB_PID_DIBCOM_STK7700P_PC 0x1e78
63#define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 64#define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131
65#define USB_PID_DPOSH_M9206_COLD 0x9206
66#define USB_PID_DPOSH_M9206_WARM 0xa090
64#define USB_PID_UNIWILL_STK7700P 0x6003 67#define USB_PID_UNIWILL_STK7700P 0x6003
65#define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 68#define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0
66#define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 69#define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1
@@ -145,6 +148,8 @@
145#define USB_PID_MSI_DIGI_VOX_MINI_II 0x1513 148#define USB_PID_MSI_DIGI_VOX_MINI_II 0x1513
146#define USB_PID_OPERA1_COLD 0x2830 149#define USB_PID_OPERA1_COLD 0x2830
147#define USB_PID_OPERA1_WARM 0x3829 150#define USB_PID_OPERA1_WARM 0x3829
151#define USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD 0x0514
152#define USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM 0x0513
148 153
149 154
150#endif 155#endif
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index 0d721731a524..6f824a569e14 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -119,7 +119,7 @@ struct usb_data_stream_properties {
119 * @caps: capabilities of the DVB USB device. 119 * @caps: capabilities of the DVB USB device.
120 * @pid_filter_count: number of PID filter position in the optional hardware 120 * @pid_filter_count: number of PID filter position in the optional hardware
121 * PID-filter. 121 * PID-filter.
122 * @streaming_crtl: called to start and stop the MPEG2-TS streaming of the 122 * @streaming_ctrl: called to start and stop the MPEG2-TS streaming of the
123 * device (not URB submitting/killing). 123 * device (not URB submitting/killing).
124 * @pid_filter_ctrl: called to en/disable the PID filter, if any. 124 * @pid_filter_ctrl: called to en/disable the PID filter, if any.
125 * @pid_filter: called to set/unset a PID for filtering. 125 * @pid_filter: called to set/unset a PID for filtering.
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c
index 45d7bc214c18..c546ddeda5d4 100644
--- a/drivers/media/dvb/dvb-usb/m920x.c
+++ b/drivers/media/dvb/dvb-usb/m920x.c
@@ -3,8 +3,8 @@
3 * Copyright (C) 2006 Aapo Tahkola (aet@rasterburn.org) 3 * Copyright (C) 2006 Aapo Tahkola (aet@rasterburn.org)
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
7 * Software Foundation, version 2. 7 * Free Software Foundation, version 2.
8 * 8 *
9 * see Documentation/dvb/README.dvb-usb for more information 9 * see Documentation/dvb/README.dvb-usb for more information
10 */ 10 */
@@ -22,26 +22,7 @@ static int dvb_usb_m920x_debug;
22module_param_named(debug,dvb_usb_m920x_debug, int, 0644); 22module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
23MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); 23MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
24 24
25static struct dvb_usb_rc_key megasky_rc_keys [] = { 25static inline int m920x_read(struct usb_device *udev, u8 request, u16 value,
26 { 0x0, 0x12, KEY_POWER },
27 { 0x0, 0x1e, KEY_CYCLEWINDOWS }, /* min/max */
28 { 0x0, 0x02, KEY_CHANNELUP },
29 { 0x0, 0x05, KEY_CHANNELDOWN },
30 { 0x0, 0x03, KEY_VOLUMEUP },
31 { 0x0, 0x06, KEY_VOLUMEDOWN },
32 { 0x0, 0x04, KEY_MUTE },
33 { 0x0, 0x07, KEY_OK }, /* TS */
34 { 0x0, 0x08, KEY_STOP },
35 { 0x0, 0x09, KEY_MENU }, /* swap */
36 { 0x0, 0x0a, KEY_REWIND },
37 { 0x0, 0x1b, KEY_PAUSE },
38 { 0x0, 0x1f, KEY_FASTFORWARD },
39 { 0x0, 0x0c, KEY_RECORD },
40 { 0x0, 0x0d, KEY_CAMERA }, /* screenshot */
41 { 0x0, 0x0e, KEY_COFFEE }, /* "MTS" */
42};
43
44static inline int m9206_read(struct usb_device *udev, u8 request, u16 value,\
45 u16 index, void *data, int size) 26 u16 index, void *data, int size)
46{ 27{
47 int ret; 28 int ret;
@@ -55,14 +36,14 @@ static inline int m9206_read(struct usb_device *udev, u8 request, u16 value,\
55 } 36 }
56 37
57 if (ret != size) { 38 if (ret != size) {
58 deb_rc("m920x_read = no data\n"); 39 deb("m920x_read = no data\n");
59 return -EIO; 40 return -EIO;
60 } 41 }
61 42
62 return 0; 43 return 0;
63} 44}
64 45
65static inline int m9206_write(struct usb_device *udev, u8 request, 46static inline int m920x_write(struct usb_device *udev, u8 request,
66 u16 value, u16 index) 47 u16 value, u16 index)
67{ 48{
68 int ret; 49 int ret;
@@ -74,32 +55,40 @@ static inline int m9206_write(struct usb_device *udev, u8 request,
74 return ret; 55 return ret;
75} 56}
76 57
77static int m9206_init(struct dvb_usb_device *d) 58static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
78{ 59{
79 int ret = 0; 60 int ret = 0;
80 61
81 /* Remote controller init. */ 62 /* Remote controller init. */
82 if (d->props.rc_query) { 63 if (d->props.rc_query) {
83 if ((ret = m9206_write(d->udev, M9206_CORE, 0xa8, M9206_RC_INIT2)) != 0) 64 deb("Initialising remote control\n");
84 return ret; 65 while (rc_seq->address) {
66 if ((ret = m920x_write(d->udev, M9206_CORE,
67 rc_seq->data,
68 rc_seq->address)) != 0) {
69 deb("Initialising remote control failed\n");
70 return ret;
71 }
85 72
86 if ((ret = m9206_write(d->udev, M9206_CORE, 0x51, M9206_RC_INIT1)) != 0) 73 rc_seq++;
87 return ret; 74 }
75
76 deb("Initialising remote control success\n");
88 } 77 }
89 78
90 return ret; 79 return ret;
91} 80}
92 81
93static int m9206_rc_query(struct dvb_usb_device *d, u32 *event, int *state) 82static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
94{ 83{
95 struct m9206_state *m = d->priv; 84 struct m920x_state *m = d->priv;
96 int i, ret = 0; 85 int i, ret = 0;
97 u8 rc_state[2]; 86 u8 rc_state[2];
98 87
99 if ((ret = m9206_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, rc_state, 1)) != 0) 88 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, rc_state, 1)) != 0)
100 goto unlock; 89 goto unlock;
101 90
102 if ((ret = m9206_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, rc_state + 1, 1)) != 0) 91 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, rc_state + 1, 1)) != 0)
103 goto unlock; 92 goto unlock;
104 93
105 for (i = 0; i < d->props.rc_key_map_size; i++) 94 for (i = 0; i < d->props.rc_key_map_size; i++)
@@ -111,6 +100,14 @@ static int m9206_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
111 *state = REMOTE_NO_KEY_PRESSED; 100 *state = REMOTE_NO_KEY_PRESSED;
112 goto unlock; 101 goto unlock;
113 102
103 case 0x88: /* framing error or "invalid code" */
104 case 0x99:
105 case 0xc0:
106 case 0xd8:
107 *state = REMOTE_NO_KEY_PRESSED;
108 m->rep_count = 0;
109 goto unlock;
110
114 case 0x93: 111 case 0x93:
115 case 0x92: 112 case 0x92:
116 m->rep_count = 0; 113 m->rep_count = 0;
@@ -118,31 +115,32 @@ static int m9206_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
118 goto unlock; 115 goto unlock;
119 116
120 case 0x91: 117 case 0x91:
121 /* For comfort. */ 118 /* prevent immediate auto-repeat */
122 if (++m->rep_count > 2) 119 if (++m->rep_count > 2)
123 *state = REMOTE_KEY_REPEAT; 120 *state = REMOTE_KEY_REPEAT;
121 else
122 *state = REMOTE_NO_KEY_PRESSED;
124 goto unlock; 123 goto unlock;
125 124
126 default: 125 default:
127 deb_rc("Unexpected rc response %x\n", rc_state[0]); 126 deb("Unexpected rc state %02x\n", rc_state[0]);
128 *state = REMOTE_NO_KEY_PRESSED; 127 *state = REMOTE_NO_KEY_PRESSED;
129 goto unlock; 128 goto unlock;
130 } 129 }
131 } 130 }
132 131
133 if (rc_state[1] != 0) 132 if (rc_state[1] != 0)
134 deb_rc("Unknown rc key %x\n", rc_state[1]); 133 deb("Unknown rc key %02x\n", rc_state[1]);
135 134
136 *state = REMOTE_NO_KEY_PRESSED; 135 *state = REMOTE_NO_KEY_PRESSED;
137 136
138 unlock: 137 unlock:
139 138
140 return ret; 139 return ret;
141} 140}
142 141
143/* I2C */ 142/* I2C */
144static int m9206_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], 143static int m920x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
145 int num)
146{ 144{
147 struct dvb_usb_device *d = i2c_get_adapdata(adap); 145 struct dvb_usb_device *d = i2c_get_adapdata(adap);
148 int i, j; 146 int i, j;
@@ -155,33 +153,40 @@ static int m9206_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
155 return -EAGAIN; 153 return -EAGAIN;
156 154
157 for (i = 0; i < num; i++) { 155 for (i = 0; i < num; i++) {
158 if (msg[i].flags & (I2C_M_NO_RD_ACK|I2C_M_IGNORE_NAK|I2C_M_TEN) || 156 if (msg[i].flags & (I2C_M_NO_RD_ACK | I2C_M_IGNORE_NAK | I2C_M_TEN) || msg[i].len == 0) {
159 msg[i].len == 0) { 157 /* For a 0 byte message, I think sending the address
160 /* For a 0 byte message, I think sending the address to index 0x80|0x40 158 * to index 0x80|0x40 would be the correct thing to
161 * would be the correct thing to do. However, zero byte messages are 159 * do. However, zero byte messages are only used for
162 * only used for probing, and since we don't know how to get the slave's 160 * probing, and since we don't know how to get the
163 * ack, we can't probe. */ 161 * slave's ack, we can't probe. */
164 ret = -ENOTSUPP; 162 ret = -ENOTSUPP;
165 goto unlock; 163 goto unlock;
166 } 164 }
167 /* Send START & address/RW bit */ 165 /* Send START & address/RW bit */
168 if (!(msg[i].flags & I2C_M_NOSTART)) { 166 if (!(msg[i].flags & I2C_M_NOSTART)) {
169 if ((ret = m9206_write(d->udev, M9206_I2C, (msg[i].addr<<1)|(msg[i].flags&I2C_M_RD?0x01:0), 0x80)) != 0) 167 if ((ret = m920x_write(d->udev, M9206_I2C,
168 (msg[i].addr << 1) |
169 (msg[i].flags & I2C_M_RD ? 0x01 : 0), 0x80)) != 0)
170 goto unlock; 170 goto unlock;
171 /* Should check for ack here, if we knew how. */ 171 /* Should check for ack here, if we knew how. */
172 } 172 }
173 if (msg[i].flags & I2C_M_RD) { 173 if (msg[i].flags & I2C_M_RD) {
174 for (j = 0; j < msg[i].len; j++) { 174 for (j = 0; j < msg[i].len; j++) {
175 /* Last byte of transaction? Send STOP, otherwise send ACK. */ 175 /* Last byte of transaction?
176 int stop = (i+1 == num && j+1 == msg[i].len)?0x40:0x01; 176 * Send STOP, otherwise send ACK. */
177 if ((ret = m9206_read(d->udev, M9206_I2C, 0x0, 0x20|stop, &msg[i].buf[j], 1)) != 0) 177 int stop = (i+1 == num && j+1 == msg[i].len) ? 0x40 : 0x01;
178
179 if ((ret = m920x_read(d->udev, M9206_I2C, 0x0,
180 0x20 | stop,
181 &msg[i].buf[j], 1)) != 0)
178 goto unlock; 182 goto unlock;
179 } 183 }
180 } else { 184 } else {
181 for (j = 0; j < msg[i].len; j++) { 185 for (j = 0; j < msg[i].len; j++) {
182 /* Last byte of transaction? Then send STOP. */ 186 /* Last byte of transaction? Then send STOP. */
183 int stop = (i+1 == num && j+1 == msg[i].len)?0x40:0x00; 187 int stop = (i+1 == num && j+1 == msg[i].len) ? 0x40 : 0x00;
184 if ((ret = m9206_write(d->udev, M9206_I2C, msg[i].buf[j], stop)) != 0) 188
189 if ((ret = m920x_write(d->udev, M9206_I2C, msg[i].buf[j], stop)) != 0)
185 goto unlock; 190 goto unlock;
186 /* Should check for ack here too. */ 191 /* Should check for ack here too. */
187 } 192 }
@@ -189,25 +194,25 @@ static int m9206_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
189 } 194 }
190 ret = num; 195 ret = num;
191 196
192unlock: 197 unlock:
193 mutex_unlock(&d->i2c_mutex); 198 mutex_unlock(&d->i2c_mutex);
194 199
195 return ret; 200 return ret;
196} 201}
197 202
198static u32 m9206_i2c_func(struct i2c_adapter *adapter) 203static u32 m920x_i2c_func(struct i2c_adapter *adapter)
199{ 204{
200 return I2C_FUNC_I2C; 205 return I2C_FUNC_I2C;
201} 206}
202 207
203static struct i2c_algorithm m9206_i2c_algo = { 208static struct i2c_algorithm m920x_i2c_algo = {
204 .master_xfer = m9206_i2c_xfer, 209 .master_xfer = m920x_i2c_xfer,
205 .functionality = m9206_i2c_func, 210 .functionality = m920x_i2c_func,
206}; 211};
207 212
208 213/* pid filter */
209static int m9206_set_filter(struct dvb_usb_adapter *adap, int type, int idx, 214static int m920x_set_filter(struct dvb_usb_adapter *adap,
210 int pid) 215 int type, int idx, int pid)
211{ 216{
212 int ret = 0; 217 int ret = 0;
213 218
@@ -216,18 +221,18 @@ static int m9206_set_filter(struct dvb_usb_adapter *adap, int type, int idx,
216 221
217 pid |= 0x8000; 222 pid |= 0x8000;
218 223
219 if ((ret = m9206_write(adap->dev->udev, M9206_FILTER, pid, (type << 8) | (idx * 4) )) != 0) 224 if ((ret = m920x_write(adap->dev->udev, M9206_FILTER, pid, (type << 8) | (idx * 4) )) != 0)
220 return ret; 225 return ret;
221 226
222 if ((ret = m9206_write(adap->dev->udev, M9206_FILTER, 0, (type << 8) | (idx * 4) )) != 0) 227 if ((ret = m920x_write(adap->dev->udev, M9206_FILTER, 0, (type << 8) | (idx * 4) )) != 0)
223 return ret; 228 return ret;
224 229
225 return ret; 230 return ret;
226} 231}
227 232
228static int m9206_update_filters(struct dvb_usb_adapter *adap) 233static int m920x_update_filters(struct dvb_usb_adapter *adap)
229{ 234{
230 struct m9206_state *m = adap->dev->priv; 235 struct m920x_state *m = adap->dev->priv;
231 int enabled = m->filtering_enabled; 236 int enabled = m->filtering_enabled;
232 int i, ret = 0, filter = 0; 237 int i, ret = 0, filter = 0;
233 238
@@ -236,14 +241,14 @@ static int m9206_update_filters(struct dvb_usb_adapter *adap)
236 enabled = 0; 241 enabled = 0;
237 242
238 /* Disable all filters */ 243 /* Disable all filters */
239 if ((ret = m9206_set_filter(adap, 0x81, 1, enabled)) != 0) 244 if ((ret = m920x_set_filter(adap, 0x81, 1, enabled)) != 0)
240 return ret; 245 return ret;
241 246
242 for (i = 0; i < M9206_MAX_FILTERS; i++) 247 for (i = 0; i < M9206_MAX_FILTERS; i++)
243 if ((ret = m9206_set_filter(adap, 0x81, i + 2, 0)) != 0) 248 if ((ret = m920x_set_filter(adap, 0x81, i + 2, 0)) != 0)
244 return ret; 249 return ret;
245 250
246 if ((ret = m9206_set_filter(adap, 0x82, 0, 0x0)) != 0) 251 if ((ret = m920x_set_filter(adap, 0x82, 0, 0x0)) != 0)
247 return ret; 252 return ret;
248 253
249 /* Set */ 254 /* Set */
@@ -252,40 +257,38 @@ static int m9206_update_filters(struct dvb_usb_adapter *adap)
252 if (m->filters[i] == 0) 257 if (m->filters[i] == 0)
253 continue; 258 continue;
254 259
255 if ((ret = m9206_set_filter(adap, 0x81, filter + 2, m->filters[i])) != 0) 260 if ((ret = m920x_set_filter(adap, 0x81, filter + 2, m->filters[i])) != 0)
256 return ret; 261 return ret;
257 262
258 filter++; 263 filter++;
259 } 264 }
260 } 265 }
261 266
262 if ((ret = m9206_set_filter(adap, 0x82, 0, 0x02f5)) != 0) 267 if ((ret = m920x_set_filter(adap, 0x82, 0, 0x02f5)) != 0)
263 return ret; 268 return ret;
264 269
265 return ret; 270 return ret;
266} 271}
267 272
268static int m9206_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) 273static int m920x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
269{ 274{
270 struct m9206_state *m = adap->dev->priv; 275 struct m920x_state *m = adap->dev->priv;
271 276
272 m->filtering_enabled = onoff ? 1 : 0; 277 m->filtering_enabled = onoff ? 1 : 0;
273 278
274 return m9206_update_filters(adap); 279 return m920x_update_filters(adap);
275} 280}
276 281
277static int m9206_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, 282static int m920x_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff)
278 int onoff)
279{ 283{
280 struct m9206_state *m = adap->dev->priv; 284 struct m920x_state *m = adap->dev->priv;
281 285
282 m->filters[index] = onoff ? pid : 0; 286 m->filters[index] = onoff ? pid : 0;
283 287
284 return m9206_update_filters(adap); 288 return m920x_update_filters(adap);
285} 289}
286 290
287static int m9206_firmware_download(struct usb_device *udev, 291static int m920x_firmware_download(struct usb_device *udev, const struct firmware *fw)
288 const struct firmware *fw)
289{ 292{
290 u16 value, index, size; 293 u16 value, index, size;
291 u8 read[4], *buff; 294 u8 read[4], *buff;
@@ -293,13 +296,13 @@ static int m9206_firmware_download(struct usb_device *udev,
293 296
294 buff = kmalloc(65536, GFP_KERNEL); 297 buff = kmalloc(65536, GFP_KERNEL);
295 298
296 if ((ret = m9206_read(udev, M9206_FILTER, 0x0, 0x8000, read, 4)) != 0) 299 if ((ret = m920x_read(udev, M9206_FILTER, 0x0, 0x8000, read, 4)) != 0)
297 goto done; 300 goto done;
298 deb_rc("%x %x %x %x\n", read[0], read[1], read[2], read[3]); 301 deb("%x %x %x %x\n", read[0], read[1], read[2], read[3]);
299 302
300 if ((ret = m9206_read(udev, M9206_FW, 0x0, 0x0, read, 1)) != 0) 303 if ((ret = m920x_read(udev, M9206_FW, 0x0, 0x0, read, 1)) != 0)
301 goto done; 304 goto done;
302 deb_rc("%x\n", read[0]); 305 deb("%x\n", read[0]);
303 306
304 for (pass = 0; pass < 2; pass++) { 307 for (pass = 0; pass < 2; pass++) {
305 for (i = 0; i + (sizeof(u16) * 3) < fw->size;) { 308 for (i = 0; i + (sizeof(u16) * 3) < fw->size;) {
@@ -317,11 +320,11 @@ static int m9206_firmware_download(struct usb_device *udev,
317 memcpy(buff, fw->data + i, size); 320 memcpy(buff, fw->data + i, size);
318 321
319 ret = usb_control_msg(udev, usb_sndctrlpipe(udev,0), 322 ret = usb_control_msg(udev, usb_sndctrlpipe(udev,0),
320 M9206_FW, 323 M9206_FW,
321 USB_TYPE_VENDOR | USB_DIR_OUT, 324 USB_TYPE_VENDOR | USB_DIR_OUT,
322 value, index, buff, size, 20); 325 value, index, buff, size, 20);
323 if (ret != size) { 326 if (ret != size) {
324 deb_rc("error while uploading fw!\n"); 327 deb("error while uploading fw!\n");
325 ret = -EIO; 328 ret = -EIO;
326 goto done; 329 goto done;
327 } 330 }
@@ -330,7 +333,7 @@ static int m9206_firmware_download(struct usb_device *udev,
330 i += size; 333 i += size;
331 } 334 }
332 if (i != fw->size) { 335 if (i != fw->size) {
333 deb_rc("bad firmware file!\n"); 336 deb("bad firmware file!\n");
334 ret = -EINVAL; 337 ret = -EINVAL;
335 goto done; 338 goto done;
336 } 339 }
@@ -338,11 +341,11 @@ static int m9206_firmware_download(struct usb_device *udev,
338 341
339 msleep(36); 342 msleep(36);
340 343
341 /* m9206 will disconnect itself from the bus after this. */ 344 /* m920x will disconnect itself from the bus after this. */
342 (void) m9206_write(udev, M9206_CORE, 0x01, M9206_FW_GO); 345 (void) m920x_write(udev, M9206_CORE, 0x01, M9206_FW_GO);
343 deb_rc("firmware uploaded!\n"); 346 deb("firmware uploaded!\n");
344 347
345 done: 348 done:
346 kfree(buff); 349 kfree(buff);
347 350
348 return ret; 351 return ret;
@@ -362,7 +365,8 @@ static int m920x_identify_state(struct usb_device *udev,
362 return 0; 365 return 0;
363} 366}
364 367
365static int megasky_mt352_demod_init(struct dvb_frontend *fe) 368/* demod configurations */
369static int m920x_mt352_demod_init(struct dvb_frontend *fe)
366{ 370{
367 u8 config[] = { CONFIG, 0x3d }; 371 u8 config[] = { CONFIG, 0x3d };
368 u8 clock[] = { CLOCK_CTL, 0x30 }; 372 u8 clock[] = { CLOCK_CTL, 0x30 };
@@ -382,74 +386,174 @@ static int megasky_mt352_demod_init(struct dvb_frontend *fe)
382 mt352_write(fe, unk1, ARRAY_SIZE(unk1)); 386 mt352_write(fe, unk1, ARRAY_SIZE(unk1));
383 mt352_write(fe, unk2, ARRAY_SIZE(unk2)); 387 mt352_write(fe, unk2, ARRAY_SIZE(unk2));
384 388
385 deb_rc("Demod init!\n"); 389 deb("Demod init!\n");
386 390
387 return 0; 391 return 0;
388} 392}
389 393
390static struct mt352_config megasky_mt352_config = { 394static struct mt352_config m920x_mt352_config = {
391 .demod_address = 0x0f, 395 .demod_address = 0x0f,
392 .no_tuner = 1, 396 .no_tuner = 1,
393 .demod_init = megasky_mt352_demod_init, 397 .demod_init = m920x_mt352_demod_init,
398};
399
400static struct tda1004x_config m920x_tda10046_08_config = {
401 .demod_address = 0x08,
402 .invert = 0,
403 .invert_oclk = 0,
404 .ts_mode = TDA10046_TS_SERIAL,
405 .xtal_freq = TDA10046_XTAL_16M,
406 .if_freq = TDA10046_FREQ_045,
407 .agc_config = TDA10046_AGC_TDA827X,
408 .gpio_config = TDA10046_GPTRI,
409 .request_firmware = NULL,
410};
411
412static struct tda1004x_config m920x_tda10046_0b_config = {
413 .demod_address = 0x0b,
414 .invert = 0,
415 .invert_oclk = 0,
416 .ts_mode = TDA10046_TS_SERIAL,
417 .xtal_freq = TDA10046_XTAL_16M,
418 .if_freq = TDA10046_FREQ_045,
419 .agc_config = TDA10046_AGC_TDA827X,
420 .gpio_config = TDA10046_GPTRI,
421 .request_firmware = NULL, /* uses firmware EEPROM */
422};
423
424/* tuner configurations */
425static struct qt1010_config m920x_qt1010_config = {
426 .i2c_address = 0x62
394}; 427};
395 428
396static int megasky_mt352_frontend_attach(struct dvb_usb_adapter *adap) 429/* Callbacks for DVB USB */
430static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
397{ 431{
398 deb_rc("megasky_frontend_attach!\n"); 432 deb("%s\n",__FUNCTION__);
399 433
400 if ((adap->fe = dvb_attach(mt352_attach, &megasky_mt352_config, &adap->dev->i2c_adap)) == NULL) 434 if ((adap->fe = dvb_attach(mt352_attach,
435 &m920x_mt352_config,
436 &adap->dev->i2c_adap)) == NULL)
401 return -EIO; 437 return -EIO;
402 438
403 return 0; 439 return 0;
404} 440}
405 441
406static struct qt1010_config megasky_qt1010_config = { 442static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap)
407 .i2c_address = 0x62
408};
409
410static int megasky_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
411{ 443{
412 if (dvb_attach(qt1010_attach, adap->fe, &adap->dev->i2c_adap, 444 deb("%s\n",__FUNCTION__);
413 &megasky_qt1010_config) == NULL) 445
414 return -ENODEV; 446 if ((adap->fe = dvb_attach(tda10046_attach,
447 &m920x_tda10046_08_config,
448 &adap->dev->i2c_adap)) == NULL)
449 return -EIO;
415 450
416 return 0; 451 return 0;
417} 452}
418 453
419static struct tda1004x_config digivox_tda10046_config = { 454static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap)
420 .demod_address = 0x08,
421 .invert = 0,
422 .invert_oclk = 0,
423 .ts_mode = TDA10046_TS_SERIAL,
424 .xtal_freq = TDA10046_XTAL_16M,
425 .if_freq = TDA10046_FREQ_045,
426 .agc_config = TDA10046_AGC_TDA827X,
427 .gpio_config = TDA10046_GPTRI,
428 .request_firmware = NULL,
429};
430
431static int digivox_tda10046_frontend_attach(struct dvb_usb_adapter *adap)
432{ 455{
433 deb_rc("digivox_tda10046_frontend_attach!\n"); 456 deb("%s\n",__FUNCTION__);
434 457
435 if ((adap->fe = dvb_attach(tda10046_attach, &digivox_tda10046_config, 458 if ((adap->fe = dvb_attach(tda10046_attach,
459 &m920x_tda10046_0b_config,
436 &adap->dev->i2c_adap)) == NULL) 460 &adap->dev->i2c_adap)) == NULL)
437 return -EIO; 461 return -EIO;
438 462
439 return 0; 463 return 0;
440} 464}
441 465
442static int digivox_tda8275_tuner_attach(struct dvb_usb_adapter *adap) 466static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
443{ 467{
444 if (dvb_attach(tda827x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, 468 deb("%s\n",__FUNCTION__);
445 NULL) == NULL) 469
470 if (dvb_attach(qt1010_attach, adap->fe, &adap->dev->i2c_adap, &m920x_qt1010_config) == NULL)
446 return -ENODEV; 471 return -ENODEV;
472
447 return 0; 473 return 0;
448} 474}
449 475
476static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter *adap)
477{
478 deb("%s\n",__FUNCTION__);
479
480 if (dvb_attach(tda827x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, NULL) == NULL)
481 return -ENODEV;
482
483 return 0;
484}
485
486static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap)
487{
488 deb("%s\n",__FUNCTION__);
489
490 if (dvb_attach(tda827x_attach, adap->fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL)
491 return -ENODEV;
492
493 return 0;
494}
495
496/* device-specific initialization */
497static struct m920x_inits megasky_rc_init [] = {
498 { M9206_RC_INIT2, 0xa8 },
499 { M9206_RC_INIT1, 0x51 },
500 { } /* terminating entry */
501};
502
503static struct m920x_inits tvwalkertwin_rc_init [] = {
504 { M9206_RC_INIT2, 0x00 },
505 { M9206_RC_INIT1, 0xef },
506 { 0xff28, 0x00 },
507 { 0xff23, 0x00 },
508 { 0xff21, 0x30 },
509 { } /* terminating entry */
510};
511
512/* ir keymaps */
513static struct dvb_usb_rc_key megasky_rc_keys [] = {
514 { 0x0, 0x12, KEY_POWER },
515 { 0x0, 0x1e, KEY_CYCLEWINDOWS }, /* min/max */
516 { 0x0, 0x02, KEY_CHANNELUP },
517 { 0x0, 0x05, KEY_CHANNELDOWN },
518 { 0x0, 0x03, KEY_VOLUMEUP },
519 { 0x0, 0x06, KEY_VOLUMEDOWN },
520 { 0x0, 0x04, KEY_MUTE },
521 { 0x0, 0x07, KEY_OK }, /* TS */
522 { 0x0, 0x08, KEY_STOP },
523 { 0x0, 0x09, KEY_MENU }, /* swap */
524 { 0x0, 0x0a, KEY_REWIND },
525 { 0x0, 0x1b, KEY_PAUSE },
526 { 0x0, 0x1f, KEY_FASTFORWARD },
527 { 0x0, 0x0c, KEY_RECORD },
528 { 0x0, 0x0d, KEY_CAMERA }, /* screenshot */
529 { 0x0, 0x0e, KEY_COFFEE }, /* "MTS" */
530};
531
532static struct dvb_usb_rc_key tvwalkertwin_rc_keys [] = {
533 { 0x0, 0x01, KEY_ZOOM }, /* Full Screen */
534 { 0x0, 0x02, KEY_CAMERA }, /* snapshot */
535 { 0x0, 0x03, KEY_MUTE },
536 { 0x0, 0x04, KEY_REWIND },
537 { 0x0, 0x05, KEY_PLAYPAUSE }, /* Play/Pause */
538 { 0x0, 0x06, KEY_FASTFORWARD },
539 { 0x0, 0x07, KEY_RECORD },
540 { 0x0, 0x08, KEY_STOP },
541 { 0x0, 0x09, KEY_TIME }, /* Timeshift */
542 { 0x0, 0x0c, KEY_COFFEE }, /* Recall */
543 { 0x0, 0x0e, KEY_CHANNELUP },
544 { 0x0, 0x12, KEY_POWER },
545 { 0x0, 0x15, KEY_MENU }, /* source */
546 { 0x0, 0x18, KEY_CYCLEWINDOWS }, /* TWIN PIP */
547 { 0x0, 0x1a, KEY_CHANNELDOWN },
548 { 0x0, 0x1b, KEY_VOLUMEDOWN },
549 { 0x0, 0x1e, KEY_VOLUMEUP },
550};
551
450/* DVB USB Driver stuff */ 552/* DVB USB Driver stuff */
451static struct dvb_usb_device_properties megasky_properties; 553static struct dvb_usb_device_properties megasky_properties;
452static struct dvb_usb_device_properties digivox_mini_ii_properties; 554static struct dvb_usb_device_properties digivox_mini_ii_properties;
555static struct dvb_usb_device_properties tvwalkertwin_properties;
556static struct dvb_usb_device_properties dposh_properties;
453 557
454static int m920x_probe(struct usb_interface *intf, 558static int m920x_probe(struct usb_interface *intf,
455 const struct usb_device_id *id) 559 const struct usb_device_id *id)
@@ -457,19 +561,57 @@ static int m920x_probe(struct usb_interface *intf,
457 struct dvb_usb_device *d; 561 struct dvb_usb_device *d;
458 struct usb_host_interface *alt; 562 struct usb_host_interface *alt;
459 int ret; 563 int ret;
564 struct m920x_inits *rc_init_seq = NULL;
565 int bInterfaceNumber = intf->cur_altsetting->desc.bInterfaceNumber;
460 566
461 deb_rc("Probed!\n"); 567 deb("Probing for m920x device at interface %d\n", bInterfaceNumber);
462 568
463 if (((ret = dvb_usb_device_init(intf, &megasky_properties, THIS_MODULE, &d)) == 0) || 569 if (bInterfaceNumber == 0) {
464 ((ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties, THIS_MODULE, &d)) == 0)) 570 /* Single-tuner device, or first interface on
465 goto found; 571 * multi-tuner device
572 */
466 573
467 return ret; 574 if ((ret = dvb_usb_device_init(intf, &megasky_properties,
575 THIS_MODULE, &d)) == 0) {
576 rc_init_seq = megasky_rc_init;
577 goto found;
578 }
579
580 if ((ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
581 THIS_MODULE, &d)) == 0) {
582 /* No remote control, so no rc_init_seq */
583 goto found;
584 }
585
586 /* This configures both tuners on the TV Walker Twin */
587 if ((ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
588 THIS_MODULE, &d)) == 0) {
589 rc_init_seq = tvwalkertwin_rc_init;
590 goto found;
591 }
592
593 if ((ret = dvb_usb_device_init(intf, &dposh_properties,
594 THIS_MODULE, &d)) == 0) {
595 /* Remote controller not supported yet. */
596 goto found;
597 }
598
599 return ret;
600 } else {
601 /* Another interface on a multi-tuner device */
468 602
469found: 603 /* The LifeView TV Walker Twin gets here, but struct
604 * tvwalkertwin_properties already configured both
605 * tuners, so there is nothing for us to do here
606 */
607
608 return -ENODEV;
609 }
610
611 found:
470 alt = usb_altnum_to_altsetting(intf, 1); 612 alt = usb_altnum_to_altsetting(intf, 1);
471 if (alt == NULL) { 613 if (alt == NULL) {
472 deb_rc("No alt found!\n"); 614 deb("No alt found!\n");
473 return -ENODEV; 615 return -ENODEV;
474 } 616 }
475 617
@@ -478,7 +620,7 @@ found:
478 if (ret < 0) 620 if (ret < 0)
479 return ret; 621 return ret;
480 622
481 if ((ret = m9206_init(d)) != 0) 623 if ((ret = m920x_init(d, rc_init_seq)) != 0)
482 return ret; 624 return ret;
483 625
484 return ret; 626 return ret;
@@ -488,6 +630,12 @@ static struct usb_device_id m920x_table [] = {
488 { USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580) }, 630 { USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580) },
489 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC, 631 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC,
490 USB_PID_MSI_DIGI_VOX_MINI_II) }, 632 USB_PID_MSI_DIGI_VOX_MINI_II) },
633 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC,
634 USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD) },
635 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC,
636 USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM) },
637 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) },
638 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) },
491 { } /* Terminating entry */ 639 { } /* Terminating entry */
492}; 640};
493MODULE_DEVICE_TABLE (usb, m920x_table); 641MODULE_DEVICE_TABLE (usb, m920x_table);
@@ -497,14 +645,14 @@ static struct dvb_usb_device_properties megasky_properties = {
497 645
498 .usb_ctrl = DEVICE_SPECIFIC, 646 .usb_ctrl = DEVICE_SPECIFIC,
499 .firmware = "dvb-usb-megasky-02.fw", 647 .firmware = "dvb-usb-megasky-02.fw",
500 .download_firmware = m9206_firmware_download, 648 .download_firmware = m920x_firmware_download,
501 649
502 .rc_interval = 100, 650 .rc_interval = 100,
503 .rc_key_map = megasky_rc_keys, 651 .rc_key_map = megasky_rc_keys,
504 .rc_key_map_size = ARRAY_SIZE(megasky_rc_keys), 652 .rc_key_map_size = ARRAY_SIZE(megasky_rc_keys),
505 .rc_query = m9206_rc_query, 653 .rc_query = m920x_rc_query,
506 654
507 .size_of_priv = sizeof(struct m9206_state), 655 .size_of_priv = sizeof(struct m920x_state),
508 656
509 .identify_state = m920x_identify_state, 657 .identify_state = m920x_identify_state,
510 .num_adapters = 1, 658 .num_adapters = 1,
@@ -513,11 +661,11 @@ static struct dvb_usb_device_properties megasky_properties = {
513 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, 661 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
514 662
515 .pid_filter_count = 8, 663 .pid_filter_count = 8,
516 .pid_filter = m9206_pid_filter, 664 .pid_filter = m920x_pid_filter,
517 .pid_filter_ctrl = m9206_pid_filter_ctrl, 665 .pid_filter_ctrl = m920x_pid_filter_ctrl,
518 666
519 .frontend_attach = megasky_mt352_frontend_attach, 667 .frontend_attach = m920x_mt352_frontend_attach,
520 .tuner_attach = megasky_qt1010_tuner_attach, 668 .tuner_attach = m920x_qt1010_tuner_attach,
521 669
522 .stream = { 670 .stream = {
523 .type = USB_BULK, 671 .type = USB_BULK,
@@ -530,7 +678,7 @@ static struct dvb_usb_device_properties megasky_properties = {
530 } 678 }
531 }, 679 },
532 }}, 680 }},
533 .i2c_algo = &m9206_i2c_algo, 681 .i2c_algo = &m920x_i2c_algo,
534 682
535 .num_device_descs = 1, 683 .num_device_descs = 1,
536 .devices = { 684 .devices = {
@@ -546,22 +694,22 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties = {
546 694
547 .usb_ctrl = DEVICE_SPECIFIC, 695 .usb_ctrl = DEVICE_SPECIFIC,
548 .firmware = "dvb-usb-digivox-02.fw", 696 .firmware = "dvb-usb-digivox-02.fw",
549 .download_firmware = m9206_firmware_download, 697 .download_firmware = m920x_firmware_download,
550 698
551 .size_of_priv = sizeof(struct m9206_state), 699 .size_of_priv = sizeof(struct m920x_state),
552 700
553 .identify_state = m920x_identify_state, 701 .identify_state = m920x_identify_state,
554 .num_adapters = 1, 702 .num_adapters = 1,
555 .adapter = {{ 703 .adapter = {{
556 .caps = DVB_USB_ADAP_HAS_PID_FILTER | 704 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
557 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, 705 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
558 706
559 .pid_filter_count = 8, 707 .pid_filter_count = 8,
560 .pid_filter = m9206_pid_filter, 708 .pid_filter = m920x_pid_filter,
561 .pid_filter_ctrl = m9206_pid_filter_ctrl, 709 .pid_filter_ctrl = m920x_pid_filter_ctrl,
562 710
563 .frontend_attach = digivox_tda10046_frontend_attach, 711 .frontend_attach = m920x_tda10046_08_frontend_attach,
564 .tuner_attach = digivox_tda8275_tuner_attach, 712 .tuner_attach = m920x_tda8275_60_tuner_attach,
565 713
566 .stream = { 714 .stream = {
567 .type = USB_BULK, 715 .type = USB_BULK,
@@ -574,7 +722,7 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties = {
574 } 722 }
575 }, 723 },
576 }}, 724 }},
577 .i2c_algo = &m9206_i2c_algo, 725 .i2c_algo = &m920x_i2c_algo,
578 726
579 .num_device_descs = 1, 727 .num_device_descs = 1,
580 .devices = { 728 .devices = {
@@ -585,6 +733,122 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties = {
585 } 733 }
586}; 734};
587 735
736/* LifeView TV Walker Twin support by Nick Andrew <nick@nick-andrew.net>
737 *
738 * LifeView TV Walker Twin has 1 x M9206, 2 x TDA10046, 2 x TDA8275A
739 * TDA10046 #0 is located at i2c address 0x08
740 * TDA10046 #1 is located at i2c address 0x0b (presently disabled - not yet working)
741 * TDA8275A #0 is located at i2c address 0x60
742 * TDA8275A #1 is located at i2c address 0x61 (presently disabled - not yet working)
743 */
744static struct dvb_usb_device_properties tvwalkertwin_properties = {
745 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
746
747 .usb_ctrl = DEVICE_SPECIFIC,
748 .firmware = "dvb-usb-tvwalkert.fw",
749 .download_firmware = m920x_firmware_download,
750
751 .rc_interval = 100,
752 .rc_key_map = tvwalkertwin_rc_keys,
753 .rc_key_map_size = ARRAY_SIZE(tvwalkertwin_rc_keys),
754 .rc_query = m920x_rc_query,
755
756 .size_of_priv = sizeof(struct m920x_state),
757
758 .identify_state = m920x_identify_state,
759 .num_adapters = 1,
760 .adapter = {{
761 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
762 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
763
764 .pid_filter_count = 8,
765 .pid_filter = m920x_pid_filter,
766 .pid_filter_ctrl = m920x_pid_filter_ctrl,
767
768 .frontend_attach = m920x_tda10046_08_frontend_attach,
769 .tuner_attach = m920x_tda8275_60_tuner_attach,
770
771 .stream = {
772 .type = USB_BULK,
773 .count = 8,
774 .endpoint = 0x81,
775 .u = {
776 .bulk = {
777 .buffersize = 512,
778 }
779 }
780 }},{
781 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
782 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
783
784 .pid_filter_count = 8,
785 .pid_filter = m920x_pid_filter,
786 .pid_filter_ctrl = m920x_pid_filter_ctrl,
787
788 .frontend_attach = m920x_tda10046_0b_frontend_attach,
789 .tuner_attach = m920x_tda8275_61_tuner_attach,
790
791 .stream = {
792 .type = USB_BULK,
793 .count = 8,
794 .endpoint = 0x82,
795 .u = {
796 .bulk = {
797 .buffersize = 512,
798 }
799 }
800 },
801 }},
802 .i2c_algo = &m920x_i2c_algo,
803
804 .num_device_descs = 1,
805 .devices = {
806 { .name = "LifeView TV Walker Twin DVB-T USB2.0",
807 .cold_ids = { &m920x_table[2], NULL },
808 .warm_ids = { &m920x_table[3], NULL },
809 },
810 }
811};
812
813static struct dvb_usb_device_properties dposh_properties = {
814 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
815
816 .usb_ctrl = DEVICE_SPECIFIC,
817 .firmware = "dvb-usb-dposh-01.fw",
818 .download_firmware = m920x_firmware_download,
819
820 .size_of_priv = sizeof(struct m920x_state),
821
822 .identify_state = m920x_identify_state,
823 .num_adapters = 1,
824 .adapter = {{
825 /* Hardware pid filters don't work with this device/firmware */
826
827 .frontend_attach = m920x_mt352_frontend_attach,
828 .tuner_attach = m920x_qt1010_tuner_attach,
829
830 .stream = {
831 .type = USB_BULK,
832 .count = 8,
833 .endpoint = 0x81,
834 .u = {
835 .bulk = {
836 .buffersize = 512,
837 }
838 }
839 },
840 }},
841 .i2c_algo = &m920x_i2c_algo,
842
843 .num_device_descs = 1,
844 .devices = {
845 { .name = "Dposh DVB-T USB2.0",
846 .cold_ids = { &m920x_table[4], NULL },
847 .warm_ids = { &m920x_table[5], NULL },
848 },
849 }
850};
851
588static struct usb_driver m920x_driver = { 852static struct usb_driver m920x_driver = {
589 .name = "dvb_usb_m920x", 853 .name = "dvb_usb_m920x",
590 .probe = m920x_probe, 854 .probe = m920x_probe,
@@ -615,6 +879,11 @@ module_init (m920x_module_init);
615module_exit (m920x_module_exit); 879module_exit (m920x_module_exit);
616 880
617MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>"); 881MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>");
618MODULE_DESCRIPTION("Driver MSI Mega Sky 580 DVB-T USB2.0 / Uli m920x"); 882MODULE_DESCRIPTION("DVB Driver for ULI M920x");
619MODULE_VERSION("0.1"); 883MODULE_VERSION("0.1");
620MODULE_LICENSE("GPL"); 884MODULE_LICENSE("GPL");
885
886/*
887 * Local variables:
888 * c-basic-offset: 8
889 */
diff --git a/drivers/media/dvb/dvb-usb/m920x.h b/drivers/media/dvb/dvb-usb/m920x.h
index 7dd3db65c80e..2c8942d04222 100644
--- a/drivers/media/dvb/dvb-usb/m920x.h
+++ b/drivers/media/dvb/dvb-usb/m920x.h
@@ -4,7 +4,7 @@
4#define DVB_USB_LOG_PREFIX "m920x" 4#define DVB_USB_LOG_PREFIX "m920x"
5#include "dvb-usb.h" 5#include "dvb-usb.h"
6 6
7#define deb_rc(args...) dprintk(dvb_usb_m920x_debug,0x01,args) 7#define deb(args...) dprintk(dvb_usb_m920x_debug,0x01,args)
8 8
9#define M9206_CORE 0x22 9#define M9206_CORE 0x22
10#define M9206_RC_STATE 0xff51 10#define M9206_RC_STATE 0xff51
@@ -59,9 +59,18 @@ What any other bits might mean, or how to get the slave's ACK/NACK
59response to a write, is unknown. 59response to a write, is unknown.
60*/ 60*/
61 61
62struct m9206_state { 62struct m920x_state {
63 u16 filters[M9206_MAX_FILTERS]; 63 u16 filters[M9206_MAX_FILTERS];
64 int filtering_enabled; 64 int filtering_enabled;
65 int rep_count; 65 int rep_count;
66}; 66};
67
68/* Initialisation data for the m920x
69 */
70
71struct m920x_inits {
72 u16 address;
73 u8 data;
74};
75
67#endif 76#endif
diff --git a/drivers/media/dvb/dvb-usb/vp702x-fe.c b/drivers/media/dvb/dvb-usb/vp702x-fe.c
index 3ecb2e0ce80f..c3fdc7cd094e 100644
--- a/drivers/media/dvb/dvb-usb/vp702x-fe.c
+++ b/drivers/media/dvb/dvb-usb/vp702x-fe.c
@@ -204,8 +204,8 @@ static int vp702x_fe_get_frontend(struct dvb_frontend* fe,
204static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe, 204static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe,
205 struct dvb_diseqc_master_cmd *m) 205 struct dvb_diseqc_master_cmd *m)
206{ 206{
207 //struct vp702x_fe_state *st = fe->demodulator_priv; 207 struct vp702x_fe_state *st = fe->demodulator_priv;
208 u8 cmd[8];//,ibuf[10]; 208 u8 cmd[8],ibuf[10];
209 memset(cmd,0,8); 209 memset(cmd,0,8);
210 210
211 deb_fe("%s\n",__FUNCTION__); 211 deb_fe("%s\n",__FUNCTION__);
@@ -218,12 +218,12 @@ static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe,
218 memcpy(&cmd[3], m->msg, m->msg_len); 218 memcpy(&cmd[3], m->msg, m->msg_len);
219 cmd[7] = vp702x_chksum(cmd,0,7); 219 cmd[7] = vp702x_chksum(cmd,0,7);
220 220
221// vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100); 221 vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100);
222 222
223// if (ibuf[2] == 0 && ibuf[3] == 0) 223 if (ibuf[2] == 0 && ibuf[3] == 0)
224// deb_fe("diseqc cmd failed.\n"); 224 deb_fe("diseqc cmd failed.\n");
225// else 225 else
226// deb_fe("diseqc cmd succeeded.\n"); 226 deb_fe("diseqc cmd succeeded.\n");
227 227
228 return 0; 228 return 0;
229} 229}