#include <asm/unaligned.h>
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fwnode.h>
#define OV5675_REG_VALUE_08BIT …
#define OV5675_REG_VALUE_16BIT …
#define OV5675_REG_VALUE_24BIT …
#define OV5675_LINK_FREQ_450MHZ …
#define OV5675_SCLK …
#define OV5675_XVCLK_19_2 …
#define OV5675_DATA_LANES …
#define OV5675_RGB_DEPTH …
#define OV5675_REG_CHIP_ID …
#define OV5675_CHIP_ID …
#define OV5675_REG_MODE_SELECT …
#define OV5675_MODE_STANDBY …
#define OV5675_MODE_STREAMING …
#define OV5675_REG_VTS …
#define OV5675_VTS_30FPS …
#define OV5675_VTS_30FPS_MIN …
#define OV5675_VTS_MAX …
#define OV5675_REG_HTS …
#define OV5675_REG_EXPOSURE …
#define OV5675_EXPOSURE_MIN …
#define OV5675_EXPOSURE_MAX_MARGIN …
#define OV5675_EXPOSURE_STEP …
#define OV5675_REG_ANALOG_GAIN …
#define OV5675_ANAL_GAIN_MIN …
#define OV5675_ANAL_GAIN_MAX …
#define OV5675_ANAL_GAIN_STEP …
#define OV5675_REG_DIGITAL_GAIN …
#define OV5675_REG_MWB_R_GAIN …
#define OV5675_REG_MWB_G_GAIN …
#define OV5675_REG_MWB_B_GAIN …
#define OV5675_DGTL_GAIN_MIN …
#define OV5675_DGTL_GAIN_MAX …
#define OV5675_DGTL_GAIN_STEP …
#define OV5675_DGTL_GAIN_DEFAULT …
#define OV5675_REG_GROUP_ACCESS …
#define OV5675_GROUP_HOLD_START …
#define OV5675_GROUP_HOLD_END …
#define OV5675_GROUP_HOLD_LAUNCH …
#define OV5675_REG_TEST_PATTERN …
#define OV5675_TEST_PATTERN_ENABLE …
#define OV5675_TEST_PATTERN_BAR_SHIFT …
#define OV5675_REG_FORMAT1 …
#define OV5675_REG_FORMAT2 …
#define to_ov5675(_sd) …
static const char * const ov5675_supply_names[] = …;
#define OV5675_NUM_SUPPLIES …
enum { … };
struct ov5675_reg { … };
struct ov5675_reg_list { … };
struct ov5675_link_freq_config { … };
struct ov5675_mode { … };
static const struct ov5675_reg mipi_data_rate_900mbps[] = …;
static const struct ov5675_reg mode_2592x1944_regs[] = …;
static const struct ov5675_reg mode_1296x972_regs[] = …;
static const char * const ov5675_test_pattern_menu[] = …;
static const s64 link_freq_menu_items[] = …;
static const struct ov5675_link_freq_config link_freq_configs[] = …;
static const struct ov5675_mode supported_modes[] = …;
struct ov5675 { … };
static u64 to_pixel_rate(u32 f_index)
{ … }
static u64 to_pixels_per_line(u32 hts, u32 f_index)
{ … }
static int ov5675_read_reg(struct ov5675 *ov5675, u16 reg, u16 len, u32 *val)
{ … }
static int ov5675_write_reg(struct ov5675 *ov5675, u16 reg, u16 len, u32 val)
{ … }
static int ov5675_write_reg_list(struct ov5675 *ov5675,
const struct ov5675_reg_list *r_list)
{ … }
static int ov5675_update_digital_gain(struct ov5675 *ov5675, u32 d_gain)
{ … }
static int ov5675_test_pattern(struct ov5675 *ov5675, u32 pattern)
{ … }
static int ov5675_set_ctrl_hflip(struct ov5675 *ov5675, u32 ctrl_val)
{ … }
static int ov5675_set_ctrl_vflip(struct ov5675 *ov5675, u8 ctrl_val)
{ … }
static int ov5675_set_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops ov5675_ctrl_ops = …;
static int ov5675_init_controls(struct ov5675 *ov5675)
{ … }
static void ov5675_update_pad_format(const struct ov5675_mode *mode,
struct v4l2_mbus_framefmt *fmt)
{ … }
static int ov5675_identify_module(struct ov5675 *ov5675)
{ … }
static int ov5675_start_streaming(struct ov5675 *ov5675)
{ … }
static void ov5675_stop_streaming(struct ov5675 *ov5675)
{ … }
static int ov5675_set_stream(struct v4l2_subdev *sd, int enable)
{ … }
static int ov5675_power_off(struct device *dev)
{ … }
static int ov5675_power_on(struct device *dev)
{ … }
static int ov5675_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int ov5675_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int ov5675_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state,
struct v4l2_subdev_selection *sel)
{ … }
static int ov5675_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int ov5675_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
{ … }
static int ov5675_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ … }
static const struct v4l2_subdev_video_ops ov5675_video_ops = …;
static const struct v4l2_subdev_pad_ops ov5675_pad_ops = …;
static const struct v4l2_subdev_ops ov5675_subdev_ops = …;
static const struct media_entity_operations ov5675_subdev_entity_ops = …;
static const struct v4l2_subdev_internal_ops ov5675_internal_ops = …;
static int ov5675_get_hwcfg(struct ov5675 *ov5675, struct device *dev)
{ … }
static void ov5675_remove(struct i2c_client *client)
{ … }
static int ov5675_probe(struct i2c_client *client)
{ … }
static const struct dev_pm_ops ov5675_pm_ops = …;
#ifdef CONFIG_ACPI
static const struct acpi_device_id ov5675_acpi_ids[] = …;
MODULE_DEVICE_TABLE(acpi, ov5675_acpi_ids);
#endif
static const struct of_device_id ov5675_of_match[] = …;
MODULE_DEVICE_TABLE(of, ov5675_of_match);
static struct i2c_driver ov5675_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;