#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <linux/unaligned.h>
#define IMX208_REG_MODE_SELECT …
#define IMX208_MODE_STANDBY …
#define IMX208_MODE_STREAMING …
#define IMX208_REG_CHIP_ID …
#define IMX208_CHIP_ID …
#define IMX208_REG_VTS …
#define IMX208_VTS_60FPS …
#define IMX208_VTS_BINNING …
#define IMX208_VTS_60FPS_MIN …
#define IMX208_VTS_BINNING_MIN …
#define IMX208_VTS_MAX …
#define IMX208_PPL_384MHZ …
#define IMX208_PPL_96MHZ …
#define IMX208_REG_EXPOSURE …
#define IMX208_EXPOSURE_MIN …
#define IMX208_EXPOSURE_STEP …
#define IMX208_EXPOSURE_DEFAULT …
#define IMX208_EXPOSURE_MAX …
#define IMX208_REG_ANALOG_GAIN …
#define IMX208_ANA_GAIN_MIN …
#define IMX208_ANA_GAIN_MAX …
#define IMX208_ANA_GAIN_STEP …
#define IMX208_ANA_GAIN_DEFAULT …
#define IMX208_REG_GR_DIGITAL_GAIN …
#define IMX208_REG_R_DIGITAL_GAIN …
#define IMX208_REG_B_DIGITAL_GAIN …
#define IMX208_REG_GB_DIGITAL_GAIN …
#define IMX208_DIGITAL_GAIN_SHIFT …
#define IMX208_REG_ORIENTATION_CONTROL …
#define IMX208_REG_TEST_PATTERN_MODE …
#define IMX208_TEST_PATTERN_DISABLE …
#define IMX208_TEST_PATTERN_SOLID_COLOR …
#define IMX208_TEST_PATTERN_COLOR_BARS …
#define IMX208_TEST_PATTERN_GREY_COLOR …
#define IMX208_TEST_PATTERN_PN9 …
#define IMX208_TEST_PATTERN_FIX_1 …
#define IMX208_TEST_PATTERN_FIX_2 …
#define IMX208_TEST_PATTERN_FIX_3 …
#define IMX208_TEST_PATTERN_FIX_4 …
#define IMX208_TEST_PATTERN_FIX_5 …
#define IMX208_TEST_PATTERN_FIX_6 …
#define IMX208_OTP_BASE …
#define IMX208_OTP_SIZE …
struct imx208_reg { … };
struct imx208_reg_list { … };
struct imx208_link_freq_config { … };
struct imx208_mode { … };
static const struct imx208_reg pll_ctrl_reg[] = …;
static const struct imx208_reg mode_1936x1096_60fps_regs[] = …;
static const struct imx208_reg mode_968_548_60fps_regs[] = …;
static const s64 imx208_discrete_digital_gain[] = …;
static const char * const imx208_test_pattern_menu[] = …;
static const int imx208_test_pattern_val[] = …;
#define IMX208_MHZ …
#define IMX208_LINK_FREQ_384MHZ …
#define IMX208_LINK_FREQ_96MHZ …
#define IMX208_DATA_RATE_DOUBLE …
#define IMX208_NUM_OF_LANES …
#define IMX208_PIXEL_BITS …
enum { … };
static u64 link_freq_to_pixel_rate(u64 f)
{ … }
static const s64 link_freq_menu_items[] = …;
static const struct imx208_link_freq_config link_freq_configs[] = …;
static const struct imx208_mode supported_modes[] = …;
struct imx208 { … };
static inline struct imx208 *to_imx208(struct v4l2_subdev *_sd)
{ … }
static u32 imx208_get_format_code(struct imx208 *imx208)
{ … }
static int imx208_read_reg(struct imx208 *imx208, u16 reg, u32 len, u32 *val)
{ … }
static int imx208_write_reg(struct imx208 *imx208, u16 reg, u32 len, u32 val)
{ … }
static int imx208_write_regs(struct imx208 *imx208,
const struct imx208_reg *regs, u32 len)
{ … }
static int imx208_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ … }
static int imx208_update_digital_gain(struct imx208 *imx208, u32 len, u32 val)
{ … }
static int imx208_set_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops imx208_ctrl_ops = …;
static const struct v4l2_ctrl_config imx208_digital_gain_control = …;
static int imx208_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int imx208_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
{ … }
static void imx208_mode_to_pad_format(struct imx208 *imx208,
const struct imx208_mode *mode,
struct v4l2_subdev_format *fmt)
{ … }
static int __imx208_get_pad_format(struct imx208 *imx208,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int imx208_get_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int imx208_set_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int imx208_identify_module(struct imx208 *imx208)
{ … }
static int imx208_start_streaming(struct imx208 *imx208)
{ … }
static int imx208_stop_streaming(struct imx208 *imx208)
{ … }
static int imx208_set_stream(struct v4l2_subdev *sd, int enable)
{ … }
static const struct v4l2_subdev_video_ops imx208_video_ops = …;
static const struct v4l2_subdev_pad_ops imx208_pad_ops = …;
static const struct v4l2_subdev_ops imx208_subdev_ops = …;
static const struct v4l2_subdev_internal_ops imx208_internal_ops = …;
static int imx208_read_otp(struct imx208 *imx208)
{ … }
static ssize_t otp_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{ … }
static const BIN_ATTR_RO(otp, IMX208_OTP_SIZE);
static int imx208_init_controls(struct imx208 *imx208)
{ … }
static void imx208_free_controls(struct imx208 *imx208)
{ … }
static int imx208_probe(struct i2c_client *client)
{ … }
static void imx208_remove(struct i2c_client *client)
{ … }
#ifdef CONFIG_ACPI
static const struct acpi_device_id imx208_acpi_ids[] = …;
MODULE_DEVICE_TABLE(acpi, imx208_acpi_ids);
#endif
static struct i2c_driver imx208_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;