Commit 4bd81936 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] ivtv: remove g_chip_ident

g_chip_ident was used to determine if a saa7114 or saa7115 was used. Instead
just check the subdev name.
After that the g_chip_ident function can be removed.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent e84e91ea
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <media/tveeprom.h> #include <media/tveeprom.h>
#include <media/saa7115.h> #include <media/saa7115.h>
#include <media/v4l2-chip-ident.h>
#include "tuner-xc2028.h" #include "tuner-xc2028.h"
/* If you have already X v4l cards, then set this to X. This way /* If you have already X v4l cards, then set this to X. This way
...@@ -968,15 +967,10 @@ static void ivtv_load_and_init_modules(struct ivtv *itv) ...@@ -968,15 +967,10 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
} }
if (hw & IVTV_HW_SAA711X) { if (hw & IVTV_HW_SAA711X) {
struct v4l2_dbg_chip_ident v;
/* determine the exact saa711x model */ /* determine the exact saa711x model */
itv->hw_flags &= ~IVTV_HW_SAA711X; itv->hw_flags &= ~IVTV_HW_SAA711X;
v.match.type = V4L2_CHIP_MATCH_I2C_DRIVER; if (strstr(itv->sd_video->name, "saa7114")) {
strlcpy(v.match.name, "saa7115", sizeof(v.match.name));
ivtv_call_hw(itv, IVTV_HW_SAA711X, core, g_chip_ident, &v);
if (v.ident == V4L2_IDENT_SAA7114) {
itv->hw_flags |= IVTV_HW_SAA7114; itv->hw_flags |= IVTV_HW_SAA7114;
/* VBI is not yet supported by the saa7114 driver. */ /* VBI is not yet supported by the saa7114 driver. */
itv->v4l2_cap &= ~(V4L2_CAP_SLICED_VBI_CAPTURE|V4L2_CAP_VBI_CAPTURE); itv->v4l2_cap &= ~(V4L2_CAP_SLICED_VBI_CAPTURE|V4L2_CAP_VBI_CAPTURE);
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "ivtv-cards.h" #include "ivtv-cards.h"
#include <media/saa7127.h> #include <media/saa7127.h>
#include <media/tveeprom.h> #include <media/tveeprom.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-event.h> #include <media/v4l2-event.h>
#include <linux/dvb/audio.h> #include <linux/dvb/audio.h>
...@@ -692,24 +691,6 @@ static int ivtv_s_fmt_vid_out_overlay(struct file *file, void *fh, struct v4l2_f ...@@ -692,24 +691,6 @@ static int ivtv_s_fmt_vid_out_overlay(struct file *file, void *fh, struct v4l2_f
return ret; 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 #ifdef CONFIG_VIDEO_ADV_DEBUG
static int ivtv_itvc(struct ivtv *itv, bool get, u64 reg, u64 *val) static int ivtv_itvc(struct ivtv *itv, bool get, u64 reg, u64 *val)
{ {
...@@ -736,29 +717,16 @@ static int ivtv_g_register(struct file *file, void *fh, struct v4l2_dbg_register ...@@ -736,29 +717,16 @@ static int ivtv_g_register(struct file *file, void *fh, struct v4l2_dbg_register
{ {
struct ivtv *itv = fh2id(fh)->itv; struct ivtv *itv = fh2id(fh)->itv;
if (v4l2_chip_match_host(&reg->match)) { reg->size = 4;
reg->size = 4; return ivtv_itvc(itv, true, reg->reg, &reg->val);
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;
} }
static int ivtv_s_register(struct file *file, void *fh, const struct v4l2_dbg_register *reg) static int ivtv_s_register(struct file *file, void *fh, const struct v4l2_dbg_register *reg)
{ {
struct ivtv *itv = fh2id(fh)->itv; struct ivtv *itv = fh2id(fh)->itv;
u64 val = reg->val;
if (v4l2_chip_match_host(&reg->match)) { return ivtv_itvc(itv, false, reg->reg, &val);
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;
} }
#endif #endif
...@@ -1912,7 +1880,6 @@ static const struct v4l2_ioctl_ops ivtv_ioctl_ops = { ...@@ -1912,7 +1880,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_vid_out_overlay = ivtv_try_fmt_vid_out_overlay,
.vidioc_try_fmt_sliced_vbi_out = ivtv_try_fmt_sliced_vbi_out, .vidioc_try_fmt_sliced_vbi_out = ivtv_try_fmt_sliced_vbi_out,
.vidioc_g_sliced_vbi_cap = ivtv_g_sliced_vbi_cap, .vidioc_g_sliced_vbi_cap = ivtv_g_sliced_vbi_cap,
.vidioc_g_chip_ident = ivtv_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.vidioc_g_register = ivtv_g_register, .vidioc_g_register = ivtv_g_register,
.vidioc_s_register = ivtv_s_register, .vidioc_s_register = ivtv_s_register,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment