diff options
Diffstat (limited to 'drivers/staging/media/atomisp/i2c')
24 files changed, 52 insertions, 173 deletions
diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index bacffbe962d4..2f772a020c8b 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -11,11 +11,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - * */ #include "../include/linux/atomisp.h" @@ -1098,7 +1093,7 @@ static const struct v4l2_ctrl_config ctrls[] = { }, }; -static struct v4l2_subdev_sensor_ops ap1302_sensor_ops = { +static const struct v4l2_subdev_sensor_ops ap1302_sensor_ops = { .g_skip_frames = ap1302_g_skip_frames, }; diff --git a/drivers/staging/media/atomisp/i2c/ap1302.h b/drivers/staging/media/atomisp/i2c/ap1302.h index 9341232c580d..4d0b181a9671 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.h +++ b/drivers/staging/media/atomisp/i2c/ap1302.h @@ -158,8 +158,8 @@ struct ap1302_res_struct { }; struct ap1302_context_res { - s32 res_num; - s32 cur_res; + u32 res_num; + u32 cur_res; struct ap1302_res_struct *res_table; }; diff --git a/drivers/staging/media/atomisp/i2c/gc0310.c b/drivers/staging/media/atomisp/i2c/gc0310.c index 350fd7fd5b86..35ed51ffe944 100644 --- a/drivers/staging/media/atomisp/i2c/gc0310.c +++ b/drivers/staging/media/atomisp/i2c/gc0310.c @@ -118,9 +118,8 @@ static int gc0310_write_reg(struct i2c_client *client, u16 data_length, /* high byte goes out first */ *wreg = (u8)(reg & 0xff); - if (data_length == GC0310_8BIT) { + if (data_length == GC0310_8BIT) data[1] = (u8)(val); - } ret = gc0310_i2c_write(client, len, data); if (ret) @@ -1453,7 +1452,7 @@ out_free: return ret; } -static struct acpi_device_id gc0310_acpi_match[] = { +static const struct acpi_device_id gc0310_acpi_match[] = { {"XXGC0310"}, {"INT0310"}, {}, diff --git a/drivers/staging/media/atomisp/i2c/gc0310.h b/drivers/staging/media/atomisp/i2c/gc0310.h index f31eb277f542..7d8a0aeecb6c 100644 --- a/drivers/staging/media/atomisp/i2c/gc0310.h +++ b/drivers/staging/media/atomisp/i2c/gc0310.h @@ -454,6 +454,6 @@ struct gc0310_resolution gc0310_res_video[] = { #define N_RES_VIDEO (ARRAY_SIZE(gc0310_res_video)) static struct gc0310_resolution *gc0310_res = gc0310_res_preview; -static int N_RES = N_RES_PREVIEW; +static unsigned long N_RES = N_RES_PREVIEW; #endif diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c b/drivers/staging/media/atomisp/i2c/gc2235.c index 50f431729b6c..e43d31ea9676 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.c +++ b/drivers/staging/media/atomisp/i2c/gc2235.c @@ -480,7 +480,7 @@ static const struct v4l2_ctrl_ops ctrl_ops = { .g_volatile_ctrl = gc2235_g_volatile_ctrl }; -struct v4l2_ctrl_config gc2235_controls[] = { +static struct v4l2_ctrl_config gc2235_controls[] = { { .ops = &ctrl_ops, .id = V4L2_CID_EXPOSURE_ABSOLUTE, @@ -1183,7 +1183,7 @@ out_free: return ret; } -static struct acpi_device_id gc2235_acpi_match[] = { +static const struct acpi_device_id gc2235_acpi_match[] = { { "INT33F8" }, {}, }; diff --git a/drivers/staging/media/atomisp/i2c/gc2235.h b/drivers/staging/media/atomisp/i2c/gc2235.h index ccbc757045a5..a8d6aa9c9a5d 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.h +++ b/drivers/staging/media/atomisp/i2c/gc2235.h @@ -530,7 +530,7 @@ static struct gc2235_reg const gc2235_1616_1216_30fps[] = { { GC2235_TOK_TERM, 0, 0 } }; -struct gc2235_resolution gc2235_res_preview[] = { +static struct gc2235_resolution gc2235_res_preview[] = { { .desc = "gc2235_1600_900_30fps", @@ -582,7 +582,7 @@ struct gc2235_resolution gc2235_res_preview[] = { }; #define N_RES_PREVIEW (ARRAY_SIZE(gc2235_res_preview)) -struct gc2235_resolution gc2235_res_still[] = { +static struct gc2235_resolution gc2235_res_still[] = { { .desc = "gc2235_1600_900_30fps", .width = 1600, @@ -632,7 +632,7 @@ struct gc2235_resolution gc2235_res_still[] = { }; #define N_RES_STILL (ARRAY_SIZE(gc2235_res_still)) -struct gc2235_resolution gc2235_res_video[] = { +static struct gc2235_resolution gc2235_res_video[] = { { .desc = "gc2235_1296_736_30fps", .width = 1296, @@ -668,5 +668,5 @@ struct gc2235_resolution gc2235_res_video[] = { #define N_RES_VIDEO (ARRAY_SIZE(gc2235_res_video)) static struct gc2235_resolution *gc2235_res = gc2235_res_preview; -static int N_RES = N_RES_PREVIEW; +static unsigned long N_RES = N_RES_PREVIEW; #endif diff --git a/drivers/staging/media/atomisp/i2c/imx/ad5816g.c b/drivers/staging/media/atomisp/i2c/imx/ad5816g.c index d68ebb49f002..558dcdf135d9 100644 --- a/drivers/staging/media/atomisp/i2c/imx/ad5816g.c +++ b/drivers/staging/media/atomisp/i2c/imx/ad5816g.c @@ -136,7 +136,7 @@ int ad5816g_vcm_power_down(struct v4l2_subdev *sd) } -int ad5816g_t_focus_vcm(struct v4l2_subdev *sd, u16 val) +static int ad5816g_t_focus_vcm(struct v4l2_subdev *sd, u16 val) { struct i2c_client *client = v4l2_get_subdevdata(sd); u16 data = val & VCM_CODE_MASK; @@ -214,12 +214,3 @@ int ad5816g_t_vcm_timing(struct v4l2_subdev *sd, s32 value) { return 0; } - -int ad5816g_vcm_init(struct v4l2_subdev *sd) -{ - ad5816g_dev.platform_data = camera_get_af_platform_data(); - return (NULL == ad5816g_dev.platform_data) ? -ENODEV : 0; - -} - - diff --git a/drivers/staging/media/atomisp/i2c/imx/drv201.c b/drivers/staging/media/atomisp/i2c/imx/drv201.c index 915e4019cfeb..6d9d4c968722 100644 --- a/drivers/staging/media/atomisp/i2c/imx/drv201.c +++ b/drivers/staging/media/atomisp/i2c/imx/drv201.c @@ -128,7 +128,7 @@ int drv201_vcm_power_down(struct v4l2_subdev *sd) } -int drv201_t_focus_vcm(struct v4l2_subdev *sd, u16 val) +static int drv201_t_focus_vcm(struct v4l2_subdev *sd, u16 val) { struct i2c_client *client = v4l2_get_subdevdata(sd); u16 data = val & VCM_CODE_MASK; @@ -207,12 +207,3 @@ int drv201_t_vcm_timing(struct v4l2_subdev *sd, s32 value) { return 0; } - -int drv201_vcm_init(struct v4l2_subdev *sd) -{ - drv201_dev.platform_data = camera_get_af_platform_data(); - return (NULL == drv201_dev.platform_data) ? -ENODEV : 0; -} - - - diff --git a/drivers/staging/media/atomisp/i2c/imx/dw9714.c b/drivers/staging/media/atomisp/i2c/imx/dw9714.c index b7dee1b6bb37..6397a7ee0af6 100644 --- a/drivers/staging/media/atomisp/i2c/imx/dw9714.c +++ b/drivers/staging/media/atomisp/i2c/imx/dw9714.c @@ -56,7 +56,7 @@ int dw9714_vcm_power_down(struct v4l2_subdev *sd) } -int dw9714_t_focus_vcm(struct v4l2_subdev *sd, u16 val) +static int dw9714_t_focus_vcm(struct v4l2_subdev *sd, u16 val) { struct i2c_client *client = v4l2_get_subdevdata(sd); int ret = -EINVAL; @@ -221,15 +221,3 @@ int dw9714_t_vcm_timing(struct v4l2_subdev *sd, s32 value) return 0; } - -int dw9714_vcm_init(struct v4l2_subdev *sd) -{ - - /* set VCM to home position and vcm mode to direct*/ - dw9714_dev.vcm_mode = DW9714_DIRECT; - dw9714_dev.vcm_settings.update = false; - dw9714_dev.platform_data = camera_get_af_platform_data(); - return (NULL == dw9714_dev.platform_data) ? -ENODEV : 0; - -} - diff --git a/drivers/staging/media/atomisp/i2c/imx/dw9718.c b/drivers/staging/media/atomisp/i2c/imx/dw9718.c index 65a1fcf187d5..c02b9f0a2440 100644 --- a/drivers/staging/media/atomisp/i2c/imx/dw9718.c +++ b/drivers/staging/media/atomisp/i2c/imx/dw9718.c @@ -204,11 +204,6 @@ int dw9718_q_focus_status(struct v4l2_subdev *sd, s32 *value) return 0; } -int dw9718_t_focus_vcm(struct v4l2_subdev *sd, u16 val) -{ - return -EINVAL; -} - int dw9718_t_focus_rel(struct v4l2_subdev *sd, s32 value) { return dw9718_t_focus_abs(sd, dw9718_dev.focus + value); diff --git a/drivers/staging/media/atomisp/i2c/imx/dw9719.c b/drivers/staging/media/atomisp/i2c/imx/dw9719.c index eca2d7640030..565237796bb4 100644 --- a/drivers/staging/media/atomisp/i2c/imx/dw9719.c +++ b/drivers/staging/media/atomisp/i2c/imx/dw9719.c @@ -161,11 +161,6 @@ int dw9719_q_focus_status(struct v4l2_subdev *sd, s32 *value) return 0; } -int dw9719_t_focus_vcm(struct v4l2_subdev *sd, u16 val) -{ - return -EINVAL; -} - int dw9719_t_focus_abs(struct v4l2_subdev *sd, s32 value) { struct i2c_client *client = v4l2_get_subdevdata(sd); @@ -201,9 +196,3 @@ int dw9719_t_vcm_timing(struct v4l2_subdev *sd, s32 value) { return 0; } - -int dw9719_vcm_init(struct v4l2_subdev *sd) -{ - dw9719_dev.platform_data = camera_get_af_platform_data(); - return (NULL == dw9719_dev.platform_data) ? -ENODEV : 0; -} diff --git a/drivers/staging/media/atomisp/i2c/imx/imx.c b/drivers/staging/media/atomisp/i2c/imx/imx.c index 408a7b945153..49ab0af87096 100644 --- a/drivers/staging/media/atomisp/i2c/imx/imx.c +++ b/drivers/staging/media/atomisp/i2c/imx/imx.c @@ -1084,46 +1084,15 @@ static int imx_g_bin_factor_y(struct v4l2_subdev *sd, s32 *val) return 0; } -int imx_vcm_power_up(struct v4l2_subdev *sd) -{ - struct imx_device *dev = to_imx_sensor(sd); - if (dev->vcm_driver && dev->vcm_driver->power_up) - return dev->vcm_driver->power_up(sd); - return 0; -} - -int imx_vcm_power_down(struct v4l2_subdev *sd) -{ - struct imx_device *dev = to_imx_sensor(sd); - if (dev->vcm_driver && dev->vcm_driver->power_down) - return dev->vcm_driver->power_down(sd); - return 0; -} - -int imx_vcm_init(struct v4l2_subdev *sd) -{ - struct imx_device *dev = to_imx_sensor(sd); - if (dev->vcm_driver && dev->vcm_driver->init) - return dev->vcm_driver->init(sd); - return 0; -} - -int imx_t_focus_vcm(struct v4l2_subdev *sd, u16 val) -{ - struct imx_device *dev = to_imx_sensor(sd); - if (dev->vcm_driver && dev->vcm_driver->t_focus_vcm) - return dev->vcm_driver->t_focus_vcm(sd, val); - return 0; -} - -int imx_t_focus_abs(struct v4l2_subdev *sd, s32 value) +static int imx_t_focus_abs(struct v4l2_subdev *sd, s32 value) { struct imx_device *dev = to_imx_sensor(sd); if (dev->vcm_driver && dev->vcm_driver->t_focus_abs) return dev->vcm_driver->t_focus_abs(sd, value); return 0; } -int imx_t_focus_rel(struct v4l2_subdev *sd, s32 value) + +static int imx_t_focus_rel(struct v4l2_subdev *sd, s32 value) { struct imx_device *dev = to_imx_sensor(sd); if (dev->vcm_driver && dev->vcm_driver->t_focus_rel) @@ -1131,7 +1100,7 @@ int imx_t_focus_rel(struct v4l2_subdev *sd, s32 value) return 0; } -int imx_q_focus_status(struct v4l2_subdev *sd, s32 *value) +static int imx_q_focus_status(struct v4l2_subdev *sd, s32 *value) { struct imx_device *dev = to_imx_sensor(sd); if (dev->vcm_driver && dev->vcm_driver->q_focus_status) @@ -1139,7 +1108,7 @@ int imx_q_focus_status(struct v4l2_subdev *sd, s32 *value) return 0; } -int imx_q_focus_abs(struct v4l2_subdev *sd, s32 *value) +static int imx_q_focus_abs(struct v4l2_subdev *sd, s32 *value) { struct imx_device *dev = to_imx_sensor(sd); if (dev->vcm_driver && dev->vcm_driver->q_focus_abs) @@ -1147,7 +1116,7 @@ int imx_q_focus_abs(struct v4l2_subdev *sd, s32 *value) return 0; } -int imx_t_vcm_slew(struct v4l2_subdev *sd, s32 value) +static int imx_t_vcm_slew(struct v4l2_subdev *sd, s32 value) { struct imx_device *dev = to_imx_sensor(sd); if (dev->vcm_driver && dev->vcm_driver->t_vcm_slew) @@ -1155,7 +1124,7 @@ int imx_t_vcm_slew(struct v4l2_subdev *sd, s32 value) return 0; } -int imx_t_vcm_timing(struct v4l2_subdev *sd, s32 value) +static int imx_t_vcm_timing(struct v4l2_subdev *sd, s32 value) { struct imx_device *dev = to_imx_sensor(sd); if (dev->vcm_driver && dev->vcm_driver->t_vcm_timing) @@ -2105,8 +2074,7 @@ imx_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *param) return 0; } -int -imx_g_frame_interval(struct v4l2_subdev *sd, +static int imx_g_frame_interval(struct v4l2_subdev *sd, struct v4l2_subdev_frame_interval *interval) { struct imx_device *dev = to_imx_sensor(sd); diff --git a/drivers/staging/media/atomisp/i2c/imx/imx.h b/drivers/staging/media/atomisp/i2c/imx/imx.h index 36b3f3a5a41f..30beb2a0ed93 100644 --- a/drivers/staging/media/atomisp/i2c/imx/imx.h +++ b/drivers/staging/media/atomisp/i2c/imx/imx.h @@ -222,8 +222,6 @@ struct imx_vcm { int (*power_up)(struct v4l2_subdev *sd); int (*power_down)(struct v4l2_subdev *sd); - int (*init)(struct v4l2_subdev *sd); - int (*t_focus_vcm)(struct v4l2_subdev *sd, u16 val); int (*t_focus_abs)(struct v4l2_subdev *sd, s32 value); int (*t_focus_abs_init)(struct v4l2_subdev *sd); int (*t_focus_rel)(struct v4l2_subdev *sd, s32 value); @@ -480,7 +478,7 @@ struct imx_device { struct imx_vcm *vcm_driver; struct imx_otp *otp_driver; const struct imx_resolution *curr_res_table; - int entries_curr_table; + unsigned long entries_curr_table; const struct firmware *fw; struct imx_reg_addr *reg_addr; const struct imx_reg *param_hold; @@ -549,9 +547,6 @@ static const struct imx_reg imx219_param_update[] = { extern int ad5816g_vcm_power_up(struct v4l2_subdev *sd); extern int ad5816g_vcm_power_down(struct v4l2_subdev *sd); -extern int ad5816g_vcm_init(struct v4l2_subdev *sd); - -extern int ad5816g_t_focus_vcm(struct v4l2_subdev *sd, u16 val); extern int ad5816g_t_focus_abs(struct v4l2_subdev *sd, s32 value); extern int ad5816g_t_focus_rel(struct v4l2_subdev *sd, s32 value); extern int ad5816g_q_focus_status(struct v4l2_subdev *sd, s32 *value); @@ -561,9 +556,6 @@ extern int ad5816g_t_vcm_timing(struct v4l2_subdev *sd, s32 value); extern int drv201_vcm_power_up(struct v4l2_subdev *sd); extern int drv201_vcm_power_down(struct v4l2_subdev *sd); -extern int drv201_vcm_init(struct v4l2_subdev *sd); - -extern int drv201_t_focus_vcm(struct v4l2_subdev *sd, u16 val); extern int drv201_t_focus_abs(struct v4l2_subdev *sd, s32 value); extern int drv201_t_focus_rel(struct v4l2_subdev *sd, s32 value); extern int drv201_q_focus_status(struct v4l2_subdev *sd, s32 *value); @@ -573,9 +565,6 @@ extern int drv201_t_vcm_timing(struct v4l2_subdev *sd, s32 value); extern int dw9714_vcm_power_up(struct v4l2_subdev *sd); extern int dw9714_vcm_power_down(struct v4l2_subdev *sd); -extern int dw9714_vcm_init(struct v4l2_subdev *sd); - -extern int dw9714_t_focus_vcm(struct v4l2_subdev *sd, u16 val); extern int dw9714_t_focus_abs(struct v4l2_subdev *sd, s32 value); extern int dw9714_t_focus_abs_init(struct v4l2_subdev *sd); extern int dw9714_t_focus_rel(struct v4l2_subdev *sd, s32 value); @@ -586,9 +575,6 @@ extern int dw9714_t_vcm_timing(struct v4l2_subdev *sd, s32 value); extern int dw9719_vcm_power_up(struct v4l2_subdev *sd); extern int dw9719_vcm_power_down(struct v4l2_subdev *sd); -extern int dw9719_vcm_init(struct v4l2_subdev *sd); - -extern int dw9719_t_focus_vcm(struct v4l2_subdev *sd, u16 val); extern int dw9719_t_focus_abs(struct v4l2_subdev *sd, s32 value); extern int dw9719_t_focus_rel(struct v4l2_subdev *sd, s32 value); extern int dw9719_q_focus_status(struct v4l2_subdev *sd, s32 *value); @@ -598,9 +584,6 @@ extern int dw9719_t_vcm_timing(struct v4l2_subdev *sd, s32 value); extern int dw9718_vcm_power_up(struct v4l2_subdev *sd); extern int dw9718_vcm_power_down(struct v4l2_subdev *sd); -extern int dw9718_vcm_init(struct v4l2_subdev *sd); - -extern int dw9718_t_focus_vcm(struct v4l2_subdev *sd, u16 val); extern int dw9718_t_focus_abs(struct v4l2_subdev *sd, s32 value); extern int dw9718_t_focus_rel(struct v4l2_subdev *sd, s32 value); extern int dw9718_q_focus_status(struct v4l2_subdev *sd, s32 *value); @@ -615,8 +598,6 @@ struct imx_vcm imx_vcms[] = { [IMX175_MERRFLD] = { .power_up = drv201_vcm_power_up, .power_down = drv201_vcm_power_down, - .init = drv201_vcm_init, - .t_focus_vcm = drv201_t_focus_vcm, .t_focus_abs = drv201_t_focus_abs, .t_focus_abs_init = NULL, .t_focus_rel = drv201_t_focus_rel, @@ -628,8 +609,6 @@ struct imx_vcm imx_vcms[] = { [IMX175_VALLEYVIEW] = { .power_up = dw9714_vcm_power_up, .power_down = dw9714_vcm_power_down, - .init = dw9714_vcm_init, - .t_focus_vcm = dw9714_t_focus_vcm, .t_focus_abs = dw9714_t_focus_abs, .t_focus_abs_init = NULL, .t_focus_rel = dw9714_t_focus_rel, @@ -641,8 +620,6 @@ struct imx_vcm imx_vcms[] = { [IMX135_SALTBAY] = { .power_up = ad5816g_vcm_power_up, .power_down = ad5816g_vcm_power_down, - .init = ad5816g_vcm_init, - .t_focus_vcm = ad5816g_t_focus_vcm, .t_focus_abs = ad5816g_t_focus_abs, .t_focus_abs_init = NULL, .t_focus_rel = ad5816g_t_focus_rel, @@ -654,8 +631,6 @@ struct imx_vcm imx_vcms[] = { [IMX135_VICTORIABAY] = { .power_up = dw9719_vcm_power_up, .power_down = dw9719_vcm_power_down, - .init = dw9719_vcm_init, - .t_focus_vcm = dw9719_t_focus_vcm, .t_focus_abs = dw9719_t_focus_abs, .t_focus_abs_init = NULL, .t_focus_rel = dw9719_t_focus_rel, @@ -667,8 +642,6 @@ struct imx_vcm imx_vcms[] = { [IMX134_VALLEYVIEW] = { .power_up = dw9714_vcm_power_up, .power_down = dw9714_vcm_power_down, - .init = dw9714_vcm_init, - .t_focus_vcm = dw9714_t_focus_vcm, .t_focus_abs = dw9714_t_focus_abs, .t_focus_abs_init = dw9714_t_focus_abs_init, .t_focus_rel = dw9714_t_focus_rel, @@ -680,8 +653,6 @@ struct imx_vcm imx_vcms[] = { [IMX219_MFV0_PRH] = { .power_up = dw9718_vcm_power_up, .power_down = dw9718_vcm_power_down, - .init = dw9718_vcm_init, - .t_focus_vcm = dw9718_t_focus_vcm, .t_focus_abs = dw9718_t_focus_abs, .t_focus_abs_init = NULL, .t_focus_rel = dw9718_t_focus_rel, diff --git a/drivers/staging/media/atomisp/i2c/lm3554.c b/drivers/staging/media/atomisp/i2c/lm3554.c index 2b170c07aaba..679176f7c542 100644 --- a/drivers/staging/media/atomisp/i2c/lm3554.c +++ b/drivers/staging/media/atomisp/i2c/lm3554.c @@ -974,7 +974,7 @@ static const struct dev_pm_ops lm3554_pm_ops = { .resume = lm3554_resume, }; -static struct acpi_device_id lm3554_acpi_match[] = { +static const struct acpi_device_id lm3554_acpi_match[] = { { "INTCF1C" }, {}, }; diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.c b/drivers/staging/media/atomisp/i2c/mt9m114.c index 3fa915313e53..3c837cb8859c 100644 --- a/drivers/staging/media/atomisp/i2c/mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/mt9m114.c @@ -1209,10 +1209,10 @@ static int mt9m114_s_exposure_selection(struct v4l2_subdev *sd, return -EINVAL; } - clamp_t(int, win_left, 0, 4); - clamp_t(int, win_top, 0, 4); - clamp_t(int, win_right, 0, 4); - clamp_t(int, win_bottom, 0, 4); + win_left = clamp_t(int, win_left, 0, 4); + win_top = clamp_t(int, win_top, 0, 4); + win_right = clamp_t(int, win_right, 0, 4); + win_bottom = clamp_t(int, win_bottom, 0, 4); ret = mt9m114_write_reg_array(client, mt9m114_exp_average, NO_POLLING); if (ret) { @@ -1806,7 +1806,7 @@ static const struct v4l2_subdev_video_ops mt9m114_video_ops = { .g_frame_interval = mt9m114_g_frame_interval, }; -static struct v4l2_subdev_sensor_ops mt9m114_sensor_ops = { +static const struct v4l2_subdev_sensor_ops mt9m114_sensor_ops = { .g_skip_frames = mt9m114_g_skip_frames, }; @@ -1928,7 +1928,7 @@ static int mt9m114_probe(struct i2c_client *client, MODULE_DEVICE_TABLE(i2c, mt9m114_id); -static struct acpi_device_id mt9m114_acpi_match[] = { +static const struct acpi_device_id mt9m114_acpi_match[] = { { "INT33F0" }, { "CRMT1040" }, {}, diff --git a/drivers/staging/media/atomisp/i2c/ov2680.c b/drivers/staging/media/atomisp/i2c/ov2680.c index 3cabfe54c669..51b7d61df0f5 100644 --- a/drivers/staging/media/atomisp/i2c/ov2680.c +++ b/drivers/staging/media/atomisp/i2c/ov2680.c @@ -89,7 +89,7 @@ static int ov2680_read_reg(struct i2c_client *client, "read from offset 0x%x error %d", reg, err); return err; } - + *val = 0; /* high byte comes first */ if (data_length == OV2680_8BIT) @@ -285,7 +285,6 @@ static int ov2680_g_fnumber(struct v4l2_subdev *sd, s32 *val) static int ov2680_g_fnumber_range(struct v4l2_subdev *sd, s32 *val) { - *val = (OV2680_F_NUMBER_DEFAULT_NUM << 24) | (OV2680_F_NUMBER_DEM << 16) | (OV2680_F_NUMBER_DEFAULT_NUM << 8) | OV2680_F_NUMBER_DEM; @@ -306,7 +305,7 @@ static int ov2680_g_bin_factor_y(struct v4l2_subdev *sd, s32 *val) { struct ov2680_device *dev = to_ov2680_sensor(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - + *val = ov2680_res[dev->fmt_idx].bin_factor_y; dev_dbg(&client->dev, "++++ov2680_g_bin_factor_y\n"); return 0; @@ -399,7 +398,7 @@ static long __ov2680_set_exposure(struct v4l2_subdev *sd, int coarse_itg, struct ov2680_device *dev = to_ov2680_sensor(sd); u16 vts,hts; int ret,exp_val; - + dev_dbg(&client->dev, "+++++++__ov2680_set_exposure coarse_itg %d, gain %d, digitgain %d++\n",coarse_itg, gain, digitgain); hts = ov2680_res[dev->fmt_idx].pixels_per_line; @@ -542,7 +541,7 @@ static long ov2680_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) switch (cmd) { case ATOMISP_IOC_S_EXPOSURE: return ov2680_s_exposure(sd, arg); - + default: return -EINVAL; } @@ -983,7 +982,7 @@ static int ov2680_s_power(struct v4l2_subdev *sd, int on) if (on == 0){ ret = power_down(sd); } else { - ret = power_up(sd); + ret = power_up(sd); if (!ret) return ov2680_init(sd); } @@ -1207,7 +1206,7 @@ static int ov2680_s_stream(struct v4l2_subdev *sd, int enable) dev_dbg(&client->dev, "ov2680_s_stream one \n"); else dev_dbg(&client->dev, "ov2680_s_stream off \n"); - + ret = ov2680_write_reg(client, OV2680_8BIT, OV2680_SW_STREAM, enable ? OV2680_START_STREAMING : OV2680_STOP_STREAMING); @@ -1267,7 +1266,7 @@ static int ov2680_s_config(struct v4l2_subdev *sd, dev_err(&client->dev, "ov2680_detect err s_config.\n"); goto fail_csi_cfg; } - + /* turn off sensor, after probed */ ret = power_down(sd); if (ret) { @@ -1385,7 +1384,7 @@ static int ov2680_enum_frame_size(struct v4l2_subdev *sd, static int ov2680_g_skip_frames(struct v4l2_subdev *sd, u32 *frames) { struct ov2680_device *dev = to_ov2680_sensor(sd); - + mutex_lock(&dev->input_lock); *frames = ov2680_res[dev->fmt_idx].skip_frames; mutex_unlock(&dev->input_lock); @@ -1517,7 +1516,7 @@ out_free: return ret; } -static struct acpi_device_id ov2680_acpi_match[] = { +static const struct acpi_device_id ov2680_acpi_match[] = { {"XXOV2680"}, {"OVTI2680"}, {}, diff --git a/drivers/staging/media/atomisp/i2c/ov2680.h b/drivers/staging/media/atomisp/i2c/ov2680.h index 944fe8e3bcbf..ab8907e6c9ef 100644 --- a/drivers/staging/media/atomisp/i2c/ov2680.h +++ b/drivers/staging/media/atomisp/i2c/ov2680.h @@ -934,7 +934,6 @@ static struct ov2680_resolution ov2680_res_video[] = { #define N_RES_VIDEO (ARRAY_SIZE(ov2680_res_video)) static struct ov2680_resolution *ov2680_res = ov2680_res_preview; -static int N_RES = N_RES_PREVIEW; - +static unsigned long N_RES = N_RES_PREVIEW; #endif diff --git a/drivers/staging/media/atomisp/i2c/ov2722.c b/drivers/staging/media/atomisp/i2c/ov2722.c index b7afadebdf89..10094ac56561 100644 --- a/drivers/staging/media/atomisp/i2c/ov2722.c +++ b/drivers/staging/media/atomisp/i2c/ov2722.c @@ -1337,7 +1337,7 @@ out_free: MODULE_DEVICE_TABLE(i2c, ov2722_id); -static struct acpi_device_id ov2722_acpi_match[] = { +static const struct acpi_device_id ov2722_acpi_match[] = { { "INT33FB" }, {}, }; diff --git a/drivers/staging/media/atomisp/i2c/ov2722.h b/drivers/staging/media/atomisp/i2c/ov2722.h index b0d40965d89e..73ecb1679718 100644 --- a/drivers/staging/media/atomisp/i2c/ov2722.h +++ b/drivers/staging/media/atomisp/i2c/ov2722.h @@ -1263,5 +1263,5 @@ struct ov2722_resolution ov2722_res_video[] = { #define N_RES_VIDEO (ARRAY_SIZE(ov2722_res_video)) static struct ov2722_resolution *ov2722_res = ov2722_res_preview; -static int N_RES = N_RES_PREVIEW; +static unsigned long N_RES = N_RES_PREVIEW; #endif diff --git a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c index d6447398f5ef..123642557aa8 100644 --- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c +++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c @@ -146,7 +146,7 @@ static int ov5693_read_reg(struct i2c_client *client, return -EINVAL; } - memset(msg, 0 , sizeof(msg)); + memset(msg, 0, sizeof(msg)); msg[0].addr = client->addr; msg[0].flags = 0; @@ -702,7 +702,7 @@ static long ov5693_s_exposure(struct v4l2_subdev *sd, } static int ov5693_read_otp_reg_array(struct i2c_client *client, u16 size, - u16 addr, u8 * buf) + u16 addr, u8 *buf) { u16 index; int ret; @@ -720,7 +720,7 @@ static int ov5693_read_otp_reg_array(struct i2c_client *client, u16 size, return 0; } -static int __ov5693_otp_read(struct v4l2_subdev *sd, u8 * buf) +static int __ov5693_otp_read(struct v4l2_subdev *sd, u8 *buf) { struct i2c_client *client = v4l2_get_subdevdata(sd); struct ov5693_device *dev = to_ov5693_sensor(sd); @@ -913,7 +913,7 @@ err: return ret; } -int ad5823_t_focus_vcm(struct v4l2_subdev *sd, u16 val) +static int ad5823_t_focus_vcm(struct v4l2_subdev *sd, u16 val) { struct i2c_client *client = v4l2_get_subdevdata(sd); int ret = -EINVAL; @@ -2032,7 +2032,7 @@ out_free: MODULE_DEVICE_TABLE(i2c, ov5693_id); -static struct acpi_device_id ov5693_acpi_match[] = { +static const struct acpi_device_id ov5693_acpi_match[] = { {"INT33BE"}, {}, }; diff --git a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h index d88ac1777d86..8c2e6794463b 100644 --- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h +++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h @@ -1377,5 +1377,5 @@ struct ov5693_resolution ov5693_res_video[] = { #define N_RES_VIDEO (ARRAY_SIZE(ov5693_res_video)) static struct ov5693_resolution *ov5693_res = ov5693_res_preview; -static int N_RES = N_RES_PREVIEW; +static unsigned long N_RES = N_RES_PREVIEW; #endif diff --git a/drivers/staging/media/atomisp/i2c/ov8858.c b/drivers/staging/media/atomisp/i2c/ov8858.c index 9574bc49113c..43e1638fd674 100644 --- a/drivers/staging/media/atomisp/i2c/ov8858.c +++ b/drivers/staging/media/atomisp/i2c/ov8858.c @@ -2189,7 +2189,7 @@ static const struct i2c_device_id ov8858_id[] = { MODULE_DEVICE_TABLE(i2c, ov8858_id); -static struct acpi_device_id ov8858_acpi_match[] = { +static const struct acpi_device_id ov8858_acpi_match[] = { {"INT3477"}, {}, }; diff --git a/drivers/staging/media/atomisp/i2c/ov8858.h b/drivers/staging/media/atomisp/i2c/ov8858.h index 9be6a0e63861..638d1a803a2b 100644 --- a/drivers/staging/media/atomisp/i2c/ov8858.h +++ b/drivers/staging/media/atomisp/i2c/ov8858.h @@ -164,7 +164,6 @@ struct ov8858_vcm { int (*power_up)(struct v4l2_subdev *sd); int (*power_down)(struct v4l2_subdev *sd); int (*init)(struct v4l2_subdev *sd); - int (*t_focus_vcm)(struct v4l2_subdev *sd, u16 val); int (*t_focus_abs)(struct v4l2_subdev *sd, s32 value); int (*t_focus_rel)(struct v4l2_subdev *sd, s32 value); int (*q_focus_status)(struct v4l2_subdev *sd, s32 *value); @@ -266,7 +265,7 @@ struct ov8858_device { const struct ov8858_reg *regs; struct ov8858_vcm *vcm_driver; const struct ov8858_resolution *curr_res_table; - int entries_curr_table; + unsigned long entries_curr_table; struct v4l2_ctrl_handler ctrl_handler; struct v4l2_ctrl *run_mode; @@ -312,7 +311,6 @@ static const struct ov8858_reg ov8858_param_update[] = { extern int dw9718_vcm_power_up(struct v4l2_subdev *sd); extern int dw9718_vcm_power_down(struct v4l2_subdev *sd); extern int dw9718_vcm_init(struct v4l2_subdev *sd); -extern int dw9718_t_focus_vcm(struct v4l2_subdev *sd, u16 val); extern int dw9718_t_focus_abs(struct v4l2_subdev *sd, s32 value); extern int dw9718_t_focus_rel(struct v4l2_subdev *sd, s32 value); extern int dw9718_q_focus_status(struct v4l2_subdev *sd, s32 *value); @@ -328,7 +326,6 @@ static struct ov8858_vcm ov8858_vcms[] = { .power_up = dw9718_vcm_power_up, .power_down = dw9718_vcm_power_down, .init = dw9718_vcm_init, - .t_focus_vcm = dw9718_t_focus_vcm, .t_focus_abs = dw9718_t_focus_abs, .t_focus_rel = dw9718_t_focus_rel, .q_focus_status = dw9718_q_focus_status, diff --git a/drivers/staging/media/atomisp/i2c/ov8858_btns.h b/drivers/staging/media/atomisp/i2c/ov8858_btns.h index 09e3cdc1a394..7d74a8899fae 100644 --- a/drivers/staging/media/atomisp/i2c/ov8858_btns.h +++ b/drivers/staging/media/atomisp/i2c/ov8858_btns.h @@ -164,7 +164,6 @@ struct ov8858_vcm { int (*power_up)(struct v4l2_subdev *sd); int (*power_down)(struct v4l2_subdev *sd); int (*init)(struct v4l2_subdev *sd); - int (*t_focus_vcm)(struct v4l2_subdev *sd, u16 val); int (*t_focus_abs)(struct v4l2_subdev *sd, s32 value); int (*t_focus_rel)(struct v4l2_subdev *sd, s32 value); int (*q_focus_status)(struct v4l2_subdev *sd, s32 *value); @@ -266,7 +265,7 @@ struct ov8858_device { const struct ov8858_reg *regs; struct ov8858_vcm *vcm_driver; const struct ov8858_resolution *curr_res_table; - int entries_curr_table; + unsigned long entries_curr_table; struct v4l2_ctrl_handler ctrl_handler; struct v4l2_ctrl *run_mode; @@ -312,7 +311,6 @@ static const struct ov8858_reg ov8858_param_update[] = { extern int dw9718_vcm_power_up(struct v4l2_subdev *sd); extern int dw9718_vcm_power_down(struct v4l2_subdev *sd); extern int dw9718_vcm_init(struct v4l2_subdev *sd); -extern int dw9718_t_focus_vcm(struct v4l2_subdev *sd, u16 val); extern int dw9718_t_focus_abs(struct v4l2_subdev *sd, s32 value); extern int dw9718_t_focus_rel(struct v4l2_subdev *sd, s32 value); extern int dw9718_q_focus_status(struct v4l2_subdev *sd, s32 *value); @@ -328,7 +326,6 @@ static struct ov8858_vcm ov8858_vcms[] = { .power_up = dw9718_vcm_power_up, .power_down = dw9718_vcm_power_down, .init = dw9718_vcm_init, - .t_focus_vcm = dw9718_t_focus_vcm, .t_focus_abs = dw9718_t_focus_abs, .t_focus_rel = dw9718_t_focus_rel, .q_focus_status = dw9718_q_focus_status, |