From bd7892e6fc1c78809e6b71abec98ebc62d1e6aa5 Mon Sep 17 00:00:00 2001 From: Andy Walls Date: Sun, 13 Jul 2008 15:05:25 -0400 Subject: cx18: Add locking for struct cx18 GPIO state variables From: Andy Walls cx18: Add locking for struct cx18 GPIO state variables in anticpation of adding IR microcontroller reset support for use by external IR modules. Signed-off-by: Andy Walls --- linux/drivers/media/video/cx18/cx18-ioctl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/drivers/media/video/cx18/cx18-ioctl.c') diff --git a/linux/drivers/media/video/cx18/cx18-ioctl.c b/linux/drivers/media/video/cx18/cx18-ioctl.c index b3d72d4a4..f414d4e3a 100644 --- a/linux/drivers/media/video/cx18/cx18-ioctl.c +++ b/linux/drivers/media/video/cx18/cx18-ioctl.c @@ -821,8 +821,10 @@ static int cx18_log_status(struct file *file, void *fh) cx18_get_audio_input(cx, cx->audio_input, &audin); CX18_INFO("Video Input: %s\n", vidin.name); CX18_INFO("Audio Input: %s\n", audin.name); + mutex_lock(&cx->gpio_lock); CX18_INFO("GPIO: direction 0x%08x, value 0x%08x\n", cx->gpio_dir, cx->gpio_val); + mutex_unlock(&cx->gpio_lock); CX18_INFO("Tuner: %s\n", test_bit(CX18_F_I_RADIO_USER, &cx->i_flags) ? "Radio" : "TV"); cx2341x_log_status(&cx->params, cx->name); -- cgit v1.2.3 From 686cc1c1d15e11ccb0bd3687091cd989974d9e91 Mon Sep 17 00:00:00 2001 From: Andy Walls Date: Sun, 13 Jul 2008 15:30:15 -0400 Subject: cx18: Suport external reset of the Z8F0811 IR controller on HVR-1600 for lirc From: Andy Walls cx18: added in cx18_ir_reset_gpio function for lirc_pvr150 like module. Also added the ability to reset the IR chip via ioctl like ivtv. This needs the mutex to protect gpio_dir and gpio_val in struct cx18 as gpio changes can come from a few different asynchronous sources now. Signed-off-by: Andy Walls --- linux/drivers/media/video/cx18/cx18-ioctl.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'linux/drivers/media/video/cx18/cx18-ioctl.c') diff --git a/linux/drivers/media/video/cx18/cx18-ioctl.c b/linux/drivers/media/video/cx18/cx18-ioctl.c index f414d4e3a..0221a67aa 100644 --- a/linux/drivers/media/video/cx18/cx18-ioctl.c +++ b/linux/drivers/media/video/cx18/cx18-ioctl.c @@ -859,6 +859,15 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg) cx18_audio_set_route(cx, route); break; } + + case VIDIOC_INT_RESET: { + u32 val = *(u32 *)arg; + + if ((val == 0) || (val & 0x01)) + cx18_reset_ir_gpio(&cx->i2c_algo_cb_data[0]); + break; + } + default: return -EINVAL; } -- cgit v1.2.3