diff options
author | Thomas Gleixner <tglx@tglx.tec.linutronix.de> | 2005-07-16 03:20:01 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-07-16 03:20:01 -0400 |
commit | 2c4eec9802ae753a4973f0a0d71f8d154e86fd31 (patch) | |
tree | 59c93e5616d487d41c52e3ccb86fe497a7049542 /drivers | |
parent | 5d157885f383ccc0660c011fa488ae4edb77ab16 (diff) | |
parent | d6e1860312cd8c33ad1f17d1af22fb6aa1f2cf83 (diff) |
Merge with rsync://fileserver/linux
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/rocket.c | 3 | ||||
-rw-r--r-- | drivers/char/vt.c | 2 | ||||
-rw-r--r-- | drivers/md/bitmap.c | 9 | ||||
-rw-r--r-- | drivers/md/raid0.c | 8 | ||||
-rw-r--r-- | drivers/md/raid1.c | 37 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 8 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 4 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 7 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 6 | ||||
-rw-r--r-- | drivers/media/video/tea5767.c | 34 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 33 |
11 files changed, 86 insertions, 65 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index f463d6baa6..5b1d3680c8 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -355,7 +355,7 @@ static void rp_do_receive(struct r_port *info, | |||
355 | ToRecv = space; | 355 | ToRecv = space; |
356 | 356 | ||
357 | if (ToRecv <= 0) | 357 | if (ToRecv <= 0) |
358 | return; | 358 | goto done; |
359 | 359 | ||
360 | /* | 360 | /* |
361 | * if status indicates there are errored characters in the | 361 | * if status indicates there are errored characters in the |
@@ -437,6 +437,7 @@ static void rp_do_receive(struct r_port *info, | |||
437 | } | 437 | } |
438 | /* Push the data up to the tty layer */ | 438 | /* Push the data up to the tty layer */ |
439 | ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); | 439 | ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); |
440 | done: | ||
440 | tty_ldisc_deref(ld); | 441 | tty_ldisc_deref(ld); |
441 | } | 442 | } |
442 | 443 | ||
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index d7aa7a29f6..30d96739fb 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2796,7 +2796,7 @@ void do_blank_screen(int entering_gfx) | |||
2796 | return; | 2796 | return; |
2797 | 2797 | ||
2798 | if (vesa_off_interval) { | 2798 | if (vesa_off_interval) { |
2799 | blank_state = blank_vesa_wait, | 2799 | blank_state = blank_vesa_wait; |
2800 | mod_timer(&console_timer, jiffies + vesa_off_interval); | 2800 | mod_timer(&console_timer, jiffies + vesa_off_interval); |
2801 | } | 2801 | } |
2802 | 2802 | ||
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 95980ad6b2..0c2ed99a38 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1345,7 +1345,8 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto | |||
1345 | } | 1345 | } |
1346 | } | 1346 | } |
1347 | 1347 | ||
1348 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks) | 1348 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, |
1349 | int degraded) | ||
1349 | { | 1350 | { |
1350 | bitmap_counter_t *bmc; | 1351 | bitmap_counter_t *bmc; |
1351 | int rv; | 1352 | int rv; |
@@ -1362,8 +1363,10 @@ int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks) | |||
1362 | rv = 1; | 1363 | rv = 1; |
1363 | else if (NEEDED(*bmc)) { | 1364 | else if (NEEDED(*bmc)) { |
1364 | rv = 1; | 1365 | rv = 1; |
1365 | *bmc |= RESYNC_MASK; | 1366 | if (!degraded) { /* don't set/clear bits if degraded */ |
1366 | *bmc &= ~NEEDED_MASK; | 1367 | *bmc |= RESYNC_MASK; |
1368 | *bmc &= ~NEEDED_MASK; | ||
1369 | } | ||
1367 | } | 1370 | } |
1368 | } | 1371 | } |
1369 | spin_unlock_irq(&bitmap->lock); | 1372 | spin_unlock_irq(&bitmap->lock); |
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index e11dd14d0b..2120710172 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -314,16 +314,16 @@ static int raid0_run (mddev_t *mddev) | |||
314 | sector_t space = conf->hash_spacing; | 314 | sector_t space = conf->hash_spacing; |
315 | int round; | 315 | int round; |
316 | conf->preshift = 0; | 316 | conf->preshift = 0; |
317 | if (sizeof(sector_t) > sizeof(unsigned long)) { | 317 | if (sizeof(sector_t) > sizeof(u32)) { |
318 | /*shift down space and s so that sector_div will work */ | 318 | /*shift down space and s so that sector_div will work */ |
319 | while (space > (sector_t) (~(unsigned long)0)) { | 319 | while (space > (sector_t) (~(u32)0)) { |
320 | s >>= 1; | 320 | s >>= 1; |
321 | space >>= 1; | 321 | space >>= 1; |
322 | s += 1; /* force round-up */ | 322 | s += 1; /* force round-up */ |
323 | conf->preshift++; | 323 | conf->preshift++; |
324 | } | 324 | } |
325 | } | 325 | } |
326 | round = sector_div(s, (unsigned long)space) ? 1 : 0; | 326 | round = sector_div(s, (u32)space) ? 1 : 0; |
327 | nb_zone = s + round; | 327 | nb_zone = s + round; |
328 | } | 328 | } |
329 | printk("raid0 : nb_zone is %d.\n", nb_zone); | 329 | printk("raid0 : nb_zone is %d.\n", nb_zone); |
@@ -443,7 +443,7 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio) | |||
443 | volatile | 443 | volatile |
444 | #endif | 444 | #endif |
445 | sector_t x = block >> conf->preshift; | 445 | sector_t x = block >> conf->preshift; |
446 | sector_div(x, (unsigned long)conf->hash_spacing); | 446 | sector_div(x, (u32)conf->hash_spacing); |
447 | zone = conf->hash_table[x]; | 447 | zone = conf->hash_table[x]; |
448 | } | 448 | } |
449 | 449 | ||
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index ff1dbec864..5f253ee536 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1126,21 +1126,19 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1126 | * only be one in raid1 resync. | 1126 | * only be one in raid1 resync. |
1127 | * We can find the current addess in mddev->curr_resync | 1127 | * We can find the current addess in mddev->curr_resync |
1128 | */ | 1128 | */ |
1129 | if (!conf->fullsync) { | 1129 | if (mddev->curr_resync < max_sector) /* aborted */ |
1130 | if (mddev->curr_resync < max_sector) | 1130 | bitmap_end_sync(mddev->bitmap, mddev->curr_resync, |
1131 | bitmap_end_sync(mddev->bitmap, | ||
1132 | mddev->curr_resync, | ||
1133 | &sync_blocks, 1); | 1131 | &sync_blocks, 1); |
1134 | bitmap_close_sync(mddev->bitmap); | 1132 | else /* completed sync */ |
1135 | } | ||
1136 | if (mddev->curr_resync >= max_sector) | ||
1137 | conf->fullsync = 0; | 1133 | conf->fullsync = 0; |
1134 | |||
1135 | bitmap_close_sync(mddev->bitmap); | ||
1138 | close_sync(conf); | 1136 | close_sync(conf); |
1139 | return 0; | 1137 | return 0; |
1140 | } | 1138 | } |
1141 | 1139 | ||
1142 | if (!conf->fullsync && | 1140 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, mddev->degraded) && |
1143 | !bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks)) { | 1141 | !conf->fullsync) { |
1144 | /* We can skip this block, and probably several more */ | 1142 | /* We can skip this block, and probably several more */ |
1145 | *skipped = 1; | 1143 | *skipped = 1; |
1146 | return sync_blocks; | 1144 | return sync_blocks; |
@@ -1243,15 +1241,15 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1243 | len = (max_sector - sector_nr) << 9; | 1241 | len = (max_sector - sector_nr) << 9; |
1244 | if (len == 0) | 1242 | if (len == 0) |
1245 | break; | 1243 | break; |
1246 | if (!conf->fullsync) { | 1244 | if (sync_blocks == 0) { |
1247 | if (sync_blocks == 0) { | 1245 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, |
1248 | if (!bitmap_start_sync(mddev->bitmap, | 1246 | &sync_blocks, mddev->degraded) && |
1249 | sector_nr, &sync_blocks)) | 1247 | !conf->fullsync) |
1250 | break; | 1248 | break; |
1251 | if (sync_blocks < (PAGE_SIZE>>9)) | 1249 | if (sync_blocks < (PAGE_SIZE>>9)) |
1252 | BUG(); | 1250 | BUG(); |
1253 | if (len > (sync_blocks<<9)) len = sync_blocks<<9; | 1251 | if (len > (sync_blocks<<9)) |
1254 | } | 1252 | len = sync_blocks<<9; |
1255 | } | 1253 | } |
1256 | 1254 | ||
1257 | for (i=0 ; i < conf->raid_disks; i++) { | 1255 | for (i=0 ; i < conf->raid_disks; i++) { |
@@ -1264,7 +1262,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1264 | while (i > 0) { | 1262 | while (i > 0) { |
1265 | i--; | 1263 | i--; |
1266 | bio = r1_bio->bios[i]; | 1264 | bio = r1_bio->bios[i]; |
1267 | if (bio->bi_end_io==NULL) continue; | 1265 | if (bio->bi_end_io==NULL) |
1266 | continue; | ||
1268 | /* remove last page from this bio */ | 1267 | /* remove last page from this bio */ |
1269 | bio->bi_vcnt--; | 1268 | bio->bi_vcnt--; |
1270 | bio->bi_size -= len; | 1269 | bio->bi_size -= len; |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index b0b47c3cde..3d0c784b37 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-cards.c,v 1.85 2005/07/04 19:35:05 mkrufky Exp $ | 2 | * $Id: cx88-cards.c,v 1.86 2005/07/14 03:06:43 mchehab Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * card-specific stuff. | 5 | * card-specific stuff. |
@@ -682,9 +682,9 @@ struct cx88_board cx88_boards[] = { | |||
682 | .name = "PixelView PlayTV Ultra Pro (Stereo)", | 682 | .name = "PixelView PlayTV Ultra Pro (Stereo)", |
683 | /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */ | 683 | /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */ |
684 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, | 684 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, |
685 | .radio_type = TUNER_TEA5767, | 685 | .radio_type = UNSET, |
686 | .tuner_addr = 0xc2>>1, | 686 | .tuner_addr = ADDR_UNSET, |
687 | .radio_addr = 0xc0>>1, | 687 | .radio_addr = ADDR_UNSET, |
688 | .input = {{ | 688 | .input = {{ |
689 | .type = CX88_VMUX_TELEVISION, | 689 | .type = CX88_VMUX_TELEVISION, |
690 | .vmux = 0, | 690 | .vmux = 0, |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 8db68f2d13..6ad1458ab6 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-dvb.c,v 1.41 2005/07/04 19:35:05 mkrufky Exp $ | 2 | * $Id: cx88-dvb.c,v 1.42 2005/07/12 15:44:55 mkrufky Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * MPEG Transport Stream (DVB) routines | 5 | * MPEG Transport Stream (DVB) routines |
@@ -180,12 +180,14 @@ static struct mt352_config dntv_live_dvbt_config = { | |||
180 | #if CONFIG_DVB_CX22702 | 180 | #if CONFIG_DVB_CX22702 |
181 | static struct cx22702_config connexant_refboard_config = { | 181 | static struct cx22702_config connexant_refboard_config = { |
182 | .demod_address = 0x43, | 182 | .demod_address = 0x43, |
183 | .output_mode = CX22702_SERIAL_OUTPUT, | ||
183 | .pll_address = 0x60, | 184 | .pll_address = 0x60, |
184 | .pll_desc = &dvb_pll_thomson_dtt7579, | 185 | .pll_desc = &dvb_pll_thomson_dtt7579, |
185 | }; | 186 | }; |
186 | 187 | ||
187 | static struct cx22702_config hauppauge_novat_config = { | 188 | static struct cx22702_config hauppauge_novat_config = { |
188 | .demod_address = 0x43, | 189 | .demod_address = 0x43, |
190 | .output_mode = CX22702_SERIAL_OUTPUT, | ||
189 | .pll_address = 0x61, | 191 | .pll_address = 0x61, |
190 | .pll_desc = &dvb_pll_thomson_dtt759x, | 192 | .pll_desc = &dvb_pll_thomson_dtt759x, |
191 | }; | 193 | }; |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index c44a079d08..5588a3aeec 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-video.c,v 1.79 2005/07/07 14:17:47 mchehab Exp $ | 2 | * $Id: cx88-video.c,v 1.80 2005/07/13 08:49:08 mchehab Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * video4linux video interface | 5 | * video4linux video interface |
@@ -1346,6 +1346,11 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1346 | dev->freq = f->frequency; | 1346 | dev->freq = f->frequency; |
1347 | cx88_newstation(core); | 1347 | cx88_newstation(core); |
1348 | cx88_call_i2c_clients(dev->core,VIDIOC_S_FREQUENCY,f); | 1348 | cx88_call_i2c_clients(dev->core,VIDIOC_S_FREQUENCY,f); |
1349 | |||
1350 | /* When changing channels it is required to reset TVAUDIO */ | ||
1351 | msleep (10); | ||
1352 | cx88_set_tvaudio(core); | ||
1353 | |||
1349 | up(&dev->lock); | 1354 | up(&dev->lock); |
1350 | return 0; | 1355 | return 0; |
1351 | } | 1356 | } |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 307beae04f..b008f7db6d 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88.h,v 1.68 2005/07/07 14:17:47 mchehab Exp $ | 2 | * $Id: cx88.h,v 1.69 2005/07/13 17:25:25 mchehab Exp $ |
3 | * | 3 | * |
4 | * v4l2 device driver for cx2388x based TV cards | 4 | * v4l2 device driver for cx2388x based TV cards |
5 | * | 5 | * |
@@ -35,8 +35,8 @@ | |||
35 | #include "btcx-risc.h" | 35 | #include "btcx-risc.h" |
36 | #include "cx88-reg.h" | 36 | #include "cx88-reg.h" |
37 | 37 | ||
38 | #include <linux/version.h> | 38 | #include <linux/utsname.h> |
39 | #define CX88_VERSION_CODE KERNEL_VERSION(0,0,4) | 39 | #define CX88_VERSION_CODE KERNEL_VERSION(0,0,5) |
40 | 40 | ||
41 | #ifndef TRUE | 41 | #ifndef TRUE |
42 | # define TRUE (1==1) | 42 | # define TRUE (1==1) |
diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index b53c748caf..4d27ac1b7f 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview | 2 | * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview |
3 | * I2C address is allways 0xC0. | 3 | * I2C address is allways 0xC0. |
4 | * | 4 | * |
5 | * $Id: tea5767.c,v 1.18 2005/07/07 03:02:55 mchehab Exp $ | 5 | * $Id: tea5767.c,v 1.21 2005/07/14 03:06:43 mchehab Exp $ |
6 | * | 6 | * |
7 | * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) | 7 | * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) |
8 | * This code is placed under the terms of the GNU General Public License | 8 | * This code is placed under the terms of the GNU General Public License |
@@ -153,17 +153,17 @@ static void tea5767_status_dump(unsigned char *buffer) | |||
153 | 153 | ||
154 | switch (TEA5767_HIGH_LO_32768) { | 154 | switch (TEA5767_HIGH_LO_32768) { |
155 | case TEA5767_HIGH_LO_13MHz: | 155 | case TEA5767_HIGH_LO_13MHz: |
156 | frq = 1000 * (div * 50 - 700 - 225) / 4; /* Freq in KHz */ | 156 | frq = (div * 50000 - 700000 - 225000) / 4; /* Freq in KHz */ |
157 | break; | 157 | break; |
158 | case TEA5767_LOW_LO_13MHz: | 158 | case TEA5767_LOW_LO_13MHz: |
159 | frq = 1000 * (div * 50 + 700 + 225) / 4; /* Freq in KHz */ | 159 | frq = (div * 50000 + 700000 + 225000) / 4; /* Freq in KHz */ |
160 | break; | 160 | break; |
161 | case TEA5767_LOW_LO_32768: | 161 | case TEA5767_LOW_LO_32768: |
162 | frq = 1000 * (div * 32768 / 1000 + 700 + 225) / 4; /* Freq in KHz */ | 162 | frq = (div * 32768 + 700000 + 225000) / 4; /* Freq in KHz */ |
163 | break; | 163 | break; |
164 | case TEA5767_HIGH_LO_32768: | 164 | case TEA5767_HIGH_LO_32768: |
165 | default: | 165 | default: |
166 | frq = 1000 * (div * 32768 / 1000 - 700 - 225) / 4; /* Freq in KHz */ | 166 | frq = (div * 32768 - 700000 - 225000) / 4; /* Freq in KHz */ |
167 | break; | 167 | break; |
168 | } | 168 | } |
169 | buffer[0] = (div >> 8) & 0x3f; | 169 | buffer[0] = (div >> 8) & 0x3f; |
@@ -196,7 +196,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) | |||
196 | unsigned div; | 196 | unsigned div; |
197 | int rc; | 197 | int rc; |
198 | 198 | ||
199 | tuner_dbg (PREFIX "radio freq counter %d\n", frq); | 199 | tuner_dbg (PREFIX "radio freq = %d.%03d MHz\n", frq/16000,(frq/16)%1000); |
200 | 200 | ||
201 | /* Rounds freq to next decimal value - for 62.5 KHz step */ | 201 | /* Rounds freq to next decimal value - for 62.5 KHz step */ |
202 | /* frq = 20*(frq/16)+radio_frq[frq%16]; */ | 202 | /* frq = 20*(frq/16)+radio_frq[frq%16]; */ |
@@ -224,19 +224,19 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) | |||
224 | tuner_dbg ("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n"); | 224 | tuner_dbg ("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n"); |
225 | buffer[2] |= TEA5767_HIGH_LO_INJECT; | 225 | buffer[2] |= TEA5767_HIGH_LO_INJECT; |
226 | buffer[4] |= TEA5767_PLLREF_ENABLE; | 226 | buffer[4] |= TEA5767_PLLREF_ENABLE; |
227 | div = (frq * 4 / 16 + 700 + 225 + 25) / 50; | 227 | div = (frq * 4000 / 16 + 700000 + 225000 + 25000) / 50000; |
228 | break; | 228 | break; |
229 | case TEA5767_LOW_LO_13MHz: | 229 | case TEA5767_LOW_LO_13MHz: |
230 | tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 13 MHz\n"); | 230 | tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 13 MHz\n"); |
231 | 231 | ||
232 | buffer[4] |= TEA5767_PLLREF_ENABLE; | 232 | buffer[4] |= TEA5767_PLLREF_ENABLE; |
233 | div = (frq * 4 / 16 - 700 - 225 + 25) / 50; | 233 | div = (frq * 4000 / 16 - 700000 - 225000 + 25000) / 50000; |
234 | break; | 234 | break; |
235 | case TEA5767_LOW_LO_32768: | 235 | case TEA5767_LOW_LO_32768: |
236 | tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n"); | 236 | tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n"); |
237 | buffer[3] |= TEA5767_XTAL_32768; | 237 | buffer[3] |= TEA5767_XTAL_32768; |
238 | /* const 700=4000*175 Khz - to adjust freq to right value */ | 238 | /* const 700=4000*175 Khz - to adjust freq to right value */ |
239 | div = (1000 * (frq * 4 / 16 - 700 - 225) + 16384) >> 15; | 239 | div = ((frq * 4000 / 16 - 700000 - 225000) + 16384) >> 15; |
240 | break; | 240 | break; |
241 | case TEA5767_HIGH_LO_32768: | 241 | case TEA5767_HIGH_LO_32768: |
242 | default: | 242 | default: |
@@ -244,17 +244,21 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) | |||
244 | 244 | ||
245 | buffer[2] |= TEA5767_HIGH_LO_INJECT; | 245 | buffer[2] |= TEA5767_HIGH_LO_INJECT; |
246 | buffer[3] |= TEA5767_XTAL_32768; | 246 | buffer[3] |= TEA5767_XTAL_32768; |
247 | div = (1000 * (frq * 4 / 16 + 700 + 225) + 16384) >> 15; | 247 | div = ((frq * (4000 / 16) + 700000 + 225000) + 16384) >> 15; |
248 | break; | 248 | break; |
249 | } | 249 | } |
250 | buffer[0] = (div >> 8) & 0x3f; | 250 | buffer[0] = (div >> 8) & 0x3f; |
251 | buffer[1] = div & 0xff; | 251 | buffer[1] = div & 0xff; |
252 | 252 | ||
253 | if (tuner_debug) | ||
254 | tea5767_status_dump(buffer); | ||
255 | |||
256 | if (5 != (rc = i2c_master_send(c, buffer, 5))) | 253 | if (5 != (rc = i2c_master_send(c, buffer, 5))) |
257 | tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); | 254 | tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); |
255 | |||
256 | if (tuner_debug) { | ||
257 | if (5 != (rc = i2c_master_recv(c, buffer, 5))) | ||
258 | tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); | ||
259 | else | ||
260 | tea5767_status_dump(buffer); | ||
261 | } | ||
258 | } | 262 | } |
259 | 263 | ||
260 | static int tea5767_signal(struct i2c_client *c) | 264 | static int tea5767_signal(struct i2c_client *c) |
@@ -294,7 +298,7 @@ int tea5767_autodetection(struct i2c_client *c) | |||
294 | struct tuner *t = i2c_get_clientdata(c); | 298 | struct tuner *t = i2c_get_clientdata(c); |
295 | 299 | ||
296 | if (5 != (rc = i2c_master_recv(c, buffer, 5))) { | 300 | if (5 != (rc = i2c_master_recv(c, buffer, 5))) { |
297 | tuner_warn("it is not a TEA5767. Received %i chars.\n", rc); | 301 | tuner_warn("It is not a TEA5767. Received %i bytes.\n", rc); |
298 | return EINVAL; | 302 | return EINVAL; |
299 | } | 303 | } |
300 | 304 | ||
@@ -310,11 +314,11 @@ int tea5767_autodetection(struct i2c_client *c) | |||
310 | * bit 0 : internally set to 0 | 314 | * bit 0 : internally set to 0 |
311 | * Byte 5: bit 7:0 : == 0 | 315 | * Byte 5: bit 7:0 : == 0 |
312 | */ | 316 | */ |
313 | |||
314 | if (!((buffer[3] & 0x0f) == 0x00) && (buffer[4] == 0x00)) { | 317 | if (!((buffer[3] & 0x0f) == 0x00) && (buffer[4] == 0x00)) { |
315 | tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); | 318 | tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); |
316 | return EINVAL; | 319 | return EINVAL; |
317 | } | 320 | } |
321 | |||
318 | tuner_warn("TEA5767 detected.\n"); | 322 | tuner_warn("TEA5767 detected.\n"); |
319 | return 0; | 323 | return 0; |
320 | } | 324 | } |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index de190630ba..b25a9c08ac 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: tuner-core.c,v 1.55 2005/07/08 13:20:33 mchehab Exp $ | 2 | * $Id: tuner-core.c,v 1.58 2005/07/14 03:06:43 mchehab Exp $ |
3 | * | 3 | * |
4 | * i2c tv tuner chip device driver | 4 | * i2c tv tuner chip device driver |
5 | * core core, i.e. kernel interfaces, registering and so on | 5 | * core core, i.e. kernel interfaces, registering and so on |
@@ -39,6 +39,9 @@ I2C_CLIENT_INSMOD; | |||
39 | static unsigned int addr = 0; | 39 | static unsigned int addr = 0; |
40 | module_param(addr, int, 0444); | 40 | module_param(addr, int, 0444); |
41 | 41 | ||
42 | static unsigned int no_autodetect = 0; | ||
43 | module_param(no_autodetect, int, 0444); | ||
44 | |||
42 | /* insmod options used at runtime => read/write */ | 45 | /* insmod options used at runtime => read/write */ |
43 | unsigned int tuner_debug = 0; | 46 | unsigned int tuner_debug = 0; |
44 | module_param(tuner_debug, int, 0644); | 47 | module_param(tuner_debug, int, 0644); |
@@ -318,17 +321,19 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) | |||
318 | tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); | 321 | tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); |
319 | 322 | ||
320 | /* TEA5767 autodetection code - only for addr = 0xc0 */ | 323 | /* TEA5767 autodetection code - only for addr = 0xc0 */ |
321 | if (addr == 0x60) { | 324 | if (!no_autodetect) { |
322 | if (tea5767_autodetection(&t->i2c) != EINVAL) { | 325 | if (addr == 0x60) { |
323 | t->type = TUNER_TEA5767; | 326 | if (tea5767_autodetection(&t->i2c) != EINVAL) { |
324 | t->mode_mask = T_RADIO; | 327 | t->type = TUNER_TEA5767; |
325 | t->mode = T_STANDBY; | 328 | t->mode_mask = T_RADIO; |
326 | t->freq = 87.5 * 16; /* Sets freq to FM range */ | 329 | t->mode = T_STANDBY; |
327 | default_mode_mask &= ~T_RADIO; | 330 | t->freq = 87.5 * 16; /* Sets freq to FM range */ |
328 | 331 | default_mode_mask &= ~T_RADIO; | |
329 | i2c_attach_client (&t->i2c); | 332 | |
330 | set_type(&t->i2c,t->type, t->mode_mask); | 333 | i2c_attach_client (&t->i2c); |
331 | return 0; | 334 | set_type(&t->i2c,t->type, t->mode_mask); |
335 | return 0; | ||
336 | } | ||
332 | } | 337 | } |
333 | } | 338 | } |
334 | 339 | ||
@@ -631,7 +636,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
631 | break; | 636 | break; |
632 | } | 637 | } |
633 | default: | 638 | default: |
634 | tuner_dbg("Unimplemented IOCTL 0x%08x called to tuner.\n", cmd); | 639 | tuner_dbg("Unimplemented IOCTL 0x%08x(dir=%d,tp=0x%02x,nr=%d,sz=%d)\n", |
640 | cmd, _IOC_DIR(cmd), _IOC_TYPE(cmd), | ||
641 | _IOC_NR(cmd), _IOC_SIZE(cmd)); | ||
635 | break; | 642 | break; |
636 | } | 643 | } |
637 | 644 | ||