V4L/DVB (8994): Adjust MPEG initialization in cx24116
[safe/jmp/linux-2.6] / drivers / media / dvb / dvb-usb / dw2102.c
1 /* DVB USB framework compliant Linux driver for the
2 *       DVBWorld DVB-S 2101, 2102, DVB-S2 2104 Card
3 *
4 * Copyright (C) 2008 Igor M. Liplianin (liplianin@me.by)
5 *
6 *       This program is free software; you can redistribute it and/or modify it
7 *       under the terms of the GNU General Public License as published by the
8 *       Free Software Foundation, version 2.
9 *
10 * see Documentation/dvb/README.dvb-usb for more information
11 */
12 #include <linux/version.h>
13 #include "dw2102.h"
14 #include "stv0299.h"
15 #include "z0194a.h"
16 #include "cx24116.h"
17
18 #ifndef USB_PID_DW2102
19 #define USB_PID_DW2102 0x2102
20 #endif
21
22 #ifndef USB_PID_DW2104
23 #define USB_PID_DW2104 0x2104
24 #endif
25
26 #define DW2102_READ_MSG 0
27 #define DW2102_WRITE_MSG 1
28
29 #define REG_1F_SYMBOLRATE_BYTE0 0x1f
30 #define REG_20_SYMBOLRATE_BYTE1 0x20
31 #define REG_21_SYMBOLRATE_BYTE2 0x21
32 /* on my own*/
33 #define DW2102_VOLTAGE_CTRL (0x1800)
34 #define DW2102_RC_QUERY (0x1a00)
35
36 struct dw2102_state {
37         u32 last_key_pressed;
38 };
39 struct dw2102_rc_keys {
40         u32 keycode;
41         u32 event;
42 };
43
44 /* debug */
45 static int dvb_usb_dw2102_debug;
46 module_param_named(debug, dvb_usb_dw2102_debug, int, 0644);
47 MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer (or-able))." DVB_USB_DEBUG_STATUS);
48
49 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
50
51 static int dw2102_op_rw(struct usb_device *dev, u8 request, u16 value,
52                         u16 index, u8 * data, u16 len, int flags)
53 {
54         int ret;
55         u8 u8buf[len];
56
57         unsigned int pipe = (flags == DW2102_READ_MSG) ?
58                                 usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0);
59         u8 request_type = (flags == DW2102_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT;
60
61         if (flags == DW2102_WRITE_MSG)
62                 memcpy(u8buf, data, len);
63         ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR,
64                                 value, index , u8buf, len, 2000);
65
66         if (flags == DW2102_READ_MSG)
67                 memcpy(data, u8buf, len);
68         return ret;
69 }
70
71 /* I2C */
72
73 static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
74                 int num)
75 {
76 struct dvb_usb_device *d = i2c_get_adapdata(adap);
77         int i = 0, ret = 0;
78         u8 buf6[] = {0x2c, 0x05, 0xc0, 0, 0, 0, 0};
79         u16 value;
80
81         if (!d)
82                 return -ENODEV;
83         if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
84                 return -EAGAIN;
85
86         switch (num) {
87         case 2:
88                 /* read stv0299 register */
89                 value = msg[0].buf[0];/* register */
90                 for (i = 0; i < msg[1].len; i++) {
91                         value = value + i;
92                         ret = dw2102_op_rw(d->udev, 0xb5, value, 0,
93                                         buf6, 2, DW2102_READ_MSG);
94                         msg[1].buf[i] = buf6[0];
95
96                 }
97                 break;
98         case 1:
99                 switch (msg[0].addr) {
100                 case 0x68:
101                         /* write to stv0299 register */
102                         buf6[0] = 0x2a;
103                         buf6[1] = msg[0].buf[0];
104                         buf6[2] = msg[0].buf[1];
105                         ret = dw2102_op_rw(d->udev, 0xb2, 0, 0,
106                                         buf6, 3, DW2102_WRITE_MSG);
107                         break;
108                 case 0x60:
109                         if (msg[0].flags == 0) {
110                         /* write to tuner pll */
111                                 buf6[0] = 0x2c;
112                                 buf6[1] = 5;
113                                 buf6[2] = 0xc0;
114                                 buf6[3] = msg[0].buf[0];
115                                 buf6[4] = msg[0].buf[1];
116                                 buf6[5] = msg[0].buf[2];
117                                 buf6[6] = msg[0].buf[3];
118                                 ret = dw2102_op_rw(d->udev, 0xb2, 0, 0,
119                                                 buf6, 7, DW2102_WRITE_MSG);
120                         } else {
121                         /* read from tuner */
122                                 ret = dw2102_op_rw(d->udev, 0xb5, 0,0,
123                                                 buf6, 1, DW2102_READ_MSG);
124                                 msg[0].buf[0] = buf6[0];
125                         }
126                         break;
127                 case (DW2102_RC_QUERY):
128                         ret  = dw2102_op_rw(d->udev, 0xb8, 0, 0,
129                                         buf6, 2, DW2102_READ_MSG);
130                         msg[0].buf[0] = buf6[0];
131                         msg[0].buf[1] = buf6[1];
132                         break;
133                 case (DW2102_VOLTAGE_CTRL):
134                         buf6[0] = 0x30;
135                         buf6[1] = msg[0].buf[0];
136                         ret = dw2102_op_rw(d->udev, 0xb2, 0, 0,
137                                         buf6, 2, DW2102_WRITE_MSG);
138                         break;
139                 }
140
141                 break;
142         }
143
144         mutex_unlock(&d->i2c_mutex);
145         return num;
146 }
147
148 static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
149 {
150         struct dvb_usb_device *d = i2c_get_adapdata(adap);
151         int ret = 0;
152         int len, i;
153
154         if (!d)
155                 return -ENODEV;
156         if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
157                 return -EAGAIN;
158
159         switch (num) {
160         case 2: {
161                 /* read */
162                 /* first write first register number */
163                 u8 ibuf [msg[1].len + 2], obuf[3];
164                 obuf[0] = 0xaa;
165                 obuf[1] = msg[0].len;
166                 obuf[2] = msg[0].buf[0];
167                 ret = dw2102_op_rw(d->udev, 0xc2, 0, 0,
168                                 obuf, msg[0].len + 2, DW2102_WRITE_MSG);
169                 /* second read registers */
170                 ret = dw2102_op_rw(d->udev, 0xc3, 0xab , 0,
171                                 ibuf, msg[1].len + 2, DW2102_READ_MSG);
172                 memcpy(msg[1].buf, ibuf + 2, msg[1].len);
173
174                 break;
175         }
176         case 1:
177                 switch (msg[0].addr) {
178                 case 0x55: {
179                         if (msg[0].buf[0] == 0xf7) {
180                                 /* firmware */
181                                 /* Write in small blocks */
182                                 u8 obuf[19];
183                                 obuf[0] = 0xaa;
184                                 obuf[1] = 0x11;
185                                 obuf[2] = 0xf7;
186                                 len = msg[0].len - 1;
187                                 i = 1;
188                                 do {
189                                         memcpy(obuf + 3, msg[0].buf + i, (len > 16 ? 16 : len));
190                                         ret = dw2102_op_rw(d->udev, 0xc2, 0, 0,
191                                                 obuf, (len > 16 ? 16 : len) + 3, DW2102_WRITE_MSG);
192                                         i += 16;
193                                         len -= 16;
194                                 } while (len > 0);
195                         } else {
196                                 /* write to register */
197                                 u8 obuf[msg[0].len + 2];
198                                 obuf[0] = 0xaa;
199                                 obuf[1] = msg[0].len;
200                                 memcpy(obuf + 2, msg[0].buf, msg[0].len);
201                                 ret = dw2102_op_rw(d->udev, 0xc2, 0, 0,
202                                                 obuf, msg[0].len + 2, DW2102_WRITE_MSG);
203                         }
204                         break;
205                 }
206                 case(DW2102_RC_QUERY): {
207                         u8 ibuf[2];
208                         ret  = dw2102_op_rw(d->udev, 0xb8, 0, 0,
209                                         ibuf, 2, DW2102_READ_MSG);
210                         memcpy(msg[0].buf, ibuf , 2);
211                         break;
212                 }
213                 case(DW2102_VOLTAGE_CTRL): {
214                         u8 obuf[2];
215                         obuf[0] = 0x30;
216                         obuf[1] = msg[0].buf[0];
217                         ret = dw2102_op_rw(d->udev, 0xb2, 0, 0,
218                                         obuf, 2, DW2102_WRITE_MSG);
219                         break;
220                 }
221                 }
222
223                 break;
224         }
225
226         mutex_unlock(&d->i2c_mutex);
227         return num;
228 }
229
230 static u32 dw2102_i2c_func(struct i2c_adapter *adapter)
231 {
232         return I2C_FUNC_I2C;
233 }
234
235 static struct i2c_algorithm dw2102_i2c_algo = {
236         .master_xfer = dw2102_i2c_transfer,
237         .functionality = dw2102_i2c_func,
238 };
239
240 static struct i2c_algorithm dw2104_i2c_algo = {
241         .master_xfer = dw2104_i2c_transfer,
242         .functionality = dw2102_i2c_func,
243 };
244
245 static int dw2102_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
246 {
247         int i;
248         u8 ibuf[] = {0, 0};
249         u8 eeprom[256], eepromline[16];
250
251         for (i = 0; i < 256; i++) {
252                 if (dw2102_op_rw(d->udev, 0xb6, 0xa0 , i, ibuf, 2, DW2102_READ_MSG) < 0) {
253                         err("read eeprom failed.");
254                         return -1;
255                 } else {
256                         eepromline[i%16] = ibuf[0];
257                         eeprom[i] = ibuf[0];
258                 }
259                 if ((i % 16) == 15) {
260                         deb_xfer("%02x: ", i - 15);
261                         debug_dump(eepromline, 16, deb_xfer);
262                 }
263         }
264         memcpy(mac, eeprom + 8, 6);
265         return 0;
266 };
267
268 static int dw2102_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
269 {
270         static u8 command_13v[1] = {0x00};
271         static u8 command_18v[1] = {0x01};
272         struct i2c_msg msg[] = {
273                 {.addr = DW2102_VOLTAGE_CTRL, .flags = 0,
274                         .buf = command_13v, .len = 1},
275         };
276
277         struct dvb_usb_adapter *udev_adap =
278                 (struct dvb_usb_adapter *)(fe->dvb->priv);
279         if (voltage == SEC_VOLTAGE_18)
280                 msg[0].buf = command_18v;
281         i2c_transfer(&udev_adap->dev->i2c_adap, msg, 1);
282         return 0;
283 }
284
285 static struct cx24116_config dw2104_config = {
286         .demod_address = 0x55,
287         .mpg_clk_pos_pol = 0x01,
288 };
289
290 static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
291 {
292         if ((d->fe = dvb_attach(cx24116_attach, &dw2104_config,
293                         &d->dev->i2c_adap)) != NULL) {
294                 d->fe->ops.set_voltage = dw2102_set_voltage;
295                 info("Attached cx24116!\n");
296                 return 0;
297         }
298         return -EIO;
299 }
300
301 static int dw2102_frontend_attach(struct dvb_usb_adapter *d)
302 {
303         d->fe = dvb_attach(stv0299_attach, &sharp_z0194a_config,
304                 &d->dev->i2c_adap);
305         if (d->fe != NULL) {
306                 d->fe->ops.set_voltage = dw2102_set_voltage;
307                 info("Attached stv0299!\n");
308                 return 0;
309         }
310         return -EIO;
311 }
312
313 static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
314 {
315         dvb_attach(dvb_pll_attach, adap->fe, 0x60,
316                 &adap->dev->i2c_adap, DVB_PLL_OPERA1);
317         return 0;
318 }
319
320 static struct dvb_usb_rc_key dw2102_rc_keys[] = {
321         { 0xf8, 0x0a, KEY_Q },          /*power*/
322         { 0xf8, 0x0c, KEY_M },          /*mute*/
323         { 0xf8, 0x11, KEY_1 },
324         { 0xf8, 0x12, KEY_2 },
325         { 0xf8, 0x13, KEY_3 },
326         { 0xf8, 0x14, KEY_4 },
327         { 0xf8, 0x15, KEY_5 },
328         { 0xf8, 0x16, KEY_6 },
329         { 0xf8, 0x17, KEY_7 },
330         { 0xf8, 0x18, KEY_8 },
331         { 0xf8, 0x19, KEY_9 },
332         { 0xf8, 0x10, KEY_0 },
333         { 0xf8, 0x1c, KEY_PAGEUP },     /*ch+*/
334         { 0xf8, 0x0f, KEY_PAGEDOWN },   /*ch-*/
335         { 0xf8, 0x1a, KEY_O },          /*vol+*/
336         { 0xf8, 0x0e, KEY_Z },          /*vol-*/
337         { 0xf8, 0x04, KEY_R },          /*rec*/
338         { 0xf8, 0x09, KEY_D },          /*fav*/
339         { 0xf8, 0x08, KEY_BACKSPACE },  /*rewind*/
340         { 0xf8, 0x07, KEY_A },          /*fast*/
341         { 0xf8, 0x0b, KEY_P },          /*pause*/
342         { 0xf8, 0x02, KEY_ESC },        /*cancel*/
343         { 0xf8, 0x03, KEY_G },          /*tab*/
344         { 0xf8, 0x00, KEY_UP },         /*up*/
345         { 0xf8, 0x1f, KEY_ENTER },      /*ok*/
346         { 0xf8, 0x01, KEY_DOWN },       /*down*/
347         { 0xf8, 0x05, KEY_C },          /*cap*/
348         { 0xf8, 0x06, KEY_S },          /*stop*/
349         { 0xf8, 0x40, KEY_F },          /*full*/
350         { 0xf8, 0x1e, KEY_W },          /*tvmode*/
351         { 0xf8, 0x1b, KEY_B },          /*recall*/
352
353 };
354
355
356
357 static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
358 {
359         struct dw2102_state *st = d->priv;
360         u8 key[2];
361         struct i2c_msg msg[] = {
362                 {.addr = DW2102_RC_QUERY, .flags = I2C_M_RD, .buf = key,
363                 .len = 2},
364         };
365         int i;
366
367         *state = REMOTE_NO_KEY_PRESSED;
368         if (dw2102_i2c_transfer(&d->i2c_adap, msg, 1) == 1) {
369                 for (i = 0; i < ARRAY_SIZE(dw2102_rc_keys); i++) {
370                         if (dw2102_rc_keys[i].data == msg[0].buf[0]) {
371                                 *state = REMOTE_KEY_PRESSED;
372                                 *event = dw2102_rc_keys[i].event;
373                                 st->last_key_pressed =
374                                         dw2102_rc_keys[i].event;
375                                 break;
376                         }
377                 st->last_key_pressed = 0;
378                 }
379         }
380         /* info("key: %x %x\n",key[0],key[1]); */
381         return 0;
382 }
383
384 static struct usb_device_id dw2102_table[] = {
385         {USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW2102)},
386         {USB_DEVICE(USB_VID_CYPRESS, 0x2101)},
387         {USB_DEVICE(USB_VID_CYPRESS, 0x2104)},
388         {USB_DEVICE(0x9022, 0xd650)},
389         { }
390 };
391
392 MODULE_DEVICE_TABLE(usb, dw2102_table);
393
394 static int dw2102_load_firmware(struct usb_device *dev,
395                         const struct firmware *frmwr)
396 {
397         u8 *b, *p;
398         int ret = 0, i;
399         u8 reset;
400         u8 reset16 [] = {0, 0, 0, 0, 0, 0, 0};
401         const struct firmware *fw;
402         const char *filename = "dvb-usb-dw2101.fw";
403         switch (dev->descriptor.idProduct) {
404         case 0x2101:
405                 ret = request_firmware(&fw, filename, &dev->dev);
406                 if (ret != 0) {
407                         err("did not find the firmware file. (%s) "
408                         "Please see linux/Documentation/dvb/ for more details "
409                         "on firmware-problems.", filename);
410                         return ret;
411                 }
412                 break;
413         default:
414                 fw = frmwr;
415                 break;
416         }
417         info("start downloading DW210X firmware");
418         p = kmalloc(fw->size, GFP_KERNEL);
419         reset = 1;
420         /*stop the CPU*/
421         dw2102_op_rw(dev, 0xa0, 0x7f92, 0, &reset, 1, DW2102_WRITE_MSG);
422         dw2102_op_rw(dev, 0xa0, 0xe600, 0, &reset, 1, DW2102_WRITE_MSG);
423
424         if (p != NULL) {
425                 memcpy(p, fw->data, fw->size);
426                 for (i = 0; i < fw->size; i += 0x40) {
427                         b = (u8 *) p + i;
428                         if (dw2102_op_rw(dev, 0xa0, i, 0, b , 0x40,
429                                         DW2102_WRITE_MSG) != 0x40) {
430                                 err("error while transferring firmware");
431                                 ret = -EINVAL;
432                                 break;
433                         }
434                 }
435                 /* restart the CPU */
436                 reset = 0;
437                 if (ret || dw2102_op_rw(dev, 0xa0, 0x7f92, 0, &reset, 1,
438                                         DW2102_WRITE_MSG) != 1) {
439                         err("could not restart the USB controller CPU.");
440                         ret = -EINVAL;
441                 }
442                 if (ret || dw2102_op_rw(dev, 0xa0, 0xe600, 0, &reset, 1,
443                                         DW2102_WRITE_MSG) != 1) {
444                         err("could not restart the USB controller CPU.");
445                         ret = -EINVAL;
446                 }
447                 /* init registers */
448                 switch (dev->descriptor.idProduct) {
449                 case USB_PID_DW2104:
450                 case 0xd650:
451                         reset = 1;
452                         dw2102_op_rw(dev, 0xc4, 0x0000, 0, &reset, 1,
453                                         DW2102_WRITE_MSG);
454                         reset = 0;
455                         dw2102_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0,
456                                         DW2102_WRITE_MSG);
457                         break;
458                 case USB_PID_DW2102:
459                         dw2102_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0,
460                                         DW2102_WRITE_MSG);
461                         dw2102_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2,
462                                         DW2102_READ_MSG);
463                         break;
464                 case 0x2101:
465                         dw2102_op_rw(dev, 0xbc, 0x0030, 0, &reset16[0], 2,
466                                         DW2102_READ_MSG);
467                         dw2102_op_rw(dev, 0xba, 0x0000, 0, &reset16[0], 7,
468                                         DW2102_READ_MSG);
469                         dw2102_op_rw(dev, 0xba, 0x0000, 0, &reset16[0], 7,
470                                         DW2102_READ_MSG);
471                         dw2102_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2,
472                                         DW2102_READ_MSG);
473                         break;
474                 }
475                 msleep(100);
476                 kfree(p);
477         }
478         return ret;
479 }
480
481 static struct dvb_usb_device_properties dw2102_properties = {
482         .caps = DVB_USB_IS_AN_I2C_ADAPTER,
483         .usb_ctrl = DEVICE_SPECIFIC,
484         .firmware = "dvb-usb-dw2102.fw",
485         .size_of_priv = sizeof(struct dw2102_state),
486         .no_reconnect = 1,
487
488         .i2c_algo = &dw2102_i2c_algo,
489         .rc_key_map = dw2102_rc_keys,
490         .rc_key_map_size = ARRAY_SIZE(dw2102_rc_keys),
491         .rc_interval = 150,
492         .rc_query = dw2102_rc_query,
493
494         .generic_bulk_ctrl_endpoint = 0x81,
495         /* parameter for the MPEG2-data transfer */
496         .num_adapters = 1,
497         .download_firmware = dw2102_load_firmware,
498         .read_mac_address = dw2102_read_mac_address,
499                 .adapter = {
500                 {
501                         .frontend_attach = dw2102_frontend_attach,
502                         .streaming_ctrl = NULL,
503                         .tuner_attach = dw2102_tuner_attach,
504                         .stream = {
505                                 .type = USB_BULK,
506                                 .count = 8,
507                                 .endpoint = 0x82,
508                                 .u = {
509                                         .bulk = {
510                                                 .buffersize = 4096,
511                                         }
512                                 }
513                         },
514                 }
515         },
516         .num_device_descs = 2,
517         .devices = {
518                 {"DVBWorld DVB-S 2102 USB2.0",
519                         {&dw2102_table[0], NULL},
520                         {NULL},
521                 },
522                 {"DVBWorld DVB-S 2101 USB2.0",
523                         {&dw2102_table[1], NULL},
524                         {NULL},
525                 },
526         }
527 };
528
529 static struct dvb_usb_device_properties dw2104_properties = {
530         .caps = DVB_USB_IS_AN_I2C_ADAPTER,
531         .usb_ctrl = DEVICE_SPECIFIC,
532         .firmware = "dvb-usb-dw2104.fw",
533         .size_of_priv = sizeof(struct dw2102_state),
534         .no_reconnect = 1,
535
536         .i2c_algo = &dw2104_i2c_algo,
537         .rc_key_map = dw2102_rc_keys,
538         .rc_key_map_size = ARRAY_SIZE(dw2102_rc_keys),
539         .rc_interval = 150,
540         .rc_query = dw2102_rc_query,
541
542         .generic_bulk_ctrl_endpoint = 0x81,
543         /* parameter for the MPEG2-data transfer */
544         .num_adapters = 1,
545         .download_firmware = dw2102_load_firmware,
546         .read_mac_address = dw2102_read_mac_address,
547         .adapter = {
548                 {
549                         .frontend_attach = dw2104_frontend_attach,
550                         .streaming_ctrl = NULL,
551                         /*.tuner_attach = dw2104_tuner_attach,*/
552                         .stream = {
553                                 .type = USB_BULK,
554                                 .count = 8,
555                                 .endpoint = 0x82,
556                                 .u = {
557                                         .bulk = {
558                                                 .buffersize = 4096,
559                                         }
560                                 }
561                         },
562                 }
563         },
564         .num_device_descs = 2,
565         .devices = {
566                 { "DVBWorld DW2104 USB2.0",
567                         {&dw2102_table[2], NULL},
568                         {NULL},
569                 },
570                 { "TeVii S650 USB2.0",
571                         {&dw2102_table[3], NULL},
572                         {NULL},
573                 },
574         }
575 };
576
577 static int dw2102_probe(struct usb_interface *intf,
578                 const struct usb_device_id *id)
579 {
580         if (0 == dvb_usb_device_init(intf, &dw2102_properties,
581                         THIS_MODULE, NULL, adapter_nr) ||
582             0 == dvb_usb_device_init(intf, &dw2104_properties,
583                         THIS_MODULE, NULL, adapter_nr)) {
584                 return 0;
585         }
586         return -ENODEV;
587 }
588
589 static struct usb_driver dw2102_driver = {
590         .name = "dw2102",
591         .probe = dw2102_probe,
592         .disconnect = dvb_usb_device_exit,
593         .id_table = dw2102_table,
594 };
595
596 static int __init dw2102_module_init(void)
597 {
598         int ret =  usb_register(&dw2102_driver);
599         if (ret)
600                 err("usb_register failed. Error number %d", ret);
601
602         return ret;
603 }
604
605 static void __exit dw2102_module_exit(void)
606 {
607         usb_deregister(&dw2102_driver);
608 }
609
610 module_init(dw2102_module_init);
611 module_exit(dw2102_module_exit);
612
613 MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
614 MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104 USB2.0 device");
615 MODULE_VERSION("0.1");
616 MODULE_LICENSE("GPL");