#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
#define OV7251_SC_MODE_SELECT …
#define OV7251_SC_MODE_SELECT_SW_STANDBY …
#define OV7251_SC_MODE_SELECT_STREAMING …
#define OV7251_CHIP_ID_HIGH …
#define OV7251_CHIP_ID_HIGH_BYTE …
#define OV7251_CHIP_ID_LOW …
#define OV7251_CHIP_ID_LOW_BYTE …
#define OV7251_SC_GP_IO_IN1 …
#define OV7251_AEC_EXPO_0 …
#define OV7251_AEC_EXPO_1 …
#define OV7251_AEC_EXPO_2 …
#define OV7251_AEC_AGC_ADJ_0 …
#define OV7251_AEC_AGC_ADJ_1 …
#define OV7251_TIMING_FORMAT1 …
#define OV7251_TIMING_FORMAT1_VFLIP …
#define OV7251_TIMING_FORMAT2 …
#define OV7251_TIMING_FORMAT2_MIRROR …
#define OV7251_PRE_ISP_00 …
#define OV7251_PRE_ISP_00_TEST_PATTERN …
#define OV7251_PLL1_PRE_DIV_REG …
#define OV7251_PLL1_MULT_REG …
#define OV7251_PLL1_DIVIDER_REG …
#define OV7251_PLL1_PIX_DIV_REG …
#define OV7251_PLL1_MIPI_DIV_REG …
#define OV7251_PLL2_PRE_DIV_REG …
#define OV7251_PLL2_MULT_REG …
#define OV7251_PLL2_DIVIDER_REG …
#define OV7251_PLL2_SYS_DIV_REG …
#define OV7251_PLL2_ADC_DIV_REG …
#define OV7251_NATIVE_WIDTH …
#define OV7251_NATIVE_HEIGHT …
#define OV7251_ACTIVE_START_LEFT …
#define OV7251_ACTIVE_START_TOP …
#define OV7251_ACTIVE_WIDTH …
#define OV7251_ACTIVE_HEIGHT …
#define OV7251_FIXED_PPL …
#define OV7251_TIMING_VTS_REG …
#define OV7251_TIMING_MIN_VTS …
#define OV7251_TIMING_MAX_VTS …
#define OV7251_INTEGRATION_MARGIN …
struct reg_value { … };
struct ov7251_mode_info { … };
struct ov7251_pll1_cfg { … };
struct ov7251_pll2_cfg { … };
struct ov7251_pll_cfgs { … };
enum xclk_rate { … };
enum supported_link_freqs { … };
struct ov7251 { … };
static inline struct ov7251 *to_ov7251(struct v4l2_subdev *sd)
{ … }
static const struct ov7251_pll1_cfg ov7251_pll1_cfg_19_2_mhz_240_mhz = …;
static const struct ov7251_pll1_cfg ov7251_pll1_cfg_19_2_mhz_319_2_mhz = …;
static const struct ov7251_pll1_cfg ov7251_pll1_cfg_24_mhz_240_mhz = …;
static const struct ov7251_pll1_cfg ov7251_pll1_cfg_24_mhz_319_2_mhz = …;
static const struct ov7251_pll2_cfg ov7251_pll2_cfg_19_2_mhz = …;
static const struct ov7251_pll2_cfg ov7251_pll2_cfg_24_mhz = …;
static const struct ov7251_pll_cfgs ov7251_pll_cfgs_19_2_mhz = …;
static const struct ov7251_pll_cfgs ov7251_pll_cfgs_24_mhz = …;
static const struct ov7251_pll_cfgs *ov7251_pll_cfgs[] = …;
static const struct reg_value ov7251_global_init_setting[] = …;
static const struct reg_value ov7251_setting_vga_30fps[] = …;
static const struct reg_value ov7251_setting_vga_60fps[] = …;
static const struct reg_value ov7251_setting_vga_90fps[] = …;
static const unsigned long supported_xclk_rates[] = …;
static const s64 link_freq[] = …;
static const s64 pixel_rates[] = …;
static const struct ov7251_mode_info ov7251_mode_info_data[] = …;
static int ov7251_regulators_enable(struct ov7251 *ov7251)
{ … }
static void ov7251_regulators_disable(struct ov7251 *ov7251)
{ … }
static int ov7251_write_reg(struct ov7251 *ov7251, u16 reg, u8 val)
{ … }
static int ov7251_write_seq_regs(struct ov7251 *ov7251, u16 reg, u8 *val,
u8 num)
{ … }
static int ov7251_read_reg(struct ov7251 *ov7251, u16 reg, u8 *val)
{ … }
static int ov7251_pll_configure(struct ov7251 *ov7251)
{ … }
static int ov7251_set_exposure(struct ov7251 *ov7251, s32 exposure)
{ … }
static int ov7251_set_gain(struct ov7251 *ov7251, s32 gain)
{ … }
static int ov7251_set_register_array(struct ov7251 *ov7251,
const struct reg_value *settings,
unsigned int num_settings)
{ … }
static int ov7251_set_power_on(struct device *dev)
{ … }
static int ov7251_set_power_off(struct device *dev)
{ … }
static int ov7251_set_hflip(struct ov7251 *ov7251, s32 value)
{ … }
static int ov7251_set_vflip(struct ov7251 *ov7251, s32 value)
{ … }
static int ov7251_set_test_pattern(struct ov7251 *ov7251, s32 value)
{ … }
static const char * const ov7251_test_pattern_menu[] = …;
static int ov7251_vts_configure(struct ov7251 *ov7251, s32 vblank)
{ … }
static int ov7251_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops ov7251_ctrl_ops = …;
static int ov7251_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int ov7251_enum_frame_size(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
{ … }
static int ov7251_enum_frame_ival(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval_enum *fie)
{ … }
static struct v4l2_mbus_framefmt *
__ov7251_get_pad_format(struct ov7251 *ov7251,
struct v4l2_subdev_state *sd_state,
unsigned int pad,
enum v4l2_subdev_format_whence which)
{ … }
static int ov7251_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format)
{ … }
static struct v4l2_rect *
__ov7251_get_pad_crop(struct ov7251 *ov7251,
struct v4l2_subdev_state *sd_state,
unsigned int pad, enum v4l2_subdev_format_whence which)
{ … }
static inline u32 avg_fps(const struct v4l2_fract *t)
{ … }
static const struct ov7251_mode_info *
ov7251_find_mode_by_ival(struct ov7251 *ov7251, struct v4l2_fract *timeperframe)
{ … }
static int ov7251_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format)
{ … }
static int ov7251_init_state(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state)
{ … }
static int ov7251_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
{ … }
static int ov7251_s_stream(struct v4l2_subdev *subdev, int enable)
{ … }
static int ov7251_get_frame_interval(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval *fi)
{ … }
static int ov7251_set_frame_interval(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval *fi)
{ … }
static const struct v4l2_subdev_video_ops ov7251_video_ops = …;
static const struct v4l2_subdev_pad_ops ov7251_subdev_pad_ops = …;
static const struct v4l2_subdev_ops ov7251_subdev_ops = …;
static const struct v4l2_subdev_internal_ops ov7251_internal_ops = …;
static int ov7251_check_hwcfg(struct ov7251 *ov7251)
{ … }
static int ov7251_detect_chip(struct ov7251 *ov7251)
{ … }
static int ov7251_init_ctrls(struct ov7251 *ov7251)
{ … }
static int ov7251_probe(struct i2c_client *client)
{ … }
static void ov7251_remove(struct i2c_client *client)
{ … }
static const struct dev_pm_ops ov7251_pm_ops = …;
static const struct of_device_id ov7251_of_match[] = …;
MODULE_DEVICE_TABLE(of, ov7251_of_match);
static const struct acpi_device_id ov7251_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, ov7251_acpi_match);
static struct i2c_driver ov7251_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;