23 #include <linux/module.h>
24 #include <linux/kernel.h>
25 #include <linux/slab.h>
27 #include <linux/i2c.h>
33 #define USB_TIMEOUT (5 * HZ)
49 pipe = usb_rcvctrlpipe(dev->
udev, 0);
51 pipe = usb_sndctrlpipe(dev->
udev, 0);
59 (req_type & USB_DIR_IN) ?
" IN" :
"OUT",
60 req_type, req, value&0xff, value>>8, index&0xff,
61 index>>8, len&0xff, len>>8);
63 if (!(req_type & USB_DIR_IN)) {
65 for (i = 0; i < len; i++)
74 if (req_type & USB_DIR_IN)
79 if (req_type & USB_DIR_IN)
83 }
else if (req_type & USB_DIR_IN) {
85 for (i = 0; i < len; i++)
99 tsleep = (len * 200) + 200;
115 req, value, index,
NULL, 0);
125 value, index, buf, 1);
147 new_index = (buf[0] & ~mask) | (index & mask);
149 if (new_index == buf[0])
153 req, value, new_index,
NULL, 0);
163 value, index, buf, 2);
168 return buf[1]|buf[0]<<8;
177 value, index, buf, 4);
182 return buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24;
346 if (dev->
gpio.dvb_led) {
348 dev->
gpio.dvb_led, 0x01);
397 if (dev->
gpio.dvb_led) {
399 dev->
gpio.dvb_led, 0x00);
413 static struct reg_init tm6000_init_tab[] = {
481 static struct reg_init tm6010_init_tab[] = {
573 switch (board & 0xff) {
588 printk(
KERN_ERR "Error %i while retrieving board version\n", board);
591 tab = tm6010_init_tab;
594 tab = tm6000_init_tab;
603 "reg %d to value %d\n", rc,
604 tab[
i].req, tab[
i].reg, tab[
i].val);
666 switch (dev->
rinput.amux) {
696 switch (dev->
rinput.amux) {
726 static void tm6010_set_mute_adc(
struct tm6000_core *dev,
u8 mute)
759 tm6010_set_mute_sif(dev, mute);
762 " SIF audio inputs. Please check the %s"
763 " configuration.\n", dev->
name);
769 tm6010_set_mute_adc(dev, mute);
778 static void tm6010_set_volume_sif(
struct tm6000_core *dev,
int vol)
782 vol_reg = vol & 0x0F;
791 static void tm6010_set_volume_adc(
struct tm6000_core *dev,
int vol)
795 vol_reg = (vol + 0x10) & 0x1f;
820 tm6010_set_volume_sif(dev, vol);
823 " SIF audio inputs. Please check the %s"
824 " configuration.\n", dev->
name);
828 tm6010_set_volume_adc(dev, vol);
860 static LIST_HEAD(tm6000_extension_devlist);
869 if (!list_empty(&tm6000_extension_devlist)) {
914 if (!list_empty(&tm6000_extension_devlist)) {
928 if (!list_empty(&tm6000_extension_devlist)) {