aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/v4l2-common.c27
-rw-r--r--drivers/media/video/v4l2-ioctl.c34
2 files changed, 3 insertions, 58 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 1da8cb836cb6..f23a77473aaf 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -739,33 +739,8 @@ EXPORT_SYMBOL(v4l2_chip_ident_i2c_client);
739 739
740/* ----------------------------------------------------------------- */ 740/* ----------------------------------------------------------------- */
741 741
742/* Helper function for I2C legacy drivers */ 742/* I2C Helper functions */
743 743
744int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver *driver,
745 const char *name,
746 int (*probe)(struct i2c_client *, const struct i2c_device_id *))
747{
748 struct i2c_client *client;
749 int err;
750
751 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
752 if (!client)
753 return -ENOMEM;
754
755 client->addr = address;
756 client->adapter = adapter;
757 client->driver = driver;
758 strlcpy(client->name, name, sizeof(client->name));
759
760 err = probe(client, NULL);
761 if (err == 0) {
762 i2c_attach_client(client);
763 } else {
764 kfree(client);
765 }
766 return err != -ENOMEM ? 0 : err;
767}
768EXPORT_SYMBOL(v4l2_i2c_attach);
769 744
770void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, 745void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
771 const struct v4l2_subdev_ops *ops) 746 const struct v4l2_subdev_ops *ops)
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index f41c6f506f42..88f10d6cbc92 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -275,32 +275,6 @@ static const char *v4l2_ioctls[] = {
275}; 275};
276#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) 276#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
277 277
278static const char *v4l2_int_ioctls[] = {
279 [_IOC_NR(AUDC_SET_RADIO)] = "AUDC_SET_RADIO",
280
281 [_IOC_NR(TUNER_SET_TYPE_ADDR)] = "TUNER_SET_TYPE_ADDR",
282 [_IOC_NR(TUNER_SET_STANDBY)] = "TUNER_SET_STANDBY",
283 [_IOC_NR(TUNER_SET_CONFIG)] = "TUNER_SET_CONFIG",
284
285 [_IOC_NR(VIDIOC_INT_S_TUNER_MODE)] = "VIDIOC_INT_S_TUNER_MODE",
286 [_IOC_NR(VIDIOC_INT_RESET)] = "VIDIOC_INT_RESET",
287 [_IOC_NR(VIDIOC_INT_AUDIO_CLOCK_FREQ)] = "VIDIOC_INT_AUDIO_CLOCK_FREQ",
288 [_IOC_NR(VIDIOC_INT_DECODE_VBI_LINE)] = "VIDIOC_INT_DECODE_VBI_LINE",
289 [_IOC_NR(VIDIOC_INT_S_VBI_DATA)] = "VIDIOC_INT_S_VBI_DATA",
290 [_IOC_NR(VIDIOC_INT_G_VBI_DATA)] = "VIDIOC_INT_G_VBI_DATA",
291 [_IOC_NR(VIDIOC_INT_I2S_CLOCK_FREQ)] = "VIDIOC_INT_I2S_CLOCK_FREQ",
292 [_IOC_NR(VIDIOC_INT_S_STANDBY)] = "VIDIOC_INT_S_STANDBY",
293 [_IOC_NR(VIDIOC_INT_S_AUDIO_ROUTING)] = "VIDIOC_INT_S_AUDIO_ROUTING",
294 [_IOC_NR(VIDIOC_INT_G_AUDIO_ROUTING)] = "VIDIOC_INT_G_AUDIO_ROUTING",
295 [_IOC_NR(VIDIOC_INT_S_VIDEO_ROUTING)] = "VIDIOC_INT_S_VIDEO_ROUTING",
296 [_IOC_NR(VIDIOC_INT_G_VIDEO_ROUTING)] = "VIDIOC_INT_G_VIDEO_ROUTING",
297 [_IOC_NR(VIDIOC_INT_S_CRYSTAL_FREQ)] = "VIDIOC_INT_S_CRYSTAL_FREQ",
298 [_IOC_NR(VIDIOC_INT_INIT)] = "VIDIOC_INT_INIT",
299 [_IOC_NR(VIDIOC_INT_G_STD_OUTPUT)] = "VIDIOC_INT_G_STD_OUTPUT",
300 [_IOC_NR(VIDIOC_INT_S_STD_OUTPUT)] = "VIDIOC_INT_S_STD_OUTPUT",
301};
302#define V4L2_INT_IOCTLS ARRAY_SIZE(v4l2_int_ioctls)
303
304/* Common ioctl debug function. This function can be used by 278/* Common ioctl debug function. This function can be used by
305 external ioctl messages as well as internal V4L ioctl */ 279 external ioctl messages as well as internal V4L ioctl */
306void v4l_printk_ioctl(unsigned int cmd) 280void v4l_printk_ioctl(unsigned int cmd)
@@ -309,12 +283,8 @@ void v4l_printk_ioctl(unsigned int cmd)
309 283
310 switch (_IOC_TYPE(cmd)) { 284 switch (_IOC_TYPE(cmd)) {
311 case 'd': 285 case 'd':
312 if (_IOC_NR(cmd) >= V4L2_INT_IOCTLS) { 286 type = "v4l2_int";
313 type = "v4l2_int"; 287 break;
314 break;
315 }
316 printk("%s", v4l2_int_ioctls[_IOC_NR(cmd)]);
317 return;
318#ifdef CONFIG_VIDEO_V4L1_COMPAT 288#ifdef CONFIG_VIDEO_V4L1_COMPAT
319 case 'v': 289 case 'v':
320 if (_IOC_NR(cmd) >= V4L1_IOCTLS) { 290 if (_IOC_NR(cmd) >= V4L1_IOCTLS) {