diff --git a/[refs] b/[refs] index 0b2fe4822728..456e3e4e83e2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3a3485be68c3b44dd7e3790472976fdc2467bb40 +refs/heads/master: 02febdf7f62f2fbfa89ca9dc5d929beea89c96b1 diff --git a/trunk/drivers/media/dvb/dvb-usb/af9005-fe.c b/trunk/drivers/media/dvb/dvb-usb/af9005-fe.c index b1a9c4cdec93..7195c9461524 100644 --- a/trunk/drivers/media/dvb/dvb-usb/af9005-fe.c +++ b/trunk/drivers/media/dvb/dvb-usb/af9005-fe.c @@ -29,6 +29,8 @@ struct af9005_fe_state { struct dvb_usb_device *d; + struct dvb_frontend *tuner; + fe_status_t stat; /* retraining parameters */ @@ -343,8 +345,8 @@ static int af9005_reset_pre_viterbi(struct dvb_frontend *fe) 1 & 0xff); if (ret) return ret; - ret = af9005_write_ofdm_register(state->d, xd_p_fec_super_frm_unit_15_8, - 1 >> 8); + af9005_write_ofdm_register(state->d, xd_p_fec_super_frm_unit_15_8, + 1 >> 8); if (ret) return ret; /* reset pre viterbi error count */ @@ -445,7 +447,7 @@ static int af9005_fe_read_status(struct dvb_frontend *fe, fe_status_t * stat) u8 temp; int ret; - if (fe->ops.tuner_ops.release == NULL) + if (state->tuner == NULL) return -ENODEV; *stat = 0; @@ -491,7 +493,7 @@ static int af9005_fe_read_status(struct dvb_frontend *fe, fe_status_t * stat) static int af9005_fe_read_ber(struct dvb_frontend *fe, u32 * ber) { struct af9005_fe_state *state = fe->demodulator_priv; - if (fe->ops.tuner_ops.release == NULL) + if (state->tuner == NULL) return -ENODEV; af9005_fe_refresh_state(fe); *ber = state->ber; @@ -501,7 +503,7 @@ static int af9005_fe_read_ber(struct dvb_frontend *fe, u32 * ber) static int af9005_fe_read_unc_blocks(struct dvb_frontend *fe, u32 * unc) { struct af9005_fe_state *state = fe->demodulator_priv; - if (fe->ops.tuner_ops.release == NULL) + if (state->tuner == NULL) return -ENODEV; af9005_fe_refresh_state(fe); *unc = state->unc; @@ -515,7 +517,7 @@ static int af9005_fe_read_signal_strength(struct dvb_frontend *fe, int ret; u8 if_gain, rf_gain; - if (fe->ops.tuner_ops.release == NULL) + if (state->tuner == NULL) return -ENODEV; ret = af9005_read_ofdm_register(state->d, xd_r_reg_aagc_rf_gain, @@ -879,8 +881,10 @@ static int af9005_fe_init(struct dvb_frontend *fe) af9005_write_register_bits(state->d, xd_I2C_reg_ofdm_rst, reg_ofdm_rst_pos, reg_ofdm_rst_len, 1))) return ret; - ret = af9005_write_register_bits(state->d, xd_I2C_reg_ofdm_rst, - reg_ofdm_rst_pos, reg_ofdm_rst_len, 0); + if ((ret = + af9005_write_register_bits(state->d, xd_I2C_reg_ofdm_rst, + reg_ofdm_rst_pos, reg_ofdm_rst_len, 0))) + return ret; if (ret) return ret; @@ -1037,7 +1041,7 @@ static int af9005_fe_init(struct dvb_frontend *fe) return ret; /* attach tuner and init */ - if (fe->ops.tuner_ops.release == NULL) { + if (state->tuner == NULL) { /* read tuner and board id from eeprom */ ret = af9005_read_eeprom(adap->dev, 0xc6, buf, 2); if (ret) { @@ -1054,16 +1058,20 @@ static int af9005_fe_init(struct dvb_frontend *fe) return ret; } if1 = (u16) (buf[0] << 8) + buf[1]; - if (dvb_attach(mt2060_attach, fe, &adap->dev->i2c_adap, - &af9005_mt2060_config, if1) == NULL) { + state->tuner = + dvb_attach(mt2060_attach, fe, &adap->dev->i2c_adap, + &af9005_mt2060_config, if1); + if (state->tuner == NULL) { deb_info("MT2060 attach failed\n"); return -ENODEV; } break; case 3: /* QT1010 */ case 9: /* QT1010B */ - if (dvb_attach(qt1010_attach, fe, &adap->dev->i2c_adap, - &af9005_qt1010_config) ==NULL) { + state->tuner = + dvb_attach(qt1010_attach, fe, &adap->dev->i2c_adap, + &af9005_qt1010_config); + if (state->tuner == NULL) { deb_info("QT1010 attach failed\n"); return -ENODEV; } @@ -1072,7 +1080,7 @@ static int af9005_fe_init(struct dvb_frontend *fe) err("Unsupported tuner type %d", buf[0]); return -ENODEV; } - ret = fe->ops.tuner_ops.init(fe); + ret = state->tuner->ops.tuner_ops.init(state->tuner); if (ret) return ret; } @@ -1110,7 +1118,7 @@ static int af9005_fe_set_frontend(struct dvb_frontend *fe, deb_info("af9005_fe_set_frontend freq %d bw %d\n", fep->frequency, fep->u.ofdm.bandwidth); - if (fe->ops.tuner_ops.release == NULL) { + if (state->tuner == NULL) { err("Tuner not attached"); return -ENODEV; } @@ -1191,7 +1199,7 @@ static int af9005_fe_set_frontend(struct dvb_frontend *fe, return ret; /* set tuner */ deb_info("set tuner\n"); - ret = fe->ops.tuner_ops.set_params(fe, fep); + ret = state->tuner->ops.tuner_ops.set_params(state->tuner, fep); if (ret) return ret; @@ -1427,6 +1435,12 @@ static void af9005_fe_release(struct dvb_frontend *fe) { struct af9005_fe_state *state = (struct af9005_fe_state *)fe->demodulator_priv; + if (state->tuner != NULL && state->tuner->ops.tuner_ops.release != NULL) { + state->tuner->ops.tuner_ops.release(state->tuner); +#ifdef CONFIG_DVB_CORE_ATTACH + symbol_put_addr(state->tuner->ops.tuner_ops.release); +#endif + } kfree(state); } @@ -1444,6 +1458,7 @@ struct dvb_frontend *af9005_fe_attach(struct dvb_usb_device *d) deb_info("attaching frontend af9005\n"); state->d = d; + state->tuner = NULL; state->opened = 0; memcpy(&state->frontend.ops, &af9005_fe_ops, diff --git a/trunk/drivers/media/dvb/frontends/dvb-pll.c b/trunk/drivers/media/dvb/frontends/dvb-pll.c index ca99e439c97c..0c0b94767bc1 100644 --- a/trunk/drivers/media/dvb/frontends/dvb-pll.c +++ b/trunk/drivers/media/dvb/frontends/dvb-pll.c @@ -501,7 +501,7 @@ static struct dvb_pll_desc dvb_pll_opera1 = { /* Philips FCV1236D */ -static struct dvb_pll_desc dvb_pll_fcv1236d = { +struct dvb_pll_desc dvb_pll_fcv1236d = { /* Bit_0: RF Input select * Bit_1: 0=digital, 1=analog */ diff --git a/trunk/drivers/media/video/bt8xx/bttv-cards.c b/trunk/drivers/media/video/bt8xx/bttv-cards.c index f6715007d409..387cb2122d4f 100644 --- a/trunk/drivers/media/video/bt8xx/bttv-cards.c +++ b/trunk/drivers/media/video/bt8xx/bttv-cards.c @@ -33,7 +33,6 @@ #include #include #include -#include #include @@ -46,7 +45,7 @@ static void boot_msp34xx(struct bttv *btv, int pin); static void boot_bt832(struct bttv *btv); static void hauppauge_eeprom(struct bttv *btv); static void avermedia_eeprom(struct bttv *btv); -static void osprey_eeprom(struct bttv *btv, const u8 ee[256]); +static void osprey_eeprom(struct bttv *btv); static void modtec_eeprom(struct bttv *btv); static void init_PXC200(struct bttv *btv); static void init_RTV24(struct bttv *btv); @@ -2844,28 +2843,13 @@ struct tvcard bttv_tvcards[] = { .has_remote = 1, }, /* ---- card 0x8c ---------------------------------- */ - /* Has four Bt878 chips behind a PCI bridge, each chip has: - one external BNC composite input (mux 2) - three internal composite inputs (unknown muxes) - an 18-bit stereo A/D (CS5331A), which has: - one external stereo unblanced (RCA) audio connection - one (or 3?) internal stereo balanced (XLR) audio connection - input is selected via gpio to a 14052B mux - (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300) - gain is controlled via an X9221A chip on the I2C bus @0x28 - sample rate is controlled via gpio to an MK1413S - (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3) - There is neither a tuner nor an svideo input. */ [BTTV_BOARD_OSPREY440] = { .name = "Osprey 440", - .video_inputs = 4, - .audio_inputs = 2, /* this is meaningless */ + .video_inputs = 1, + .audio_inputs = 1, .tuner = UNSET, - .svhs = UNSET, - .muxsel = { 2, 3, 0, 1 }, /* 3,0,1 are guesses */ - .gpiomask = 0x303, - .gpiomute = 0x000, /* int + 32kHz */ - .gpiomux = { 0, 0, 0x000, 0x100}, + .svhs = 1, + .muxsel = { 2 }, .pll = PLL_28, .tuner_type = UNSET, .tuner_addr = ADDR_UNSET, @@ -3469,12 +3453,11 @@ void __devinit bttv_init_card2(struct bttv *btv) case BTTV_BOARD_OSPREY2xx: case BTTV_BOARD_OSPREY2x0_SVID: case BTTV_BOARD_OSPREY2x0: - case BTTV_BOARD_OSPREY440: case BTTV_BOARD_OSPREY500: case BTTV_BOARD_OSPREY540: case BTTV_BOARD_OSPREY2000: bttv_readee(btv,eeprom_data,0xa0); - osprey_eeprom(btv, eeprom_data); + osprey_eeprom(btv); break; case BTTV_BOARD_IDS_EAGLE: init_ids_eagle(btv); @@ -3765,119 +3748,106 @@ static int __devinit pvr_boot(struct bttv *btv) /* ----------------------------------------------------------------------- */ /* some osprey specific stuff */ -static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256]) +static void __devinit osprey_eeprom(struct bttv *btv) { - int i; - u32 serial = 0; - int cardid = -1; - - /* This code will nevery actually get called in this case.... */ - if (btv->c.type == BTTV_BOARD_UNKNOWN) { - /* this might be an antique... check for MMAC label in eeprom */ - if (!strncmp(ee, "MMAC", 4)) { - u8 checksum = 0; - for (i = 0; i < 21; i++) - checksum += ee[i]; - if (checksum != ee[21]) - return; - cardid = BTTV_BOARD_OSPREY1x0_848; - for (i = 12; i < 21; i++) - serial *= 10, serial += ee[i] - '0'; - } + int i = 0; + unsigned char *ee = eeprom_data; + unsigned long serial = 0; + + if (btv->c.type == 0) { + /* this might be an antique... check for MMAC label in eeprom */ + if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) { + unsigned char checksum = 0; + for (i = 0; i < 21; i++) + checksum += ee[i]; + if (checksum != ee[21]) + return; + btv->c.type = BTTV_BOARD_OSPREY1x0_848; + for (i = 12; i < 21; i++) + serial *= 10, serial += ee[i] - '0'; + } } else { - unsigned short type; - - for (i = 4*16; i < 8*16; i += 16) { - u16 checksum = ip_compute_csum(ee + i, 16); - - if ((checksum&0xff) + (checksum>>8) == 0xff) - break; - } - if (i >= 8*16) - return; - ee += i; - - /* found a valid descriptor */ - type = be16_to_cpup((u16*)(ee+4)); - - switch(type) { - /* 848 based */ - case 0x0004: - cardid = BTTV_BOARD_OSPREY1x0_848; - break; - case 0x0005: - cardid = BTTV_BOARD_OSPREY101_848; - break; - - /* 878 based */ - case 0x0012: - case 0x0013: - cardid = BTTV_BOARD_OSPREY1x0; - break; - case 0x0014: - case 0x0015: - cardid = BTTV_BOARD_OSPREY1x1; - break; - case 0x0016: - case 0x0017: - case 0x0020: - cardid = BTTV_BOARD_OSPREY1x1_SVID; - break; - case 0x0018: - case 0x0019: - case 0x001E: - case 0x001F: - cardid = BTTV_BOARD_OSPREY2xx; - break; - case 0x001A: - case 0x001B: - cardid = BTTV_BOARD_OSPREY2x0_SVID; - break; - case 0x0040: - cardid = BTTV_BOARD_OSPREY500; - break; - case 0x0050: - case 0x0056: - cardid = BTTV_BOARD_OSPREY540; - /* bttv_osprey_540_init(btv); */ - break; - case 0x0060: - case 0x0070: - case 0x00A0: - cardid = BTTV_BOARD_OSPREY2x0; - /* enable output on select control lines */ - gpio_inout(0xffffff,0x000303); - break; - case 0x00D8: - cardid = BTTV_BOARD_OSPREY440; - break; - default: - /* unknown...leave generic, but get serial # */ - printk(KERN_INFO "bttv%d: " - "osprey eeprom: unknown card type 0x%04x\n", - btv->c.nr, type); - break; - } - serial = be32_to_cpup((u32*)(ee+6)); - } - - printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n", - btv->c.nr, cardid, - cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial); - - if (cardid<0 || btv->c.type == cardid) - return; - - /* card type isn't set correctly */ - if (card[btv->c.nr] < bttv_num_tvcards) { - printk(KERN_WARNING "bttv%d: osprey eeprom: " - "Not overriding user specified card type\n", btv->c.nr); - } else { - printk(KERN_INFO "bttv%d: osprey eeprom: " - "Changing card type from %d to %d\n", btv->c.nr, - btv->c.type, cardid); - btv->c.type = cardid; - } + unsigned short type; + int offset = 4*16; + + for (; offset < 8*16; offset += 16) { + unsigned short checksum = 0; + /* verify the checksum */ + for (i = 0; i < 14; i++) + checksum += ee[i+offset]; + checksum = ~checksum; /* no idea why */ + if ((((checksum>>8)&0x0FF) == ee[offset+14]) && + ((checksum & 0x0FF) == ee[offset+15])) { + break; + } + } + + if (offset >= 8*16) + return; + + /* found a valid descriptor */ + type = (ee[offset+4]<<8) | (ee[offset+5]); + + switch(type) { + /* 848 based */ + case 0x0004: + btv->c.type = BTTV_BOARD_OSPREY1x0_848; + break; + case 0x0005: + btv->c.type = BTTV_BOARD_OSPREY101_848; + break; + + /* 878 based */ + case 0x0012: + case 0x0013: + btv->c.type = BTTV_BOARD_OSPREY1x0; + break; + case 0x0014: + case 0x0015: + btv->c.type = BTTV_BOARD_OSPREY1x1; + break; + case 0x0016: + case 0x0017: + case 0x0020: + btv->c.type = BTTV_BOARD_OSPREY1x1_SVID; + break; + case 0x0018: + case 0x0019: + case 0x001E: + case 0x001F: + btv->c.type = BTTV_BOARD_OSPREY2xx; + break; + case 0x001A: + case 0x001B: + btv->c.type = BTTV_BOARD_OSPREY2x0_SVID; + break; + case 0x0040: + btv->c.type = BTTV_BOARD_OSPREY500; + break; + case 0x0050: + case 0x0056: + btv->c.type = BTTV_BOARD_OSPREY540; + /* bttv_osprey_540_init(btv); */ + break; + case 0x0060: + case 0x0070: + case 0x00A0: + btv->c.type = BTTV_BOARD_OSPREY2x0; + /* enable output on select control lines */ + gpio_inout(0xffffff,0x000303); + break; + default: + /* unknown...leave generic, but get serial # */ + break; + } + serial = (ee[offset+6] << 24) + | (ee[offset+7] << 16) + | (ee[offset+8] << 8) + | (ee[offset+9]); + } + + printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n", + btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial); } /* ----------------------------------------------------------------------- */ diff --git a/trunk/drivers/media/video/ivtv/ivtv-driver.h b/trunk/drivers/media/video/ivtv/ivtv-driver.h index 8abb34a35816..91b588d261ae 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-driver.h +++ b/trunk/drivers/media/video/ivtv/ivtv-driver.h @@ -417,7 +417,6 @@ struct ivtv_mailbox_data { #define IVTV_F_I_WORK_HANDLER_YUV 17 /* there is work to be done for YUV */ #define IVTV_F_I_WORK_HANDLER_PIO 18 /* there is work to be done for PIO */ #define IVTV_F_I_PIO 19 /* PIO in progress */ -#define IVTV_F_I_DEC_PAUSED 20 /* the decoder is paused */ /* Event notifications */ #define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */ diff --git a/trunk/drivers/media/video/ivtv/ivtv-fileops.c b/trunk/drivers/media/video/ivtv/ivtv-fileops.c index 5dd519caf81d..8e97a938398f 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-fileops.c +++ b/trunk/drivers/media/video/ivtv/ivtv-fileops.c @@ -757,7 +757,6 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts) itv->output_mode = OUT_NONE; itv->speed = 0; - clear_bit(IVTV_F_I_DEC_PAUSED, &itv->i_flags); ivtv_release_stream(s); } @@ -800,16 +799,7 @@ int ivtv_v4l2_close(struct inode *inode, struct file *filp) ivtv_unmute(itv); ivtv_release_stream(s); } else if (s->type >= IVTV_DEC_STREAM_TYPE_MPG) { - struct ivtv_stream *s_vout = &itv->streams[IVTV_DEC_STREAM_TYPE_VOUT]; - ivtv_stop_decoding(id, VIDEO_CMD_STOP_TO_BLACK | VIDEO_CMD_STOP_IMMEDIATELY, 0); - - /* If all output streams are closed, and if the user doesn't have - IVTV_DEC_STREAM_TYPE_VOUT open, then disable VBI on TV-out. */ - if (itv->output_mode == OUT_NONE && !test_bit(IVTV_F_S_APPL_IO, &s_vout->s_flags)) { - /* disable VBI on TV-out */ - ivtv_disable_vbi(itv); - } } else { ivtv_stop_capture(id, 0); } diff --git a/trunk/drivers/media/video/ivtv/ivtv-firmware.c b/trunk/drivers/media/video/ivtv/ivtv-firmware.c index 425eb1063904..d0feabf93080 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-firmware.c +++ b/trunk/drivers/media/video/ivtv/ivtv-firmware.c @@ -72,8 +72,8 @@ static int load_fw_direct(const char *fn, volatile u8 __iomem *mem, struct ivtv dst++; src++; } - IVTV_INFO("Loaded %s firmware (%zd bytes)\n", fn, fw->size); release_firmware(fw); + IVTV_INFO("Loaded %s firmware (%zd bytes)\n", fn, fw->size); return size; } IVTV_ERR("Unable to open firmware %s (must be %ld bytes)\n", fn, size); diff --git a/trunk/drivers/media/video/ivtv/ivtv-ioctl.c b/trunk/drivers/media/video/ivtv/ivtv-ioctl.c index 047624b9e271..4773453e8dab 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/trunk/drivers/media/video/ivtv/ivtv-ioctl.c @@ -285,10 +285,6 @@ static int ivtv_video_command(struct ivtv *itv, struct ivtv_open_id *id, if (ivtv_set_output_mode(itv, OUT_MPG) != OUT_MPG) return -EBUSY; - if (test_and_clear_bit(IVTV_F_I_DEC_PAUSED, &itv->i_flags)) { - /* forces ivtv_set_speed to be called */ - itv->speed = 0; - } return ivtv_start_decoding(id, vc->play.speed); } @@ -313,7 +309,6 @@ static int ivtv_video_command(struct ivtv *itv, struct ivtv_open_id *id, if (atomic_read(&itv->decoding) > 0) { ivtv_vapi(itv, CX2341X_DEC_PAUSE_PLAYBACK, 1, (vc->flags & VIDEO_CMD_FREEZE_TO_BLACK) ? 1 : 0); - set_bit(IVTV_F_I_DEC_PAUSED, &itv->i_flags); } break; @@ -322,10 +317,8 @@ static int ivtv_video_command(struct ivtv *itv, struct ivtv_open_id *id, if (try) break; if (itv->output_mode != OUT_MPG) return -EBUSY; - if (test_and_clear_bit(IVTV_F_I_DEC_PAUSED, &itv->i_flags)) { - int speed = itv->speed; - itv->speed = 0; - return ivtv_start_decoding(id, speed); + if (atomic_read(&itv->decoding) > 0) { + ivtv_vapi(itv, CX2341X_DEC_START_PLAYBACK, 2, 0, 0); } break; diff --git a/trunk/drivers/media/video/ivtv/ivtv-mailbox.c b/trunk/drivers/media/video/ivtv/ivtv-mailbox.c index 5e3b679202ae..814a673712b3 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-mailbox.c +++ b/trunk/drivers/media/video/ivtv/ivtv-mailbox.c @@ -40,7 +40,6 @@ #define API_HIGH_VOL (1 << 5) /* High volume command (i.e. called during encoding or decoding) */ #define API_NO_WAIT_MB (1 << 4) /* Command may not wait for a free mailbox */ #define API_NO_WAIT_RES (1 << 5) /* Command may not wait for the result */ -#define API_NO_POLL (1 << 6) /* Avoid pointless polling */ struct ivtv_api_info { int flags; /* Flags, see above */ @@ -52,7 +51,7 @@ struct ivtv_api_info { static const struct ivtv_api_info api_info[256] = { /* MPEG encoder API */ API_ENTRY(CX2341X_ENC_PING_FW, API_FAST_RESULT), - API_ENTRY(CX2341X_ENC_START_CAPTURE, API_RESULT | API_NO_POLL), + API_ENTRY(CX2341X_ENC_START_CAPTURE, API_RESULT), API_ENTRY(CX2341X_ENC_STOP_CAPTURE, API_RESULT), API_ENTRY(CX2341X_ENC_SET_AUDIO_ID, API_CACHE), API_ENTRY(CX2341X_ENC_SET_VIDEO_ID, API_CACHE), @@ -97,7 +96,7 @@ static const struct ivtv_api_info api_info[256] = { /* MPEG decoder API */ API_ENTRY(CX2341X_DEC_PING_FW, API_FAST_RESULT), - API_ENTRY(CX2341X_DEC_START_PLAYBACK, API_RESULT | API_NO_POLL), + API_ENTRY(CX2341X_DEC_START_PLAYBACK, API_RESULT), API_ENTRY(CX2341X_DEC_STOP_PLAYBACK, API_RESULT), API_ENTRY(CX2341X_DEC_SET_PLAYBACK_SPEED, API_RESULT), API_ENTRY(CX2341X_DEC_STEP_VIDEO, API_RESULT), @@ -291,13 +290,6 @@ static int ivtv_api_call(struct ivtv *itv, int cmd, int args, u32 data[]) /* Get results */ then = jiffies; - if (!(flags & API_NO_POLL)) { - /* First try to poll, then switch to delays */ - for (i = 0; i < 100; i++) { - if (readl(&mbox->flags) & IVTV_MBOX_FIRMWARE_DONE) - break; - } - } while (!(readl(&mbox->flags) & IVTV_MBOX_FIRMWARE_DONE)) { if (jiffies - then > api_timeout) { IVTV_DEBUG_WARN("Could not get result (%s)\n", api_info[cmd].name); @@ -309,7 +301,7 @@ static int ivtv_api_call(struct ivtv *itv, int cmd, int args, u32 data[]) if (flags & API_NO_WAIT_RES) mdelay(1); else - ivtv_msleep_timeout(1, 0); + ivtv_msleep_timeout(10, 0); } if (jiffies - then > msecs_to_jiffies(100)) IVTV_DEBUG_WARN("%s took %u jiffies\n", diff --git a/trunk/drivers/media/video/ivtv/ivtv-streams.c b/trunk/drivers/media/video/ivtv/ivtv-streams.c index 51df3f855031..322b347b67c2 100644 --- a/trunk/drivers/media/video/ivtv/ivtv-streams.c +++ b/trunk/drivers/media/video/ivtv/ivtv-streams.c @@ -603,6 +603,10 @@ static int ivtv_setup_v4l2_decode_stream(struct ivtv_stream *s) IVTV_DEBUG_INFO("Setting some initial decoder settings\n"); + /* disable VBI signals, if the MPEG stream contains VBI data, + then that data will be processed automatically for you. */ + ivtv_disable_vbi(itv); + /* set audio mode to left/stereo for dual/stereo mode. */ ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode); @@ -635,7 +639,7 @@ static int ivtv_setup_v4l2_decode_stream(struct ivtv_stream *s) } if (ivtv_vapi(itv, CX2341X_DEC_SET_DECODER_SOURCE, 4, datatype, itv->params.width, itv->params.height, itv->params.audio_properties)) { - IVTV_DEBUG_WARN("Couldn't initialize decoder source\n"); + IVTV_DEBUG_WARN("COULDN'T INITIALIZE DECODER SOURCE\n"); } return 0; } @@ -905,6 +909,11 @@ int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts) clear_bit(IVTV_F_S_STREAMING, &s->s_flags); ivtv_flush_queues(s); + if (!test_bit(IVTV_F_S_PASSTHROUGH, &s->s_flags)) { + /* disable VBI on TV-out */ + ivtv_disable_vbi(itv); + } + /* decrement decoding */ atomic_dec(&itv->decoding); diff --git a/trunk/drivers/media/video/usbvision/usbvision-video.c b/trunk/drivers/media/video/usbvision/usbvision-video.c index e3371f972240..868b6886fe7f 100644 --- a/trunk/drivers/media/video/usbvision/usbvision-video.c +++ b/trunk/drivers/media/video/usbvision/usbvision-video.c @@ -517,7 +517,6 @@ static int vidioc_g_register (struct file *file, void *priv, __FUNCTION__, errCode); return errCode; } - reg->val = errCode; return 0; } @@ -532,8 +531,8 @@ static int vidioc_s_register (struct file *file, void *priv, if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) return -EINVAL; /* NT100x has a 8-bit register space */ - errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); - if (errCode < 0) { + reg->val = (u8)usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); + if (reg->val < 0) { err("%s: VIDIOC_DBG_S_REGISTER failed: error %d", __FUNCTION__, errCode); return errCode; diff --git a/trunk/drivers/media/video/zoran.h b/trunk/drivers/media/video/zoran.h index 937c4a616c0e..8fb4a3414e0a 100644 --- a/trunk/drivers/media/video/zoran.h +++ b/trunk/drivers/media/video/zoran.h @@ -240,16 +240,11 @@ enum gpcs_type { struct zoran_format { char *name; -#ifdef CONFIG_VIDEO_V4L1_COMPAT int palette; -#endif -#ifdef CONFIG_VIDEO_V4L2 __u32 fourcc; int colorspace; -#endif int depth; __u32 flags; - __u32 vfespfr; }; /* flags */ #define ZORAN_FORMAT_COMPRESSED 1<<0 diff --git a/trunk/drivers/media/video/zoran_device.c b/trunk/drivers/media/video/zoran_device.c index ba2f4ed29483..b0752767ee4f 100644 --- a/trunk/drivers/media/video/zoran_device.c +++ b/trunk/drivers/media/video/zoran_device.c @@ -429,6 +429,8 @@ zr36057_set_vfe (struct zoran *zr, reg |= (HorDcm << ZR36057_VFESPFR_HorDcm); reg |= (VerDcm << ZR36057_VFESPFR_VerDcm); reg |= (DispMode << ZR36057_VFESPFR_DispMode); + if (format->palette != VIDEO_PALETTE_YUV422 && format->palette != VIDEO_PALETTE_YUYV) + reg |= ZR36057_VFESPFR_LittleEndian; /* RJ: I don't know, why the following has to be the opposite * of the corresponding ZR36060 setting, but only this way * we get the correct colors when uncompressing to the screen */ @@ -437,6 +439,36 @@ zr36057_set_vfe (struct zoran *zr, if (zr->norm != VIDEO_MODE_NTSC) reg |= ZR36057_VFESPFR_ExtFl; // NEEDED!!!!!!! Wolfgang reg |= ZR36057_VFESPFR_TopField; + switch (format->palette) { + + case VIDEO_PALETTE_YUYV: + case VIDEO_PALETTE_YUV422: + reg |= ZR36057_VFESPFR_YUV422; + break; + + case VIDEO_PALETTE_RGB555: + reg |= ZR36057_VFESPFR_RGB555 | ZR36057_VFESPFR_ErrDif; + break; + + case VIDEO_PALETTE_RGB565: + reg |= ZR36057_VFESPFR_RGB565 | ZR36057_VFESPFR_ErrDif; + break; + + case VIDEO_PALETTE_RGB24: + reg |= ZR36057_VFESPFR_RGB888 | ZR36057_VFESPFR_Pack24; + break; + + case VIDEO_PALETTE_RGB32: + reg |= ZR36057_VFESPFR_RGB888; + break; + + default: + dprintk(1, + KERN_INFO "%s: set_vfe() - unknown color_fmt=%x\n", + ZR_DEVNAME(zr), format->palette); + return; + + } if (HorDcm >= 48) { reg |= 3 << ZR36057_VFESPFR_HFilter; /* 5 tap filter */ } else if (HorDcm >= 32) { @@ -444,7 +476,6 @@ zr36057_set_vfe (struct zoran *zr, } else if (HorDcm >= 16) { reg |= 1 << ZR36057_VFESPFR_HFilter; /* 3 tap filter */ } - reg |= format->vfespfr; btwrite(reg, ZR36057_VFESPFR); /* display configuration */ @@ -620,17 +651,11 @@ zr36057_set_memgrab (struct zoran *zr, int mode) { if (mode) { - /* We only check SnapShot and not FrameGrab here. SnapShot==1 - * means a capture is already in progress, but FrameGrab==1 - * doesn't necessary mean that. It's more correct to say a 1 - * to 0 transition indicates a capture completed. If a - * capture is pending when capturing is tuned off, FrameGrab - * will be stuck at 1 until capturing is turned back on. - */ - if (btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_SnapShot) + if (btread(ZR36057_VSSFGR) & + (ZR36057_VSSFGR_SnapShot | ZR36057_VSSFGR_FrameGrab)) dprintk(1, KERN_WARNING - "%s: zr36057_set_memgrab(1) with SnapShot on!?\n", + "%s: zr36057_set_memgrab(1) with SnapShot or FrameGrab on!?\n", ZR_DEVNAME(zr)); /* switch on VSync interrupts */ @@ -647,12 +672,11 @@ zr36057_set_memgrab (struct zoran *zr, zr->v4l_memgrab_active = 1; } else { + zr->v4l_memgrab_active = 0; + /* switch off VSync interrupts */ btand(~zr->card.vsync_int, ZR36057_ICR); // SW - zr->v4l_memgrab_active = 0; - zr->v4l_grab_frame = NO_GRAB_ACTIVE; - /* reenable grabbing to screen if it was running */ if (zr->v4l_overlay_active) { zr36057_overlay(zr, 1); diff --git a/trunk/drivers/media/video/zoran_driver.c b/trunk/drivers/media/video/zoran_driver.c index 72a037b75d63..17118a490f81 100644 --- a/trunk/drivers/media/video/zoran_driver.c +++ b/trunk/drivers/media/video/zoran_driver.c @@ -99,103 +99,88 @@ #include -#if defined(CONFIG_VIDEO_V4L2) && defined(CONFIG_VIDEO_V4L1_COMPAT) -#define ZFMT(pal, fcc, cs) \ - .palette = (pal), .fourcc = (fcc), .colorspace = (cs) -#elif defined(CONFIG_VIDEO_V4L2) -#define ZFMT(pal, fcc, cs) \ - .fourcc = (fcc), .colorspace = (cs) -#else -#define ZFMT(pal, fcc, cs) \ - .palette = (pal) -#endif - const struct zoran_format zoran_formats[] = { { - .name = "15-bit RGB LE", - ZFMT(VIDEO_PALETTE_RGB555, - V4L2_PIX_FMT_RGB555, V4L2_COLORSPACE_SRGB), - .depth = 15, - .flags = ZORAN_FORMAT_CAPTURE | - ZORAN_FORMAT_OVERLAY, - .vfespfr = ZR36057_VFESPFR_RGB555|ZR36057_VFESPFR_ErrDif| - ZR36057_VFESPFR_LittleEndian, - }, { - .name = "15-bit RGB BE", - ZFMT(-1, - V4L2_PIX_FMT_RGB555X, V4L2_COLORSPACE_SRGB), + .name = "15-bit RGB", + .palette = VIDEO_PALETTE_RGB555, +#ifdef CONFIG_VIDEO_V4L2 +#ifdef __LITTLE_ENDIAN + .fourcc = V4L2_PIX_FMT_RGB555, +#else + .fourcc = V4L2_PIX_FMT_RGB555X, +#endif + .colorspace = V4L2_COLORSPACE_SRGB, +#endif .depth = 15, .flags = ZORAN_FORMAT_CAPTURE | ZORAN_FORMAT_OVERLAY, - .vfespfr = ZR36057_VFESPFR_RGB555|ZR36057_VFESPFR_ErrDif, - }, { - .name = "16-bit RGB LE", - ZFMT(VIDEO_PALETTE_RGB565, - V4L2_PIX_FMT_RGB565, V4L2_COLORSPACE_SRGB), - .depth = 16, - .flags = ZORAN_FORMAT_CAPTURE | - ZORAN_FORMAT_OVERLAY, - .vfespfr = ZR36057_VFESPFR_RGB565|ZR36057_VFESPFR_ErrDif| - ZR36057_VFESPFR_LittleEndian, }, { - .name = "16-bit RGB BE", - ZFMT(-1, - V4L2_PIX_FMT_RGB565, V4L2_COLORSPACE_SRGB), + .name = "16-bit RGB", + .palette = VIDEO_PALETTE_RGB565, +#ifdef CONFIG_VIDEO_V4L2 +#ifdef __LITTLE_ENDIAN + .fourcc = V4L2_PIX_FMT_RGB565, +#else + .fourcc = V4L2_PIX_FMT_RGB565X, +#endif + .colorspace = V4L2_COLORSPACE_SRGB, +#endif .depth = 16, .flags = ZORAN_FORMAT_CAPTURE | ZORAN_FORMAT_OVERLAY, - .vfespfr = ZR36057_VFESPFR_RGB565|ZR36057_VFESPFR_ErrDif, }, { .name = "24-bit RGB", - ZFMT(VIDEO_PALETTE_RGB24, - V4L2_PIX_FMT_BGR24, V4L2_COLORSPACE_SRGB), + .palette = VIDEO_PALETTE_RGB24, +#ifdef CONFIG_VIDEO_V4L2 +#ifdef __LITTLE_ENDIAN + .fourcc = V4L2_PIX_FMT_BGR24, +#else + .fourcc = V4L2_PIX_FMT_RGB24, +#endif + .colorspace = V4L2_COLORSPACE_SRGB, +#endif .depth = 24, .flags = ZORAN_FORMAT_CAPTURE | ZORAN_FORMAT_OVERLAY, - .vfespfr = ZR36057_VFESPFR_RGB888|ZR36057_VFESPFR_Pack24, }, { - .name = "32-bit RGB LE", - ZFMT(VIDEO_PALETTE_RGB32, - V4L2_PIX_FMT_BGR32, V4L2_COLORSPACE_SRGB), - .depth = 32, - .flags = ZORAN_FORMAT_CAPTURE | - ZORAN_FORMAT_OVERLAY, - .vfespfr = ZR36057_VFESPFR_RGB888|ZR36057_VFESPFR_LittleEndian, - }, { - .name = "32-bit RGB BE", - ZFMT(-1, - V4L2_PIX_FMT_RGB32, V4L2_COLORSPACE_SRGB), + .name = "32-bit RGB", + .palette = VIDEO_PALETTE_RGB32, +#ifdef CONFIG_VIDEO_V4L2 +#ifdef __LITTLE_ENDIAN + .fourcc = V4L2_PIX_FMT_BGR32, +#else + .fourcc = V4L2_PIX_FMT_RGB32, +#endif + .colorspace = V4L2_COLORSPACE_SRGB, +#endif .depth = 32, .flags = ZORAN_FORMAT_CAPTURE | ZORAN_FORMAT_OVERLAY, - .vfespfr = ZR36057_VFESPFR_RGB888, }, { .name = "4:2:2, packed, YUYV", - ZFMT(VIDEO_PALETTE_YUV422, - V4L2_PIX_FMT_YUYV, V4L2_COLORSPACE_SMPTE170M), - .depth = 16, - .flags = ZORAN_FORMAT_CAPTURE | - ZORAN_FORMAT_OVERLAY, - .vfespfr = ZR36057_VFESPFR_YUV422, - }, { - .name = "4:2:2, packed, UYVY", - ZFMT(VIDEO_PALETTE_UYVY, - V4L2_PIX_FMT_UYVY, V4L2_COLORSPACE_SMPTE170M), + .palette = VIDEO_PALETTE_YUV422, +#ifdef CONFIG_VIDEO_V4L2 + .fourcc = V4L2_PIX_FMT_YUYV, + .colorspace = V4L2_COLORSPACE_SMPTE170M, +#endif .depth = 16, .flags = ZORAN_FORMAT_CAPTURE | ZORAN_FORMAT_OVERLAY, - .vfespfr = ZR36057_VFESPFR_YUV422|ZR36057_VFESPFR_LittleEndian, }, { .name = "Hardware-encoded Motion-JPEG", - ZFMT(-1, - V4L2_PIX_FMT_MJPEG, V4L2_COLORSPACE_SMPTE170M), + .palette = -1, +#ifdef CONFIG_VIDEO_V4L2 + .fourcc = V4L2_PIX_FMT_MJPEG, + .colorspace = V4L2_COLORSPACE_SMPTE170M, +#endif .depth = 0, .flags = ZORAN_FORMAT_CAPTURE | ZORAN_FORMAT_PLAYBACK | ZORAN_FORMAT_COMPRESSED, } }; -#define NUM_FORMATS ARRAY_SIZE(zoran_formats) +static const int zoran_num_formats = + (sizeof(zoran_formats) / sizeof(struct zoran_format)); // RJ: Test only - want to test BUZ_USE_HIMEM even when CONFIG_BIGPHYS_AREA is defined @@ -783,13 +768,13 @@ v4l_grab (struct file *file, struct zoran *zr = fh->zr; int res = 0, i; - for (i = 0; i < NUM_FORMATS; i++) { + for (i = 0; i < zoran_num_formats; i++) { if (zoran_formats[i].palette == mp->format && zoran_formats[i].flags & ZORAN_FORMAT_CAPTURE && !(zoran_formats[i].flags & ZORAN_FORMAT_COMPRESSED)) break; } - if (i == NUM_FORMATS || zoran_formats[i].depth == 0) { + if (i == zoran_num_formats || zoran_formats[i].depth == 0) { dprintk(1, KERN_ERR "%s: v4l_grab() - wrong bytes-per-pixel format\n", @@ -1188,14 +1173,10 @@ zoran_close_end_session (struct file *file) /* v4l capture */ if (fh->v4l_buffers.active != ZORAN_FREE) { - long flags; - - spin_lock_irqsave(&zr->spinlock, flags); zr36057_set_memgrab(zr, 0); zr->v4l_buffers.allocated = 0; zr->v4l_buffers.active = fh->v4l_buffers.active = ZORAN_FREE; - spin_unlock_irqrestore(&zr->spinlock, flags); } /* v4l buffers */ @@ -2126,7 +2107,7 @@ zoran_do_ioctl (struct inode *inode, vpict->colour, vpict->contrast, vpict->depth, vpict->palette); - for (i = 0; i < NUM_FORMATS; i++) { + for (i = 0; i < zoran_num_formats; i++) { const struct zoran_format *fmt = &zoran_formats[i]; if (fmt->palette != -1 && @@ -2135,7 +2116,7 @@ zoran_do_ioctl (struct inode *inode, fmt->depth == vpict->depth) break; } - if (i == NUM_FORMATS) { + if (i == zoran_num_formats) { dprintk(1, KERN_ERR "%s: VIDIOCSPICT - Invalid palette %d\n", @@ -2239,10 +2220,10 @@ zoran_do_ioctl (struct inode *inode, ZR_DEVNAME(zr), vbuf->base, vbuf->width, vbuf->height, vbuf->depth, vbuf->bytesperline); - for (i = 0; i < NUM_FORMATS; i++) + for (i = 0; i < zoran_num_formats; i++) if (zoran_formats[i].depth == vbuf->depth) break; - if (i == NUM_FORMATS) { + if (i == zoran_num_formats) { dprintk(1, KERN_ERR "%s: VIDIOCSFBUF - invalid fbuf depth %d\n", @@ -2691,14 +2672,14 @@ zoran_do_ioctl (struct inode *inode, return -EINVAL; } - for (i = 0; i < NUM_FORMATS; i++) { + for (i = 0; i < zoran_num_formats; i++) { if (zoran_formats[i].flags & flag) num++; if (num == fmt->index) break; } if (fmt->index < 0 /* late, but not too late */ || - i == NUM_FORMATS) + i == zoran_num_formats) return -EINVAL; memset(fmt, 0, sizeof(*fmt)); @@ -2756,8 +2737,7 @@ zoran_do_ioctl (struct inode *inode, fmt->fmt.pix.height = fh->v4l_settings.height; fmt->fmt.pix.sizeimage = - fh->v4l_settings.bytesperline * - fh->v4l_settings.height; + fh->v4l_buffers.buffer_size; fmt->fmt.pix.pixelformat = fh->v4l_settings.format->fourcc; fmt->fmt.pix.colorspace = @@ -2961,11 +2941,11 @@ zoran_do_ioctl (struct inode *inode, sfmtjpg_unlock_and_return: mutex_unlock(&zr->resource_lock); } else { - for (i = 0; i < NUM_FORMATS; i++) + for (i = 0; i < zoran_num_formats; i++) if (fmt->fmt.pix.pixelformat == zoran_formats[i].fourcc) break; - if (i == NUM_FORMATS) { + if (i == zoran_num_formats) { dprintk(1, KERN_ERR "%s: VIDIOC_S_FMT - unknown/unsupported format 0x%x (%4.4s)\n", @@ -3004,9 +2984,8 @@ zoran_do_ioctl (struct inode *inode, /* tell the user the * results/missing stuff */ - fmt->fmt.pix.sizeimage = - fh->v4l_settings.height * - fh->v4l_settings.bytesperline; + fmt->fmt.pix.sizeimage = fh->v4l_buffers.buffer_size /*zr->gbpl * zr->gheight */ + ; if (BUZ_MAX_HEIGHT < (fh->v4l_settings.height * 2)) fmt->fmt.pix.field = @@ -3074,10 +3053,10 @@ zoran_do_ioctl (struct inode *inode, fb->fmt.bytesperline, fb->fmt.pixelformat, (char *) &printformat); - for (i = 0; i < NUM_FORMATS; i++) + for (i = 0; i < zoran_num_formats; i++) if (zoran_formats[i].fourcc == fb->fmt.pixelformat) break; - if (i == NUM_FORMATS) { + if (i == zoran_num_formats) { dprintk(1, KERN_ERR "%s: VIDIOC_S_FBUF - format=0x%x (%4.4s) not allowed\n", @@ -3460,13 +3439,8 @@ zoran_do_ioctl (struct inode *inode, goto strmoff_unlock_and_return; /* unload capture */ - if (zr->v4l_memgrab_active) { - long flags; - - spin_lock_irqsave(&zr->spinlock, flags); + if (zr->v4l_memgrab_active) zr36057_set_memgrab(zr, 0); - spin_unlock_irqrestore(&zr->spinlock, flags); - } for (i = 0; i < fh->v4l_buffers.num_buffers; i++) zr->v4l_buffers.buffer[i].state = @@ -3730,11 +3704,11 @@ zoran_do_ioctl (struct inode *inode, dprintk(3, KERN_DEBUG "%s: VIDIOC_S_STD - norm=0x%llx\n", ZR_DEVNAME(zr), (unsigned long long)*std); - if ((*std & V4L2_STD_PAL) && !(*std & ~V4L2_STD_PAL)) + if (*std == V4L2_STD_PAL) norm = VIDEO_MODE_PAL; - else if ((*std & V4L2_STD_NTSC) && !(*std & ~V4L2_STD_NTSC)) + else if (*std == V4L2_STD_NTSC) norm = VIDEO_MODE_NTSC; - else if ((*std & V4L2_STD_SECAM) && !(*std & ~V4L2_STD_SECAM)) + else if (*std == V4L2_STD_SECAM) norm = VIDEO_MODE_SECAM; else if (*std == V4L2_STD_ALL) norm = VIDEO_MODE_AUTO; @@ -4175,11 +4149,11 @@ zoran_do_ioctl (struct inode *inode, V4L2_BUF_TYPE_VIDEO_CAPTURE) { int i; - for (i = 0; i < NUM_FORMATS; i++) + for (i = 0; i < zoran_num_formats; i++) if (zoran_formats[i].fourcc == fmt->fmt.pix.pixelformat) break; - if (i == NUM_FORMATS) { + if (i == zoran_num_formats) { res = -EINVAL; goto tryfmt_unlock_and_return; } @@ -4239,8 +4213,8 @@ zoran_poll (struct file *file, { struct zoran_fh *fh = file->private_data; struct zoran *zr = fh->zr; + wait_queue_head_t *queue = NULL; int res = 0, frame; - unsigned long flags; /* we should check whether buffers are ready to be synced on * (w/o waits - O_NONBLOCK) here @@ -4254,58 +4228,51 @@ zoran_poll (struct file *file, switch (fh->map_mode) { case ZORAN_MAP_MODE_RAW: - poll_wait(file, &zr->v4l_capq, wait); - frame = zr->v4l_pend[zr->v4l_sync_tail & V4L_MASK_FRAME]; - - spin_lock_irqsave(&zr->spinlock, flags); - dprintk(3, - KERN_DEBUG - "%s: %s() raw - active=%c, sync_tail=%lu/%c, pend_tail=%lu, pend_head=%lu\n", - ZR_DEVNAME(zr), __FUNCTION__, - "FAL"[fh->v4l_buffers.active], zr->v4l_sync_tail, - "UPMD"[zr->v4l_buffers.buffer[frame].state], - zr->v4l_pend_tail, zr->v4l_pend_head); - /* Process is the one capturing? */ - if (fh->v4l_buffers.active != ZORAN_FREE && - /* Buffer ready to DQBUF? */ - zr->v4l_buffers.buffer[frame].state == BUZ_STATE_DONE) + if (fh->v4l_buffers.active == ZORAN_FREE || + zr->v4l_pend_head == zr->v4l_pend_tail) { + dprintk(1, + "%s: zoran_poll() - no buffers queued\n", + ZR_DEVNAME(zr)); + res = POLLNVAL; + goto poll_unlock_and_return; + } + queue = &zr->v4l_capq; + frame = zr->v4l_pend[zr->v4l_pend_tail & V4L_MASK_FRAME]; + poll_wait(file, queue, wait); + if (fh->v4l_buffers.buffer[frame].state == BUZ_STATE_DONE) res = POLLIN | POLLRDNORM; - spin_unlock_irqrestore(&zr->spinlock, flags); - break; case ZORAN_MAP_MODE_JPG_REC: case ZORAN_MAP_MODE_JPG_PLAY: - poll_wait(file, &zr->jpg_capq, wait); + if (fh->jpg_buffers.active == ZORAN_FREE || + zr->jpg_que_head == zr->jpg_que_tail) { + dprintk(1, + "%s: zoran_poll() - no buffers queued\n", + ZR_DEVNAME(zr)); + res = POLLNVAL; + goto poll_unlock_and_return; + } + queue = &zr->jpg_capq; frame = zr->jpg_pend[zr->jpg_que_tail & BUZ_MASK_FRAME]; - - spin_lock_irqsave(&zr->spinlock, flags); - dprintk(3, - KERN_DEBUG - "%s: %s() jpg - active=%c, que_tail=%lu/%c, que_head=%lu, dma=%lu/%lu\n", - ZR_DEVNAME(zr), __FUNCTION__, - "FAL"[fh->jpg_buffers.active], zr->jpg_que_tail, - "UPMD"[zr->jpg_buffers.buffer[frame].state], - zr->jpg_que_head, zr->jpg_dma_tail, zr->jpg_dma_head); - if (fh->jpg_buffers.active != ZORAN_FREE && - zr->jpg_buffers.buffer[frame].state == BUZ_STATE_DONE) { + poll_wait(file, queue, wait); + if (fh->jpg_buffers.buffer[frame].state == BUZ_STATE_DONE) { if (fh->map_mode == ZORAN_MAP_MODE_JPG_REC) res = POLLIN | POLLRDNORM; else res = POLLOUT | POLLWRNORM; } - spin_unlock_irqrestore(&zr->spinlock, flags); - break; default: dprintk(1, - KERN_ERR "%s: zoran_poll() - internal error, unknown map_mode=%d\n", ZR_DEVNAME(zr), fh->map_mode); res = POLLNVAL; + goto poll_unlock_and_return; } +poll_unlock_and_return: mutex_unlock(&zr->resource_lock); return res; @@ -4401,15 +4368,11 @@ zoran_vm_close (struct vm_area_struct *vma) mutex_lock(&zr->resource_lock); if (fh->v4l_buffers.active != ZORAN_FREE) { - long flags; - - spin_lock_irqsave(&zr->spinlock, flags); zr36057_set_memgrab(zr, 0); zr->v4l_buffers.allocated = 0; zr->v4l_buffers.active = fh->v4l_buffers.active = ZORAN_FREE; - spin_unlock_irqrestore(&zr->spinlock, flags); } //v4l_fbuffer_free(file); fh->v4l_buffers.allocated = 0; diff --git a/trunk/include/linux/dvb/video.h b/trunk/include/linux/dvb/video.h index 50839fe9e39e..93e4c3a6d190 100644 --- a/trunk/include/linux/dvb/video.h +++ b/trunk/include/linux/dvb/video.h @@ -29,7 +29,6 @@ #ifdef __KERNEL__ #include #else -#include #include #include #endif diff --git a/trunk/include/linux/pm.h b/trunk/include/linux/pm.h index 48b71badfb4c..e52f6f83c061 100644 --- a/trunk/include/linux/pm.h +++ b/trunk/include/linux/pm.h @@ -25,7 +25,6 @@ #include #include -#include /* * Power management requests... these are passed to pm_send_all() and friends. diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index 9b2d6178d06c..221809f1c135 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -1656,6 +1656,7 @@ static void __always_inline slab_free(struct kmem_cache *s, unsigned long flags; local_irq_save(flags); + debug_check_no_locks_freed(object, s->objsize); if (likely(page == s->cpu_slab[smp_processor_id()] && !SlabDebug(page))) { object[page->offset] = page->lockless_freelist; diff --git a/trunk/sound/pci/bt87x.c b/trunk/sound/pci/bt87x.c index 188c7cf21b82..6523ba07db96 100644 --- a/trunk/sound/pci/bt87x.c +++ b/trunk/sound/pci/bt87x.c @@ -781,8 +781,6 @@ static struct pci_device_id snd_bt87x_ids[] = { BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, 0x0070, 0x13eb, 32000), /* Viewcast Osprey 200 */ BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0xff01, 44100), - /* Viewcast Osprey 440 (rate is configurable via gpio) */ - BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0xff07, 32000), /* ATI TV-Wonder */ BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x1002, 0x0001, 32000), /* Leadtek Winfast tv 2000xp delux */