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: (46 commits)
  [media] rc: call input_sync after scancode reports
  [media] imon: allow either proto on unknown 0xffdc
  [media] imon: auto-config ffdc 7e device
  [media] saa7134: fix raw IR timeout value
  [media] rc: fix ghost keypresses with certain hw
  [media] [staging] lirc_serial: allocate irq at init time
  [media] lirc_zilog: fix spinning rx thread
  [media] keymaps: fix table for pinnacle pctv hd devices
  [media] ite-cir: 8709 needs to use pnp resource 2
  [media] V4L: mx1-camera: fix uninitialized variable
  [media] omap_vout: Added check in reqbuf & mmap for buf_size allocation
  [media] OMAP_VOUT: Change hardcoded device node number to -1
  [media] OMAP_VOUTLIB: Fix wrong resizer calculation
  [media] uvcvideo: Disable the queue when failing to start
  [media] uvcvideo: Remove buffers from the queues when freeing
  [media] uvcvideo: Ignore entities for terminals with no supported format
  [media] v4l: Don't access media entity after is has been destroyed
  [media] media: omap3isp: fix a potential NULL deref
  [media] media: vb2: fix allocation failure check
  [media] media: vb2: reset queued_count value during queue reinitialization
  ...

Fix up trivial conflict in MAINTAINERS as per Mauro
  • Loading branch information
Linus Torvalds committed Jul 6, 2011
2 parents bcb65a7 + 98c32bc commit de3796e
Show file tree
Hide file tree
Showing 40 changed files with 471 additions and 493 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6733,6 +6733,7 @@ F: fs/fat/
VIDEOBUF2 FRAMEWORK
M: Pawel Osciak <pawel@osciak.com>
M: Marek Szyprowski <m.szyprowski@samsung.com>
M: Kyungmin Park <kyungmin.park@samsung.com>
L: linux-media@vger.kernel.org
S: Maintained
F: drivers/media/video/videobuf2-*
Expand Down
5 changes: 5 additions & 0 deletions drivers/media/rc/fintek-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,17 @@ static void __devexit fintek_remove(struct pnp_dev *pdev)
static int fintek_suspend(struct pnp_dev *pdev, pm_message_t state)
{
struct fintek_dev *fintek = pnp_get_drvdata(pdev);
unsigned long flags;

fit_dbg("%s called", __func__);

spin_lock_irqsave(&fintek->fintek_lock, flags);

/* disable all CIR interrupts */
fintek_cir_reg_write(fintek, CIR_STATUS_IRQ_MASK, CIR_STATUS);

spin_unlock_irqrestore(&fintek->fintek_lock, flags);

fintek_config_mode_enable(fintek);

/* disable cir logical dev */
Expand Down
19 changes: 17 additions & 2 deletions drivers/media/rc/imon.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ static const struct {
/* 0xffdc iMON MCE VFD */
{ 0x00010000ffffffeell, KEY_VOLUMEUP },
{ 0x01000000ffffffeell, KEY_VOLUMEDOWN },
{ 0x00000001ffffffeell, KEY_MUTE },
{ 0x0000000fffffffeell, KEY_MEDIA },
{ 0x00000012ffffffeell, KEY_UP },
{ 0x00000013ffffffeell, KEY_DOWN },
{ 0x00000014ffffffeell, KEY_LEFT },
{ 0x00000015ffffffeell, KEY_RIGHT },
{ 0x00000016ffffffeell, KEY_ENTER },
{ 0x00000017ffffffeell, KEY_ESC },
/* iMON Knob values */
{ 0x000100ffffffffeell, KEY_VOLUMEUP },
{ 0x010000ffffffffeell, KEY_VOLUMEDOWN },
Expand Down Expand Up @@ -1582,16 +1590,16 @@ static void imon_incoming_packet(struct imon_context *ictx,
/* Only panel type events left to process now */
spin_lock_irqsave(&ictx->kc_lock, flags);

do_gettimeofday(&t);
/* KEY_MUTE repeats from knob need to be suppressed */
if (ictx->kc == KEY_MUTE && ictx->kc == ictx->last_keycode) {
do_gettimeofday(&t);
msec = tv2int(&t, &prev_time);
prev_time = t;
if (msec < ictx->idev->rep[REP_DELAY]) {
spin_unlock_irqrestore(&ictx->kc_lock, flags);
return;
}
}
prev_time = t;
kc = ictx->kc;

spin_unlock_irqrestore(&ictx->kc_lock, flags);
Expand All @@ -1603,7 +1611,9 @@ static void imon_incoming_packet(struct imon_context *ictx,
input_report_key(ictx->idev, kc, 0);
input_sync(ictx->idev);

spin_lock_irqsave(&ictx->kc_lock, flags);
ictx->last_keycode = kc;
spin_unlock_irqrestore(&ictx->kc_lock, flags);

return;

Expand Down Expand Up @@ -1740,6 +1750,8 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
detected_display_type = IMON_DISPLAY_TYPE_VFD;
break;
/* iMON VFD, MCE IR */
case 0x46:
case 0x7e:
case 0x9e:
dev_info(ictx->dev, "0xffdc iMON VFD, MCE IR");
detected_display_type = IMON_DISPLAY_TYPE_VFD;
Expand All @@ -1755,6 +1767,9 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
dev_info(ictx->dev, "Unknown 0xffdc device, "
"defaulting to VFD and iMON IR");
detected_display_type = IMON_DISPLAY_TYPE_VFD;
/* We don't know which one it is, allow user to set the
* RC6 one from userspace if OTHER wasn't correct. */
allowed_protos |= RC_TYPE_RC6;
break;
}

Expand Down
4 changes: 3 additions & 1 deletion drivers/media/rc/ir-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,20 @@ int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type)
s64 delta; /* ns */
DEFINE_IR_RAW_EVENT(ev);
int rc = 0;
int delay;

if (!dev->raw)
return -EINVAL;

now = ktime_get();
delta = ktime_to_ns(ktime_sub(now, dev->raw->last_event));
delay = MS_TO_NS(dev->input_dev->rep[REP_DELAY]);

/* Check for a long duration since last event or if we're
* being called for the first time, note that delta can't
* possibly be negative.
*/
if (delta > IR_MAX_DURATION || !dev->raw->last_type)
if (delta > delay || !dev->raw->last_type)
type |= IR_START_EVENT;
else
ev.duration = delta;
Expand Down
12 changes: 9 additions & 3 deletions drivers/media/rc/ite-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,7 @@ static const struct ite_dev_params ite_dev_descs[] = {
{ /* 0: ITE8704 */
.model = "ITE8704 CIR transceiver",
.io_region_size = IT87_IOREG_LENGTH,
.io_rsrc_no = 0,
.hw_tx_capable = true,
.sample_period = (u32) (1000000000ULL / 115200),
.tx_carrier_freq = 38000,
Expand All @@ -1371,6 +1372,7 @@ static const struct ite_dev_params ite_dev_descs[] = {
{ /* 1: ITE8713 */
.model = "ITE8713 CIR transceiver",
.io_region_size = IT87_IOREG_LENGTH,
.io_rsrc_no = 0,
.hw_tx_capable = true,
.sample_period = (u32) (1000000000ULL / 115200),
.tx_carrier_freq = 38000,
Expand All @@ -1395,6 +1397,7 @@ static const struct ite_dev_params ite_dev_descs[] = {
{ /* 2: ITE8708 */
.model = "ITE8708 CIR transceiver",
.io_region_size = IT8708_IOREG_LENGTH,
.io_rsrc_no = 0,
.hw_tx_capable = true,
.sample_period = (u32) (1000000000ULL / 115200),
.tx_carrier_freq = 38000,
Expand All @@ -1420,6 +1423,7 @@ static const struct ite_dev_params ite_dev_descs[] = {
{ /* 3: ITE8709 */
.model = "ITE8709 CIR transceiver",
.io_region_size = IT8709_IOREG_LENGTH,
.io_rsrc_no = 2,
.hw_tx_capable = true,
.sample_period = (u32) (1000000000ULL / 115200),
.tx_carrier_freq = 38000,
Expand Down Expand Up @@ -1461,6 +1465,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
struct rc_dev *rdev = NULL;
int ret = -ENOMEM;
int model_no;
int io_rsrc_no;

ite_dbg("%s called", __func__);

Expand Down Expand Up @@ -1490,10 +1495,11 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id

/* get the description for the device */
dev_desc = &ite_dev_descs[model_no];
io_rsrc_no = dev_desc->io_rsrc_no;

/* validate pnp resources */
if (!pnp_port_valid(pdev, 0) ||
pnp_port_len(pdev, 0) != dev_desc->io_region_size) {
if (!pnp_port_valid(pdev, io_rsrc_no) ||
pnp_port_len(pdev, io_rsrc_no) != dev_desc->io_region_size) {
dev_err(&pdev->dev, "IR PNP Port not valid!\n");
goto failure;
}
Expand All @@ -1504,7 +1510,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
}

/* store resource values */
itdev->cir_addr = pnp_port_start(pdev, 0);
itdev->cir_addr = pnp_port_start(pdev, io_rsrc_no);
itdev->cir_irq = pnp_irq(pdev, 0);

/* initialize spinlocks */
Expand Down
3 changes: 3 additions & 0 deletions drivers/media/rc/ite-cir.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ struct ite_dev_params {
/* size of the I/O region */
int io_region_size;

/* IR pnp I/O resource number */
int io_rsrc_no;

/* true if the hardware supports transmission */
bool hw_tx_capable;

Expand Down
58 changes: 27 additions & 31 deletions drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,39 @@
/* Pinnacle PCTV HD 800i mini remote */

static struct rc_map_table pinnacle_pctv_hd[] = {

{ 0x0f, KEY_1 },
{ 0x15, KEY_2 },
{ 0x10, KEY_3 },
{ 0x18, KEY_4 },
{ 0x1b, KEY_5 },
{ 0x1e, KEY_6 },
{ 0x11, KEY_7 },
{ 0x21, KEY_8 },
{ 0x12, KEY_9 },
{ 0x27, KEY_0 },

{ 0x24, KEY_ZOOM },
{ 0x2a, KEY_SUBTITLE },

{ 0x00, KEY_MUTE },
{ 0x01, KEY_ENTER }, /* Pinnacle Logo */
{ 0x39, KEY_POWER },

{ 0x03, KEY_VOLUMEUP },
{ 0x09, KEY_VOLUMEDOWN },
{ 0x06, KEY_CHANNELUP },
{ 0x0c, KEY_CHANNELDOWN },

{ 0x2d, KEY_REWIND },
{ 0x30, KEY_PLAYPAUSE },
{ 0x33, KEY_FASTFORWARD },
{ 0x3c, KEY_STOP },
{ 0x36, KEY_RECORD },
{ 0x3f, KEY_EPG }, /* Labeled "?" */
/* Key codes for the tiny Pinnacle remote*/
{ 0x0700, KEY_MUTE },
{ 0x0701, KEY_MENU }, /* Pinnacle logo */
{ 0x0739, KEY_POWER },
{ 0x0703, KEY_VOLUMEUP },
{ 0x0709, KEY_VOLUMEDOWN },
{ 0x0706, KEY_CHANNELUP },
{ 0x070c, KEY_CHANNELDOWN },
{ 0x070f, KEY_1 },
{ 0x0715, KEY_2 },
{ 0x0710, KEY_3 },
{ 0x0718, KEY_4 },
{ 0x071b, KEY_5 },
{ 0x071e, KEY_6 },
{ 0x0711, KEY_7 },
{ 0x0721, KEY_8 },
{ 0x0712, KEY_9 },
{ 0x0727, KEY_0 },
{ 0x0724, KEY_ZOOM }, /* 'Square' key */
{ 0x072a, KEY_SUBTITLE }, /* 'T' key */
{ 0x072d, KEY_REWIND },
{ 0x0730, KEY_PLAYPAUSE },
{ 0x0733, KEY_FASTFORWARD },
{ 0x0736, KEY_RECORD },
{ 0x073c, KEY_STOP },
{ 0x073f, KEY_HELP }, /* '?' key */
};

static struct rc_map_list pinnacle_pctv_hd_map = {
.map = {
.scan = pinnacle_pctv_hd,
.size = ARRAY_SIZE(pinnacle_pctv_hd),
.rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
.rc_type = RC_TYPE_RC5,
.name = RC_MAP_PINNACLE_PCTV_HD,
}
};
Expand Down
37 changes: 27 additions & 10 deletions drivers/media/rc/lirc_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ struct irctl {
struct lirc_buffer *buf;
unsigned int chunk_size;

struct cdev *cdev;

struct task_struct *task;
long jiffies_to_wait;
};

static DEFINE_MUTEX(lirc_dev_lock);

static struct irctl *irctls[MAX_IRCTL_DEVICES];
static struct cdev cdevs[MAX_IRCTL_DEVICES];

/* Only used for sysfs but defined to void otherwise */
static struct class *lirc_class;
Expand Down Expand Up @@ -167,9 +168,13 @@ static struct file_operations lirc_dev_fops = {

static int lirc_cdev_add(struct irctl *ir)
{
int retval;
int retval = -ENOMEM;
struct lirc_driver *d = &ir->d;
struct cdev *cdev = &cdevs[d->minor];
struct cdev *cdev;

cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
if (!cdev)
goto err_out;

if (d->fops) {
cdev_init(cdev, d->fops);
Expand All @@ -180,12 +185,20 @@ static int lirc_cdev_add(struct irctl *ir)
}
retval = kobject_set_name(&cdev->kobj, "lirc%d", d->minor);
if (retval)
return retval;
goto err_out;

retval = cdev_add(cdev, MKDEV(MAJOR(lirc_base_dev), d->minor), 1);
if (retval)
if (retval) {
kobject_put(&cdev->kobj);
goto err_out;
}

ir->cdev = cdev;

return 0;

err_out:
kfree(cdev);
return retval;
}

Expand Down Expand Up @@ -214,7 +227,7 @@ int lirc_register_driver(struct lirc_driver *d)
if (MAX_IRCTL_DEVICES <= d->minor) {
dev_err(d->dev, "lirc_dev: lirc_register_driver: "
"\"minor\" must be between 0 and %d (%d)!\n",
MAX_IRCTL_DEVICES-1, d->minor);
MAX_IRCTL_DEVICES - 1, d->minor);
err = -EBADRQC;
goto out;
}
Expand Down Expand Up @@ -369,7 +382,7 @@ int lirc_unregister_driver(int minor)

if (minor < 0 || minor >= MAX_IRCTL_DEVICES) {
printk(KERN_ERR "lirc_dev: %s: minor (%d) must be between "
"0 and %d!\n", __func__, minor, MAX_IRCTL_DEVICES-1);
"0 and %d!\n", __func__, minor, MAX_IRCTL_DEVICES - 1);
return -EBADRQC;
}

Expand All @@ -380,7 +393,7 @@ int lirc_unregister_driver(int minor)
return -ENOENT;
}

cdev = &cdevs[minor];
cdev = ir->cdev;

mutex_lock(&lirc_dev_lock);

Expand Down Expand Up @@ -410,6 +423,7 @@ int lirc_unregister_driver(int minor)
} else {
lirc_irctl_cleanup(ir);
cdev_del(cdev);
kfree(cdev);
kfree(ir);
irctls[minor] = NULL;
}
Expand Down Expand Up @@ -453,7 +467,7 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file)
goto error;
}

cdev = &cdevs[iminor(inode)];
cdev = ir->cdev;
if (try_module_get(cdev->owner)) {
ir->open++;
retval = ir->d.set_use_inc(ir->d.data);
Expand Down Expand Up @@ -484,13 +498,15 @@ EXPORT_SYMBOL(lirc_dev_fop_open);
int lirc_dev_fop_close(struct inode *inode, struct file *file)
{
struct irctl *ir = irctls[iminor(inode)];
struct cdev *cdev = &cdevs[iminor(inode)];
struct cdev *cdev;

if (!ir) {
printk(KERN_ERR "%s: called with invalid irctl\n", __func__);
return -EINVAL;
}

cdev = ir->cdev;

dev_dbg(ir->d.dev, LOGHEAD "close called\n", ir->d.name, ir->d.minor);

WARN_ON(mutex_lock_killable(&lirc_dev_lock));
Expand All @@ -503,6 +519,7 @@ int lirc_dev_fop_close(struct inode *inode, struct file *file)
lirc_irctl_cleanup(ir);
cdev_del(cdev);
irctls[ir->d.minor] = NULL;
kfree(cdev);
kfree(ir);
}

Expand Down
Loading

0 comments on commit de3796e

Please sign in to comment.