#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/sort.h>
#include <linux/v4l2-mediabus.h>
#include <media/media-entity.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>
#include "et8ek8_reg.h"
#define ET8EK8_NAME …
#define ET8EK8_PRIV_MEM_SIZE …
#define ET8EK8_MAX_MSG …
struct et8ek8_sensor { … };
#define to_et8ek8_sensor(sd) …
enum et8ek8_versions { … };
static struct et8ek8_gain { … } const et8ek8_gain_table[] = …;
#define REG_REVISION_NUMBER_L …
#define REG_REVISION_NUMBER_H …
#define PRIV_MEM_START_REG …
#define PRIV_MEM_WIN_SIZE …
#define ET8EK8_I2C_DELAY …
#define USE_CRC …
static int et8ek8_i2c_read_reg(struct i2c_client *client, u16 data_length,
u16 reg, u32 *val)
{ … }
static void et8ek8_i2c_create_msg(struct i2c_client *client, u16 len, u16 reg,
u32 val, struct i2c_msg *msg,
unsigned char *buf)
{ … }
static int et8ek8_i2c_buffered_write_regs(struct i2c_client *client,
const struct et8ek8_reg *wnext,
int cnt)
{ … }
static int et8ek8_i2c_write_regs(struct i2c_client *client,
const struct et8ek8_reg *regs)
{ … }
static int et8ek8_i2c_write_reg(struct i2c_client *client, u16 data_length,
u16 reg, u32 val)
{ … }
static struct et8ek8_reglist *et8ek8_reglist_find_type(
struct et8ek8_meta_reglist *meta,
u16 type)
{ … }
static int et8ek8_i2c_reglist_find_write(struct i2c_client *client,
struct et8ek8_meta_reglist *meta,
u16 type)
{ … }
static struct et8ek8_reglist **et8ek8_reglist_first(
struct et8ek8_meta_reglist *meta)
{ … }
static void et8ek8_reglist_to_mbus(const struct et8ek8_reglist *reglist,
struct v4l2_mbus_framefmt *fmt)
{ … }
static struct et8ek8_reglist *et8ek8_reglist_find_mode_fmt(
struct et8ek8_meta_reglist *meta,
struct v4l2_mbus_framefmt *fmt)
{ … }
#define TIMEPERFRAME_AVG_FPS(t) …
static struct et8ek8_reglist *et8ek8_reglist_find_mode_ival(
struct et8ek8_meta_reglist *meta,
struct et8ek8_reglist *current_reglist,
struct v4l2_fract *timeperframe)
{ … }
static int et8ek8_reglist_cmp(const void *a, const void *b)
{ … }
static int et8ek8_reglist_import(struct i2c_client *client,
struct et8ek8_meta_reglist *meta)
{ … }
static int et8ek8_set_gain(struct et8ek8_sensor *sensor, s32 gain)
{ … }
static int et8ek8_set_test_pattern(struct et8ek8_sensor *sensor, s32 mode)
{ … }
static int et8ek8_set_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops et8ek8_ctrl_ops = …;
static const char * const et8ek8_test_pattern_menu[] = …;
static int et8ek8_init_controls(struct et8ek8_sensor *sensor)
{ … }
static void et8ek8_update_controls(struct et8ek8_sensor *sensor)
{ … }
static int et8ek8_configure(struct et8ek8_sensor *sensor)
{ … }
static int et8ek8_stream_on(struct et8ek8_sensor *sensor)
{ … }
static int et8ek8_stream_off(struct et8ek8_sensor *sensor)
{ … }
static int et8ek8_s_stream(struct v4l2_subdev *subdev, int streaming)
{ … }
static int et8ek8_power_off(struct et8ek8_sensor *sensor)
{ … }
static int et8ek8_power_on(struct et8ek8_sensor *sensor)
{ … }
#define MAX_FMTS …
static int et8ek8_enum_mbus_code(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int et8ek8_enum_frame_size(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
{ … }
static int et8ek8_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 *
__et8ek8_get_pad_format(struct et8ek8_sensor *sensor,
struct v4l2_subdev_state *sd_state,
unsigned int pad, enum v4l2_subdev_format_whence which)
{ … }
static int et8ek8_get_pad_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int et8ek8_set_pad_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int et8ek8_get_frame_interval(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval *fi)
{ … }
static int et8ek8_set_frame_interval(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval *fi)
{ … }
static int et8ek8_g_priv_mem(struct v4l2_subdev *subdev)
{ … }
static int et8ek8_dev_init(struct v4l2_subdev *subdev)
{ … }
static ssize_t
priv_mem_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(priv_mem);
static int
et8ek8_registered(struct v4l2_subdev *subdev)
{ … }
static int __et8ek8_set_power(struct et8ek8_sensor *sensor, bool on)
{ … }
static int et8ek8_set_power(struct v4l2_subdev *subdev, int on)
{ … }
static int et8ek8_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ … }
static int et8ek8_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ … }
static const struct v4l2_subdev_video_ops et8ek8_video_ops = …;
static const struct v4l2_subdev_core_ops et8ek8_core_ops = …;
static const struct v4l2_subdev_pad_ops et8ek8_pad_ops = …;
static const struct v4l2_subdev_ops et8ek8_ops = …;
static const struct v4l2_subdev_internal_ops et8ek8_internal_ops = …;
static int __maybe_unused et8ek8_suspend(struct device *dev)
{ … }
static int __maybe_unused et8ek8_resume(struct device *dev)
{ … }
static int et8ek8_probe(struct i2c_client *client)
{ … }
static void et8ek8_remove(struct i2c_client *client)
{ … }
static const struct of_device_id et8ek8_of_table[] = …;
MODULE_DEVICE_TABLE(of, et8ek8_of_table);
static const struct i2c_device_id et8ek8_id_table[] = …;
MODULE_DEVICE_TABLE(i2c, et8ek8_id_table);
static const struct dev_pm_ops et8ek8_pm_ops = …;
static struct i2c_driver et8ek8_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;