Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df20d69e authored by Ross Cohen's avatar Ross Cohen Committed by Greg Kroah-Hartman
Browse files

Staging: go7007 v4l fixes



Fix up some of the v4l issues that were recently changed to make the
go7007 driver a bit cleaner.


From: Ross Cohen <rcohen@snurgle.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d63d692a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#include <linux/semaphore.h>
#include <linux/uaccess.h>
#include <asm/system.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include <media/tuner.h>
#include <media/v4l2-common.h>

+4 −8
Original line number Diff line number Diff line
@@ -26,8 +26,7 @@
#include <linux/time.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/videodev.h>
#include <linux/video_decoder.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <linux/i2c.h>
@@ -835,7 +834,6 @@ static int go7007_do_ioctl(struct inode *inode, struct file *file,
	case VIDIOC_S_STD:
	{
		v4l2_std_id *std = arg;
		int norm;

		if (go->streaming)
			return -EBUSY;
@@ -856,20 +854,17 @@ static int go7007_do_ioctl(struct inode *inode, struct file *file,
		if (*std & V4L2_STD_NTSC) {
			go->standard = GO7007_STD_NTSC;
			go->sensor_framerate = 30000;
			norm = VIDEO_MODE_NTSC;
		} else if (*std & V4L2_STD_PAL) {
			go->standard = GO7007_STD_PAL;
			go->sensor_framerate = 25025;
			norm = VIDEO_MODE_PAL;
		} else if (*std & V4L2_STD_SECAM) {
			go->standard = GO7007_STD_PAL;
			go->sensor_framerate = 25025;
			norm = VIDEO_MODE_SECAM;
		} else
			return -EINVAL;
		if (go->i2c_adapter_online)
			i2c_clients_command(&go->i2c_adapter,
						DECODER_SET_NORM, &norm);
					    VIDIOC_S_STD, std);
		set_capture_size(go, NULL, 0);
		return 0;
	}
@@ -933,7 +928,7 @@ static int go7007_do_ioctl(struct inode *inode, struct file *file,
			return -EBUSY;
		go->input = *input;
		if (go->i2c_adapter_online) {
			i2c_clients_command(&go->i2c_adapter, DECODER_SET_INPUT,
			i2c_clients_command(&go->i2c_adapter, VIDIOC_S_INPUT,
				&go->board_info->inputs[*input].video_input);
			i2c_clients_command(&go->i2c_adapter, VIDIOC_S_AUDIO,
				&go->board_info->inputs[*input].audio_input);
@@ -1459,6 +1454,7 @@ static struct file_operations go7007_fops = {

static struct video_device go7007_template = {
	.name		= "go7007",
	.vfl_type	= VID_TYPE_CAPTURE,
	.fops		= &go7007_fops,
	.minor		= -1,
	.release	= go7007_vfl_release,
+2 −2
Original line number Diff line number Diff line
@@ -44,8 +44,8 @@ module_param_array(index, int, NULL, 0444);
module_param_array(id, charp, NULL, 0444);
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for the go7007 audio driver");
MODULE_PARM_DESC(index, "ID string for the go7007 audio driver");
MODULE_PARM_DESC(index, "Enable for the go7007 audio driver");
MODULE_PARM_DESC(id, "ID string for the go7007 audio driver");
MODULE_PARM_DESC(enable, "Enable for the go7007 audio driver");

struct go7007_snd {
	struct snd_card *card;
+1 −2
Original line number Diff line number Diff line
@@ -19,8 +19,7 @@
#include <linux/init.h>
#include <linux/version.h>
#include <linux/i2c.h>
#include <linux/videodev.h>
#include <linux/video_decoder.h>
#include <linux/videodev2.h>

#include "wis-i2c.h"

+10 −15
Original line number Diff line number Diff line
@@ -19,8 +19,7 @@
#include <linux/init.h>
#include <linux/version.h>
#include <linux/i2c.h>
#include <linux/videodev.h>
#include <linux/video_decoder.h>
#include <linux/videodev2.h>
#include <linux/ioctl.h>

#include "wis-i2c.h"
@@ -124,7 +123,7 @@ static int wis_saa7113_command(struct i2c_client *client,
	struct wis_saa7113 *dec = i2c_get_clientdata(client);

	switch (cmd) {
	case DECODER_SET_INPUT:
	case VIDIOC_S_INPUT:
	{
		int *input = arg;

@@ -133,23 +132,19 @@ static int wis_saa7113_command(struct i2c_client *client,
				*input < 6 ? 0x40 : 0x80);
		break;
	}
	case DECODER_SET_NORM:
	case VIDIOC_S_STD:
	{
		int *input = arg;
		v4l2_std_id *input = arg;
		dec->norm = *input;
		switch (dec->norm) {
		case VIDEO_MODE_PAL:
			write_reg(client, 0x0e, 0x01);
			write_reg(client, 0x10, 0x48);
			break;
		case VIDEO_MODE_NTSC:
		if (dec->norm & V4L2_STD_NTSC) {
			write_reg(client, 0x0e, 0x01);
			write_reg(client, 0x10, 0x40);
			break;
		case VIDEO_MODE_SECAM:
		} else if (dec->norm & V4L2_STD_PAL) {
			write_reg(client, 0x0e, 0x01);
			write_reg(client, 0x10, 0x48);
		} else if (dec->norm * V4L2_STD_SECAM) {
			write_reg(client, 0x0e, 0x50);
			write_reg(client, 0x10, 0x48);
			break;
		}
		break;
	}
@@ -295,7 +290,7 @@ static int wis_saa7113_detect(struct i2c_adapter *adapter, int addr, int kind)
		kfree(client);
		return -ENOMEM;
	}
	dec->norm = VIDEO_MODE_NTSC;
	dec->norm = V4L2_STD_NTSC;
	dec->brightness = 128;
	dec->contrast = 71;
	dec->saturation = 64;
Loading