Created
September 11, 2014 02:30
-
-
Save acomminos/fc756269e6f1224c1466 to your computer and use it in GitHub Desktop.
smi2021 patch for kernel 3.16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/kernel/smi2021.h b/kernel/smi2021.h | |
index bd642dd..0436f8b 100644 | |
--- a/kernel/smi2021.h | |
+++ b/kernel/smi2021.h | |
@@ -42,17 +42,17 @@ | |
#include <linux/spinlock_types.h> | |
#include <linux/slab.h> | |
#include <linux/i2c.h> | |
#include <media/v4l2-event.h> | |
#include <media/v4l2-device.h> | |
#include <media/v4l2-ioctl.h> | |
#include <media/v4l2-ctrls.h> | |
-#include <media/v4l2-chip-ident.h> | |
+#include <media/v4l2-subdev.h> | |
#include <media/videobuf2-core.h> | |
#include <media/videobuf2-vmalloc.h> | |
#include <media/saa7115.h> | |
#include <sound/core.h> | |
#include <sound/pcm.h> | |
#include <sound/pcm_params.h> | |
#include <sound/initval.h> | |
diff --git a/kernel/smi2021_audio.c b/kernel/smi2021_audio.c | |
index f467866..b81aa44 100644 | |
--- a/kernel/smi2021_audio.c | |
+++ b/kernel/smi2021_audio.c | |
@@ -221,17 +221,18 @@ static struct snd_pcm_ops smi2021_pcm_ops = { | |
}; | |
int smi2021_snd_register(struct smi2021_dev *dev) | |
{ | |
struct snd_card *card; | |
struct snd_pcm *pcm; | |
int rc = 0; | |
- rc = snd_card_create(SNDRV_DEFAULT_IDX1, "smi2021 Audio", THIS_MODULE, | |
+ rc = snd_card_new(NULL, SNDRV_DEFAULT_IDX1, | |
+ "smi2021 Audio", THIS_MODULE, | |
0, &card); | |
if (rc < 0) { | |
return rc; | |
} | |
rc = snd_pcm_new(card, "smi2021 Audio", 0, 0, 1, &pcm); | |
if (rc < 0) { | |
goto err_free_card; | |
diff --git a/kernel/smi2021_v4l2.c b/kernel/smi2021_v4l2.c | |
index 41a161b..24cb773 100644 | |
--- a/kernel/smi2021_v4l2.c | |
+++ b/kernel/smi2021_v4l2.c | |
@@ -308,42 +308,42 @@ static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *norm) | |
static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm) | |
{ | |
struct smi2021_dev *dev = video_drvdata(file); | |
*norm = dev->norm; | |
return 0; | |
} | |
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm) | |
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm) | |
{ | |
struct smi2021_dev *dev = video_drvdata(file); | |
struct vb2_queue *q = &dev->vb_vidq; | |
if (vb2_is_busy(q)) { | |
return -EBUSY; | |
} | |
if (!dev->udev) { | |
return -ENODEV; | |
} | |
- dev->norm = *norm; | |
+ dev->norm = norm; | |
if (dev->norm & V4L2_STD_525_60) { | |
dev->width = SMI2021_BYTES_PER_LINE / 2; | |
dev->height = SMI2021_NTSC_LINES; | |
} else if (dev->norm & V4L2_STD_625_50) { | |
dev->width = SMI2021_BYTES_PER_LINE / 2; | |
dev->height = SMI2021_PAL_LINES; | |
} else { | |
smi2021_err("Invalid standard\n"); | |
return -EINVAL; | |
} | |
- v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, dev->norm); | |
+ v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->norm); | |
return 0; | |
} | |
static int vidioc_enum_input(struct file *file, void *priv, | |
struct v4l2_input *i) | |
{ | |
struct smi2021_dev *dev = video_drvdata(file); | |
@@ -373,29 +373,16 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i) | |
} | |
dev->ctl_input = i; | |
smi2021_set_input(dev); | |
return 0; | |
} | |
-static int vidioc_g_chip_ident(struct file *file, void *priv, | |
- struct v4l2_dbg_chip_ident *chip) | |
-{ | |
- switch (chip->match.type) { | |
- case V4L2_CHIP_MATCH_HOST: | |
- chip->ident = V4L2_IDENT_NONE; | |
- chip->revision = 0; | |
- return 0; | |
- default: | |
- return -EINVAL; | |
- } | |
-} | |
- | |
static const struct v4l2_ioctl_ops smi2021_ioctl_ops = { | |
.vidioc_querycap = vidioc_querycap, | |
.vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, | |
.vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, | |
.vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, | |
.vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, | |
.vidioc_querystd = vidioc_querystd, | |
.vidioc_g_std = vidioc_g_std, | |
@@ -411,17 +398,16 @@ static const struct v4l2_ioctl_ops smi2021_ioctl_ops = { | |
.vidioc_qbuf = vb2_ioctl_qbuf, | |
.vidioc_dqbuf = vb2_ioctl_dqbuf, | |
.vidioc_streamon = vb2_ioctl_streamon, | |
.vidioc_streamoff = vb2_ioctl_streamoff, | |
.vidioc_log_status = v4l2_ctrl_log_status, | |
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event, | |
.vidioc_unsubscribe_event = v4l2_event_unsubscribe, | |
- .vidioc_g_chip_ident = vidioc_g_chip_ident, | |
}; | |
/******************************************************************************/ | |
/* */ | |
/* Videobuf2 operations */ | |
/* */ | |
/******************************************************************************/ | |
@@ -476,20 +462,20 @@ static void buffer_queue(struct vb2_buffer *vb) | |
} | |
static int start_streaming(struct vb2_queue *vq, unsigned int count) | |
{ | |
struct smi2021_dev *dev = vb2_get_drv_priv(vq); | |
return smi2021_start_streaming(dev); | |
} | |
-static int stop_streaming(struct vb2_queue *vq) | |
+static void stop_streaming(struct vb2_queue *vq) | |
{ | |
struct smi2021_dev *dev = vb2_get_drv_priv(vq); | |
- return smi2021_stop_streaming(dev); | |
+ smi2021_stop_streaming(dev); | |
} | |
static struct vb2_ops smi2021_video_qops = { | |
.queue_setup = queue_setup, | |
.buf_queue = buffer_queue, | |
.start_streaming = start_streaming, | |
.stop_streaming = stop_streaming, | |
.wait_prepare = vb2_ops_wait_prepare, | |
@@ -561,17 +547,17 @@ int smi2021_video_register(struct smi2021_dev *dev) | |
/* PAL is default */ | |
dev->norm = V4L2_STD_PAL; | |
dev->width = SMI2021_BYTES_PER_LINE / 2; | |
dev->height = SMI2021_PAL_LINES; | |
dev->fmt = &format[0]; | |
- v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, dev->norm); | |
+ v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->norm); | |
smi2021_set_input(dev); | |
video_set_drvdata(&dev->vdev, dev); | |
rc = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1); | |
if (rc < 0) { | |
smi2021_err("video_register_device failed %d\n", rc); | |
return rc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment