Source
x
__ov7251_get_pad_crop(struct ov7251 *ov7251, struct v4l2_subdev_pad_config *cfg,
// SPDX-License-Identifier: GPL-2.0
/*
* Driver for the OV7251 camera sensor.
*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018, Linaro Ltd.
*/
struct reg_value {
u16 reg;
u8 val;
};
struct ov7251_mode_info {
u32 width;
u32 height;
const struct reg_value *data;
u32 data_size;
u32 pixel_clock;
u32 link_freq;
u16 exposure_max;
u16 exposure_def;
struct v4l2_fract timeperframe;
};
struct ov7251 {
struct i2c_client *i2c_client;
struct device *dev;
struct v4l2_subdev sd;
struct media_pad pad;
struct v4l2_fwnode_endpoint ep;
struct v4l2_mbus_framefmt fmt;
struct v4l2_rect crop;
struct clk *xclk;
u32 xclk_freq;
struct regulator *io_regulator;
struct regulator *core_regulator;
struct regulator *analog_regulator;
const struct ov7251_mode_info *current_mode;
struct v4l2_ctrl_handler ctrls;
struct v4l2_ctrl *pixel_clock;
struct v4l2_ctrl *link_freq;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *gain;
/* Cached register values */
u8 aec_pk_manual;
u8 pre_isp_00;
u8 timing_format1;
u8 timing_format2;
struct mutex lock; /* lock to protect power state, ctrls and mode */
bool power_on;