diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-19 17:49:39 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-19 17:49:39 -0400 |
commit | 39299d9d15c41cbdd7c7009967cd35afaf34d8fa (patch) | |
tree | 42a0c0408fcf76024eb6885a27d4f1ed0228abcf /drivers | |
parent | ce625a801664d8ed7344117bbb57510e4e0e872c (diff) | |
parent | f60f700876cd51de9de69f3a3c865d95e287a24d (diff) |
Merge with /shiny/git/linux-2.6/.git
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/rocket.c | 3 | ||||
-rw-r--r-- | drivers/char/vt.c | 2 | ||||
-rw-r--r-- | drivers/firmware/pcdp.h | 2 | ||||
-rw-r--r-- | drivers/ieee1394/ohci1394.c | 3 | ||||
-rw-r--r-- | drivers/input/joystick/amijoy.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/dvb/frontends/lgdt3302.c | 16 | ||||
-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 | ||||
-rw-r--r-- | drivers/mtd/chips/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0020.c | 5 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 22 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 20 | ||||
-rw-r--r-- | drivers/serial/crisv10.c | 2 | ||||
-rw-r--r-- | drivers/serial/icom.c | 1 | ||||
-rw-r--r-- | drivers/serial/jsm/jsm.h | 1 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 228 |
23 files changed, 231 insertions, 224 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index f463d6baa68..5b1d3680c8a 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -355,7 +355,7 @@ static void rp_do_receive(struct r_port *info, ToRecv = space; if (ToRecv <= 0) - return; + goto done; /* * if status indicates there are errored characters in the @@ -437,6 +437,7 @@ static void rp_do_receive(struct r_port *info, } /* Push the data up to the tty layer */ ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); +done: tty_ldisc_deref(ld); } diff --git a/drivers/char/vt.c b/drivers/char/vt.c index d7aa7a29f67..30d96739fb2 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -2796,7 +2796,7 @@ void do_blank_screen(int entering_gfx) return; if (vesa_off_interval) { - blank_state = blank_vesa_wait, + blank_state = blank_vesa_wait; mod_timer(&console_timer, jiffies + vesa_off_interval); } diff --git a/drivers/firmware/pcdp.h b/drivers/firmware/pcdp.h index e72cc47de33..ce910d68bd1 100644 --- a/drivers/firmware/pcdp.h +++ b/drivers/firmware/pcdp.h @@ -52,6 +52,8 @@ struct pcdp_uart { u32 clock_rate; u8 pci_prog_intfc; u8 flags; + u16 conout_index; + u32 reserved; } __attribute__((packed)); #define PCDP_IF_PCI 1 diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index a485f47bb21..b12a970cc9a 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c @@ -1084,7 +1084,8 @@ static int ohci_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg) initialize_dma_rcv_ctx(&ohci->ir_legacy_context, 1); - PRINT(KERN_ERR, "IR legacy activated"); + if (printk_ratelimit()) + PRINT(KERN_ERR, "IR legacy activated"); } spin_lock_irqsave(&ohci->IR_channel_lock, flags); diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c index 033456bb9fe..e996183c5b0 100644 --- a/drivers/input/joystick/amijoy.c +++ b/drivers/input/joystick/amijoy.c @@ -105,7 +105,7 @@ out: static void amijoy_close(struct input_dev *dev) { - down(&amijoysem); + down(&amijoy_sem); if (!--amijoy_used) free_irq(IRQ_AMIGA_VERTB, amijoy_interrupt); up(&amijoy_sem); diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 95980ad6b27..0c2ed99a383 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 } } -int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks) +int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, + int degraded) { bitmap_counter_t *bmc; int rv; @@ -1362,8 +1363,10 @@ int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks) rv = 1; else if (NEEDED(*bmc)) { rv = 1; - *bmc |= RESYNC_MASK; - *bmc &= ~NEEDED_MASK; + if (!degraded) { /* don't set/clear bits if degraded */ + *bmc |= RESYNC_MASK; + *bmc &= ~NEEDED_MASK; + } } } spin_unlock_irq(&bitmap->lock); diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index e11dd14d0b4..2120710172c 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -314,16 +314,16 @@ static int raid0_run (mddev_t *mddev) sector_t space = conf->hash_spacing; int round; conf->preshift = 0; - if (sizeof(sector_t) > sizeof(unsigned long)) { + if (sizeof(sector_t) > sizeof(u32)) { /*shift down space and s so that sector_div will work */ - while (space > (sector_t) (~(unsigned long)0)) { + while (space > (sector_t) (~(u32)0)) { s >>= 1; space >>= 1; s += 1; /* force round-up */ conf->preshift++; } } - round = sector_div(s, (unsigned long)space) ? 1 : 0; + round = sector_div(s, (u32)space) ? 1 : 0; nb_zone = s + round; } 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) volatile #endif sector_t x = block >> conf->preshift; - sector_div(x, (unsigned long)conf->hash_spacing); + sector_div(x, (u32)conf->hash_spacing); zone = conf->hash_table[x]; } diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index ff1dbec864a..5f253ee536b 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 * only be one in raid1 resync. * We can find the current addess in mddev->curr_resync */ - if (!conf->fullsync) { - if (mddev->curr_resync < max_sector) - bitmap_end_sync(mddev->bitmap, - mddev->curr_resync, + if (mddev->curr_resync < max_sector) /* aborted */ + bitmap_end_sync(mddev->bitmap, mddev->curr_resync, &sync_blocks, 1); - bitmap_close_sync(mddev->bitmap); - } - if (mddev->curr_resync >= max_sector) + else /* completed sync */ conf->fullsync = 0; + + bitmap_close_sync(mddev->bitmap); close_sync(conf); return 0; } - if (!conf->fullsync && - !bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks)) { + if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, mddev->degraded) && + !conf->fullsync) { /* We can skip this block, and probably several more */ *skipped = 1; return sync_blocks; @@ -1243,15 +1241,15 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i len = (max_sector - sector_nr) << 9; if (len == 0) break; - if (!conf->fullsync) { - if (sync_blocks == 0) { - if (!bitmap_start_sync(mddev->bitmap, - sector_nr, &sync_blocks)) - break; - if (sync_blocks < (PAGE_SIZE>>9)) - BUG(); - if (len > (sync_blocks<<9)) len = sync_blocks<<9; - } + if (sync_blocks == 0) { + if (!bitmap_start_sync(mddev->bitmap, sector_nr, + &sync_blocks, mddev->degraded) && + !conf->fullsync) + break; + if (sync_blocks < (PAGE_SIZE>>9)) + BUG(); + if (len > (sync_blocks<<9)) + len = sync_blocks<<9; } 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 while (i > 0) { i--; bio = r1_bio->bios[i]; - if (bio->bi_end_io==NULL) continue; + if (bio->bi_end_io==NULL) + continue; /* remove last page from this bio */ bio->bi_vcnt--; bio->bi_size -= len; diff --git a/drivers/media/dvb/frontends/lgdt3302.c b/drivers/media/dvb/frontends/lgdt3302.c index 2eea03d218c..c85a2a99df4 100644 --- a/drivers/media/dvb/frontends/lgdt3302.c +++ b/drivers/media/dvb/frontends/lgdt3302.c @@ -217,13 +217,11 @@ static int lgdt3302_set_parameters(struct dvb_frontend* fe, static u8 demux_ctrl_cfg[] = { DEMUX_CONTROL, 0xfb }; static u8 agc_rf_cfg[] = { AGC_RF_BANDWIDTH0, 0x40, 0x93, 0x00 }; static u8 agc_ctrl_cfg[] = { AGC_FUNC_CTRL2, 0xc6, 0x40 }; - static u8 agc_delay_cfg[] = { AGC_DELAY0, 0x00, 0x00, 0x00 }; + static u8 agc_delay_cfg[] = { AGC_DELAY0, 0x07, 0x00, 0xfe }; static u8 agc_loop_cfg[] = { AGC_LOOP_BANDWIDTH0, 0x08, 0x9a }; /* Change only if we are actually changing the modulation */ if (state->current_modulation != param->u.vsb.modulation) { - int value; - switch(param->u.vsb.modulation) { case VSB_8: dprintk("%s: VSB_8 MODE\n", __FUNCTION__); @@ -276,16 +274,8 @@ static int lgdt3302_set_parameters(struct dvb_frontend* fe, recovery center frequency register */ i2c_writebytes(state, state->config->demod_address, vsb_freq_cfg, sizeof(vsb_freq_cfg)); - /* Set the value of 'INLVTHD' register 0x2a/0x2c - to value from 'IFACC' register 0x39/0x3b -1 */ - i2c_selectreadbytes(state, AGC_RFIF_ACC0, - &agc_delay_cfg[1], 3); - value = ((agc_delay_cfg[1] & 0x0f) << 8) | agc_delay_cfg[3]; - value = value -1; - dprintk("%s IFACC -1 = 0x%03x\n", __FUNCTION__, value); - agc_delay_cfg[1] = (value >> 8) & 0x0f; - agc_delay_cfg[2] = 0x00; - agc_delay_cfg[3] = value & 0xff; + + /* Set the value of 'INLVTHD' register 0x2a/0x2c to 0x7fe */ i2c_writebytes(state, state->config->demod_address, agc_delay_cfg, sizeof(agc_delay_cfg)); diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index b0b47c3cde3..3d0c784b376 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-cards.c,v 1.85 2005/07/04 19:35:05 mkrufky Exp $ + * $Id: cx88-cards.c,v 1.86 2005/07/14 03:06:43 mchehab Exp $ * * device driver for Conexant 2388x based TV cards * card-specific stuff. @@ -682,9 +682,9 @@ struct cx88_board cx88_boards[] = { .name = "PixelView PlayTV Ultra Pro (Stereo)", /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */ .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, - .radio_type = TUNER_TEA5767, - .tuner_addr = 0xc2>>1, - .radio_addr = 0xc0>>1, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 8db68f2d135..6ad1458ab65 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-dvb.c,v 1.41 2005/07/04 19:35:05 mkrufky Exp $ + * $Id: cx88-dvb.c,v 1.42 2005/07/12 15:44:55 mkrufky Exp $ * * device driver for Conexant 2388x based TV cards * MPEG Transport Stream (DVB) routines @@ -180,12 +180,14 @@ static struct mt352_config dntv_live_dvbt_config = { #if CONFIG_DVB_CX22702 static struct cx22702_config connexant_refboard_config = { .demod_address = 0x43, + .output_mode = CX22702_SERIAL_OUTPUT, .pll_address = 0x60, .pll_desc = &dvb_pll_thomson_dtt7579, }; static struct cx22702_config hauppauge_novat_config = { .demod_address = 0x43, + .output_mode = CX22702_SERIAL_OUTPUT, .pll_address = 0x61, .pll_desc = &dvb_pll_thomson_dtt759x, }; diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index c44a079d08c..5588a3aeecb 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-video.c,v 1.79 2005/07/07 14:17:47 mchehab Exp $ + * $Id: cx88-video.c,v 1.80 2005/07/13 08:49:08 mchehab Exp $ * * device driver for Conexant 2388x based TV cards * video4linux video interface @@ -1346,6 +1346,11 @@ static int video_do_ioctl(struct inode *inode, struct file *file, dev->freq = f->frequency; cx88_newstation(core); cx88_call_i2c_clients(dev->core,VIDIOC_S_FREQUENCY,f); + + /* When changing channels it is required to reset TVAUDIO */ + msleep (10); + cx88_set_tvaudio(core); + up(&dev->lock); return 0; } diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 307beae04f2..b008f7db6df 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -1,5 +1,5 @@ /* - * $Id: cx88.h,v 1.68 2005/07/07 14:17:47 mchehab Exp $ + * $Id: cx88.h,v 1.69 2005/07/13 17:25:25 mchehab Exp $ * * v4l2 device driver for cx2388x based TV cards * @@ -35,8 +35,8 @@ #include "btcx-risc.h" #include "cx88-reg.h" -#include <linux/version.h> -#define CX88_VERSION_CODE KERNEL_VERSION(0,0,4) +#include <linux/utsname.h> +#define CX88_VERSION_CODE KERNEL_VERSION(0,0,5) #ifndef TRUE # define TRUE (1==1) diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index b53c748caf2..4d27ac1b7fb 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c @@ -2,7 +2,7 @@ * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview * I2C address is allways 0xC0. * - * $Id: tea5767.c,v 1.18 2005/07/07 03:02:55 mchehab Exp $ + * $Id: tea5767.c,v 1.21 2005/07/14 03:06:43 mchehab Exp $ * * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) * 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) switch (TEA5767_HIGH_LO_32768) { case TEA5767_HIGH_LO_13MHz: - frq = 1000 * (div * 50 - 700 - 225) / 4; /* Freq in KHz */ + frq = (div * 50000 - 700000 - 225000) / 4; /* Freq in KHz */ break; case TEA5767_LOW_LO_13MHz: - frq = 1000 * (div * 50 + 700 + 225) / 4; /* Freq in KHz */ + frq = (div * 50000 + 700000 + 225000) / 4; /* Freq in KHz */ break; case TEA5767_LOW_LO_32768: - frq = 1000 * (div * 32768 / 1000 + 700 + 225) / 4; /* Freq in KHz */ + frq = (div * 32768 + 700000 + 225000) / 4; /* Freq in KHz */ break; case TEA5767_HIGH_LO_32768: default: - frq = 1000 * (div * 32768 / 1000 - 700 - 225) / 4; /* Freq in KHz */ + frq = (div * 32768 - 700000 - 225000) / 4; /* Freq in KHz */ break; } buffer[0] = (div >> 8) & 0x3f; @@ -196,7 +196,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) unsigned div; int rc; - tuner_dbg (PREFIX "radio freq counter %d\n", frq); + tuner_dbg (PREFIX "radio freq = %d.%03d MHz\n", frq/16000,(frq/16)%1000); /* Rounds freq to next decimal value - for 62.5 KHz step */ /* frq = 20*(frq/16)+radio_frq[frq%16]; */ @@ -224,19 +224,19 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) tuner_dbg ("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n"); buffer[2] |= TEA5767_HIGH_LO_INJECT; buffer[4] |= TEA5767_PLLREF_ENABLE; - div = (frq * 4 / 16 + 700 + 225 + 25) / 50; + div = (frq * 4000 / 16 + 700000 + 225000 + 25000) / 50000; break; case TEA5767_LOW_LO_13MHz: tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 13 MHz\n"); buffer[4] |= TEA5767_PLLREF_ENABLE; - div = (frq * 4 / 16 - 700 - 225 + 25) / 50; + div = (frq * 4000 / 16 - 700000 - 225000 + 25000) / 50000; break; case TEA5767_LOW_LO_32768: tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n"); buffer[3] |= TEA5767_XTAL_32768; /* const 700=4000*175 Khz - to adjust freq to right value */ - div = (1000 * (frq * 4 / 16 - 700 - 225) + 16384) >> 15; + div = ((frq * 4000 / 16 - 700000 - 225000) + 16384) >> 15; break; case TEA5767_HIGH_LO_32768: default: @@ -244,17 +244,21 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) buffer[2] |= TEA5767_HIGH_LO_INJECT; buffer[3] |= TEA5767_XTAL_32768; - div = (1000 * (frq * 4 / 16 + 700 + 225) + 16384) >> 15; + div = ((frq * (4000 / 16) + 700000 + 225000) + 16384) >> 15; break; } buffer[0] = (div >> 8) & 0x3f; buffer[1] = div & 0xff; - if (tuner_debug) - tea5767_status_dump(buffer); - if (5 != (rc = i2c_master_send(c, buffer, 5))) tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); + + if (tuner_debug) { + if (5 != (rc = i2c_master_recv(c, buffer, 5))) + tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); + else + tea5767_status_dump(buffer); + } } static int tea5767_signal(struct i2c_client *c) @@ -294,7 +298,7 @@ int tea5767_autodetection(struct i2c_client *c) struct tuner *t = i2c_get_clientdata(c); if (5 != (rc = i2c_master_recv(c, buffer, 5))) { - tuner_warn("it is not a TEA5767. Received %i chars.\n", rc); + tuner_warn("It is not a TEA5767. Received %i bytes.\n", rc); return EINVAL; } @@ -310,11 +314,11 @@ int tea5767_autodetection(struct i2c_client *c) * bit 0 : internally set to 0 * Byte 5: bit 7:0 : == 0 */ - if (!((buffer[3] & 0x0f) == 0x00) && (buffer[4] == 0x00)) { tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); return EINVAL; } + tuner_warn("TEA5767 detected.\n"); return 0; } diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index de190630bab..b25a9c08ac0 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -1,5 +1,5 @@ /* - * $Id: tuner-core.c,v 1.55 2005/07/08 13:20:33 mchehab Exp $ + * $Id: tuner-core.c,v 1.58 2005/07/14 03:06:43 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -39,6 +39,9 @@ I2C_CLIENT_INSMOD; static unsigned int addr = 0; module_param(addr, int, 0444); +static unsigned int no_autodetect = 0; +module_param(no_autodetect, int, 0444); + /* insmod options used at runtime => read/write */ unsigned int tuner_debug = 0; module_param(tuner_debug, int, 0644); @@ -318,17 +321,19 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); /* TEA5767 autodetection code - only for addr = 0xc0 */ - if (addr == 0x60) { - if (tea5767_autodetection(&t->i2c) != EINVAL) { - t->type = TUNER_TEA5767; - t->mode_mask = T_RADIO; - t->mode = T_STANDBY; - t->freq = 87.5 * 16; /* Sets freq to FM range */ - default_mode_mask &= ~T_RADIO; - - i2c_attach_client (&t->i2c); - set_type(&t->i2c,t->type, t->mode_mask); - return 0; + if (!no_autodetect) { + if (addr == 0x60) { + if (tea5767_autodetection(&t->i2c) != EINVAL) { + t->type = TUNER_TEA5767; + t->mode_mask = T_RADIO; + t->mode = T_STANDBY; + t->freq = 87.5 * 16; /* Sets freq to FM range */ + default_mode_mask &= ~T_RADIO; + + i2c_attach_client (&t->i2c); + set_type(&t->i2c,t->type, t->mode_mask); + return 0; + } } } @@ -631,7 +636,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) break; } default: - tuner_dbg("Unimplemented IOCTL 0x%08x called to tuner.\n", cmd); + tuner_dbg("Unimplemented IOCTL 0x%08x(dir=%d,tp=0x%02x,nr=%d,sz=%d)\n", + cmd, _IOC_DIR(cmd), _IOC_TYPE(cmd), + _IOC_NR(cmd), _IOC_SIZE(cmd)); break; } diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig index b5dc59389bb..df95d2158b1 100644 --- a/drivers/mtd/chips/Kconfig +++ b/drivers/mtd/chips/Kconfig @@ -300,7 +300,7 @@ config MTD_JEDEC config MTD_XIP bool "XIP aware MTD support" - depends on !SMP && (MTD_CFI_INTELEXT || MTD_CFI_AMDSTD) && EXPERIMENTAL + depends on !SMP && (MTD_CFI_INTELEXT || MTD_CFI_AMDSTD) && EXPERIMENTAL && ARM default y if XIP_KERNEL help This allows MTD support to work with flash memory which is also diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c index 8c24e18db3b..c894f880157 100644 --- a/drivers/mtd/chips/cfi_cmdset_0020.c +++ b/drivers/mtd/chips/cfi_cmdset_0020.c @@ -4,7 +4,7 @@ * * (C) 2000 Red Hat. GPL'd * - * $Id: cfi_cmdset_0020.c,v 1.17 2004/11/20 12:49:04 dwmw2 Exp $ + * $Id: cfi_cmdset_0020.c,v 1.19 2005/07/13 15:52:45 dwmw2 Exp $ * * 10/10/2000 Nicolas Pitre <nico@cam.org> * - completely revamped method functions so they are aware and @@ -16,6 +16,8 @@ * - modified Intel Command Set 0x0001 to support ST Advanced Architecture * (command set 0x0020) * - added a writev function + * 07/13/2005 Joern Engel <joern@wh.fh-wedel.de> + * - Plugged memory leak in cfi_staa_writev(). */ #include <linux/version.h> @@ -719,6 +721,7 @@ cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs, write_error: if (retlen) *retlen = totlen; + kfree(buffer); return ret; } diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 1bd71a598c7..eee5115658c 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -59,7 +59,7 @@ * The AG-AND chips have nice features for speed improvement, * which are not supported yet. Read / program 4 pages in one go. * - * $Id: nand_base.c,v 1.146 2005/06/17 15:02:06 gleixner Exp $ + * $Id: nand_base.c,v 1.147 2005/07/15 07:18:06 gleixner Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -1409,16 +1409,6 @@ static int nand_read_oob (struct mtd_info *mtd, loff_t from, size_t len, size_t thislen = min_t(int, thislen, len); this->read_buf(mtd, &buf[i], thislen); i += thislen; - - /* Apply delay or wait for ready/busy pin - * Do this before the AUTOINCR check, so no problems - * arise if a chip which does auto increment - * is marked as NOAUTOINCR by the board driver. - */ - if (!this->dev_ready) - udelay (this->chip_delay); - else - nand_wait_ready(mtd); /* Read more ? */ if (i < len) { @@ -1432,6 +1422,16 @@ static int nand_read_oob (struct mtd_info *mtd, loff_t from, size_t len, size_t this->select_chip(mtd, chipnr); } + /* Apply delay or wait for ready/busy pin + * Do this before the AUTOINCR check, so no problems + * arise if a chip which does auto increment + * is marked as NOAUTOINCR by the board driver. + */ + if (!this->dev_ready) + udelay (this->chip_delay); + else + nand_wait_ready(mtd); + /* Check, if the chip supports auto page increment * or if we have hit a block boundary. */ diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 5ac2d296222..7535ef53685 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -6,7 +6,7 @@ * * Copyright (C) 2004 Thomas Gleixner (tglx@linutronix.de) * - * $Id: nand_bbt.c,v 1.33 2005/06/14 15:47:56 gleixner Exp $ + * $Id: nand_bbt.c,v 1.35 2005/07/15 13:53:47 gleixner Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -109,24 +109,21 @@ static int check_pattern (uint8_t *buf, int len, int paglen, struct nand_bbt_des /** * check_short_pattern - [GENERIC] check if a pattern is in the buffer * @buf: the buffer to search - * @len: the length of buffer to search - * @paglen: the pagelength * @td: search pattern descriptor * * Check for a pattern at the given place. Used to search bad block * tables and good / bad block identifiers. Same as check_pattern, but - * no optional empty check and the pattern is expected to start - * at offset 0. + * no optional empty check * */ -static int check_short_pattern (uint8_t *buf, int len, int paglen, struct nand_bbt_descr *td) +static int check_short_pattern (uint8_t *buf, struct nand_bbt_descr *td) { int i; uint8_t *p = buf; /* Compare the pattern */ for (i = 0; i < td->len; i++) { - if (p[i] != td->pattern[i]) + if (p[td->offs + i] != td->pattern[i]) return -1; } return 0; @@ -337,13 +334,14 @@ static int create_bbt (struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr if (!(bd->options & NAND_BBT_SCANEMPTY)) { size_t retlen; - /* No need to read pages fully, just read required OOB bytes */ - ret = mtd->read_oob(mtd, from + j * mtd->oobblock + bd->offs, - readlen, &retlen, &buf[0]); + /* Read the full oob until read_oob is fixed to + * handle single byte reads for 16 bit buswidth */ + ret = mtd->read_oob(mtd, from + j * mtd->oobblock, + mtd->oobsize, &retlen, buf); if (ret) return ret; - if (check_short_pattern (&buf[j * scanlen], scanlen, mtd->oobblock, bd)) { + if (check_short_pattern (buf, bd)) { this->bbt[i >> 3] |= 0x03 << (i & 0x6); printk (KERN_WARNING "Bad eraseblock %d at 0x%08x\n", i >> 1, (unsigned int) from); diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index 3da5494953a..23b8871e74c 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c @@ -426,8 +426,6 @@ static char *serial_version = "$Revision: 1.25 $"; #include <linux/config.h> -#include <linux/version.h> - #include <linux/types.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/serial/icom.c b/drivers/serial/icom.c index 546a0bc77e1..c112b32764e 100644 --- a/drivers/serial/icom.c +++ b/drivers/serial/icom.c @@ -25,7 +25,6 @@ #define SERIAL_DO_RESTART #include <linux/module.h> #include <linux/config.h> -#include <linux/version.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/serial/jsm/jsm.h b/drivers/serial/jsm/jsm.h index 777829fa330..5bf3c45521f 100644 --- a/drivers/serial/jsm/jsm.h +++ b/drivers/serial/jsm/jsm.h @@ -28,7 +28,6 @@ #define __JSM_DRIVER_H #include <linux/kernel.h> -#include <linux/version.h> #include <linux/types.h> /* To pick up the varions Linux types */ #include <linux/tty.h> #include <linux/serial_core.h> diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index b722175f108..e9256408757 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -12,14 +12,25 @@ History: 2005-05-19 v0.1 Initial version, based on incomplete docs - and analysis of misbehavior of the standard driver + and analysis of misbehavior with the standard driver 2005-05-20 v0.2 Extended the input buffer to avoid losing random 64-byte chunks of data 2005-05-21 v0.3 implemented chars_in_buffer() turned on low_latency simplified the code somewhat + 2005-05-24 v0.4 option_write() sometimes deadlocked under heavy load + removed some dead code + added sponsor notice + coding style clean-up + 2005-06-20 v0.4.1 add missing braces :-/ + killed end-of-line whitespace + 2005-07-15 v0.4.2 rename WLAN product to FUSION, add FUSION2 + + Work sponsored by: Sigos GmbH, Germany <info@sigos.de> + */ -#define DRIVER_VERSION "v0.3" + +#define DRIVER_VERSION "v0.4" #define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>" #define DRIVER_DESC "Option Card (PC-Card to) USB to Serial Driver" @@ -44,7 +55,6 @@ static int option_write_room (struct usb_serial_port *port); static void option_instat_callback(struct urb *urb, struct pt_regs *regs); - static int option_write (struct usb_serial_port *port, const unsigned char *buf, int count); @@ -60,14 +70,17 @@ static int option_tiocmset (struct usb_serial_port *port, struct file *file, static int option_send_setup (struct usb_serial_port *port); /* Vendor and product IDs */ -#define OPTION_VENDOR_ID 0x0AF0 +#define OPTION_VENDOR_ID 0x0AF0 + +#define OPTION_PRODUCT_OLD 0x5000 +#define OPTION_PRODUCT_FUSION 0x6000 +#define OPTION_PRODUCT_FUSION2 0x6300 -#define OPTION_PRODUCT_OLD 0x5000 -#define OPTION_PRODUCT_WLAN 0x6000 static struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_WLAN) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, { } /* Terminating entry */ }; @@ -85,58 +98,62 @@ static struct usb_driver option_driver = { * recognizes separately, thus num_port=1. */ static struct usb_serial_device_type option_3port_device = { - .owner = THIS_MODULE, - .name = "Option 3-port card", - .short_name = "option", - .id_table = option_ids, - .num_interrupt_in = NUM_DONT_CARE, - .num_bulk_in = NUM_DONT_CARE, - .num_bulk_out = NUM_DONT_CARE, - .num_ports = 1, /* 3 */ - .open = option_open, - .close = option_close, - .write = option_write, - .write_room = option_write_room, - .chars_in_buffer = option_chars_in_buffer, - .throttle = option_rx_throttle, - .unthrottle = option_rx_unthrottle, - .ioctl = option_ioctl, - .set_termios = option_set_termios, - .break_ctl = option_break_ctl, - .tiocmget = option_tiocmget, - .tiocmset = option_tiocmset, - .attach = option_startup, - .shutdown = option_shutdown, - .read_int_callback = option_instat_callback, + .owner = THIS_MODULE, + .name = "Option 3G data card", + .short_name = "option", + .id_table = option_ids, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 1, /* 3, but the card reports its ports separately */ + .open = option_open, + .close = option_close, + .write = option_write, + .write_room = option_write_room, + .chars_in_buffer = option_chars_in_buffer, + .throttle = option_rx_throttle, + .unthrottle = option_rx_unthrottle, + .ioctl = option_ioctl, + .set_termios = option_set_termios, + .break_ctl = option_break_ctl, + .tiocmget = option_tiocmget, + .tiocmset = option_tiocmset, + .attach = option_startup, + .shutdown = option_shutdown, + .read_int_callback = option_instat_callback, }; +#ifdef CONFIG_USB_DEBUG static int debug; +#else +#define debug 0 +#endif + /* per port private data */ -#define N_IN_URB 4 -#define N_OUT_URB 1 -#define IN_BUFLEN 1024 -#define OUT_BUFLEN 1024 +#define N_IN_URB 4 +#define N_OUT_URB 1 +#define IN_BUFLEN 1024 +#define OUT_BUFLEN 128 struct option_port_private { /* Input endpoints and buffer for this port */ - struct urb *in_urbs[N_IN_URB]; - char in_buffer[N_IN_URB][IN_BUFLEN]; + struct urb *in_urbs[N_IN_URB]; + char in_buffer[N_IN_URB][IN_BUFLEN]; /* Output endpoints and buffer for this port */ - struct urb *out_urbs[N_OUT_URB]; - char out_buffer[N_OUT_URB][OUT_BUFLEN]; + struct urb *out_urbs[N_OUT_URB]; + char out_buffer[N_OUT_URB][OUT_BUFLEN]; /* Settings for the port */ - int rts_state; /* Handshaking pins (outputs) */ - int dtr_state; - int cts_state; /* Handshaking pins (inputs) */ - int dsr_state; - int dcd_state; - int ri_state; - // int break_on; - - unsigned long tx_start_time[N_OUT_URB]; + int rts_state; /* Handshaking pins (outputs) */ + int dtr_state; + int cts_state; /* Handshaking pins (inputs) */ + int dsr_state; + int dcd_state; + int ri_state; + + unsigned long tx_start_time[N_OUT_URB]; }; @@ -190,13 +207,13 @@ static void option_break_ctl (struct usb_serial_port *port, int break_state) { /* Unfortunately, I don't know how to send a break */ - dbg("%s", __FUNCTION__); + dbg("%s", __FUNCTION__); } static void option_set_termios (struct usb_serial_port *port, - struct termios *old_termios) + struct termios *old_termios) { dbg("%s", __FUNCTION__); @@ -204,10 +221,10 @@ option_set_termios (struct usb_serial_port *port, } static int -option_tiocmget(struct usb_serial_port *port, struct file *file) +option_tiocmget (struct usb_serial_port *port, struct file *file) { - unsigned int value; - struct option_port_private *portdata; + unsigned int value; + struct option_port_private *portdata; portdata = usb_get_serial_port_data(port); @@ -225,7 +242,7 @@ static int option_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear) { - struct option_port_private *portdata; + struct option_port_private *portdata; portdata = usb_get_serial_port_data(port); @@ -250,71 +267,50 @@ option_ioctl (struct usb_serial_port *port, struct file *file, /* Write */ static int -option_write(struct usb_serial_port *port, - const unsigned char *buf, int count) +option_write (struct usb_serial_port *port, + const unsigned char *buf, int count) { - struct option_port_private *portdata; - int i; - int left, todo; - struct urb *this_urb = NULL; /* spurious */ - int err; + struct option_port_private *portdata; + int i; + int left, todo; + struct urb *this_urb = NULL; /* spurious */ + int err; portdata = usb_get_serial_port_data(port); dbg("%s: write (%d chars)", __FUNCTION__, count); -#if 0 - spin_lock(&port->lock); - if (port->write_urb_busy) { - spin_unlock(&port->lock); - dbg("%s: already writing", __FUNCTION__); - return 0; - } - port->write_urb_busy = 1; - spin_unlock(&port->lock); -#endif - i = 0; left = count; - while (left>0) { + for (i=0; left > 0 && i < N_OUT_URB; i++) { todo = left; if (todo > OUT_BUFLEN) todo = OUT_BUFLEN; - for (;i < N_OUT_URB; i++) { - /* Check we have a valid urb/endpoint before we use it... */ - this_urb = portdata->out_urbs[i]; - if (this_urb->status != -EINPROGRESS) - break; + this_urb = portdata->out_urbs[i]; + if (this_urb->status == -EINPROGRESS) { if (this_urb->transfer_flags & URB_ASYNC_UNLINK) continue; if (time_before(jiffies, portdata->tx_start_time[i] + 10 * HZ)) continue; this_urb->transfer_flags |= URB_ASYNC_UNLINK; usb_unlink_urb(this_urb); + continue; } - - if (i == N_OUT_URB) { - /* no bulk out free! */ - dbg("%s: no output urb -- left %d", __FUNCTION__,count-left); -#if 0 - port->write_urb_busy = 0; -#endif - return count-left; - } + if (this_urb->status != 0) + dbg("usb_write %p failed (err=%d)", this_urb, this_urb->status); dbg("%s: endpoint %d buf %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), i); + /* send the data */ memcpy (this_urb->transfer_buffer, buf, todo); - - /* send the data out the bulk port */ this_urb->transfer_buffer_length = todo; this_urb->transfer_flags &= ~URB_ASYNC_UNLINK; this_urb->dev = port->serial->dev; err = usb_submit_urb(this_urb, GFP_ATOMIC); if (err) { - dbg("usb_submit_urb %p (write bulk) failed (%d,, has %d)", this_urb, err, this_urb->status); + dbg("usb_submit_urb %p (write bulk) failed (%d, has %d)", this_urb, err, this_urb->status); continue; } portdata->tx_start_time[i] = jiffies; @@ -323,9 +319,6 @@ option_write(struct usb_serial_port *port, } count -= left; -#if 0 - port->write_urb_busy = 0; -#endif dbg("%s: wrote (did %d)", __FUNCTION__, count); return count; } @@ -333,7 +326,7 @@ option_write(struct usb_serial_port *port, static void option_indat_callback (struct urb *urb, struct pt_regs *regs) { - int i, err; + int i, err; int endpoint; struct usb_serial_port *port; struct tty_struct *tty; @@ -444,10 +437,11 @@ option_write_room (struct usb_serial_port *port) portdata = usb_get_serial_port_data(port); - for (i=0; i < N_OUT_URB; i++) + for (i=0; i < N_OUT_URB; i++) { this_urb = portdata->out_urbs[i]; if (this_urb && this_urb->status != -EINPROGRESS) data_len += OUT_BUFLEN; + } dbg("%s: %d", __FUNCTION__, data_len); return data_len; @@ -464,11 +458,11 @@ option_chars_in_buffer (struct usb_serial_port *port) portdata = usb_get_serial_port_data(port); - for (i=0; i < N_OUT_URB; i++) + for (i=0; i < N_OUT_URB; i++) { this_urb = portdata->out_urbs[i]; if (this_urb && this_urb->status == -EINPROGRESS) data_len += this_urb->transfer_buffer_length; - + } dbg("%s: %d", __FUNCTION__, data_len); return data_len; } @@ -477,10 +471,10 @@ option_chars_in_buffer (struct usb_serial_port *port) static int option_open (struct usb_serial_port *port, struct file *filp) { - struct option_port_private *portdata; - struct usb_serial *serial = port->serial; - int i, err; - struct urb *urb; + struct option_port_private *portdata; + struct usb_serial *serial = port->serial; + int i, err; + struct urb *urb; portdata = usb_get_serial_port_data(port); @@ -528,7 +522,7 @@ option_open (struct usb_serial_port *port, struct file *filp) } static inline void -stop_urb(struct urb *urb) +stop_urb (struct urb *urb) { if (urb && urb->status == -EINPROGRESS) { urb->transfer_flags &= ~URB_ASYNC_UNLINK; @@ -537,11 +531,11 @@ stop_urb(struct urb *urb) } static void -option_close(struct usb_serial_port *port, struct file *filp) +option_close (struct usb_serial_port *port, struct file *filp) { - int i; - struct usb_serial *serial = port->serial; - struct option_port_private *portdata; + int i; + struct usb_serial *serial = port->serial; + struct option_port_private *portdata; dbg("%s", __FUNCTION__); portdata = usb_get_serial_port_data(port); @@ -589,11 +583,11 @@ option_setup_urb (struct usb_serial *serial, int endpoint, /* Setup urbs */ static void -option_setup_urbs(struct usb_serial *serial) +option_setup_urbs (struct usb_serial *serial) { - int j; - struct usb_serial_port *port; - struct option_port_private *portdata; + int j; + struct usb_serial_port *port; + struct option_port_private *portdata; dbg("%s", __FUNCTION__); @@ -617,7 +611,7 @@ option_setup_urbs(struct usb_serial *serial) static int -option_send_setup(struct usb_serial_port *port) +option_send_setup (struct usb_serial_port *port) { struct usb_serial *serial = port->serial; struct option_port_private *portdata; @@ -644,9 +638,9 @@ option_send_setup(struct usb_serial_port *port) static int option_startup (struct usb_serial *serial) { - int i, err; - struct usb_serial_port *port; - struct option_port_private *portdata; + int i, err; + struct usb_serial_port *port; + struct option_port_private *portdata; dbg("%s", __FUNCTION__); @@ -677,9 +671,9 @@ option_startup (struct usb_serial *serial) static void option_shutdown (struct usb_serial *serial) { - int i, j; - struct usb_serial_port *port; - struct option_port_private *portdata; + int i, j; + struct usb_serial_port *port; + struct option_port_private *portdata; dbg("%s", __FUNCTION__); @@ -724,6 +718,8 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_VERSION(DRIVER_VERSION); MODULE_LICENSE("GPL"); +#ifdef CONFIG_USB_DEBUG module_param(debug, bool, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(debug, "Debug messages"); +#endif |