#include <asm/unaligned.h>
#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 <media/v4l2-fwnode.h>
#define OG01A1B_REG_VALUE_08BIT …
#define OG01A1B_REG_VALUE_16BIT …
#define OG01A1B_REG_VALUE_24BIT …
#define OG01A1B_LINK_FREQ_500MHZ …
#define OG01A1B_SCLK …
#define OG01A1B_MCLK …
#define OG01A1B_DATA_LANES …
#define OG01A1B_RGB_DEPTH …
#define OG01A1B_REG_CHIP_ID …
#define OG01A1B_CHIP_ID …
#define OG01A1B_REG_MODE_SELECT …
#define OG01A1B_MODE_STANDBY …
#define OG01A1B_MODE_STREAMING …
#define OG01A1B_REG_VTS …
#define OG01A1B_VTS_120FPS …
#define OG01A1B_VTS_120FPS_MIN …
#define OG01A1B_VTS_MAX …
#define OG01A1B_REG_HTS …
#define OG01A1B_REG_EXPOSURE …
#define OG01A1B_EXPOSURE_MIN …
#define OG01A1B_EXPOSURE_MAX_MARGIN …
#define OG01A1B_EXPOSURE_STEP …
#define OG01A1B_REG_ANALOG_GAIN …
#define OG01A1B_ANAL_GAIN_MIN …
#define OG01A1B_ANAL_GAIN_MAX …
#define OG01A1B_ANAL_GAIN_STEP …
#define OG01A1B_REG_DIG_GAIN …
#define OG01A1B_DGTL_GAIN_MIN …
#define OG01A1B_DGTL_GAIN_MAX …
#define OG01A1B_DGTL_GAIN_STEP …
#define OG01A1B_DGTL_GAIN_DEFAULT …
#define OG01A1B_REG_GROUP_ACCESS …
#define OG01A1B_GROUP_HOLD_START …
#define OG01A1B_GROUP_HOLD_END …
#define OG01A1B_GROUP_HOLD_LAUNCH …
#define OG01A1B_REG_TEST_PATTERN …
#define OG01A1B_TEST_PATTERN_ENABLE …
#define OG01A1B_TEST_PATTERN_BAR_SHIFT …
#define to_og01a1b(_sd) …
enum { … };
struct og01a1b_reg { … };
struct og01a1b_reg_list { … };
struct og01a1b_link_freq_config { … };
struct og01a1b_mode { … };
static const struct og01a1b_reg mipi_data_rate_1000mbps[] = …;
static const struct og01a1b_reg mode_1280x1024_regs[] = …;
static const char * const og01a1b_test_pattern_menu[] = …;
static const s64 link_freq_menu_items[] = …;
static const struct og01a1b_link_freq_config link_freq_configs[] = …;
static const struct og01a1b_mode supported_modes[] = …;
struct og01a1b { … };
static u64 to_pixel_rate(u32 f_index)
{ … }
static u64 to_pixels_per_line(u32 hts, u32 f_index)
{ … }
static int og01a1b_read_reg(struct og01a1b *og01a1b, u16 reg, u16 len, u32 *val)
{ … }
static int og01a1b_write_reg(struct og01a1b *og01a1b, u16 reg, u16 len, u32 val)
{ … }
static int og01a1b_write_reg_list(struct og01a1b *og01a1b,
const struct og01a1b_reg_list *r_list)
{ … }
static int og01a1b_test_pattern(struct og01a1b *og01a1b, u32 pattern)
{ … }
static int og01a1b_set_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops og01a1b_ctrl_ops = …;
static int og01a1b_init_controls(struct og01a1b *og01a1b)
{ … }
static void og01a1b_update_pad_format(const struct og01a1b_mode *mode,
struct v4l2_mbus_framefmt *fmt)
{ … }
static int og01a1b_start_streaming(struct og01a1b *og01a1b)
{ … }
static void og01a1b_stop_streaming(struct og01a1b *og01a1b)
{ … }
static int og01a1b_set_stream(struct v4l2_subdev *sd, int enable)
{ … }
static int og01a1b_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int og01a1b_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int og01a1b_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int og01a1b_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
{ … }
static int og01a1b_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ … }
static const struct v4l2_subdev_video_ops og01a1b_video_ops = …;
static const struct v4l2_subdev_pad_ops og01a1b_pad_ops = …;
static const struct v4l2_subdev_ops og01a1b_subdev_ops = …;
static const struct media_entity_operations og01a1b_subdev_entity_ops = …;
static const struct v4l2_subdev_internal_ops og01a1b_internal_ops = …;
static int og01a1b_identify_module(struct og01a1b *og01a1b)
{ … }
static int og01a1b_check_hwcfg(struct device *dev)
{ … }
static void og01a1b_remove(struct i2c_client *client)
{ … }
static int og01a1b_probe(struct i2c_client *client)
{ … }
#ifdef CONFIG_ACPI
static const struct acpi_device_id og01a1b_acpi_ids[] = …;
MODULE_DEVICE_TABLE(acpi, og01a1b_acpi_ids);
#endif
static struct i2c_driver og01a1b_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;