diff options
author | Timofey Trofimov <tumoxep@gmail.com> | 2010-05-29 12:52:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 13:05:44 -0400 |
commit | 52e0a72a0c6f61c26a16b5684f4eb30a6fbf8b83 (patch) | |
tree | 924335e3c5e4f1b117aa252e9192fc4d5c24d40d /drivers | |
parent | cee3926f5f245811ef7172405253815e7f3e15e1 (diff) |
V4L/DVB: Staging: tm6000: Fix coding style issues
Fixed coding style issues founded by checkpatch.pl in files:
tm6000-alsa.c,tm6000-cards, tm6000-core.c, tm6000-dvb.c, tm6000-i2c.c,
tm6000-stds.c, tm6000-usb-isoc.h, tm6000.h
[mchehab@redhat.com: Fix some compilation breakages]
Signed-off-by: Timofey Trofimov <tumoxep@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/tm6000/tm6000-cards.c | 2 | ||||
-rw-r--r-- | drivers/staging/tm6000/tm6000-core.c | 149 | ||||
-rw-r--r-- | drivers/staging/tm6000/tm6000-dvb.c | 92 | ||||
-rw-r--r-- | drivers/staging/tm6000/tm6000-i2c.c | 25 | ||||
-rw-r--r-- | drivers/staging/tm6000/tm6000-stds.c | 6 | ||||
-rw-r--r-- | drivers/staging/tm6000/tm6000.h | 51 |
6 files changed, 154 insertions, 171 deletions
diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index 52e086a38b9b..48ab5734cde5 100644 --- a/drivers/staging/tm6000/tm6000-cards.c +++ b/drivers/staging/tm6000/tm6000-cards.c | |||
@@ -705,7 +705,7 @@ static void get_max_endpoint(struct usb_device *udev, | |||
705 | unsigned int size = tmp & 0x7ff; | 705 | unsigned int size = tmp & 0x7ff; |
706 | 706 | ||
707 | if (udev->speed == USB_SPEED_HIGH) | 707 | if (udev->speed == USB_SPEED_HIGH) |
708 | size = size * hb_mult (tmp); | 708 | size = size * hb_mult(tmp); |
709 | 709 | ||
710 | if (size > tm_ep->maxsize) { | 710 | if (size > tm_ep->maxsize) { |
711 | tm_ep->endp = curr_e; | 711 | tm_ep->endp = curr_e; |
diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index 90e745802a36..3d66f9bbfc59 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c | |||
@@ -32,66 +32,64 @@ | |||
32 | 32 | ||
33 | #define USB_TIMEOUT 5*HZ /* ms */ | 33 | #define USB_TIMEOUT 5*HZ /* ms */ |
34 | 34 | ||
35 | int tm6000_read_write_usb (struct tm6000_core *dev, u8 req_type, u8 req, | 35 | int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req, |
36 | u16 value, u16 index, u8 *buf, u16 len) | 36 | u16 value, u16 index, u8 *buf, u16 len) |
37 | { | 37 | { |
38 | int ret, i; | 38 | int ret, i; |
39 | unsigned int pipe; | 39 | unsigned int pipe; |
40 | static int ini=0, last=0, n=0; | 40 | static int ini = 0, last = 0, n = 0; |
41 | u8 *data=NULL; | 41 | u8 *data = NULL; |
42 | 42 | ||
43 | if (len) | 43 | if (len) |
44 | data = kzalloc(len, GFP_KERNEL); | 44 | data = kzalloc(len, GFP_KERNEL); |
45 | 45 | ||
46 | 46 | ||
47 | if (req_type & USB_DIR_IN) | 47 | if (req_type & USB_DIR_IN) |
48 | pipe=usb_rcvctrlpipe(dev->udev, 0); | 48 | pipe = usb_rcvctrlpipe(dev->udev, 0); |
49 | else { | 49 | else { |
50 | pipe=usb_sndctrlpipe(dev->udev, 0); | 50 | pipe = usb_sndctrlpipe(dev->udev, 0); |
51 | memcpy(data, buf, len); | 51 | memcpy(data, buf, len); |
52 | } | 52 | } |
53 | 53 | ||
54 | if (tm6000_debug & V4L2_DEBUG_I2C) { | 54 | if (tm6000_debug & V4L2_DEBUG_I2C) { |
55 | if (!ini) | 55 | if (!ini) |
56 | last=ini=jiffies; | 56 | last = ini = jiffies; |
57 | 57 | ||
58 | printk("%06i (dev %p, pipe %08x): ", n, dev->udev, pipe); | 58 | printk("%06i (dev %p, pipe %08x): ", n, dev->udev, pipe); |
59 | 59 | ||
60 | printk( "%s: %06u ms %06u ms %02x %02x %02x %02x %02x %02x %02x %02x ", | 60 | printk("%s: %06u ms %06u ms %02x %02x %02x %02x %02x %02x %02x %02x ", |
61 | (req_type & USB_DIR_IN)?" IN":"OUT", | 61 | (req_type & USB_DIR_IN) ? " IN" : "OUT", |
62 | jiffies_to_msecs(jiffies-last), | 62 | jiffies_to_msecs(jiffies-last), |
63 | jiffies_to_msecs(jiffies-ini), | 63 | jiffies_to_msecs(jiffies-ini), |
64 | req_type, req,value&0xff,value>>8, index&0xff, index>>8, | 64 | req_type, req, value&0xff, value>>8, index&0xff, |
65 | len&0xff, len>>8); | 65 | index>>8, len&0xff, len>>8); |
66 | last=jiffies; | 66 | last = jiffies; |
67 | n++; | 67 | n++; |
68 | 68 | ||
69 | if ( !(req_type & USB_DIR_IN) ) { | 69 | if (!(req_type & USB_DIR_IN)) { |
70 | printk(">>> "); | 70 | printk(">>> "); |
71 | for (i=0;i<len;i++) { | 71 | for (i = 0; i < len; i++) |
72 | printk(" %02x",buf[i]); | 72 | printk(" %02x", buf[i]); |
73 | } | ||
74 | printk("\n"); | 73 | printk("\n"); |
75 | } | 74 | } |
76 | } | 75 | } |
77 | 76 | ||
78 | ret = usb_control_msg(dev->udev, pipe, req, req_type, value, index, data, | 77 | ret = usb_control_msg(dev->udev, pipe, req, req_type, value, index, |
79 | len, USB_TIMEOUT); | 78 | data, len, USB_TIMEOUT); |
80 | 79 | ||
81 | if (req_type & USB_DIR_IN) | 80 | if (req_type & USB_DIR_IN) |
82 | memcpy(buf, data, len); | 81 | memcpy(buf, data, len); |
83 | 82 | ||
84 | if (tm6000_debug & V4L2_DEBUG_I2C) { | 83 | if (tm6000_debug & V4L2_DEBUG_I2C) { |
85 | if (ret<0) { | 84 | if (ret < 0) { |
86 | if (req_type & USB_DIR_IN) | 85 | if (req_type & USB_DIR_IN) |
87 | printk("<<< (len=%d)\n",len); | 86 | printk("<<< (len=%d)\n", len); |
88 | 87 | ||
89 | printk("%s: Error #%d\n", __FUNCTION__, ret); | 88 | printk("%s: Error #%d\n", __FUNCTION__, ret); |
90 | } else if (req_type & USB_DIR_IN) { | 89 | } else if (req_type & USB_DIR_IN) { |
91 | printk("<<< "); | 90 | printk("<<< "); |
92 | for (i=0;i<len;i++) { | 91 | for (i = 0; i < len; i++) |
93 | printk(" %02x",buf[i]); | 92 | printk(" %02x", buf[i]); |
94 | } | ||
95 | printk("\n"); | 93 | printk("\n"); |
96 | } | 94 | } |
97 | } | 95 | } |
@@ -103,52 +101,52 @@ int tm6000_read_write_usb (struct tm6000_core *dev, u8 req_type, u8 req, | |||
103 | return ret; | 101 | return ret; |
104 | } | 102 | } |
105 | 103 | ||
106 | int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index) | 104 | int tm6000_set_reg(struct tm6000_core *dev, u8 req, u16 value, u16 index) |
107 | { | 105 | { |
108 | return | 106 | return |
109 | tm6000_read_write_usb (dev, USB_DIR_OUT | USB_TYPE_VENDOR, | 107 | tm6000_read_write_usb(dev, USB_DIR_OUT | USB_TYPE_VENDOR, |
110 | req, value, index, NULL, 0); | 108 | req, value, index, NULL, 0); |
111 | } | 109 | } |
112 | EXPORT_SYMBOL_GPL(tm6000_set_reg); | 110 | EXPORT_SYMBOL_GPL(tm6000_set_reg); |
113 | 111 | ||
114 | int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index) | 112 | int tm6000_get_reg(struct tm6000_core *dev, u8 req, u16 value, u16 index) |
115 | { | 113 | { |
116 | int rc; | 114 | int rc; |
117 | u8 buf[1]; | 115 | u8 buf[1]; |
118 | 116 | ||
119 | rc=tm6000_read_write_usb (dev, USB_DIR_IN | USB_TYPE_VENDOR, req, | 117 | rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR, req, |
120 | value, index, buf, 1); | 118 | value, index, buf, 1); |
121 | 119 | ||
122 | if (rc<0) | 120 | if (rc < 0) |
123 | return rc; | 121 | return rc; |
124 | 122 | ||
125 | return *buf; | 123 | return *buf; |
126 | } | 124 | } |
127 | EXPORT_SYMBOL_GPL(tm6000_get_reg); | 125 | EXPORT_SYMBOL_GPL(tm6000_get_reg); |
128 | 126 | ||
129 | int tm6000_get_reg16 (struct tm6000_core *dev, u8 req, u16 value, u16 index) | 127 | int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index) |
130 | { | 128 | { |
131 | int rc; | 129 | int rc; |
132 | u8 buf[2]; | 130 | u8 buf[2]; |
133 | 131 | ||
134 | rc=tm6000_read_write_usb (dev, USB_DIR_IN | USB_TYPE_VENDOR, req, | 132 | rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR, req, |
135 | value, index, buf, 2); | 133 | value, index, buf, 2); |
136 | 134 | ||
137 | if (rc<0) | 135 | if (rc < 0) |
138 | return rc; | 136 | return rc; |
139 | 137 | ||
140 | return buf[1]|buf[0]<<8; | 138 | return buf[1]|buf[0]<<8; |
141 | } | 139 | } |
142 | 140 | ||
143 | int tm6000_get_reg32 (struct tm6000_core *dev, u8 req, u16 value, u16 index) | 141 | int tm6000_get_reg32(struct tm6000_core *dev, u8 req, u16 value, u16 index) |
144 | { | 142 | { |
145 | int rc; | 143 | int rc; |
146 | u8 buf[4]; | 144 | u8 buf[4]; |
147 | 145 | ||
148 | rc=tm6000_read_write_usb (dev, USB_DIR_IN | USB_TYPE_VENDOR, req, | 146 | rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR, req, |
149 | value, index, buf, 4); | 147 | value, index, buf, 4); |
150 | 148 | ||
151 | if (rc<0) | 149 | if (rc < 0) |
152 | return rc; | 150 | return rc; |
153 | 151 | ||
154 | return buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24; | 152 | return buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24; |
@@ -188,7 +186,7 @@ void tm6000_set_fourcc_format(struct tm6000_core *dev) | |||
188 | } | 186 | } |
189 | } | 187 | } |
190 | 188 | ||
191 | int tm6000_init_analog_mode (struct tm6000_core *dev) | 189 | int tm6000_init_analog_mode(struct tm6000_core *dev) |
192 | { | 190 | { |
193 | if (dev->dev_type == TM6010) { | 191 | if (dev->dev_type == TM6010) { |
194 | int val; | 192 | int val; |
@@ -294,12 +292,10 @@ int tm6000_init_analog_mode (struct tm6000_core *dev) | |||
294 | /* Enables soft reset */ | 292 | /* Enables soft reset */ |
295 | tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x01); | 293 | tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x01); |
296 | 294 | ||
297 | if (dev->scaler) { | 295 | if (dev->scaler) |
298 | tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x20); | 296 | tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x20); |
299 | } else { | 297 | else /* Enable Hfilter and disable TS Drop err */ |
300 | /* Enable Hfilter and disable TS Drop err */ | ||
301 | tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x80); | 298 | tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x80); |
302 | } | ||
303 | 299 | ||
304 | tm6000_set_reg(dev, TM6010_REQ07_RC3_HSTART1, 0x88); | 300 | tm6000_set_reg(dev, TM6010_REQ07_RC3_HSTART1, 0x88); |
305 | tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_WAKEUP_SEL, 0x23); | 301 | tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_WAKEUP_SEL, 0x23); |
@@ -332,13 +328,13 @@ int tm6000_init_analog_mode (struct tm6000_core *dev) | |||
332 | /*FIXME: Hack!!! */ | 328 | /*FIXME: Hack!!! */ |
333 | struct v4l2_frequency f; | 329 | struct v4l2_frequency f; |
334 | mutex_lock(&dev->lock); | 330 | mutex_lock(&dev->lock); |
335 | f.frequency=dev->freq; | 331 | f.frequency = dev->freq; |
336 | v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f); | 332 | v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f); |
337 | mutex_unlock(&dev->lock); | 333 | mutex_unlock(&dev->lock); |
338 | 334 | ||
339 | msleep(100); | 335 | msleep(100); |
340 | tm6000_set_standard (dev, &dev->norm); | 336 | tm6000_set_standard(dev, &dev->norm); |
341 | tm6000_set_audio_bitrate (dev,48000); | 337 | tm6000_set_audio_bitrate(dev, 48000); |
342 | 338 | ||
343 | /* switch dvb led off */ | 339 | /* switch dvb led off */ |
344 | if (dev->gpio.dvb_led) { | 340 | if (dev->gpio.dvb_led) { |
@@ -349,7 +345,7 @@ int tm6000_init_analog_mode (struct tm6000_core *dev) | |||
349 | return 0; | 345 | return 0; |
350 | } | 346 | } |
351 | 347 | ||
352 | int tm6000_init_digital_mode (struct tm6000_core *dev) | 348 | int tm6000_init_digital_mode(struct tm6000_core *dev) |
353 | { | 349 | { |
354 | if (dev->dev_type == TM6010) { | 350 | if (dev->dev_type == TM6010) { |
355 | int val; | 351 | int val; |
@@ -366,10 +362,8 @@ int tm6000_init_digital_mode (struct tm6000_core *dev) | |||
366 | tm6000_set_reg(dev, TM6010_REQ08_RE2_POWER_DOWN_CTRL1, 0xfc); | 362 | tm6000_set_reg(dev, TM6010_REQ08_RE2_POWER_DOWN_CTRL1, 0xfc); |
367 | tm6000_set_reg(dev, TM6010_REQ08_RE6_POWER_DOWN_CTRL2, 0xff); | 363 | tm6000_set_reg(dev, TM6010_REQ08_RE6_POWER_DOWN_CTRL2, 0xff); |
368 | tm6000_set_reg(dev, TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfe); | 364 | tm6000_set_reg(dev, TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfe); |
369 | tm6000_read_write_usb (dev, 0xc0, 0x0e, 0x00c2, 0x0008, buf, 2); | 365 | tm6000_read_write_usb(dev, 0xc0, 0x0e, 0x00c2, 0x0008, buf, 2); |
370 | printk (KERN_INFO "buf %#x %#x \n", buf[0], buf[1]); | 366 | printk(KERN_INFO"buf %#x %#x\n", buf[0], buf[1]); |
371 | |||
372 | |||
373 | } else { | 367 | } else { |
374 | tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x08); | 368 | tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x08); |
375 | tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x00); | 369 | tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x00); |
@@ -377,7 +371,7 @@ int tm6000_init_digital_mode (struct tm6000_core *dev) | |||
377 | tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_PULSE_CNT0, 0x08); | 371 | tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_PULSE_CNT0, 0x08); |
378 | tm6000_set_reg(dev, TM6010_REQ07_RE2_OUT_SEL2, 0x0c); | 372 | tm6000_set_reg(dev, TM6010_REQ07_RE2_OUT_SEL2, 0x0c); |
379 | tm6000_set_reg(dev, TM6010_REQ07_RE8_TYPESEL_MOS_I2S, 0xff); | 373 | tm6000_set_reg(dev, TM6010_REQ07_RE8_TYPESEL_MOS_I2S, 0xff); |
380 | tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00eb, 0xd8); | 374 | tm6000_set_reg(dev, REQ_07_SET_GET_AVREG, 0x00eb, 0xd8); |
381 | tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x40); | 375 | tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x40); |
382 | tm6000_set_reg(dev, TM6010_REQ07_RC1_TRESHOLD, 0xd0); | 376 | tm6000_set_reg(dev, TM6010_REQ07_RC1_TRESHOLD, 0xd0); |
383 | tm6000_set_reg(dev, TM6010_REQ07_RC3_HSTART1, 0x09); | 377 | tm6000_set_reg(dev, TM6010_REQ07_RC3_HSTART1, 0x09); |
@@ -388,14 +382,14 @@ int tm6000_init_digital_mode (struct tm6000_core *dev) | |||
388 | 382 | ||
389 | tm6000_set_reg(dev, TM6010_REQ07_RE2_OUT_SEL2, 0x0c); | 383 | tm6000_set_reg(dev, TM6010_REQ07_RE2_OUT_SEL2, 0x0c); |
390 | tm6000_set_reg(dev, TM6010_REQ07_RE8_TYPESEL_MOS_I2S, 0xff); | 384 | tm6000_set_reg(dev, TM6010_REQ07_RE8_TYPESEL_MOS_I2S, 0xff); |
391 | tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00eb, 0x08); | 385 | tm6000_set_reg(dev, REQ_07_SET_GET_AVREG, 0x00eb, 0x08); |
392 | msleep(50); | 386 | msleep(50); |
393 | 387 | ||
394 | tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00); | 388 | tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00); |
395 | msleep(50); | 389 | msleep(50); |
396 | tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x01); | 390 | tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x01); |
397 | msleep(50); | 391 | msleep(50); |
398 | tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00); | 392 | tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00); |
399 | msleep(100); | 393 | msleep(100); |
400 | } | 394 | } |
401 | 395 | ||
@@ -567,9 +561,9 @@ struct reg_init tm6010_init_tab[] = { | |||
567 | { TM6010_REQ07_RD8_IR_WAKEUP_SEL, 0xff }, | 561 | { TM6010_REQ07_RD8_IR_WAKEUP_SEL, 0xff }, |
568 | }; | 562 | }; |
569 | 563 | ||
570 | int tm6000_init (struct tm6000_core *dev) | 564 | int tm6000_init(struct tm6000_core *dev) |
571 | { | 565 | { |
572 | int board, rc=0, i, size; | 566 | int board, rc = 0, i, size; |
573 | struct reg_init *tab; | 567 | struct reg_init *tab; |
574 | 568 | ||
575 | if (dev->dev_type == TM6010) { | 569 | if (dev->dev_type == TM6010) { |
@@ -581,12 +575,12 @@ int tm6000_init (struct tm6000_core *dev) | |||
581 | } | 575 | } |
582 | 576 | ||
583 | /* Load board's initialization table */ | 577 | /* Load board's initialization table */ |
584 | for (i=0; i< size; i++) { | 578 | for (i = 0; i < size; i++) { |
585 | rc= tm6000_set_reg (dev, tab[i].req, tab[i].reg, tab[i].val); | 579 | rc = tm6000_set_reg(dev, tab[i].req, tab[i].reg, tab[i].val); |
586 | if (rc<0) { | 580 | if (rc < 0) { |
587 | printk (KERN_ERR "Error %i while setting req %d, " | 581 | printk(KERN_ERR "Error %i while setting req %d, " |
588 | "reg %d to value %d\n", rc, | 582 | "reg %d to value %d\n", rc, |
589 | tab[i].req,tab[i].reg, tab[i].val); | 583 | tab[i].req, tab[i].reg, tab[i].val); |
590 | return rc; | 584 | return rc; |
591 | } | 585 | } |
592 | } | 586 | } |
@@ -594,12 +588,11 @@ int tm6000_init (struct tm6000_core *dev) | |||
594 | msleep(5); /* Just to be conservative */ | 588 | msleep(5); /* Just to be conservative */ |
595 | 589 | ||
596 | /* Check board version - maybe 10Moons specific */ | 590 | /* Check board version - maybe 10Moons specific */ |
597 | board=tm6000_get_reg32 (dev, REQ_40_GET_VERSION, 0, 0); | 591 | board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0); |
598 | if (board >=0) { | 592 | if (board >= 0) |
599 | printk (KERN_INFO "Board version = 0x%08x\n",board); | 593 | printk(KERN_INFO "Board version = 0x%08x\n", board); |
600 | } else { | 594 | else |
601 | printk (KERN_ERR "Error %i while retrieving board version\n",board); | 595 | printk(KERN_ERR "Error %i while retrieving board version\n", board); |
602 | } | ||
603 | 596 | ||
604 | rc = tm6000_cards_setup(dev); | 597 | rc = tm6000_cards_setup(dev); |
605 | 598 | ||
@@ -610,23 +603,23 @@ int tm6000_set_audio_bitrate(struct tm6000_core *dev, int bitrate) | |||
610 | { | 603 | { |
611 | int val; | 604 | int val; |
612 | 605 | ||
613 | val=tm6000_get_reg (dev, REQ_07_SET_GET_AVREG, 0xeb, 0x0); | 606 | val = tm6000_get_reg(dev, REQ_07_SET_GET_AVREG, 0xeb, 0x0); |
614 | printk("Original value=%d\n",val); | 607 | printk("Original value=%d\n", val); |
615 | if (val<0) | 608 | if (val < 0) |
616 | return val; | 609 | return val; |
617 | 610 | ||
618 | val &= 0x0f; /* Preserve the audio input control bits */ | 611 | val &= 0x0f; /* Preserve the audio input control bits */ |
619 | switch (bitrate) { | 612 | switch (bitrate) { |
620 | case 44100: | 613 | case 44100: |
621 | val|=0xd0; | 614 | val |= 0xd0; |
622 | dev->audio_bitrate=bitrate; | 615 | dev->audio_bitrate = bitrate; |
623 | break; | 616 | break; |
624 | case 48000: | 617 | case 48000: |
625 | val|=0x60; | 618 | val |= 0x60; |
626 | dev->audio_bitrate=bitrate; | 619 | dev->audio_bitrate = bitrate; |
627 | break; | 620 | break; |
628 | } | 621 | } |
629 | val=tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0xeb, val); | 622 | val = tm6000_set_reg(dev, REQ_07_SET_GET_AVREG, 0xeb, val); |
630 | 623 | ||
631 | return val; | 624 | return val; |
632 | } | 625 | } |
diff --git a/drivers/staging/tm6000/tm6000-dvb.c b/drivers/staging/tm6000/tm6000-dvb.c index 648ab3cfa90a..d3529ae73e2f 100644 --- a/drivers/staging/tm6000/tm6000-dvb.c +++ b/drivers/staging/tm6000/tm6000-dvb.c | |||
@@ -44,12 +44,12 @@ static int debug; | |||
44 | module_param(debug, int, 0644); | 44 | module_param(debug, int, 0644); |
45 | MODULE_PARM_DESC(debug, "enable debug message"); | 45 | MODULE_PARM_DESC(debug, "enable debug message"); |
46 | 46 | ||
47 | static void inline print_err_status (struct tm6000_core *dev, | 47 | static inline void print_err_status(struct tm6000_core *dev, |
48 | int packet, int status) | 48 | int packet, int status) |
49 | { | 49 | { |
50 | char *errmsg = "Unknown"; | 50 | char *errmsg = "Unknown"; |
51 | 51 | ||
52 | switch(status) { | 52 | switch (status) { |
53 | case -ENOENT: | 53 | case -ENOENT: |
54 | errmsg = "unlinked synchronuously"; | 54 | errmsg = "unlinked synchronuously"; |
55 | break; | 55 | break; |
@@ -75,7 +75,7 @@ static void inline print_err_status (struct tm6000_core *dev, | |||
75 | errmsg = "Device does not respond"; | 75 | errmsg = "Device does not respond"; |
76 | break; | 76 | break; |
77 | } | 77 | } |
78 | if (packet<0) { | 78 | if (packet < 0) { |
79 | dprintk(dev, 1, "URB status %d [%s].\n", | 79 | dprintk(dev, 1, "URB status %d [%s].\n", |
80 | status, errmsg); | 80 | status, errmsg); |
81 | } else { | 81 | } else { |
@@ -87,19 +87,17 @@ static void inline print_err_status (struct tm6000_core *dev, | |||
87 | static void tm6000_urb_received(struct urb *urb) | 87 | static void tm6000_urb_received(struct urb *urb) |
88 | { | 88 | { |
89 | int ret; | 89 | int ret; |
90 | struct tm6000_core* dev = urb->context; | 90 | struct tm6000_core *dev = urb->context; |
91 | 91 | ||
92 | if(urb->status != 0) { | 92 | if (urb->status != 0) |
93 | print_err_status (dev,0,urb->status); | 93 | print_err_status(dev, 0, urb->status); |
94 | } | 94 | else if (urb->actual_length > 0) |
95 | else if(urb->actual_length>0){ | ||
96 | dvb_dmx_swfilter(&dev->dvb->demux, urb->transfer_buffer, | 95 | dvb_dmx_swfilter(&dev->dvb->demux, urb->transfer_buffer, |
97 | urb->actual_length); | 96 | urb->actual_length); |
98 | } | ||
99 | 97 | ||
100 | if(dev->dvb->streams > 0) { | 98 | if (dev->dvb->streams > 0) { |
101 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 99 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
102 | if(ret < 0) { | 100 | if (ret < 0) { |
103 | printk(KERN_ERR "tm6000: error %s\n", __FUNCTION__); | 101 | printk(KERN_ERR "tm6000: error %s\n", __FUNCTION__); |
104 | kfree(urb->transfer_buffer); | 102 | kfree(urb->transfer_buffer); |
105 | usb_free_urb(urb); | 103 | usb_free_urb(urb); |
@@ -113,7 +111,7 @@ int tm6000_start_stream(struct tm6000_core *dev) | |||
113 | unsigned int pipe, size; | 111 | unsigned int pipe, size; |
114 | struct tm6000_dvb *dvb = dev->dvb; | 112 | struct tm6000_dvb *dvb = dev->dvb; |
115 | 113 | ||
116 | printk(KERN_INFO "tm6000: got start stream request %s\n",__FUNCTION__); | 114 | printk(KERN_INFO "tm6000: got start stream request %s\n", __FUNCTION__); |
117 | 115 | ||
118 | if (dev->mode != TM6000_MODE_DIGITAL) { | 116 | if (dev->mode != TM6000_MODE_DIGITAL) { |
119 | tm6000_init_digital_mode(dev); | 117 | tm6000_init_digital_mode(dev); |
@@ -121,7 +119,7 @@ int tm6000_start_stream(struct tm6000_core *dev) | |||
121 | } | 119 | } |
122 | 120 | ||
123 | dvb->bulk_urb = usb_alloc_urb(0, GFP_KERNEL); | 121 | dvb->bulk_urb = usb_alloc_urb(0, GFP_KERNEL); |
124 | if(dvb->bulk_urb == NULL) { | 122 | if (dvb->bulk_urb == NULL) { |
125 | printk(KERN_ERR "tm6000: couldn't allocate urb\n"); | 123 | printk(KERN_ERR "tm6000: couldn't allocate urb\n"); |
126 | return -ENOMEM; | 124 | return -ENOMEM; |
127 | } | 125 | } |
@@ -133,7 +131,7 @@ int tm6000_start_stream(struct tm6000_core *dev) | |||
133 | size = size * 15; /* 512 x 8 or 12 or 15 */ | 131 | size = size * 15; /* 512 x 8 or 12 or 15 */ |
134 | 132 | ||
135 | dvb->bulk_urb->transfer_buffer = kzalloc(size, GFP_KERNEL); | 133 | dvb->bulk_urb->transfer_buffer = kzalloc(size, GFP_KERNEL); |
136 | if(dvb->bulk_urb->transfer_buffer == NULL) { | 134 | if (dvb->bulk_urb->transfer_buffer == NULL) { |
137 | usb_free_urb(dvb->bulk_urb); | 135 | usb_free_urb(dvb->bulk_urb); |
138 | printk(KERN_ERR "tm6000: couldn't allocate transfer buffer!\n"); | 136 | printk(KERN_ERR "tm6000: couldn't allocate transfer buffer!\n"); |
139 | return -ENOMEM; | 137 | return -ENOMEM; |
@@ -145,20 +143,20 @@ int tm6000_start_stream(struct tm6000_core *dev) | |||
145 | tm6000_urb_received, dev); | 143 | tm6000_urb_received, dev); |
146 | 144 | ||
147 | ret = usb_clear_halt(dev->udev, pipe); | 145 | ret = usb_clear_halt(dev->udev, pipe); |
148 | if(ret < 0) { | 146 | if (ret < 0) { |
149 | printk(KERN_ERR "tm6000: error %i in %s during pipe reset\n",ret,__FUNCTION__); | 147 | printk(KERN_ERR "tm6000: error %i in %s during pipe reset\n", |
148 | ret, __FUNCTION__); | ||
150 | return ret; | 149 | return ret; |
151 | } | 150 | } else |
152 | else { | ||
153 | printk(KERN_ERR "tm6000: pipe resetted\n"); | 151 | printk(KERN_ERR "tm6000: pipe resetted\n"); |
154 | } | ||
155 | 152 | ||
156 | /* mutex_lock(&tm6000_driver.open_close_mutex); */ | 153 | /* mutex_lock(&tm6000_driver.open_close_mutex); */ |
157 | ret = usb_submit_urb(dvb->bulk_urb, GFP_KERNEL); | 154 | ret = usb_submit_urb(dvb->bulk_urb, GFP_KERNEL); |
158 | 155 | ||
159 | /* mutex_unlock(&tm6000_driver.open_close_mutex); */ | 156 | /* mutex_unlock(&tm6000_driver.open_close_mutex); */ |
160 | if (ret) { | 157 | if (ret) { |
161 | printk(KERN_ERR "tm6000: submit of urb failed (error=%i)\n",ret); | 158 | printk(KERN_ERR "tm6000: submit of urb failed (error=%i)\n", |
159 | ret); | ||
162 | 160 | ||
163 | kfree(dvb->bulk_urb->transfer_buffer); | 161 | kfree(dvb->bulk_urb->transfer_buffer); |
164 | usb_free_urb(dvb->bulk_urb); | 162 | usb_free_urb(dvb->bulk_urb); |
@@ -172,10 +170,10 @@ void tm6000_stop_stream(struct tm6000_core *dev) | |||
172 | { | 170 | { |
173 | struct tm6000_dvb *dvb = dev->dvb; | 171 | struct tm6000_dvb *dvb = dev->dvb; |
174 | 172 | ||
175 | if(dvb->bulk_urb) { | 173 | if (dvb->bulk_urb) { |
176 | printk (KERN_INFO "urb killing\n"); | 174 | printk(KERN_INFO "urb killing\n"); |
177 | usb_kill_urb(dvb->bulk_urb); | 175 | usb_kill_urb(dvb->bulk_urb); |
178 | printk (KERN_INFO "urb buffer free\n"); | 176 | printk(KERN_INFO "urb buffer free\n"); |
179 | kfree(dvb->bulk_urb->transfer_buffer); | 177 | kfree(dvb->bulk_urb->transfer_buffer); |
180 | usb_free_urb(dvb->bulk_urb); | 178 | usb_free_urb(dvb->bulk_urb); |
181 | dvb->bulk_urb = NULL; | 179 | dvb->bulk_urb = NULL; |
@@ -187,35 +185,34 @@ int tm6000_start_feed(struct dvb_demux_feed *feed) | |||
187 | struct dvb_demux *demux = feed->demux; | 185 | struct dvb_demux *demux = feed->demux; |
188 | struct tm6000_core *dev = demux->priv; | 186 | struct tm6000_core *dev = demux->priv; |
189 | struct tm6000_dvb *dvb = dev->dvb; | 187 | struct tm6000_dvb *dvb = dev->dvb; |
190 | printk(KERN_INFO "tm6000: got start feed request %s\n",__FUNCTION__); | 188 | printk(KERN_INFO "tm6000: got start feed request %s\n", __FUNCTION__); |
191 | 189 | ||
192 | mutex_lock(&dvb->mutex); | 190 | mutex_lock(&dvb->mutex); |
193 | if(dvb->streams == 0) { | 191 | if (dvb->streams == 0) { |
194 | dvb->streams = 1; | 192 | dvb->streams = 1; |
195 | /* mutex_init(&tm6000_dev->streming_mutex); */ | 193 | /* mutex_init(&tm6000_dev->streming_mutex); */ |
196 | tm6000_start_stream(dev); | 194 | tm6000_start_stream(dev); |
197 | } | 195 | } else |
198 | else { | ||
199 | ++(dvb->streams); | 196 | ++(dvb->streams); |
200 | } | ||
201 | mutex_unlock(&dvb->mutex); | 197 | mutex_unlock(&dvb->mutex); |
202 | 198 | ||
203 | return 0; | 199 | return 0; |
204 | } | 200 | } |
205 | 201 | ||
206 | int tm6000_stop_feed(struct dvb_demux_feed *feed) { | 202 | int tm6000_stop_feed(struct dvb_demux_feed *feed) |
203 | { | ||
207 | struct dvb_demux *demux = feed->demux; | 204 | struct dvb_demux *demux = feed->demux; |
208 | struct tm6000_core *dev = demux->priv; | 205 | struct tm6000_core *dev = demux->priv; |
209 | struct tm6000_dvb *dvb = dev->dvb; | 206 | struct tm6000_dvb *dvb = dev->dvb; |
210 | 207 | ||
211 | printk(KERN_INFO "tm6000: got stop feed request %s\n",__FUNCTION__); | 208 | printk(KERN_INFO "tm6000: got stop feed request %s\n", __FUNCTION__); |
212 | 209 | ||
213 | mutex_lock(&dvb->mutex); | 210 | mutex_lock(&dvb->mutex); |
214 | 211 | ||
215 | printk (KERN_INFO "stream %#x\n", dvb->streams); | 212 | printk(KERN_INFO "stream %#x\n", dvb->streams); |
216 | --(dvb->streams); | 213 | --(dvb->streams); |
217 | if(dvb->streams == 0) { | 214 | if (dvb->streams == 0) { |
218 | printk (KERN_INFO "stop stream\n"); | 215 | printk(KERN_INFO "stop stream\n"); |
219 | tm6000_stop_stream(dev); | 216 | tm6000_stop_stream(dev); |
220 | /* mutex_destroy(&tm6000_dev->streaming_mutex); */ | 217 | /* mutex_destroy(&tm6000_dev->streaming_mutex); */ |
221 | } | 218 | } |
@@ -229,9 +226,9 @@ int tm6000_dvb_attach_frontend(struct tm6000_core *dev) | |||
229 | { | 226 | { |
230 | struct tm6000_dvb *dvb = dev->dvb; | 227 | struct tm6000_dvb *dvb = dev->dvb; |
231 | 228 | ||
232 | if(dev->caps.has_zl10353) { | 229 | if (dev->caps.has_zl10353) { |
233 | struct zl10353_config config = | 230 | struct zl10353_config config = { |
234 | {.demod_address = dev->demod_addr, | 231 | .demod_address = dev->demod_addr, |
235 | .no_tuner = 1, | 232 | .no_tuner = 1, |
236 | .parallel_ts = 1, | 233 | .parallel_ts = 1, |
237 | .if2 = 45700, | 234 | .if2 = 45700, |
@@ -240,8 +237,7 @@ int tm6000_dvb_attach_frontend(struct tm6000_core *dev) | |||
240 | 237 | ||
241 | dvb->frontend = dvb_attach(zl10353_attach, &config, | 238 | dvb->frontend = dvb_attach(zl10353_attach, &config, |
242 | &dev->i2c_adap); | 239 | &dev->i2c_adap); |
243 | } | 240 | } else { |
244 | else { | ||
245 | printk(KERN_ERR "tm6000: no frontend defined for the device!\n"); | 241 | printk(KERN_ERR "tm6000: no frontend defined for the device!\n"); |
246 | return -1; | 242 | return -1; |
247 | } | 243 | } |
@@ -262,13 +258,13 @@ int register_dvb(struct tm6000_core *dev) | |||
262 | 258 | ||
263 | /* attach the frontend */ | 259 | /* attach the frontend */ |
264 | ret = tm6000_dvb_attach_frontend(dev); | 260 | ret = tm6000_dvb_attach_frontend(dev); |
265 | if(ret < 0) { | 261 | if (ret < 0) { |
266 | printk(KERN_ERR "tm6000: couldn't attach the frontend!\n"); | 262 | printk(KERN_ERR "tm6000: couldn't attach the frontend!\n"); |
267 | goto err; | 263 | goto err; |
268 | } | 264 | } |
269 | 265 | ||
270 | ret = dvb_register_adapter(&dvb->adapter, "Trident TVMaster 6000 DVB-T", | 266 | ret = dvb_register_adapter(&dvb->adapter, "Trident TVMaster 6000 DVB-T", |
271 | THIS_MODULE, &dev->udev->dev, adapter_nr); | 267 | THIS_MODULE, &dev->udev->dev, adapter_nr); |
272 | dvb->adapter.priv = dev; | 268 | dvb->adapter.priv = dev; |
273 | 269 | ||
274 | if (dvb->frontend) { | 270 | if (dvb->frontend) { |
@@ -321,9 +317,8 @@ int register_dvb(struct tm6000_core *dev) | |||
321 | break; | 317 | break; |
322 | } | 318 | } |
323 | } | 319 | } |
324 | } else { | 320 | } else |
325 | printk(KERN_ERR "tm6000: no frontend found\n"); | 321 | printk(KERN_ERR "tm6000: no frontend found\n"); |
326 | } | ||
327 | 322 | ||
328 | dvb->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING | 323 | dvb->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING |
329 | | DMX_MEMORY_BASED_FILTERING; | 324 | | DMX_MEMORY_BASED_FILTERING; |
@@ -334,7 +329,7 @@ int register_dvb(struct tm6000_core *dev) | |||
334 | dvb->demux.stop_feed = tm6000_stop_feed; | 329 | dvb->demux.stop_feed = tm6000_stop_feed; |
335 | dvb->demux.write_to_decoder = NULL; | 330 | dvb->demux.write_to_decoder = NULL; |
336 | ret = dvb_dmx_init(&dvb->demux); | 331 | ret = dvb_dmx_init(&dvb->demux); |
337 | if(ret < 0) { | 332 | if (ret < 0) { |
338 | printk("tm6000: dvb_dmx_init failed (errno = %d)\n", ret); | 333 | printk("tm6000: dvb_dmx_init failed (errno = %d)\n", ret); |
339 | goto frontend_err; | 334 | goto frontend_err; |
340 | } | 335 | } |
@@ -344,7 +339,7 @@ int register_dvb(struct tm6000_core *dev) | |||
344 | dvb->dmxdev.capabilities = 0; | 339 | dvb->dmxdev.capabilities = 0; |
345 | 340 | ||
346 | ret = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); | 341 | ret = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); |
347 | if(ret < 0) { | 342 | if (ret < 0) { |
348 | printk("tm6000: dvb_dmxdev_init failed (errno = %d)\n", ret); | 343 | printk("tm6000: dvb_dmxdev_init failed (errno = %d)\n", ret); |
349 | goto dvb_dmx_err; | 344 | goto dvb_dmx_err; |
350 | } | 345 | } |
@@ -354,7 +349,7 @@ int register_dvb(struct tm6000_core *dev) | |||
354 | dvb_dmx_err: | 349 | dvb_dmx_err: |
355 | dvb_dmx_release(&dvb->demux); | 350 | dvb_dmx_release(&dvb->demux); |
356 | frontend_err: | 351 | frontend_err: |
357 | if(dvb->frontend) { | 352 | if (dvb->frontend) { |
358 | dvb_frontend_detach(dvb->frontend); | 353 | dvb_frontend_detach(dvb->frontend); |
359 | dvb_unregister_frontend(dvb->frontend); | 354 | dvb_unregister_frontend(dvb->frontend); |
360 | } | 355 | } |
@@ -368,7 +363,7 @@ void unregister_dvb(struct tm6000_core *dev) | |||
368 | { | 363 | { |
369 | struct tm6000_dvb *dvb = dev->dvb; | 364 | struct tm6000_dvb *dvb = dev->dvb; |
370 | 365 | ||
371 | if(dvb->bulk_urb != NULL) { | 366 | if (dvb->bulk_urb != NULL) { |
372 | struct urb *bulk_urb = dvb->bulk_urb; | 367 | struct urb *bulk_urb = dvb->bulk_urb; |
373 | 368 | ||
374 | kfree(bulk_urb->transfer_buffer); | 369 | kfree(bulk_urb->transfer_buffer); |
@@ -378,7 +373,7 @@ void unregister_dvb(struct tm6000_core *dev) | |||
378 | } | 373 | } |
379 | 374 | ||
380 | /* mutex_lock(&tm6000_driver.open_close_mutex); */ | 375 | /* mutex_lock(&tm6000_driver.open_close_mutex); */ |
381 | if(dvb->frontend) { | 376 | if (dvb->frontend) { |
382 | dvb_frontend_detach(dvb->frontend); | 377 | dvb_frontend_detach(dvb->frontend); |
383 | dvb_unregister_frontend(dvb->frontend); | 378 | dvb_unregister_frontend(dvb->frontend); |
384 | } | 379 | } |
@@ -388,7 +383,6 @@ void unregister_dvb(struct tm6000_core *dev) | |||
388 | dvb_unregister_adapter(&dvb->adapter); | 383 | dvb_unregister_adapter(&dvb->adapter); |
389 | mutex_destroy(&dvb->mutex); | 384 | mutex_destroy(&dvb->mutex); |
390 | /* mutex_unlock(&tm6000_driver.open_close_mutex); */ | 385 | /* mutex_unlock(&tm6000_driver.open_close_mutex); */ |
391 | |||
392 | } | 386 | } |
393 | 387 | ||
394 | static int dvb_init(struct tm6000_core *dev) | 388 | static int dvb_init(struct tm6000_core *dev) |
diff --git a/drivers/staging/tm6000/tm6000-i2c.c b/drivers/staging/tm6000/tm6000-i2c.c index 94ff489a1bbb..79bc67f0311f 100644 --- a/drivers/staging/tm6000/tm6000-i2c.c +++ b/drivers/staging/tm6000/tm6000-i2c.c | |||
@@ -40,7 +40,7 @@ static unsigned int i2c_debug = 0; | |||
40 | module_param(i2c_debug, int, 0644); | 40 | module_param(i2c_debug, int, 0644); |
41 | MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]"); | 41 | MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]"); |
42 | 42 | ||
43 | #define i2c_dprintk(lvl,fmt, args...) if (i2c_debug>=lvl) do{ \ | 43 | #define i2c_dprintk(lvl, fmt, args...) if (i2c_debug >= lvl) do { \ |
44 | printk(KERN_DEBUG "%s at %s: " fmt, \ | 44 | printk(KERN_DEBUG "%s at %s: " fmt, \ |
45 | dev->name, __FUNCTION__ , ##args); } while (0) | 45 | dev->name, __FUNCTION__ , ##args); } while (0) |
46 | 46 | ||
@@ -171,7 +171,7 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap, | |||
171 | return 0; | 171 | return 0; |
172 | for (i = 0; i < num; i++) { | 172 | for (i = 0; i < num; i++) { |
173 | addr = (msgs[i].addr << 1) & 0xff; | 173 | addr = (msgs[i].addr << 1) & 0xff; |
174 | i2c_dprintk(2,"%s %s addr=0x%x len=%d:", | 174 | i2c_dprintk(2, "%s %s addr=0x%x len=%d:", |
175 | (msgs[i].flags & I2C_M_RD) ? "read" : "write", | 175 | (msgs[i].flags & I2C_M_RD) ? "read" : "write", |
176 | i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len); | 176 | i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len); |
177 | if (msgs[i].flags & I2C_M_RD) { | 177 | if (msgs[i].flags & I2C_M_RD) { |
@@ -235,7 +235,7 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap, | |||
235 | 235 | ||
236 | return num; | 236 | return num; |
237 | err: | 237 | err: |
238 | i2c_dprintk(2," ERROR: %i\n", rc); | 238 | i2c_dprintk(2, " ERROR: %i\n", rc); |
239 | return rc; | 239 | return rc; |
240 | } | 240 | } |
241 | 241 | ||
@@ -266,11 +266,10 @@ static int tm6000_i2c_eeprom(struct tm6000_core *dev, | |||
266 | if (0 == (i % 16)) | 266 | if (0 == (i % 16)) |
267 | printk(KERN_INFO "%s: i2c eeprom %02x:", dev->name, i); | 267 | printk(KERN_INFO "%s: i2c eeprom %02x:", dev->name, i); |
268 | printk(" %02x", eedata[i]); | 268 | printk(" %02x", eedata[i]); |
269 | if ((eedata[i] >= ' ') && (eedata[i] <= 'z')) { | 269 | if ((eedata[i] >= ' ') && (eedata[i] <= 'z')) |
270 | bytes[i%16] = eedata[i]; | 270 | bytes[i%16] = eedata[i]; |
271 | } else { | 271 | else |
272 | bytes[i%16]='.'; | 272 | bytes[i%16] = '.'; |
273 | } | ||
274 | 273 | ||
275 | i++; | 274 | i++; |
276 | 275 | ||
@@ -305,15 +304,15 @@ static u32 functionality(struct i2c_adapter *adap) | |||
305 | } | 304 | } |
306 | 305 | ||
307 | #define mass_write(addr, reg, data...) \ | 306 | #define mass_write(addr, reg, data...) \ |
308 | { const static u8 _val[] = data; \ | 307 | { static const u8 _val[] = data; \ |
309 | rc=tm6000_read_write_usb(dev,USB_DIR_OUT | USB_TYPE_VENDOR, \ | 308 | rc = tm6000_read_write_usb(dev, USB_DIR_OUT | USB_TYPE_VENDOR, \ |
310 | REQ_16_SET_GET_I2C_WR1_RDN,(reg<<8)+addr, 0x00, (u8 *) _val, \ | 309 | REQ_16_SET_GET_I2C_WR1_RDN, (reg<<8)+addr, 0x00, (u8 *) _val, \ |
311 | ARRAY_SIZE(_val)); \ | 310 | ARRAY_SIZE(_val)); \ |
312 | if (rc<0) { \ | 311 | if (rc < 0) { \ |
313 | printk(KERN_ERR "Error on line %d: %d\n",__LINE__,rc); \ | 312 | printk(KERN_ERR "Error on line %d: %d\n", __LINE__, rc); \ |
314 | return rc; \ | 313 | return rc; \ |
315 | } \ | 314 | } \ |
316 | msleep (10); \ | 315 | msleep(10); \ |
317 | } | 316 | } |
318 | 317 | ||
319 | static struct i2c_algorithm tm6000_algo = { | 318 | static struct i2c_algorithm tm6000_algo = { |
diff --git a/drivers/staging/tm6000/tm6000-stds.c b/drivers/staging/tm6000/tm6000-stds.c index 49e5283c9f83..6bf4a73b320d 100644 --- a/drivers/staging/tm6000/tm6000-stds.c +++ b/drivers/staging/tm6000/tm6000-stds.c | |||
@@ -763,11 +763,11 @@ static struct tm6000_std_settings svideo_stds[] = { | |||
763 | void tm6000_get_std_res(struct tm6000_core *dev) | 763 | void tm6000_get_std_res(struct tm6000_core *dev) |
764 | { | 764 | { |
765 | /* Currently, those are the only supported resoltions */ | 765 | /* Currently, those are the only supported resoltions */ |
766 | if (dev->norm & V4L2_STD_525_60) { | 766 | if (dev->norm & V4L2_STD_525_60) |
767 | dev->height = 480; | 767 | dev->height = 480; |
768 | } else { | 768 | else |
769 | dev->height = 576; | 769 | dev->height = 576; |
770 | } | 770 | |
771 | dev->width = 720; | 771 | dev->width = 720; |
772 | } | 772 | } |
773 | 773 | ||
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h index 50bb1be84840..18d1e51ba991 100644 --- a/drivers/staging/tm6000/tm6000.h +++ b/drivers/staging/tm6000/tm6000.h | |||
@@ -20,8 +20,8 @@ | |||
20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | // Use the tm6000-hack, instead of the proper initialization code | 23 | /* Use the tm6000-hack, instead of the proper initialization code i*/ |
24 | //#define HACK 1 | 24 | /* #define HACK 1 */ |
25 | 25 | ||
26 | #include <linux/videodev2.h> | 26 | #include <linux/videodev2.h> |
27 | #include <media/v4l2-common.h> | 27 | #include <media/v4l2-common.h> |
@@ -98,7 +98,7 @@ enum tm6000_io_method { | |||
98 | }; | 98 | }; |
99 | 99 | ||
100 | enum tm6000_mode { | 100 | enum tm6000_mode { |
101 | TM6000_MODE_UNKNOWN=0, | 101 | TM6000_MODE_UNKNOWN = 0, |
102 | TM6000_MODE_ANALOG, | 102 | TM6000_MODE_ANALOG, |
103 | TM6000_MODE_DIGITAL, | 103 | TM6000_MODE_DIGITAL, |
104 | }; | 104 | }; |
@@ -128,7 +128,7 @@ struct tm6000_dvb { | |||
128 | struct dvb_frontend *frontend; | 128 | struct dvb_frontend *frontend; |
129 | struct dmxdev dmxdev; | 129 | struct dmxdev dmxdev; |
130 | unsigned int streams; | 130 | unsigned int streams; |
131 | struct urb *bulk_urb; | 131 | struct urb *bulk_urb; |
132 | struct mutex mutex; | 132 | struct mutex mutex; |
133 | }; | 133 | }; |
134 | 134 | ||
@@ -159,7 +159,7 @@ struct tm6000_core { | |||
159 | enum tm6000_devtype dev_type; /* type of device */ | 159 | enum tm6000_devtype dev_type; /* type of device */ |
160 | 160 | ||
161 | v4l2_std_id norm; /* Current norm */ | 161 | v4l2_std_id norm; /* Current norm */ |
162 | int width,height; /* Selected resolution */ | 162 | int width, height; /* Selected resolution */ |
163 | 163 | ||
164 | enum tm6000_core_state state; | 164 | enum tm6000_core_state state; |
165 | 165 | ||
@@ -238,7 +238,7 @@ struct tm6000_fh { | |||
238 | 238 | ||
239 | /* video capture */ | 239 | /* video capture */ |
240 | struct tm6000_fmt *fmt; | 240 | struct tm6000_fmt *fmt; |
241 | unsigned int width,height; | 241 | unsigned int width, height; |
242 | struct videobuf_queue vb_vidq; | 242 | struct videobuf_queue vb_vidq; |
243 | 243 | ||
244 | enum v4l2_buf_type type; | 244 | enum v4l2_buf_type type; |
@@ -250,25 +250,24 @@ struct tm6000_fh { | |||
250 | 250 | ||
251 | /* In tm6000-cards.c */ | 251 | /* In tm6000-cards.c */ |
252 | 252 | ||
253 | int tm6000_tuner_callback (void *ptr, int component, int command, int arg); | 253 | int tm6000_tuner_callback(void *ptr, int component, int command, int arg); |
254 | int tm6000_xc5000_callback (void *ptr, int component, int command, int arg); | 254 | int tm6000_xc5000_callback(void *ptr, int component, int command, int arg); |
255 | int tm6000_cards_setup(struct tm6000_core *dev); | 255 | int tm6000_cards_setup(struct tm6000_core *dev); |
256 | 256 | ||
257 | /* In tm6000-core.c */ | 257 | /* In tm6000-core.c */ |
258 | 258 | ||
259 | int tm6000_read_write_usb (struct tm6000_core *dev, u8 reqtype, u8 req, | 259 | int tm6000_read_write_usb(struct tm6000_core *dev, u8 reqtype, u8 req, |
260 | u16 value, u16 index, u8 *buf, u16 len); | 260 | u16 value, u16 index, u8 *buf, u16 len); |
261 | int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); | 261 | int tm6000_get_reg(struct tm6000_core *dev, u8 req, u16 value, u16 index); |
262 | int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index); | 262 | int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index); |
263 | int tm6000_get_reg32(struct tm6000_core *dev, u8 req, u16 value, u16 index); | 263 | int tm6000_get_reg32(struct tm6000_core *dev, u8 req, u16 value, u16 index); |
264 | int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); | 264 | int tm6000_set_reg(struct tm6000_core *dev, u8 req, u16 value, u16 index); |
265 | int tm6000_i2c_reset(struct tm6000_core *dev, u16 tsleep); | 265 | int tm6000_i2c_reset(struct tm6000_core *dev, u16 tsleep); |
266 | int tm6000_init(struct tm6000_core *dev); | ||
266 | 267 | ||
267 | int tm6000_init (struct tm6000_core *dev); | 268 | int tm6000_init_analog_mode(struct tm6000_core *dev); |
268 | 269 | int tm6000_init_digital_mode(struct tm6000_core *dev); | |
269 | int tm6000_init_analog_mode (struct tm6000_core *dev); | 270 | int tm6000_set_audio_bitrate(struct tm6000_core *dev, int bitrate); |
270 | int tm6000_init_digital_mode (struct tm6000_core *dev); | ||
271 | int tm6000_set_audio_bitrate (struct tm6000_core *dev, int bitrate); | ||
272 | 271 | ||
273 | int tm6000_v4l2_register(struct tm6000_core *dev); | 272 | int tm6000_v4l2_register(struct tm6000_core *dev); |
274 | int tm6000_v4l2_unregister(struct tm6000_core *dev); | 273 | int tm6000_v4l2_unregister(struct tm6000_core *dev); |
@@ -284,7 +283,7 @@ void tm6000_close_extension(struct tm6000_core *dev); | |||
284 | 283 | ||
285 | /* In tm6000-stds.c */ | 284 | /* In tm6000-stds.c */ |
286 | void tm6000_get_std_res(struct tm6000_core *dev); | 285 | void tm6000_get_std_res(struct tm6000_core *dev); |
287 | int tm6000_set_standard (struct tm6000_core *dev, v4l2_std_id *norm); | 286 | int tm6000_set_standard(struct tm6000_core *dev, v4l2_std_id *norm); |
288 | 287 | ||
289 | /* In tm6000-i2c.c */ | 288 | /* In tm6000-i2c.c */ |
290 | int tm6000_i2c_register(struct tm6000_core *dev); | 289 | int tm6000_i2c_register(struct tm6000_core *dev); |
@@ -298,14 +297,14 @@ int tm6000_vidioc_streamon(struct file *file, void *priv, | |||
298 | enum v4l2_buf_type i); | 297 | enum v4l2_buf_type i); |
299 | int tm6000_vidioc_streamoff(struct file *file, void *priv, | 298 | int tm6000_vidioc_streamoff(struct file *file, void *priv, |
300 | enum v4l2_buf_type i); | 299 | enum v4l2_buf_type i); |
301 | int tm6000_vidioc_reqbufs (struct file *file, void *priv, | 300 | int tm6000_vidioc_reqbufs(struct file *file, void *priv, |
302 | struct v4l2_requestbuffers *rb); | 301 | struct v4l2_requestbuffers *rb); |
303 | int tm6000_vidioc_querybuf (struct file *file, void *priv, | 302 | int tm6000_vidioc_querybuf(struct file *file, void *priv, |
304 | struct v4l2_buffer *b); | 303 | struct v4l2_buffer *b); |
305 | int tm6000_vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *b); | 304 | int tm6000_vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b); |
306 | int tm6000_vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *b); | 305 | int tm6000_vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b); |
307 | ssize_t tm6000_v4l2_read(struct file *filp, char __user * buf, size_t count, | 306 | ssize_t tm6000_v4l2_read(struct file *filp, char __user * buf, size_t count, |
308 | loff_t * f_pos); | 307 | loff_t *f_pos); |
309 | unsigned int tm6000_v4l2_poll(struct file *file, | 308 | unsigned int tm6000_v4l2_poll(struct file *file, |
310 | struct poll_table_struct *wait); | 309 | struct poll_table_struct *wait); |
311 | int tm6000_queue_init(struct tm6000_core *dev); | 310 | int tm6000_queue_init(struct tm6000_core *dev); |
@@ -320,7 +319,7 @@ extern int tm6000_debug; | |||
320 | 319 | ||
321 | #define dprintk(dev, level, fmt, arg...) do {\ | 320 | #define dprintk(dev, level, fmt, arg...) do {\ |
322 | if (tm6000_debug & level) \ | 321 | if (tm6000_debug & level) \ |
323 | printk(KERN_INFO "(%lu) %s %s :"fmt, jiffies, \ | 322 | printk(KERN_INFO "(%lu) %s %s :"fmt, jiffies, \ |
324 | dev->name, __FUNCTION__ , ##arg); } while (0) | 323 | dev->name, __FUNCTION__ , ##arg); } while (0) |
325 | 324 | ||
326 | #define V4L2_DEBUG_REG 0x0004 | 325 | #define V4L2_DEBUG_REG 0x0004 |
@@ -333,5 +332,3 @@ extern int tm6000_debug; | |||
333 | #define tm6000_err(fmt, arg...) do {\ | 332 | #define tm6000_err(fmt, arg...) do {\ |
334 | printk(KERN_ERR "tm6000 %s :"fmt, \ | 333 | printk(KERN_ERR "tm6000 %s :"fmt, \ |
335 | __FUNCTION__ , ##arg); } while (0) | 334 | __FUNCTION__ , ##arg); } while (0) |
336 | |||
337 | |||