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

[media] media/i2c: remove g_chip_ident op

This is no longer needed since the core now handles this through DBG_G_CHIP_INFO.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6be89daa
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/v4l2-dv-timings.h> #include <linux/v4l2-dv-timings.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/ad9389b.h> #include <media/ad9389b.h>
...@@ -343,10 +342,6 @@ static const struct v4l2_ctrl_ops ad9389b_ctrl_ops = { ...@@ -343,10 +342,6 @@ static const struct v4l2_ctrl_ops ad9389b_ctrl_ops = {
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->val = ad9389b_rd(sd, reg->reg & 0xff); reg->val = ad9389b_rd(sd, reg->reg & 0xff);
reg->size = 1; reg->size = 1;
return 0; return 0;
...@@ -354,22 +349,11 @@ static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * ...@@ -354,22 +349,11 @@ static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
static int ad9389b_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int ad9389b_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
ad9389b_wr(sd, reg->reg & 0xff, reg->val & 0xff); ad9389b_wr(sd, reg->reg & 0xff, reg->val & 0xff);
return 0; return 0;
} }
#endif #endif
static int ad9389b_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_AD9389B, 0);
}
static int ad9389b_log_status(struct v4l2_subdev *sd) static int ad9389b_log_status(struct v4l2_subdev *sd)
{ {
struct ad9389b_state *state = get_ad9389b_state(sd); struct ad9389b_state *state = get_ad9389b_state(sd);
...@@ -596,7 +580,6 @@ static int ad9389b_isr(struct v4l2_subdev *sd, u32 status, bool *handled) ...@@ -596,7 +580,6 @@ static int ad9389b_isr(struct v4l2_subdev *sd, u32 status, bool *handled)
static const struct v4l2_subdev_core_ops ad9389b_core_ops = { static const struct v4l2_subdev_core_ops ad9389b_core_ops = {
.log_status = ad9389b_log_status, .log_status = ad9389b_log_status,
.g_chip_ident = ad9389b_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = ad9389b_g_register, .g_register = ad9389b_g_register,
.s_register = ad9389b_s_register, .s_register = ad9389b_s_register,
...@@ -1303,8 +1286,8 @@ static int ad9389b_remove(struct i2c_client *client) ...@@ -1303,8 +1286,8 @@ static int ad9389b_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static struct i2c_device_id ad9389b_id[] = { static struct i2c_device_id ad9389b_id[] = {
{ "ad9389b", V4L2_IDENT_AD9389B }, { "ad9389b", 0 },
{ "ad9889b", V4L2_IDENT_AD9389B }, { "ad9889b", 0 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, ad9389b_id); MODULE_DEVICE_TABLE(i2c, ad9389b_id);
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
MODULE_DESCRIPTION("Analog Devices ADV7170 video encoder driver"); MODULE_DESCRIPTION("Analog Devices ADV7170 video encoder driver");
MODULE_AUTHOR("Maxim Yevtyushkin"); MODULE_AUTHOR("Maxim Yevtyushkin");
...@@ -317,19 +316,8 @@ static int adv7170_s_fmt(struct v4l2_subdev *sd, ...@@ -317,19 +316,8 @@ static int adv7170_s_fmt(struct v4l2_subdev *sd,
return ret; return ret;
} }
static int adv7170_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7170, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops adv7170_core_ops = {
.g_chip_ident = adv7170_g_chip_ident,
};
static const struct v4l2_subdev_video_ops adv7170_video_ops = { static const struct v4l2_subdev_video_ops adv7170_video_ops = {
.s_std_output = adv7170_s_std_output, .s_std_output = adv7170_s_std_output,
.s_routing = adv7170_s_routing, .s_routing = adv7170_s_routing,
...@@ -339,7 +327,6 @@ static const struct v4l2_subdev_video_ops adv7170_video_ops = { ...@@ -339,7 +327,6 @@ static const struct v4l2_subdev_video_ops adv7170_video_ops = {
}; };
static const struct v4l2_subdev_ops adv7170_ops = { static const struct v4l2_subdev_ops adv7170_ops = {
.core = &adv7170_core_ops,
.video = &adv7170_video_ops, .video = &adv7170_video_ops,
}; };
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
MODULE_DESCRIPTION("Analog Devices ADV7175 video encoder driver"); MODULE_DESCRIPTION("Analog Devices ADV7175 video encoder driver");
MODULE_AUTHOR("Dave Perks"); MODULE_AUTHOR("Dave Perks");
...@@ -355,13 +354,6 @@ static int adv7175_s_fmt(struct v4l2_subdev *sd, ...@@ -355,13 +354,6 @@ static int adv7175_s_fmt(struct v4l2_subdev *sd,
return ret; return ret;
} }
static int adv7175_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7175, 0);
}
static int adv7175_s_power(struct v4l2_subdev *sd, int on) static int adv7175_s_power(struct v4l2_subdev *sd, int on)
{ {
if (on) if (on)
...@@ -375,7 +367,6 @@ static int adv7175_s_power(struct v4l2_subdev *sd, int on) ...@@ -375,7 +367,6 @@ static int adv7175_s_power(struct v4l2_subdev *sd, int on)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops adv7175_core_ops = { static const struct v4l2_subdev_core_ops adv7175_core_ops = {
.g_chip_ident = adv7175_g_chip_ident,
.init = adv7175_init, .init = adv7175_init,
.s_power = adv7175_s_power, .s_power = adv7175_s_power,
}; };
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-chip-ident.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#define ADV7180_INPUT_CONTROL_REG 0x00 #define ADV7180_INPUT_CONTROL_REG 0x00
...@@ -274,14 +273,6 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status) ...@@ -274,14 +273,6 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status)
return ret; return ret;
} }
static int adv7180_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7180, 0);
}
static int adv7180_s_std(struct v4l2_subdev *sd, v4l2_std_id std) static int adv7180_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
{ {
struct adv7180_state *state = to_state(sd); struct adv7180_state *state = to_state(sd);
...@@ -450,7 +441,6 @@ static const struct v4l2_subdev_video_ops adv7180_video_ops = { ...@@ -450,7 +441,6 @@ static const struct v4l2_subdev_video_ops adv7180_video_ops = {
}; };
static const struct v4l2_subdev_core_ops adv7180_core_ops = { static const struct v4l2_subdev_core_ops adv7180_core_ops = {
.g_chip_ident = adv7180_g_chip_ident,
.s_std = adv7180_s_std, .s_std = adv7180_s_std,
}; };
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/adv7183.h> #include <media/adv7183.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
...@@ -481,25 +480,9 @@ static int adv7183_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -481,25 +480,9 @@ static int adv7183_s_stream(struct v4l2_subdev *sd, int enable)
return 0; return 0;
} }
static int adv7183_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
int rev;
struct i2c_client *client = v4l2_get_subdevdata(sd);
/* 0x11 for adv7183, 0x13 for adv7183b */
rev = adv7183_read(sd, ADV7183_IDENT);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7183, rev);
}
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->val = adv7183_read(sd, reg->reg & 0xff); reg->val = adv7183_read(sd, reg->reg & 0xff);
reg->size = 1; reg->size = 1;
return 0; return 0;
...@@ -507,10 +490,6 @@ static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * ...@@ -507,10 +490,6 @@ static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
static int adv7183_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int adv7183_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
adv7183_write(sd, reg->reg & 0xff, reg->val & 0xff); adv7183_write(sd, reg->reg & 0xff, reg->val & 0xff);
return 0; return 0;
} }
...@@ -525,7 +504,6 @@ static const struct v4l2_subdev_core_ops adv7183_core_ops = { ...@@ -525,7 +504,6 @@ static const struct v4l2_subdev_core_ops adv7183_core_ops = {
.g_std = adv7183_g_std, .g_std = adv7183_g_std,
.s_std = adv7183_s_std, .s_std = adv7183_s_std,
.reset = adv7183_reset, .reset = adv7183_reset,
.g_chip_ident = adv7183_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = adv7183_g_register, .g_register = adv7183_g_register,
.s_register = adv7183_s_register, .s_register = adv7183_s_register,
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <media/adv7343.h> #include <media/adv7343.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include "adv7343_regs.h" #include "adv7343_regs.h"
...@@ -311,21 +310,12 @@ static int adv7343_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -311,21 +310,12 @@ static int adv7343_s_ctrl(struct v4l2_ctrl *ctrl)
return -EINVAL; return -EINVAL;
} }
static int adv7343_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7343, 0);
}
static const struct v4l2_ctrl_ops adv7343_ctrl_ops = { static const struct v4l2_ctrl_ops adv7343_ctrl_ops = {
.s_ctrl = adv7343_s_ctrl, .s_ctrl = adv7343_s_ctrl,
}; };
static const struct v4l2_subdev_core_ops adv7343_core_ops = { static const struct v4l2_subdev_core_ops adv7343_core_ops = {
.log_status = adv7343_log_status, .log_status = adv7343_log_status,
.g_chip_ident = adv7343_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <media/adv7393.h> #include <media/adv7393.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include "adv7393_regs.h" #include "adv7393_regs.h"
...@@ -301,21 +300,12 @@ static int adv7393_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -301,21 +300,12 @@ static int adv7393_s_ctrl(struct v4l2_ctrl *ctrl)
return -EINVAL; return -EINVAL;
} }
static int adv7393_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7393, 0);
}
static const struct v4l2_ctrl_ops adv7393_ctrl_ops = { static const struct v4l2_ctrl_ops adv7393_ctrl_ops = {
.s_ctrl = adv7393_s_ctrl, .s_ctrl = adv7393_s_ctrl,
}; };
static const struct v4l2_subdev_core_ops adv7393_core_ops = { static const struct v4l2_subdev_core_ops adv7393_core_ops = {
.log_status = adv7393_log_status, .log_status = adv7393_log_status,
.g_chip_ident = adv7393_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <linux/v4l2-dv-timings.h> #include <linux/v4l2-dv-timings.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-chip-ident.h>
#include <media/adv7604.h> #include <media/adv7604.h>
static int debug; static int debug;
...@@ -643,10 +642,6 @@ static void adv7604_inv_register(struct v4l2_subdev *sd) ...@@ -643,10 +642,6 @@ static void adv7604_inv_register(struct v4l2_subdev *sd)
static int adv7604_g_register(struct v4l2_subdev *sd, static int adv7604_g_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg) struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->size = 1; reg->size = 1;
switch (reg->reg >> 8) { switch (reg->reg >> 8) {
case 0: case 0:
...@@ -699,10 +694,6 @@ static int adv7604_g_register(struct v4l2_subdev *sd, ...@@ -699,10 +694,6 @@ static int adv7604_g_register(struct v4l2_subdev *sd,
static int adv7604_s_register(struct v4l2_subdev *sd, static int adv7604_s_register(struct v4l2_subdev *sd,
const struct v4l2_dbg_register *reg) const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
switch (reg->reg >> 8) { switch (reg->reg >> 8) {
case 0: case 0:
io_write(sd, reg->reg & 0xff, reg->val & 0xff); io_write(sd, reg->reg & 0xff, reg->val & 0xff);
...@@ -980,14 +971,6 @@ static int adv7604_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -980,14 +971,6 @@ static int adv7604_s_ctrl(struct v4l2_ctrl *ctrl)
return -EINVAL; return -EINVAL;
} }
static int adv7604_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7604, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static inline bool no_power(struct v4l2_subdev *sd) static inline bool no_power(struct v4l2_subdev *sd)
...@@ -1783,7 +1766,6 @@ static const struct v4l2_subdev_core_ops adv7604_core_ops = { ...@@ -1783,7 +1766,6 @@ static const struct v4l2_subdev_core_ops adv7604_core_ops = {
.s_ctrl = v4l2_subdev_s_ctrl, .s_ctrl = v4l2_subdev_s_ctrl,
.queryctrl = v4l2_subdev_queryctrl, .queryctrl = v4l2_subdev_queryctrl,
.querymenu = v4l2_subdev_querymenu, .querymenu = v4l2_subdev_querymenu,
.g_chip_ident = adv7604_g_chip_ident,
.interrupt_service_routine = adv7604_isr, .interrupt_service_routine = adv7604_isr,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = adv7604_g_register, .g_register = adv7604_g_register,
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <media/ak881x.h> #include <media/ak881x.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
...@@ -33,7 +32,6 @@ struct ak881x { ...@@ -33,7 +32,6 @@ struct ak881x {
struct v4l2_subdev subdev; struct v4l2_subdev subdev;
struct ak881x_pdata *pdata; struct ak881x_pdata *pdata;
unsigned int lines; unsigned int lines;
int id; /* DEVICE_ID code V4L2_IDENT_AK881X code from v4l2-chip-ident.h */
char revision; /* DEVICE_REVISION content */ char revision; /* DEVICE_REVISION content */
}; };
...@@ -62,36 +60,15 @@ static struct ak881x *to_ak881x(const struct i2c_client *client) ...@@ -62,36 +60,15 @@ static struct ak881x *to_ak881x(const struct i2c_client *client)
return container_of(i2c_get_clientdata(client), struct ak881x, subdev); return container_of(i2c_get_clientdata(client), struct ak881x, subdev);
} }
static int ak881x_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *id)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct ak881x *ak881x = to_ak881x(client);
if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
return -EINVAL;
if (id->match.addr != client->addr)
return -ENODEV;
id->ident = ak881x->id;
id->revision = ak881x->revision;
return 0;
}
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int ak881x_g_register(struct v4l2_subdev *sd, static int ak881x_g_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg) struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd); struct i2c_client *client = v4l2_get_subdevdata(sd);
if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x26) if (reg->reg > 0x26)
return -EINVAL; return -EINVAL;
if (reg->match.addr != client->addr)
return -ENODEV;
reg->val = reg_read(client, reg->reg); reg->val = reg_read(client, reg->reg);
if (reg->val > 0xffff) if (reg->val > 0xffff)
...@@ -105,12 +82,9 @@ static int ak881x_s_register(struct v4l2_subdev *sd, ...@@ -105,12 +82,9 @@ static int ak881x_s_register(struct v4l2_subdev *sd,
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd); struct i2c_client *client = v4l2_get_subdevdata(sd);
if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x26) if (reg->reg > 0x26)
return -EINVAL; return -EINVAL;
if (reg->match.addr != client->addr)
return -ENODEV;
if (reg_write(client, reg->reg, reg->val) < 0) if (reg_write(client, reg->reg, reg->val) < 0)
return -EIO; return -EIO;
...@@ -229,7 +203,6 @@ static int ak881x_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -229,7 +203,6 @@ static int ak881x_s_stream(struct v4l2_subdev *sd, int enable)
} }
static struct v4l2_subdev_core_ops ak881x_subdev_core_ops = { static struct v4l2_subdev_core_ops ak881x_subdev_core_ops = {
.g_chip_ident = ak881x_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = ak881x_g_register, .g_register = ak881x_g_register,
.s_register = ak881x_s_register, .s_register = ak881x_s_register,
...@@ -274,10 +247,7 @@ static int ak881x_probe(struct i2c_client *client, ...@@ -274,10 +247,7 @@ static int ak881x_probe(struct i2c_client *client,
switch (data) { switch (data) {
case 0x13: case 0x13:
ak881x->id = V4L2_IDENT_AK8813;
break;
case 0x14: case 0x14:
ak881x->id = V4L2_IDENT_AK8814;
break; break;
default: default:
dev_err(&client->dev, dev_err(&client->dev,
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/bt819.h> #include <media/bt819.h>
...@@ -57,7 +56,6 @@ struct bt819 { ...@@ -57,7 +56,6 @@ struct bt819 {
unsigned char reg[32]; unsigned char reg[32];
v4l2_std_id norm; v4l2_std_id norm;
int ident;
int input; int input;
int enable; int enable;
}; };
...@@ -373,14 +371,6 @@ static int bt819_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -373,14 +371,6 @@ static int bt819_s_ctrl(struct v4l2_ctrl *ctrl)
return 0; return 0;
} }
static int bt819_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct bt819 *decoder = to_bt819(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, decoder->ident, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_ctrl_ops bt819_ctrl_ops = { static const struct v4l2_ctrl_ops bt819_ctrl_ops = {
...@@ -388,7 +378,6 @@ static const struct v4l2_ctrl_ops bt819_ctrl_ops = { ...@@ -388,7 +378,6 @@ static const struct v4l2_ctrl_ops bt819_ctrl_ops = {
}; };
static const struct v4l2_subdev_core_ops bt819_core_ops = { static const struct v4l2_subdev_core_ops bt819_core_ops = {
.g_chip_ident = bt819_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
...@@ -435,15 +424,12 @@ static int bt819_probe(struct i2c_client *client, ...@@ -435,15 +424,12 @@ static int bt819_probe(struct i2c_client *client,
switch (ver & 0xf0) { switch (ver & 0xf0) {
case 0x70: case 0x70:
name = "bt819a"; name = "bt819a";
decoder->ident = V4L2_IDENT_BT819A;
break; break;
case 0x60: case 0x60:
name = "bt817a"; name = "bt817a";
decoder->ident = V4L2_IDENT_BT817A;
break; break;
case 0x20: case 0x20:
name = "bt815a"; name = "bt815a";
decoder->ident = V4L2_IDENT_BT815A;
break; break;
default: default:
v4l2_dbg(1, debug, sd, v4l2_dbg(1, debug, sd,
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
MODULE_DESCRIPTION("Brooktree-856A video encoder driver"); MODULE_DESCRIPTION("Brooktree-856A video encoder driver");
MODULE_AUTHOR("Mike Bernson & Dave Perks"); MODULE_AUTHOR("Mike Bernson & Dave Perks");
...@@ -177,17 +176,9 @@ static int bt856_s_routing(struct v4l2_subdev *sd, ...@@ -177,17 +176,9 @@ static int bt856_s_routing(struct v4l2_subdev *sd,
return 0; return 0;
} }
static int bt856_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_BT856, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops bt856_core_ops = { static const struct v4l2_subdev_core_ops bt856_core_ops = {
.g_chip_ident = bt856_g_chip_ident,
.init = bt856_init, .init = bt856_init,
}; };
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
MODULE_DESCRIPTION("Brooktree-866 video encoder driver"); MODULE_DESCRIPTION("Brooktree-866 video encoder driver");
MODULE_AUTHOR("Mike Bernson & Dave Perks"); MODULE_AUTHOR("Mike Bernson & Dave Perks");
...@@ -175,26 +174,14 @@ static int bt866_s_routing(struct v4l2_subdev *sd, ...@@ -175,26 +174,14 @@ static int bt866_s_routing(struct v4l2_subdev *sd,
bt866_write(client, 0xdc, val); bt866_write(client, 0xdc, val);
#endif #endif
static int bt866_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_BT866, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops bt866_core_ops = {
.g_chip_ident = bt866_g_chip_ident,
};
static const struct v4l2_subdev_video_ops bt866_video_ops = { static const struct v4l2_subdev_video_ops bt866_video_ops = {
.s_std_output = bt866_s_std_output, .s_std_output = bt866_s_std_output,
.s_routing = bt866_s_routing, .s_routing = bt866_s_routing,
}; };
static const struct v4l2_subdev_ops bt866_ops = { static const struct v4l2_subdev_ops bt866_ops = {
.core = &bt866_core_ops,
.video = &bt866_video_ops, .video = &bt866_video_ops,
}; };
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
MODULE_DESCRIPTION("i2c device driver for cs5345 Audio ADC"); MODULE_DESCRIPTION("i2c device driver for cs5345 Audio ADC");
...@@ -99,10 +98,6 @@ static int cs5345_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -99,10 +98,6 @@ static int cs5345_s_ctrl(struct v4l2_ctrl *ctrl)
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->size = 1; reg->size = 1;
reg->val = cs5345_read(sd, reg->reg & 0x1f); reg->val = cs5345_read(sd, reg->reg & 0x1f);
return 0; return 0;
...@@ -110,22 +105,11 @@ static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r ...@@ -110,22 +105,11 @@ static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
static int cs5345_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int cs5345_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
cs5345_write(sd, reg->reg & 0x1f, reg->val & 0xff); cs5345_write(sd, reg->reg & 0x1f, reg->val & 0xff);
return 0; return 0;
} }
#endif #endif
static int cs5345_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_CS5345, 0);
}
static int cs5345_log_status(struct v4l2_subdev *sd) static int cs5345_log_status(struct v4l2_subdev *sd)
{ {
u8 v = cs5345_read(sd, 0x09) & 7; u8 v = cs5345_read(sd, 0x09) & 7;
...@@ -148,7 +132,6 @@ static const struct v4l2_ctrl_ops cs5345_ctrl_ops = { ...@@ -148,7 +132,6 @@ static const struct v4l2_ctrl_ops cs5345_ctrl_ops = {
static const struct v4l2_subdev_core_ops cs5345_core_ops = { static const struct v4l2_subdev_core_ops cs5345_core_ops = {
.log_status = cs5345_log_status, .log_status = cs5345_log_status,
.g_chip_ident = cs5345_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
MODULE_DESCRIPTION("i2c device driver for cs53l32a Audio ADC"); MODULE_DESCRIPTION("i2c device driver for cs53l32a Audio ADC");
...@@ -104,14 +103,6 @@ static int cs53l32a_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -104,14 +103,6 @@ static int cs53l32a_s_ctrl(struct v4l2_ctrl *ctrl)
return -EINVAL; return -EINVAL;
} }
static int cs53l32a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client,
chip, V4L2_IDENT_CS53l32A, 0);
}
static int cs53l32a_log_status(struct v4l2_subdev *sd) static int cs53l32a_log_status(struct v4l2_subdev *sd)
{ {
struct cs53l32a_state *state = to_state(sd); struct cs53l32a_state *state = to_state(sd);
...@@ -130,7 +121,6 @@ static const struct v4l2_ctrl_ops cs53l32a_ctrl_ops = { ...@@ -130,7 +121,6 @@ static const struct v4l2_ctrl_ops cs53l32a_ctrl_ops = {
static const struct v4l2_subdev_core_ops cs53l32a_core_ops = { static const struct v4l2_subdev_core_ops cs53l32a_core_ops = {
.log_status = cs53l32a_log_status, .log_status = cs53l32a_log_status,
.g_chip_ident = cs53l32a_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/math64.h> #include <linux/math64.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-chip-ident.h>
#include <media/cx25840.h> #include <media/cx25840.h>
#include "cx25840-core.h" #include "cx25840-core.h"
...@@ -1662,8 +1661,6 @@ static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * ...@@ -1662,8 +1661,6 @@ static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd); struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->size = 1; reg->size = 1;
reg->val = cx25840_read(client, reg->reg & 0x0fff); reg->val = cx25840_read(client, reg->reg & 0x0fff);
return 0; return 0;
...@@ -1673,8 +1670,6 @@ static int cx25840_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi ...@@ -1673,8 +1670,6 @@ static int cx25840_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd); struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
cx25840_write(client, reg->reg & 0x0fff, reg->val & 0xff); cx25840_write(client, reg->reg & 0x0fff, reg->val & 0xff);
return 0; return 0;
} }
...@@ -1934,14 +1929,6 @@ static int cx25840_reset(struct v4l2_subdev *sd, u32 val) ...@@ -1934,14 +1929,6 @@ static int cx25840_reset(struct v4l2_subdev *sd, u32 val)
return 0; return 0;
} }
static int cx25840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct cx25840_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, state->id, state->rev);
}
static int cx25840_log_status(struct v4l2_subdev *sd) static int cx25840_log_status(struct v4l2_subdev *sd)
{ {
struct cx25840_state *state = to_state(sd); struct cx25840_state *state = to_state(sd);
...@@ -5047,7 +5034,6 @@ static const struct v4l2_ctrl_ops cx25840_ctrl_ops = { ...@@ -5047,7 +5034,6 @@ static const struct v4l2_ctrl_ops cx25840_ctrl_ops = {
static const struct v4l2_subdev_core_ops cx25840_core_ops = { static const struct v4l2_subdev_core_ops cx25840_core_ops = {
.log_status = cx25840_log_status, .log_status = cx25840_log_status,
.g_chip_ident = cx25840_g_chip_ident,
.g_ctrl = v4l2_subdev_g_ctrl, .g_ctrl = v4l2_subdev_g_ctrl,
.s_ctrl = v4l2_subdev_s_ctrl, .s_ctrl = v4l2_subdev_s_ctrl,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include "ks0127.h" #include "ks0127.h"
MODULE_DESCRIPTION("KS0127 video decoder driver"); MODULE_DESCRIPTION("KS0127 video decoder driver");
...@@ -200,7 +199,6 @@ struct adjust { ...@@ -200,7 +199,6 @@ struct adjust {
struct ks0127 { struct ks0127 {
struct v4l2_subdev sd; struct v4l2_subdev sd;
v4l2_std_id norm; v4l2_std_id norm;
int ident;
u8 regs[256]; u8 regs[256];
}; };
...@@ -371,12 +369,9 @@ static void ks0127_and_or(struct v4l2_subdev *sd, u8 reg, u8 and_v, u8 or_v) ...@@ -371,12 +369,9 @@ static void ks0127_and_or(struct v4l2_subdev *sd, u8 reg, u8 and_v, u8 or_v)
****************************************************************************/ ****************************************************************************/
static void ks0127_init(struct v4l2_subdev *sd) static void ks0127_init(struct v4l2_subdev *sd)
{ {
struct ks0127 *ks = to_ks0127(sd);
u8 *table = reg_defaults; u8 *table = reg_defaults;
int i; int i;
ks->ident = V4L2_IDENT_KS0127;
v4l2_dbg(1, debug, sd, "reset\n"); v4l2_dbg(1, debug, sd, "reset\n");
msleep(1); msleep(1);
...@@ -397,7 +392,6 @@ static void ks0127_init(struct v4l2_subdev *sd) ...@@ -397,7 +392,6 @@ static void ks0127_init(struct v4l2_subdev *sd)
if ((ks0127_read(sd, KS_STAT) & 0x80) == 0) { if ((ks0127_read(sd, KS_STAT) & 0x80) == 0) {
ks->ident = V4L2_IDENT_KS0122S;
v4l2_dbg(1, debug, sd, "ks0122s found\n"); v4l2_dbg(1, debug, sd, "ks0122s found\n");
return; return;
} }
...@@ -408,7 +402,6 @@ static void ks0127_init(struct v4l2_subdev *sd) ...@@ -408,7 +402,6 @@ static void ks0127_init(struct v4l2_subdev *sd)
break; break;
case 9: case 9:
ks->ident = V4L2_IDENT_KS0127B;
v4l2_dbg(1, debug, sd, "ks0127B Revision A found\n"); v4l2_dbg(1, debug, sd, "ks0127B Revision A found\n");
break; break;
...@@ -646,18 +639,9 @@ static int ks0127_g_input_status(struct v4l2_subdev *sd, u32 *status) ...@@ -646,18 +639,9 @@ static int ks0127_g_input_status(struct v4l2_subdev *sd, u32 *status)
return ks0127_status(sd, status, NULL); return ks0127_status(sd, status, NULL);
} }
static int ks0127_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct ks0127 *ks = to_ks0127(sd);
return v4l2_chip_ident_i2c_client(client, chip, ks->ident, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops ks0127_core_ops = { static const struct v4l2_subdev_core_ops ks0127_core_ops = {
.g_chip_ident = ks0127_g_chip_ident,
.s_std = ks0127_s_std, .s_std = ks0127_s_std,
}; };
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/m52790.h> #include <media/m52790.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
MODULE_DESCRIPTION("i2c device driver for m52790 A/V switch"); MODULE_DESCRIPTION("i2c device driver for m52790 A/V switch");
MODULE_AUTHOR("Hans Verkuil"); MODULE_AUTHOR("Hans Verkuil");
...@@ -83,10 +82,7 @@ static int m52790_s_routing(struct v4l2_subdev *sd, ...@@ -83,10 +82,7 @@ static int m52790_s_routing(struct v4l2_subdev *sd,
static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct m52790_state *state = to_state(sd); struct m52790_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
if (reg->reg != 0) if (reg->reg != 0)
return -EINVAL; return -EINVAL;
reg->size = 1; reg->size = 1;
...@@ -97,10 +93,7 @@ static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r ...@@ -97,10 +93,7 @@ static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct m52790_state *state = to_state(sd); struct m52790_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
if (reg->reg != 0) if (reg->reg != 0)
return -EINVAL; return -EINVAL;
state->input = reg->val & 0x0303; state->input = reg->val & 0x0303;
...@@ -110,13 +103,6 @@ static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis ...@@ -110,13 +103,6 @@ static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis
} }
#endif #endif
static int m52790_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_M52790, 0);
}
static int m52790_log_status(struct v4l2_subdev *sd) static int m52790_log_status(struct v4l2_subdev *sd)
{ {
struct m52790_state *state = to_state(sd); struct m52790_state *state = to_state(sd);
...@@ -132,7 +118,6 @@ static int m52790_log_status(struct v4l2_subdev *sd) ...@@ -132,7 +118,6 @@ static int m52790_log_status(struct v4l2_subdev *sd)
static const struct v4l2_subdev_core_ops m52790_core_ops = { static const struct v4l2_subdev_core_ops m52790_core_ops = {
.log_status = m52790_log_status, .log_status = m52790_log_status,
.g_chip_ident = m52790_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = m52790_g_register, .g_register = m52790_g_register,
.s_register = m52790_s_register, .s_register = m52790_s_register,
......
...@@ -570,15 +570,6 @@ static int msp_s_i2s_clock_freq(struct v4l2_subdev *sd, u32 freq) ...@@ -570,15 +570,6 @@ static int msp_s_i2s_clock_freq(struct v4l2_subdev *sd, u32 freq)
return 0; return 0;
} }
static int msp_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct msp_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, state->ident,
(state->rev1 << 16) | state->rev2);
}
static int msp_log_status(struct v4l2_subdev *sd) static int msp_log_status(struct v4l2_subdev *sd)
{ {
struct msp_state *state = to_state(sd); struct msp_state *state = to_state(sd);
...@@ -651,7 +642,6 @@ static const struct v4l2_ctrl_ops msp_ctrl_ops = { ...@@ -651,7 +642,6 @@ static const struct v4l2_ctrl_ops msp_ctrl_ops = {
static const struct v4l2_subdev_core_ops msp_core_ops = { static const struct v4l2_subdev_core_ops msp_core_ops = {
.log_status = msp_log_status, .log_status = msp_log_status,
.g_chip_ident = msp_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
...@@ -554,10 +554,8 @@ static int mt9m032_g_register(struct v4l2_subdev *sd, ...@@ -554,10 +554,8 @@ static int mt9m032_g_register(struct v4l2_subdev *sd,
struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev);
int val; int val;
if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) if (reg->reg > 0xff)
return -EINVAL; return -EINVAL;
if (reg->match.addr != client->addr)
return -ENODEV;
val = mt9m032_read(client, reg->reg); val = mt9m032_read(client, reg->reg);
if (val < 0) if (val < 0)
...@@ -575,12 +573,9 @@ static int mt9m032_s_register(struct v4l2_subdev *sd, ...@@ -575,12 +573,9 @@ static int mt9m032_s_register(struct v4l2_subdev *sd,
struct mt9m032 *sensor = to_mt9m032(sd); struct mt9m032 *sensor = to_mt9m032(sd);
struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev);
if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) if (reg->reg > 0xff)
return -EINVAL; return -EINVAL;
if (reg->match.addr != client->addr)
return -ENODEV;
return mt9m032_write(client, reg->reg, reg->val); return mt9m032_write(client, reg->reg, reg->val);
} }
#endif #endif
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/mt9p031.h> #include <media/mt9p031.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-subdev.h> #include <media/v4l2-subdev.h>
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <asm/div64.h> #include <asm/div64.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/mt9v011.h> #include <media/mt9v011.h>
...@@ -407,11 +406,6 @@ static int mt9v011_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt ...@@ -407,11 +406,6 @@ static int mt9v011_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt
static int mt9v011_g_register(struct v4l2_subdev *sd, static int mt9v011_g_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg) struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->val = mt9v011_read(sd, reg->reg & 0xff); reg->val = mt9v011_read(sd, reg->reg & 0xff);
reg->size = 2; reg->size = 2;
...@@ -421,29 +415,12 @@ static int mt9v011_g_register(struct v4l2_subdev *sd, ...@@ -421,29 +415,12 @@ static int mt9v011_g_register(struct v4l2_subdev *sd,
static int mt9v011_s_register(struct v4l2_subdev *sd, static int mt9v011_s_register(struct v4l2_subdev *sd,
const struct v4l2_dbg_register *reg) const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
mt9v011_write(sd, reg->reg & 0xff, reg->val & 0xffff); mt9v011_write(sd, reg->reg & 0xff, reg->val & 0xffff);
return 0; return 0;
} }
#endif #endif
static int mt9v011_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
u16 version;
struct i2c_client *client = v4l2_get_subdevdata(sd);
version = mt9v011_read(sd, R00_MT9V011_CHIP_VERSION);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_MT9V011,
version);
}
static int mt9v011_s_ctrl(struct v4l2_ctrl *ctrl) static int mt9v011_s_ctrl(struct v4l2_ctrl *ctrl)
{ {
struct mt9v011 *core = struct mt9v011 *core =
...@@ -485,7 +462,6 @@ static struct v4l2_ctrl_ops mt9v011_ctrl_ops = { ...@@ -485,7 +462,6 @@ static struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
static const struct v4l2_subdev_core_ops mt9v011_core_ops = { static const struct v4l2_subdev_core_ops mt9v011_core_ops = {
.reset = mt9v011_reset, .reset = mt9v011_reset,
.g_chip_ident = mt9v011_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = mt9v011_g_register, .g_register = mt9v011_g_register,
.s_register = mt9v011_s_register, .s_register = mt9v011_s_register,
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <media/noon010pc30.h> #include <media/noon010pc30.h>
#include <media/v4l2-chip-ident.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/module.h> #include <linux/module.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <linux/slab.h> #include <linux/slab.h>
MODULE_DESCRIPTION("OmniVision ov7640 sensor driver"); MODULE_DESCRIPTION("OmniVision ov7640 sensor driver");
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-mediabus.h> #include <media/v4l2-mediabus.h>
#include <media/ov7670.h> #include <media/ov7670.h>
...@@ -1462,23 +1461,12 @@ static const struct v4l2_ctrl_ops ov7670_ctrl_ops = { ...@@ -1462,23 +1461,12 @@ static const struct v4l2_ctrl_ops ov7670_ctrl_ops = {
.g_volatile_ctrl = ov7670_g_volatile_ctrl, .g_volatile_ctrl = ov7670_g_volatile_ctrl,
}; };
static int ov7670_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_OV7670, 0);
}
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
unsigned char val = 0; unsigned char val = 0;
int ret; int ret;
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
ret = ov7670_read(sd, reg->reg & 0xff, &val); ret = ov7670_read(sd, reg->reg & 0xff, &val);
reg->val = val; reg->val = val;
reg->size = 1; reg->size = 1;
...@@ -1487,10 +1475,6 @@ static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r ...@@ -1487,10 +1475,6 @@ static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
ov7670_write(sd, reg->reg & 0xff, reg->val & 0xff); ov7670_write(sd, reg->reg & 0xff, reg->val & 0xff);
return 0; return 0;
} }
...@@ -1499,7 +1483,6 @@ static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis ...@@ -1499,7 +1483,6 @@ static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops ov7670_core_ops = { static const struct v4l2_subdev_core_ops ov7670_core_ops = {
.g_chip_ident = ov7670_g_chip_ident,
.reset = ov7670_reset, .reset = ov7670_reset,
.init = ov7670_init, .init = ov7670_init,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <media/saa6588.h> #include <media/saa6588.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
/* insmod options */ /* insmod options */
...@@ -443,17 +442,9 @@ static int saa6588_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt) ...@@ -443,17 +442,9 @@ static int saa6588_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
return 0; return 0;
} }
static int saa6588_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_SAA6588, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops saa6588_core_ops = { static const struct v4l2_subdev_core_ops saa6588_core_ops = {
.g_chip_ident = saa6588_g_chip_ident,
.ioctl = saa6588_ioctl, .ioctl = saa6588_ioctl,
}; };
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
MODULE_DESCRIPTION("Philips SAA7110 video decoder driver"); MODULE_DESCRIPTION("Philips SAA7110 video decoder driver");
...@@ -352,13 +351,6 @@ static int saa7110_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -352,13 +351,6 @@ static int saa7110_s_ctrl(struct v4l2_ctrl *ctrl)
return 0; return 0;
} }
static int saa7110_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_SAA7110, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_ctrl_ops saa7110_ctrl_ops = { static const struct v4l2_ctrl_ops saa7110_ctrl_ops = {
...@@ -366,7 +358,6 @@ static const struct v4l2_ctrl_ops saa7110_ctrl_ops = { ...@@ -366,7 +358,6 @@ static const struct v4l2_ctrl_ops saa7110_ctrl_ops = {
}; };
static const struct v4l2_subdev_core_ops saa7110_core_ops = { static const struct v4l2_subdev_core_ops saa7110_core_ops = {
.g_chip_ident = saa7110_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
This diff is collapsed.
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/saa7127.h> #include <media/saa7127.h>
static int debug; static int debug;
...@@ -251,10 +250,15 @@ static struct i2c_reg_value saa7127_init_config_50hz_secam[] = { ...@@ -251,10 +250,15 @@ static struct i2c_reg_value saa7127_init_config_50hz_secam[] = {
********************************************************************** **********************************************************************
*/ */
enum saa712x_model {
SAA7127,
SAA7129,
};
struct saa7127_state { struct saa7127_state {
struct v4l2_subdev sd; struct v4l2_subdev sd;
v4l2_std_id std; v4l2_std_id std;
u32 ident; enum saa712x_model ident;
enum saa7127_input_type input_type; enum saa7127_input_type input_type;
enum saa7127_output_type output_type; enum saa7127_output_type output_type;
int video_enable; int video_enable;
...@@ -482,7 +486,7 @@ static int saa7127_set_std(struct v4l2_subdev *sd, v4l2_std_id std) ...@@ -482,7 +486,7 @@ static int saa7127_set_std(struct v4l2_subdev *sd, v4l2_std_id std)
inittab = saa7127_init_config_60hz; inittab = saa7127_init_config_60hz;
state->reg_61 = SAA7127_60HZ_DAC_CONTROL; state->reg_61 = SAA7127_60HZ_DAC_CONTROL;
} else if (state->ident == V4L2_IDENT_SAA7129 && } else if (state->ident == SAA7129 &&
(std & V4L2_STD_SECAM) && (std & V4L2_STD_SECAM) &&
!(std & (V4L2_STD_625_50 & ~V4L2_STD_SECAM))) { !(std & (V4L2_STD_625_50 & ~V4L2_STD_SECAM))) {
...@@ -517,7 +521,7 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output) ...@@ -517,7 +521,7 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output)
break; break;
case SAA7127_OUTPUT_TYPE_COMPOSITE: case SAA7127_OUTPUT_TYPE_COMPOSITE:
if (state->ident == V4L2_IDENT_SAA7129) if (state->ident == SAA7129)
state->reg_2d = 0x20; /* CVBS only */ state->reg_2d = 0x20; /* CVBS only */
else else
state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */ state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */
...@@ -525,7 +529,7 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output) ...@@ -525,7 +529,7 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output)
break; break;
case SAA7127_OUTPUT_TYPE_SVIDEO: case SAA7127_OUTPUT_TYPE_SVIDEO:
if (state->ident == V4L2_IDENT_SAA7129) if (state->ident == SAA7129)
state->reg_2d = 0x18; /* Y + C */ state->reg_2d = 0x18; /* Y + C */
else else
state->reg_2d = 0xff; /*11111111 croma -> R, luma -> CVBS + G + B */ state->reg_2d = 0xff; /*11111111 croma -> R, luma -> CVBS + G + B */
...@@ -543,7 +547,7 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output) ...@@ -543,7 +547,7 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output)
break; break;
case SAA7127_OUTPUT_TYPE_BOTH: case SAA7127_OUTPUT_TYPE_BOTH:
if (state->ident == V4L2_IDENT_SAA7129) if (state->ident == SAA7129)
state->reg_2d = 0x38; state->reg_2d = 0x38;
else else
state->reg_2d = 0xbf; state->reg_2d = 0xbf;
...@@ -661,10 +665,6 @@ static int saa7127_s_vbi_data(struct v4l2_subdev *sd, const struct v4l2_sliced_v ...@@ -661,10 +665,6 @@ static int saa7127_s_vbi_data(struct v4l2_subdev *sd, const struct v4l2_sliced_v
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->val = saa7127_read(sd, reg->reg & 0xff); reg->val = saa7127_read(sd, reg->reg & 0xff);
reg->size = 1; reg->size = 1;
return 0; return 0;
...@@ -672,23 +672,11 @@ static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * ...@@ -672,23 +672,11 @@ static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
static int saa7127_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int saa7127_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
saa7127_write(sd, reg->reg & 0xff, reg->val & 0xff); saa7127_write(sd, reg->reg & 0xff, reg->val & 0xff);
return 0; return 0;
} }
#endif #endif
static int saa7127_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct saa7127_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, state->ident, 0);
}
static int saa7127_log_status(struct v4l2_subdev *sd) static int saa7127_log_status(struct v4l2_subdev *sd)
{ {
struct saa7127_state *state = to_state(sd); struct saa7127_state *state = to_state(sd);
...@@ -708,7 +696,6 @@ static int saa7127_log_status(struct v4l2_subdev *sd) ...@@ -708,7 +696,6 @@ static int saa7127_log_status(struct v4l2_subdev *sd)
static const struct v4l2_subdev_core_ops saa7127_core_ops = { static const struct v4l2_subdev_core_ops saa7127_core_ops = {
.log_status = saa7127_log_status, .log_status = saa7127_log_status,
.g_chip_ident = saa7127_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = saa7127_g_register, .g_register = saa7127_g_register,
.s_register = saa7127_s_register, .s_register = saa7127_s_register,
...@@ -777,10 +764,10 @@ static int saa7127_probe(struct i2c_client *client, ...@@ -777,10 +764,10 @@ static int saa7127_probe(struct i2c_client *client,
if (saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2) == 0xaa) { if (saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2) == 0xaa) {
saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2, saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2,
read_result); read_result);
state->ident = V4L2_IDENT_SAA7129; state->ident = SAA7129;
strlcpy(client->name, "saa7129", I2C_NAME_SIZE); strlcpy(client->name, "saa7129", I2C_NAME_SIZE);
} else { } else {
state->ident = V4L2_IDENT_SAA7127; state->ident = SAA7127;
strlcpy(client->name, "saa7127", I2C_NAME_SIZE); strlcpy(client->name, "saa7127", I2C_NAME_SIZE);
} }
} }
...@@ -804,7 +791,7 @@ static int saa7127_probe(struct i2c_client *client, ...@@ -804,7 +791,7 @@ static int saa7127_probe(struct i2c_client *client,
saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL); saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL);
saa7127_set_video_enable(sd, 1); saa7127_set_video_enable(sd, 1);
if (state->ident == V4L2_IDENT_SAA7129) if (state->ident == SAA7129)
saa7127_write_inittab(sd, saa7129_init_config_extra); saa7127_write_inittab(sd, saa7129_init_config_extra);
return 0; return 0;
} }
...@@ -825,10 +812,10 @@ static int saa7127_remove(struct i2c_client *client) ...@@ -825,10 +812,10 @@ static int saa7127_remove(struct i2c_client *client)
static struct i2c_device_id saa7127_id[] = { static struct i2c_device_id saa7127_id[] = {
{ "saa7127_auto", 0 }, /* auto-detection */ { "saa7127_auto", 0 }, /* auto-detection */
{ "saa7126", V4L2_IDENT_SAA7127 }, { "saa7126", SAA7127 },
{ "saa7127", V4L2_IDENT_SAA7127 }, { "saa7127", SAA7127 },
{ "saa7128", V4L2_IDENT_SAA7129 }, { "saa7128", SAA7129 },
{ "saa7129", V4L2_IDENT_SAA7129 }, { "saa7129", SAA7129 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, saa7127_id); MODULE_DEVICE_TABLE(i2c, saa7127_id);
......
...@@ -977,10 +977,6 @@ static int saa717x_s_video_routing(struct v4l2_subdev *sd, ...@@ -977,10 +977,6 @@ static int saa717x_s_video_routing(struct v4l2_subdev *sd,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->val = saa717x_read(sd, reg->reg); reg->val = saa717x_read(sd, reg->reg);
reg->size = 1; reg->size = 1;
return 0; return 0;
...@@ -988,12 +984,9 @@ static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * ...@@ -988,12 +984,9 @@ static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
static int saa717x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int saa717x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
u16 addr = reg->reg & 0xffff; u16 addr = reg->reg & 0xffff;
u8 val = reg->val & 0xff; u8 val = reg->val & 0xff;
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
saa717x_write(sd, addr, val); saa717x_write(sd, addr, val);
return 0; return 0;
} }
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
MODULE_DESCRIPTION("Philips SAA7185 video encoder driver"); MODULE_DESCRIPTION("Philips SAA7185 video encoder driver");
MODULE_AUTHOR("Dave Perks"); MODULE_AUTHOR("Dave Perks");
...@@ -285,17 +284,9 @@ static int saa7185_s_routing(struct v4l2_subdev *sd, ...@@ -285,17 +284,9 @@ static int saa7185_s_routing(struct v4l2_subdev *sd,
return 0; return 0;
} }
static int saa7185_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_SAA7185, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops saa7185_core_ops = { static const struct v4l2_subdev_core_ops saa7185_core_ops = {
.g_chip_ident = saa7185_g_chip_ident,
.init = saa7185_init, .init = saa7185_init,
}; };
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include "saa7191.h" #include "saa7191.h"
...@@ -567,18 +566,9 @@ static int saa7191_g_input_status(struct v4l2_subdev *sd, u32 *status) ...@@ -567,18 +566,9 @@ static int saa7191_g_input_status(struct v4l2_subdev *sd, u32 *status)
} }
static int saa7191_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_SAA7191, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops saa7191_core_ops = { static const struct v4l2_subdev_core_ops saa7191_core_ops = {
.g_chip_ident = saa7191_g_chip_ident,
.g_ctrl = saa7191_g_ctrl, .g_ctrl = saa7191_g_ctrl,
.s_ctrl = saa7191_s_ctrl, .s_ctrl = saa7191_s_ctrl,
.s_std = saa7191_s_std, .s_std = saa7191_s_std,
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
MODULE_DESCRIPTION("tda9840 driver"); MODULE_DESCRIPTION("tda9840 driver");
...@@ -145,26 +144,14 @@ static int tda9840_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *t) ...@@ -145,26 +144,14 @@ static int tda9840_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *t)
return 0; return 0;
} }
static int tda9840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TDA9840, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops tda9840_core_ops = {
.g_chip_ident = tda9840_g_chip_ident,
};
static const struct v4l2_subdev_tuner_ops tda9840_tuner_ops = { static const struct v4l2_subdev_tuner_ops tda9840_tuner_ops = {
.s_tuner = tda9840_s_tuner, .s_tuner = tda9840_s_tuner,
.g_tuner = tda9840_g_tuner, .g_tuner = tda9840_g_tuner,
}; };
static const struct v4l2_subdev_ops tda9840_ops = { static const struct v4l2_subdev_ops tda9840_ops = {
.core = &tda9840_core_ops,
.tuner = &tda9840_tuner_ops, .tuner = &tda9840_tuner_ops,
}; };
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include "tea6415c.h" #include "tea6415c.h"
MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
...@@ -119,25 +118,13 @@ static int tea6415c_s_routing(struct v4l2_subdev *sd, ...@@ -119,25 +118,13 @@ static int tea6415c_s_routing(struct v4l2_subdev *sd,
return ret; return ret;
} }
static int tea6415c_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TEA6415C, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops tea6415c_core_ops = {
.g_chip_ident = tea6415c_g_chip_ident,
};
static const struct v4l2_subdev_video_ops tea6415c_video_ops = { static const struct v4l2_subdev_video_ops tea6415c_video_ops = {
.s_routing = tea6415c_s_routing, .s_routing = tea6415c_s_routing,
}; };
static const struct v4l2_subdev_ops tea6415c_ops = { static const struct v4l2_subdev_ops tea6415c_ops = {
.core = &tea6415c_core_ops,
.video = &tea6415c_video_ops, .video = &tea6415c_video_ops,
}; };
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include "tea6420.h" #include "tea6420.h"
MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
...@@ -90,25 +89,13 @@ static int tea6420_s_routing(struct v4l2_subdev *sd, ...@@ -90,25 +89,13 @@ static int tea6420_s_routing(struct v4l2_subdev *sd,
return 0; return 0;
} }
static int tea6420_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TEA6420, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops tea6420_core_ops = {
.g_chip_ident = tea6420_g_chip_ident,
};
static const struct v4l2_subdev_audio_ops tea6420_audio_ops = { static const struct v4l2_subdev_audio_ops tea6420_audio_ops = {
.s_routing = tea6420_s_routing, .s_routing = tea6420_s_routing,
}; };
static const struct v4l2_subdev_ops tea6420_ops = { static const struct v4l2_subdev_ops tea6420_ops = {
.core = &tea6420_core_ops,
.audio = &tea6420_audio_ops, .audio = &tea6420_audio_ops,
}; };
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <media/ths7303.h> #include <media/ths7303.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#define THS7303_CHANNEL_1 1 #define THS7303_CHANNEL_1 1
...@@ -212,15 +211,6 @@ static int ths7303_s_dv_timings(struct v4l2_subdev *sd, ...@@ -212,15 +211,6 @@ static int ths7303_s_dv_timings(struct v4l2_subdev *sd,
return ths7303_config(sd); return ths7303_config(sd);
} }
static int ths7303_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct ths7303_state *state = to_state(sd);
return v4l2_chip_ident_i2c_client(client, chip, state->driver_data, 0);
}
static const struct v4l2_subdev_video_ops ths7303_video_ops = { static const struct v4l2_subdev_video_ops ths7303_video_ops = {
.s_stream = ths7303_s_stream, .s_stream = ths7303_s_stream,
.s_std_output = ths7303_s_std_output, .s_std_output = ths7303_s_std_output,
...@@ -232,11 +222,6 @@ static const struct v4l2_subdev_video_ops ths7303_video_ops = { ...@@ -232,11 +222,6 @@ static const struct v4l2_subdev_video_ops ths7303_video_ops = {
static int ths7303_g_register(struct v4l2_subdev *sd, static int ths7303_g_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg) struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->size = 1; reg->size = 1;
reg->val = ths7303_read(sd, reg->reg); reg->val = ths7303_read(sd, reg->reg);
return 0; return 0;
...@@ -245,11 +230,6 @@ static int ths7303_g_register(struct v4l2_subdev *sd, ...@@ -245,11 +230,6 @@ static int ths7303_g_register(struct v4l2_subdev *sd,
static int ths7303_s_register(struct v4l2_subdev *sd, static int ths7303_s_register(struct v4l2_subdev *sd,
const struct v4l2_dbg_register *reg) const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
ths7303_write(sd, reg->reg, reg->val); ths7303_write(sd, reg->reg, reg->val);
return 0; return 0;
} }
...@@ -336,7 +316,6 @@ static int ths7303_log_status(struct v4l2_subdev *sd) ...@@ -336,7 +316,6 @@ static int ths7303_log_status(struct v4l2_subdev *sd)
} }
static const struct v4l2_subdev_core_ops ths7303_core_ops = { static const struct v4l2_subdev_core_ops ths7303_core_ops = {
.g_chip_ident = ths7303_g_chip_ident,
.log_status = ths7303_log_status, .log_status = ths7303_log_status,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = ths7303_g_register, .g_register = ths7303_g_register,
...@@ -398,8 +377,8 @@ static int ths7303_remove(struct i2c_client *client) ...@@ -398,8 +377,8 @@ static int ths7303_remove(struct i2c_client *client)
} }
static const struct i2c_device_id ths7303_id[] = { static const struct i2c_device_id ths7303_id[] = {
{"ths7303", V4L2_IDENT_THS7303}, {"ths7303", 0},
{"ths7353", V4L2_IDENT_THS7353}, {"ths7353", 0},
{}, {},
}; };
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <media/tvaudio.h> #include <media/tvaudio.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/i2c-addr.h> #include <media/i2c-addr.h>
...@@ -1838,13 +1837,6 @@ static int tvaudio_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequen ...@@ -1838,13 +1837,6 @@ static int tvaudio_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequen
return 0; return 0;
} }
static int tvaudio_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVAUDIO, 0);
}
static int tvaudio_log_status(struct v4l2_subdev *sd) static int tvaudio_log_status(struct v4l2_subdev *sd)
{ {
struct CHIPSTATE *chip = to_state(sd); struct CHIPSTATE *chip = to_state(sd);
...@@ -1863,7 +1855,6 @@ static const struct v4l2_ctrl_ops tvaudio_ctrl_ops = { ...@@ -1863,7 +1855,6 @@ static const struct v4l2_ctrl_ops tvaudio_ctrl_ops = {
static const struct v4l2_subdev_core_ops tvaudio_core_ops = { static const struct v4l2_subdev_core_ops tvaudio_core_ops = {
.log_status = tvaudio_log_status, .log_status = tvaudio_log_status,
.g_chip_ident = tvaudio_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-mediabus.h> #include <media/v4l2-mediabus.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/tvp514x.h> #include <media/tvp514x.h>
#include <media/media-entity.h> #include <media/media-entity.h>
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/tvp5150.h> #include <media/tvp5150.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include "tvp5150_reg.h" #include "tvp5150_reg.h"
...@@ -1031,29 +1030,11 @@ static int tvp5150_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_f ...@@ -1031,29 +1030,11 @@ static int tvp5150_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_f
return 0; return 0;
} }
static int tvp5150_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
int rev;
struct i2c_client *client = v4l2_get_subdevdata(sd);
rev = tvp5150_read(sd, TVP5150_ROM_MAJOR_VER) << 8 |
tvp5150_read(sd, TVP5150_ROM_MINOR_VER);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVP5150,
rev);
}
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
int res; int res;
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
res = tvp5150_read(sd, reg->reg & 0xff); res = tvp5150_read(sd, reg->reg & 0xff);
if (res < 0) { if (res < 0) {
v4l2_err(sd, "%s: failed with error = %d\n", __func__, res); v4l2_err(sd, "%s: failed with error = %d\n", __func__, res);
...@@ -1067,10 +1048,6 @@ static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * ...@@ -1067,10 +1048,6 @@ static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
static int tvp5150_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int tvp5150_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
tvp5150_write(sd, reg->reg & 0xff, reg->val & 0xff); tvp5150_write(sd, reg->reg & 0xff, reg->val & 0xff);
return 0; return 0;
} }
...@@ -1094,7 +1071,6 @@ static const struct v4l2_subdev_core_ops tvp5150_core_ops = { ...@@ -1094,7 +1071,6 @@ static const struct v4l2_subdev_core_ops tvp5150_core_ops = {
.log_status = tvp5150_log_status, .log_status = tvp5150_log_status,
.s_std = tvp5150_s_std, .s_std = tvp5150_s_std,
.reset = tvp5150_reset, .reset = tvp5150_reset,
.g_chip_ident = tvp5150_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = tvp5150_g_register, .g_register = tvp5150_g_register,
.s_register = tvp5150_s_register, .s_register = tvp5150_s_register,
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <linux/v4l2-dv-timings.h> #include <linux/v4l2-dv-timings.h>
#include <media/tvp7002.h> #include <media/tvp7002.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include "tvp7002_reg.h" #include "tvp7002_reg.h"
...@@ -532,29 +531,6 @@ static inline void tvp7002_write_err(struct v4l2_subdev *sd, u8 reg, ...@@ -532,29 +531,6 @@ static inline void tvp7002_write_err(struct v4l2_subdev *sd, u8 reg,
*err = tvp7002_write(sd, reg, val); *err = tvp7002_write(sd, reg, val);
} }
/*
* tvp7002_g_chip_ident() - Get chip identification number
* @sd: ptr to v4l2_subdev struct
* @chip: ptr to v4l2_dbg_chip_ident struct
*
* Obtains the chip's identification number.
* Returns zero or -EINVAL if read operation fails.
*/
static int tvp7002_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
u8 rev;
int error;
struct i2c_client *client = v4l2_get_subdevdata(sd);
error = tvp7002_read(sd, TVP7002_CHIP_REV, &rev);
if (error < 0)
return error;
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVP7002, rev);
}
/* /*
* tvp7002_write_inittab() - Write initialization values * tvp7002_write_inittab() - Write initialization values
* @sd: ptr to v4l2_subdev struct * @sd: ptr to v4l2_subdev struct
...@@ -741,13 +717,9 @@ static int tvp7002_query_dv_timings(struct v4l2_subdev *sd, ...@@ -741,13 +717,9 @@ static int tvp7002_query_dv_timings(struct v4l2_subdev *sd,
static int tvp7002_g_register(struct v4l2_subdev *sd, static int tvp7002_g_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg) struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
u8 val; u8 val;
int ret; int ret;
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
ret = tvp7002_read(sd, reg->reg & 0xff, &val); ret = tvp7002_read(sd, reg->reg & 0xff, &val);
reg->val = val; reg->val = val;
return ret; return ret;
...@@ -764,11 +736,6 @@ static int tvp7002_g_register(struct v4l2_subdev *sd, ...@@ -764,11 +736,6 @@ static int tvp7002_g_register(struct v4l2_subdev *sd,
static int tvp7002_s_register(struct v4l2_subdev *sd, static int tvp7002_s_register(struct v4l2_subdev *sd,
const struct v4l2_dbg_register *reg) const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
return tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff); return tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff);
} }
#endif #endif
...@@ -933,7 +900,6 @@ tvp7002_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, ...@@ -933,7 +900,6 @@ tvp7002_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
/* V4L2 core operation handlers */ /* V4L2 core operation handlers */
static const struct v4l2_subdev_core_ops tvp7002_core_ops = { static const struct v4l2_subdev_core_ops tvp7002_core_ops = {
.g_chip_ident = tvp7002_g_chip_ident,
.log_status = tvp7002_log_status, .log_status = tvp7002_log_status,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <media/v4l2-subdev.h> #include <media/v4l2-subdev.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#define TW2804_REG_AUTOGAIN 0x02 #define TW2804_REG_AUTOGAIN 0x02
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/upd64031a.h> #include <media/upd64031a.h>
/* --------------------- read registers functions define -------------------- */ /* --------------------- read registers functions define -------------------- */
...@@ -147,13 +146,6 @@ static int upd64031a_s_routing(struct v4l2_subdev *sd, ...@@ -147,13 +146,6 @@ static int upd64031a_s_routing(struct v4l2_subdev *sd,
return upd64031a_s_frequency(sd, NULL); return upd64031a_s_frequency(sd, NULL);
} }
static int upd64031a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_UPD64031A, 0);
}
static int upd64031a_log_status(struct v4l2_subdev *sd) static int upd64031a_log_status(struct v4l2_subdev *sd)
{ {
v4l2_info(sd, "Status: SA00=0x%02x SA01=0x%02x\n", v4l2_info(sd, "Status: SA00=0x%02x SA01=0x%02x\n",
...@@ -164,10 +156,6 @@ static int upd64031a_log_status(struct v4l2_subdev *sd) ...@@ -164,10 +156,6 @@ static int upd64031a_log_status(struct v4l2_subdev *sd)
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->val = upd64031a_read(sd, reg->reg & 0xff); reg->val = upd64031a_read(sd, reg->reg & 0xff);
reg->size = 1; reg->size = 1;
return 0; return 0;
...@@ -175,10 +163,6 @@ static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register ...@@ -175,10 +163,6 @@ static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register
static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
upd64031a_write(sd, reg->reg & 0xff, reg->val & 0xff); upd64031a_write(sd, reg->reg & 0xff, reg->val & 0xff);
return 0; return 0;
} }
...@@ -188,7 +172,6 @@ static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_re ...@@ -188,7 +172,6 @@ static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_re
static const struct v4l2_subdev_core_ops upd64031a_core_ops = { static const struct v4l2_subdev_core_ops upd64031a_core_ops = {
.log_status = upd64031a_log_status, .log_status = upd64031a_log_status,
.g_chip_ident = upd64031a_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = upd64031a_g_register, .g_register = upd64031a_g_register,
.s_register = upd64031a_s_register, .s_register = upd64031a_s_register,
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/upd64083.h> #include <media/upd64083.h>
MODULE_DESCRIPTION("uPD64083 driver"); MODULE_DESCRIPTION("uPD64083 driver");
...@@ -122,10 +121,6 @@ static int upd64083_s_routing(struct v4l2_subdev *sd, ...@@ -122,10 +121,6 @@ static int upd64083_s_routing(struct v4l2_subdev *sd,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->val = upd64083_read(sd, reg->reg & 0xff); reg->val = upd64083_read(sd, reg->reg & 0xff);
reg->size = 1; reg->size = 1;
return 0; return 0;
...@@ -133,22 +128,11 @@ static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register ...@@ -133,22 +128,11 @@ static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register
static int upd64083_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int upd64083_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
upd64083_write(sd, reg->reg & 0xff, reg->val & 0xff); upd64083_write(sd, reg->reg & 0xff, reg->val & 0xff);
return 0; return 0;
} }
#endif #endif
static int upd64083_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_UPD64083, 0);
}
static int upd64083_log_status(struct v4l2_subdev *sd) static int upd64083_log_status(struct v4l2_subdev *sd)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd); struct i2c_client *client = v4l2_get_subdevdata(sd);
...@@ -165,7 +149,6 @@ static int upd64083_log_status(struct v4l2_subdev *sd) ...@@ -165,7 +149,6 @@ static int upd64083_log_status(struct v4l2_subdev *sd)
static const struct v4l2_subdev_core_ops upd64083_core_ops = { static const struct v4l2_subdev_core_ops upd64083_core_ops = {
.log_status = upd64083_log_status, .log_status = upd64083_log_status,
.g_chip_ident = upd64083_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = upd64083_g_register, .g_register = upd64083_g_register,
.s_register = upd64083_s_register, .s_register = upd64083_s_register,
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
MODULE_DESCRIPTION("vp27smpx driver"); MODULE_DESCRIPTION("vp27smpx driver");
MODULE_AUTHOR("Hans Verkuil"); MODULE_AUTHOR("Hans Verkuil");
...@@ -112,13 +111,6 @@ static int vp27smpx_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) ...@@ -112,13 +111,6 @@ static int vp27smpx_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0; return 0;
} }
static int vp27smpx_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_VP27SMPX, 0);
}
static int vp27smpx_log_status(struct v4l2_subdev *sd) static int vp27smpx_log_status(struct v4l2_subdev *sd)
{ {
struct vp27smpx_state *state = to_state(sd); struct vp27smpx_state *state = to_state(sd);
...@@ -132,7 +124,6 @@ static int vp27smpx_log_status(struct v4l2_subdev *sd) ...@@ -132,7 +124,6 @@ static int vp27smpx_log_status(struct v4l2_subdev *sd)
static const struct v4l2_subdev_core_ops vp27smpx_core_ops = { static const struct v4l2_subdev_core_ops vp27smpx_core_ops = {
.log_status = vp27smpx_log_status, .log_status = vp27smpx_log_status,
.g_chip_ident = vp27smpx_g_chip_ident,
.s_std = vp27smpx_s_std, .s_std = vp27smpx_s_std,
}; };
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
MODULE_DESCRIPTION("vpx3220a/vpx3216b/vpx3214c video decoder driver"); MODULE_DESCRIPTION("vpx3220a/vpx3216b/vpx3214c video decoder driver");
...@@ -49,7 +48,6 @@ struct vpx3220 { ...@@ -49,7 +48,6 @@ struct vpx3220 {
unsigned char reg[255]; unsigned char reg[255];
v4l2_std_id norm; v4l2_std_id norm;
int ident;
int input; int input;
int enable; int enable;
}; };
...@@ -442,14 +440,6 @@ static int vpx3220_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -442,14 +440,6 @@ static int vpx3220_s_ctrl(struct v4l2_ctrl *ctrl)
return -EINVAL; return -EINVAL;
} }
static int vpx3220_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct vpx3220 *decoder = to_vpx3220(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, decoder->ident, 0);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static const struct v4l2_ctrl_ops vpx3220_ctrl_ops = { static const struct v4l2_ctrl_ops vpx3220_ctrl_ops = {
...@@ -457,7 +447,6 @@ static const struct v4l2_ctrl_ops vpx3220_ctrl_ops = { ...@@ -457,7 +447,6 @@ static const struct v4l2_ctrl_ops vpx3220_ctrl_ops = {
}; };
static const struct v4l2_subdev_core_ops vpx3220_core_ops = { static const struct v4l2_subdev_core_ops vpx3220_core_ops = {
.g_chip_ident = vpx3220_g_chip_ident,
.init = vpx3220_init, .init = vpx3220_init,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
...@@ -528,7 +517,6 @@ static int vpx3220_probe(struct i2c_client *client, ...@@ -528,7 +517,6 @@ static int vpx3220_probe(struct i2c_client *client,
ver = i2c_smbus_read_byte_data(client, 0x00); ver = i2c_smbus_read_byte_data(client, 0x00);
pn = (i2c_smbus_read_byte_data(client, 0x02) << 8) + pn = (i2c_smbus_read_byte_data(client, 0x02) << 8) +
i2c_smbus_read_byte_data(client, 0x01); i2c_smbus_read_byte_data(client, 0x01);
decoder->ident = V4L2_IDENT_VPX3220A;
if (ver == 0xec) { if (ver == 0xec) {
switch (pn) { switch (pn) {
case 0x4680: case 0x4680:
...@@ -536,11 +524,9 @@ static int vpx3220_probe(struct i2c_client *client, ...@@ -536,11 +524,9 @@ static int vpx3220_probe(struct i2c_client *client,
break; break;
case 0x4260: case 0x4260:
name = "vpx3216b"; name = "vpx3216b";
decoder->ident = V4L2_IDENT_VPX3216B;
break; break;
case 0x4280: case 0x4280:
name = "vpx3214c"; name = "vpx3214c";
decoder->ident = V4L2_IDENT_VPX3214C;
break; break;
} }
} }
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-mediabus.h> #include <media/v4l2-mediabus.h>
...@@ -722,25 +721,9 @@ static int vs6624_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -722,25 +721,9 @@ static int vs6624_s_stream(struct v4l2_subdev *sd, int enable)
return 0; return 0;
} }
static int vs6624_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
int rev;
struct i2c_client *client = v4l2_get_subdevdata(sd);
rev = (vs6624_read(sd, VS6624_FW_VSN_MAJOR) << 8)
| vs6624_read(sd, VS6624_FW_VSN_MINOR);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_VS6624, rev);
}
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
reg->val = vs6624_read(sd, reg->reg & 0xffff); reg->val = vs6624_read(sd, reg->reg & 0xffff);
reg->size = 1; reg->size = 1;
return 0; return 0;
...@@ -748,10 +731,6 @@ static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r ...@@ -748,10 +731,6 @@ static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
static int vs6624_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) static int vs6624_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
vs6624_write(sd, reg->reg & 0xffff, reg->val & 0xff); vs6624_write(sd, reg->reg & 0xffff, reg->val & 0xff);
return 0; return 0;
} }
...@@ -762,7 +741,6 @@ static const struct v4l2_ctrl_ops vs6624_ctrl_ops = { ...@@ -762,7 +741,6 @@ static const struct v4l2_ctrl_ops vs6624_ctrl_ops = {
}; };
static const struct v4l2_subdev_core_ops vs6624_core_ops = { static const struct v4l2_subdev_core_ops vs6624_core_ops = {
.g_chip_ident = vs6624_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = vs6624_g_register, .g_register = vs6624_g_register,
.s_register = vs6624_s_register, .s_register = vs6624_s_register,
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
MODULE_DESCRIPTION("wm8739 driver"); MODULE_DESCRIPTION("wm8739 driver");
...@@ -160,13 +159,6 @@ static int wm8739_s_clock_freq(struct v4l2_subdev *sd, u32 audiofreq) ...@@ -160,13 +159,6 @@ static int wm8739_s_clock_freq(struct v4l2_subdev *sd, u32 audiofreq)
return 0; return 0;
} }
static int wm8739_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_WM8739, 0);
}
static int wm8739_log_status(struct v4l2_subdev *sd) static int wm8739_log_status(struct v4l2_subdev *sd)
{ {
struct wm8739_state *state = to_state(sd); struct wm8739_state *state = to_state(sd);
...@@ -184,7 +176,6 @@ static const struct v4l2_ctrl_ops wm8739_ctrl_ops = { ...@@ -184,7 +176,6 @@ static const struct v4l2_ctrl_ops wm8739_ctrl_ops = {
static const struct v4l2_subdev_core_ops wm8739_core_ops = { static const struct v4l2_subdev_core_ops wm8739_core_ops = {
.log_status = wm8739_log_status, .log_status = wm8739_log_status,
.g_chip_ident = wm8739_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/wm8775.h> #include <media/wm8775.h>
...@@ -158,13 +157,6 @@ static int wm8775_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -158,13 +157,6 @@ static int wm8775_s_ctrl(struct v4l2_ctrl *ctrl)
return -EINVAL; return -EINVAL;
} }
static int wm8775_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_WM8775, 0);
}
static int wm8775_log_status(struct v4l2_subdev *sd) static int wm8775_log_status(struct v4l2_subdev *sd)
{ {
struct wm8775_state *state = to_state(sd); struct wm8775_state *state = to_state(sd);
...@@ -188,7 +180,6 @@ static const struct v4l2_ctrl_ops wm8775_ctrl_ops = { ...@@ -188,7 +180,6 @@ static const struct v4l2_ctrl_ops wm8775_ctrl_ops = {
static const struct v4l2_subdev_core_ops wm8775_core_ops = { static const struct v4l2_subdev_core_ops wm8775_core_ops = {
.log_status = wm8775_log_status, .log_status = wm8775_log_status,
.g_chip_ident = wm8775_g_chip_ident,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls, .g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls, .try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls, .s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
......
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