Skip to content

Commit

Permalink
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/mchehab/linux-2.6

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (37 commits)
  V4L/DVB: v4l: radio: si470x: fix unneeded free_irq() call
  V4L/DVB: v4l: videobuf: prevent passing a NULL to dma_free_coherent()
  V4L/DVB: ir-core: Fix null dereferences in the protocols sysfs interface
  V4L/DVB: v4l: s5p-fimc: Fix 3-planar formats handling and pixel offset error on S5PV210 SoCs
  V4L/DVB: v4l: s5p-fimc: Fix return value on probe() failure
  V4L/DVB: uvcvideo: Restrict frame rates for Chicony CNF7129 webcam
  V4L/DVB: uvcvideo: Fix support for Medion Akoya All-in-one PC integrated webcam
  V4L/DVB: ivtvfb: prevent reading uninitialized stack memory
  V4L/DVB: cx25840: Fix typo in volume control initialization: 65335 vs. 65535
  V4L/DVB: v4l: mem2mem_testdev: add missing release for video_device
  V4L/DVB: v4l: mem2mem_testdev: fix errorenous comparison
  V4L/DVB: mt9v022.c: Fixed compilation warning
  V4L/DVB: mt9m111: added current colorspace at g_fmt
  V4L/DVB: mt9m111: cropcap and s_crop check if type is VIDEO_CAPTURE
  V4L/DVB: mx2_camera: fix a race causing NULL dereference
  V4L/DVB: tm6000: bugfix data handling
  V4L/DVB: gspca - sn9c20x: Bad transfer size of Bayer images
  V4L/DVB: videobuf-dma-sg: set correct size in last sg element
  V4L/DVB: cx231xx: Avoid an OOPS when card is unknown (card=0)
  V4L/DVB: dvb: fix smscore_getbuffer() logic
  ...
  • Loading branch information
Linus Torvalds committed Oct 7, 2010
2 parents 5672bc8 + cc6e853 commit a4099ae
Show file tree
Hide file tree
Showing 35 changed files with 271 additions and 144 deletions.
9 changes: 8 additions & 1 deletion drivers/media/IR/ir-keytable.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static void ir_timer_keyup(unsigned long cookie)
* a keyup event might follow immediately after the keydown.
*/
spin_lock_irqsave(&ir->keylock, flags);
if (time_is_after_eq_jiffies(ir->keyup_jiffies))
if (time_is_before_eq_jiffies(ir->keyup_jiffies))
ir_keyup(ir);
spin_unlock_irqrestore(&ir->keylock, flags);
}
Expand Down Expand Up @@ -510,6 +510,13 @@ int __ir_input_register(struct input_dev *input_dev,
(ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_IR_RAW) ?
" in raw mode" : "");

/*
* Default delay of 250ms is too short for some protocols, expecially
* since the timeout is currently set to 250ms. Increase it to 500ms,
* to avoid wrong repetition of the keycodes.
*/
input_dev->rep[REP_DELAY] = 500;

return 0;

out_event:
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/IR/ir-lirc-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static int ir_lirc_register(struct input_dev *input_dev)
features |= LIRC_CAN_SET_SEND_CARRIER;

if (ir_dev->props->s_tx_duty_cycle)
features |= LIRC_CAN_SET_REC_DUTY_CYCLE;
features |= LIRC_CAN_SET_SEND_DUTY_CYCLE;
}

if (ir_dev->props->s_rx_carrier_range)
Expand Down
4 changes: 3 additions & 1 deletion drivers/media/IR/ir-raw-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ int ir_raw_event_register(struct input_dev *input_dev)
"rc%u", (unsigned int)ir->devno);

if (IS_ERR(ir->raw->thread)) {
int ret = PTR_ERR(ir->raw->thread);

kfree(ir->raw);
ir->raw = NULL;
return PTR_ERR(ir->raw->thread);
return ret;
}

mutex_lock(&ir_raw_handler_lock);
Expand Down
17 changes: 11 additions & 6 deletions drivers/media/IR/ir-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ static ssize_t show_protocols(struct device *d,
char *tmp = buf;
int i;

if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) {
if (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_SCANCODE) {
enabled = ir_dev->rc_tab.ir_type;
allowed = ir_dev->props->allowed_protos;
} else {
} else if (ir_dev->raw) {
enabled = ir_dev->raw->enabled_protocols;
allowed = ir_raw_get_allowed_protocols();
}
} else
return sprintf(tmp, "[builtin]\n");

IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n",
(long long)allowed,
Expand Down Expand Up @@ -121,10 +122,14 @@ static ssize_t store_protocols(struct device *d,
int rc, i, count = 0;
unsigned long flags;

if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE)
if (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_SCANCODE)
type = ir_dev->rc_tab.ir_type;
else
else if (ir_dev->raw)
type = ir_dev->raw->enabled_protocols;
else {
IR_dprintk(1, "Protocol switching not supported\n");
return -EINVAL;
}

while ((tmp = strsep((char **) &data, " \n")) != NULL) {
if (!*tmp)
Expand Down Expand Up @@ -185,7 +190,7 @@ static ssize_t store_protocols(struct device *d,
}
}

if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) {
if (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_SCANCODE) {
spin_lock_irqsave(&ir_dev->rc_tab.lock, flags);
ir_dev->rc_tab.ir_type = type;
spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags);
Expand Down
3 changes: 3 additions & 0 deletions drivers/media/IR/keymaps/rc-rc6-mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static struct ir_scancode rc6_mce[] = {

{ 0x800f0416, KEY_PLAY },
{ 0x800f0418, KEY_PAUSE },
{ 0x800f046e, KEY_PLAYPAUSE },
{ 0x800f0419, KEY_STOP },
{ 0x800f0417, KEY_RECORD },

Expand All @@ -37,6 +38,8 @@ static struct ir_scancode rc6_mce[] = {
{ 0x800f0411, KEY_VOLUMEDOWN },
{ 0x800f0412, KEY_CHANNELUP },
{ 0x800f0413, KEY_CHANNELDOWN },
{ 0x800f043a, KEY_BRIGHTNESSUP },
{ 0x800f0480, KEY_BRIGHTNESSDOWN },

{ 0x800f0401, KEY_NUMERIC_1 },
{ 0x800f0402, KEY_NUMERIC_2 },
Expand Down
4 changes: 4 additions & 0 deletions drivers/media/IR/mceusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ static struct usb_device_id mceusb_dev_table[] = {
{ USB_DEVICE(VENDOR_PHILIPS, 0x0613) },
/* Philips eHome Infrared Transceiver */
{ USB_DEVICE(VENDOR_PHILIPS, 0x0815) },
/* Philips/Spinel plus IR transceiver for ASUS */
{ USB_DEVICE(VENDOR_PHILIPS, 0x206c) },
/* Philips/Spinel plus IR transceiver for ASUS */
{ USB_DEVICE(VENDOR_PHILIPS, 0x2088) },
/* Realtek MCE IR Receiver */
{ USB_DEVICE(VENDOR_REALTEK, 0x0161) },
/* SMK/Toshiba G83C0004D410 */
Expand Down
3 changes: 0 additions & 3 deletions drivers/media/dvb/dvb-usb/dib0700_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,6 @@ static int dib0700_probe(struct usb_interface *intf,
else
dev->props.rc.core.bulk_mode = false;

/* Need a higher delay, to avoid wrong repeat */
dev->rc_input_dev->rep[REP_DELAY] = 500;

dib0700_rc_setup(dev);

return 0;
Expand Down
56 changes: 54 additions & 2 deletions drivers/media/dvb/dvb-usb/dib0700_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,58 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
return adap->fe == NULL ? -ENODEV : 0;
}

/* STK7770P */
static struct dib7000p_config dib7770p_dib7000p_config = {
.output_mpeg2_in_188_bytes = 1,

.agc_config_count = 1,
.agc = &dib7070_agc_config,
.bw = &dib7070_bw_config_12_mhz,
.tuner_is_baseband = 1,
.spur_protect = 1,

.gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
.gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
.gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,

.hostbus_diversity = 1,
.enable_current_mirror = 1,
.disable_sample_and_hold = 0,
};

static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap)
{
struct usb_device_descriptor *p = &adap->dev->udev->descriptor;
if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) &&
p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E))
dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
else
dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
msleep(10);
dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);

dib0700_ctrl_clock(adap->dev, 72, 1);

msleep(10);
dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
msleep(10);
dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);

if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
&dib7770p_dib7000p_config) != 0) {
err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
__func__);
return -ENODEV;
}

adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
&dib7770p_dib7000p_config);
return adap->fe == NULL ? -ENODEV : 0;
}

/* DIB807x generic */
static struct dibx000_agc_config dib807x_agc_config[2] = {
{
Expand Down Expand Up @@ -1781,7 +1833,7 @@ struct usb_device_id dib0700_usb_id_table[] = {
/* 60 */{ USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS_2) },
{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XPVR) },
{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XP) },
{ USB_DEVICE(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD) },
{ USB_DEVICE_VER(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD, 0x000, 0x3f00) },
{ USB_DEVICE(USB_VID_EVOLUTEPC, USB_PID_TVWAY_PLUS) },
/* 65 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73ESE) },
{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV282E) },
Expand Down Expand Up @@ -2406,7 +2458,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.pid_filter_count = 32,
.pid_filter = stk70x0p_pid_filter,
.pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
.frontend_attach = stk7070p_frontend_attach,
.frontend_attach = stk7770p_frontend_attach,
.tuner_attach = dib7770p_tuner_attach,

DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
Expand Down
4 changes: 1 addition & 3 deletions drivers/media/dvb/dvb-usb/opera1.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,7 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev,
}
}
kfree(p);
if (fw) {
release_firmware(fw);
}
release_firmware(fw);
return ret;
}

Expand Down
8 changes: 7 additions & 1 deletion drivers/media/dvb/frontends/dib7000p.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ static void dib7000p_set_adc_state(struct dib7000p_state *state, enum dibx000_ad

// dprintk( "908: %x, 909: %x\n", reg_908, reg_909);

reg_909 |= (state->cfg.disable_sample_and_hold & 1) << 4;
reg_908 |= (state->cfg.enable_current_mirror & 1) << 7;

dib7000p_write_word(state, 908, reg_908);
dib7000p_write_word(state, 909, reg_909);
}
Expand Down Expand Up @@ -778,7 +781,10 @@ static void dib7000p_set_channel(struct dib7000p_state *state, struct dvb_fronte
default:
case GUARD_INTERVAL_1_32: value *= 1; break;
}
state->div_sync_wait = (value * 3) / 2 + 32; // add 50% SFN margin + compensate for one DVSY-fifo TODO
if (state->cfg.diversity_delay == 0)
state->div_sync_wait = (value * 3) / 2 + 48; // add 50% SFN margin + compensate for one DVSY-fifo
else
state->div_sync_wait = (value * 3) / 2 + state->cfg.diversity_delay; // add 50% SFN margin + compensate for one DVSY-fifo

/* deactive the possibility of diversity reception if extended interleaver */
state->div_force_off = !1 && ch->u.ofdm.transmission_mode != TRANSMISSION_MODE_8K;
Expand Down
5 changes: 5 additions & 0 deletions drivers/media/dvb/frontends/dib7000p.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ struct dib7000p_config {
int (*agc_control) (struct dvb_frontend *, u8 before);

u8 output_mode;
u8 disable_sample_and_hold : 1;

u8 enable_current_mirror : 1;
u8 diversity_delay;

};

#define DEFAULT_DIB7000P_I2C_ADDRESS 18
Expand Down
31 changes: 12 additions & 19 deletions drivers/media/dvb/siano/smscoreapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,33 +1098,26 @@ EXPORT_SYMBOL_GPL(smscore_onresponse);
*
* @return pointer to descriptor on success, NULL on error.
*/
struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev)

struct smscore_buffer_t *get_entry(struct smscore_device_t *coredev)
{
struct smscore_buffer_t *cb = NULL;
unsigned long flags;

DEFINE_WAIT(wait);

spin_lock_irqsave(&coredev->bufferslock, flags);

/* This function must return a valid buffer, since the buffer list is
* finite, we check that there is an available buffer, if not, we wait
* until such buffer become available.
*/

prepare_to_wait(&coredev->buffer_mng_waitq, &wait, TASK_INTERRUPTIBLE);
if (list_empty(&coredev->buffers)) {
spin_unlock_irqrestore(&coredev->bufferslock, flags);
schedule();
spin_lock_irqsave(&coredev->bufferslock, flags);
if (!list_empty(&coredev->buffers)) {
cb = (struct smscore_buffer_t *) coredev->buffers.next;
list_del(&cb->entry);
}
spin_unlock_irqrestore(&coredev->bufferslock, flags);
return cb;
}

finish_wait(&coredev->buffer_mng_waitq, &wait);

cb = (struct smscore_buffer_t *) coredev->buffers.next;
list_del(&cb->entry);
struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev)
{
struct smscore_buffer_t *cb = NULL;

spin_unlock_irqrestore(&coredev->bufferslock, flags);
wait_event(coredev->buffer_mng_waitq, (cb = get_entry(coredev)));

return cb;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/si470x/radio-si470x-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static int __devinit si470x_i2c_probe(struct i2c_client *client,
radio->registers[POWERCFG] = POWERCFG_ENABLE;
if (si470x_set_register(radio, POWERCFG) < 0) {
retval = -EIO;
goto err_all;
goto err_video;
}
msleep(110);

Expand Down
1 change: 1 addition & 0 deletions drivers/media/video/cx231xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ EXTRA_CFLAGS += -Idrivers/media/video
EXTRA_CFLAGS += -Idrivers/media/common/tuners
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-usb

17 changes: 11 additions & 6 deletions drivers/media/video/cx231xx/cx231xx-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <media/v4l2-chip-ident.h>

#include <media/cx25840.h>
#include "dvb-usb-ids.h"
#include "xc5000.h"

#include "cx231xx.h"
Expand Down Expand Up @@ -175,6 +176,8 @@ struct usb_device_id cx231xx_id_table[] = {
.driver_info = CX231XX_BOARD_CNXT_RDE_250},
{USB_DEVICE(0x0572, 0x58A1),
.driver_info = CX231XX_BOARD_CNXT_RDU_250},
{USB_DEVICE_VER(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD, 0x4000,0x4fff),
.driver_info = CX231XX_BOARD_UNKNOWN},
{},
};

Expand Down Expand Up @@ -226,14 +229,16 @@ void cx231xx_pre_card_setup(struct cx231xx *dev)
dev->board.name, dev->model);

/* set the direction for GPIO pins */
cx231xx_set_gpio_direction(dev, dev->board.tuner_gpio->bit, 1);
cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit, 1);
cx231xx_set_gpio_direction(dev, dev->board.tuner_sif_gpio, 1);
if (dev->board.tuner_gpio) {
cx231xx_set_gpio_direction(dev, dev->board.tuner_gpio->bit, 1);
cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit, 1);
cx231xx_set_gpio_direction(dev, dev->board.tuner_sif_gpio, 1);

/* request some modules if any required */
/* request some modules if any required */

/* reset the Tuner */
cx231xx_gpio_set(dev, dev->board.tuner_gpio);
/* reset the Tuner */
cx231xx_gpio_set(dev, dev->board.tuner_gpio);
}

/* set the mode to Analog mode initially */
cx231xx_set_mode(dev, CX231XX_ANALOG_MODE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ static int cx25840_probe(struct i2c_client *client,

state->volume = v4l2_ctrl_new_std(&state->hdl,
&cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME,
0, 65335, 65535 / 100, default_volume);
0, 65535, 65535 / 100, default_volume);
state->mute = v4l2_ctrl_new_std(&state->hdl,
&cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_MUTE,
0, 1, 1, 0);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cx88/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ config VIDEO_CX88

config VIDEO_CX88_ALSA
tristate "Conexant 2388x DMA audio support"
depends on VIDEO_CX88 && SND && EXPERIMENTAL
depends on VIDEO_CX88 && SND
select SND_PCM
---help---
This is a video4linux driver for direct (DMA) audio on
Expand Down
1 change: 1 addition & 0 deletions drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
usb_rcvintpipe(dev, ep->bEndpointAddress),
buffer, buffer_len,
int_irq, (void *)gspca_dev, interval);
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
gspca_dev->int_urb = urb;
ret = usb_submit_urb(urb, GFP_KERNEL);
if (ret < 0) {
Expand Down
3 changes: 1 addition & 2 deletions drivers/media/video/gspca/sn9c20x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2357,8 +2357,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
(data[33] << 10);
avg_lum >>= 9;
atomic_set(&sd->avg_lum, avg_lum);
gspca_frame_add(gspca_dev, LAST_PACKET,
data, len);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
return;
}
if (gspca_dev->last_packet_type == LAST_PACKET) {
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/video/ivtv/ivtvfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ static int ivtvfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long ar
struct fb_vblank vblank;
u32 trace;

memset(&vblank, 0, sizeof(struct fb_vblank));

vblank.flags = FB_VBLANK_HAVE_COUNT |FB_VBLANK_HAVE_VCOUNT |
FB_VBLANK_HAVE_VSYNC;
trace = read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16;
Expand Down
Loading

0 comments on commit a4099ae

Please sign in to comment.