Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / media / pci / ivtv / ivtv-ioctl.c
index 9cbbce0..d4d0f0e 100644 (file)
@@ -34,7 +34,6 @@
 #include "ivtv-cards.h"
 #include <media/saa7127.h>
 #include <media/tveeprom.h>
-#include <media/v4l2-chip-ident.h>
 #include <media/v4l2-event.h>
 #include <linux/dvb/audio.h>
 
@@ -352,7 +351,6 @@ static int ivtv_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f
        pixfmt->height = itv->cxhdl.height;
        pixfmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
        pixfmt->field = V4L2_FIELD_INTERLACED;
-       pixfmt->priv = 0;
        if (id->type == IVTV_ENC_STREAM_TYPE_YUV) {
                pixfmt->pixelformat = V4L2_PIX_FMT_HM12;
                /* YUV size is (Y=(h*720) + UV=(h*(720/2))) */
@@ -419,7 +417,6 @@ static int ivtv_g_fmt_vid_out(struct file *file, void *fh, struct v4l2_format *f
        pixfmt->height = itv->main_rect.height;
        pixfmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
        pixfmt->field = V4L2_FIELD_INTERLACED;
-       pixfmt->priv = 0;
        if (id->type == IVTV_DEC_STREAM_TYPE_YUV) {
                switch (itv->yuv_info.lace_mode & IVTV_YUV_MODE_MASK) {
                case IVTV_YUV_MODE_INTERLACED:
@@ -692,31 +689,13 @@ static int ivtv_s_fmt_vid_out_overlay(struct file *file, void *fh, struct v4l2_f
        return ret;
 }
 
-static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_dbg_chip_ident *chip)
-{
-       struct ivtv *itv = fh2id(fh)->itv;
-
-       chip->ident = V4L2_IDENT_NONE;
-       chip->revision = 0;
-       if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
-               if (v4l2_chip_match_host(&chip->match))
-                       chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : V4L2_IDENT_CX23416;
-               return 0;
-       }
-       if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
-           chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
-               return -EINVAL;
-       /* TODO: is this correct? */
-       return ivtv_call_all_err(itv, core, g_chip_ident, chip);
-}
-
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int ivtv_itvc(struct ivtv *itv, bool get, u64 reg, u64 *val)
 {
        volatile u8 __iomem *reg_start;
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
+       if (reg & 0x3)
+               return -EINVAL;
        if (reg >= IVTV_REG_OFFSET && reg < IVTV_REG_OFFSET + IVTV_REG_SIZE)
                reg_start = itv->reg_mem - IVTV_REG_OFFSET;
        else if (itv->has_cx23415 && reg >= IVTV_DECODER_OFFSET &&
@@ -738,29 +717,16 @@ static int ivtv_g_register(struct file *file, void *fh, struct v4l2_dbg_register
 {
        struct ivtv *itv = fh2id(fh)->itv;
 
-       if (v4l2_chip_match_host(&reg->match)) {
-               reg->size = 4;
-               return ivtv_itvc(itv, true, reg->reg, &reg->val);
-       }
-       /* TODO: subdev errors should not be ignored, this should become a
-          subdev helper function. */
-       ivtv_call_all(itv, core, g_register, reg);
-       return 0;
+       reg->size = 4;
+       return ivtv_itvc(itv, true, reg->reg, &reg->val);
 }
 
 static int ivtv_s_register(struct file *file, void *fh, const struct v4l2_dbg_register *reg)
 {
        struct ivtv *itv = fh2id(fh)->itv;
+       u64 val = reg->val;
 
-       if (v4l2_chip_match_host(&reg->match)) {
-               u64 val = reg->val;
-
-               return ivtv_itvc(itv, false, reg->reg, &val);
-       }
-       /* TODO: subdev errors should not be ignored, this should become a
-          subdev helper function. */
-       ivtv_call_all(itv, core, s_register, reg);
-       return 0;
+       return ivtv_itvc(itv, false, reg->reg, &val);
 }
 #endif
 
@@ -1416,7 +1382,6 @@ static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
        fb->fmt.bytesperline = fb->fmt.width;
        fb->fmt.colorspace = V4L2_COLORSPACE_SMPTE170M;
        fb->fmt.field = V4L2_FIELD_INTERLACED;
-       fb->fmt.priv = 0;
        if (fb->fmt.pixelformat != V4L2_PIX_FMT_PAL8)
                fb->fmt.bytesperline *= 2;
        if (fb->fmt.pixelformat == V4L2_PIX_FMT_RGB32 ||
@@ -1914,7 +1879,6 @@ static const struct v4l2_ioctl_ops ivtv_ioctl_ops = {
        .vidioc_try_fmt_vid_out_overlay     = ivtv_try_fmt_vid_out_overlay,
        .vidioc_try_fmt_sliced_vbi_out      = ivtv_try_fmt_sliced_vbi_out,
        .vidioc_g_sliced_vbi_cap            = ivtv_g_sliced_vbi_cap,
-       .vidioc_g_chip_ident                = ivtv_g_chip_ident,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
        .vidioc_g_register                  = ivtv_g_register,
        .vidioc_s_register                  = ivtv_s_register,