linux/drivers/media/i2c/gc08a3.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Driver for GalaxyCore gc08a3 image sensor
 *
 * Copyright 2024 MediaTek
 *
 * Zhi Mao <[email protected]>
 */
#include <linux/array_size.h>
#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/container_of.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/math64.h>
#include <linux/mod_devicetable.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/types.h>
#include <linux/units.h>

#include <media/v4l2-cci.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>

#define GC08A3_REG_TEST_PATTERN_EN
#define GC08A3_REG_TEST_PATTERN_IDX
#define GC08A3_TEST_PATTERN_EN

#define GC08A3_STREAMING_REG

#define GC08A3_FLIP_REG
#define GC08A3_FLIP_H_MASK
#define GC08A3_FLIP_V_MASK

#define GC08A3_EXP_REG
#define GC08A3_EXP_MARGIN
#define GC08A3_EXP_MIN
#define GC08A3_EXP_STEP

#define GC08A3_AGAIN_REG
#define GC08A3_AGAIN_MIN
#define GC08A3_AGAIN_MAX
#define GC08A3_AGAIN_STEP

#define GC08A3_FRAME_LENGTH_REG
#define GC08A3_VTS_MAX

#define GC08A3_REG_CHIP_ID
#define GC08A3_CHIP_ID

#define GC08A3_NATIVE_WIDTH
#define GC08A3_NATIVE_HEIGHT

#define GC08A3_DEFAULT_CLK_FREQ
#define GC08A3_MBUS_CODE
#define GC08A3_DATA_LANES

#define GC08A3_RGB_DEPTH

#define GC08A3_SLEEP_US

static const char *const gc08a3_test_pattern_menu[] =;

static const s64 gc08a3_link_freq_menu_items[] =;

static const char *const gc08a3_supply_name[] =;

struct gc08a3 {};

struct gc08a3_reg_list {};

static const struct cci_reg_sequence mode_3264x2448[] =;

static const struct cci_reg_sequence mode_1920x1080[] =;

static const struct cci_reg_sequence mode_table_common[] =;

struct gc08a3_mode {};

/* Declare modes in order, from biggest to smallest height. */
static const struct gc08a3_mode gc08a3_modes[] =;

static inline struct gc08a3 *to_gc08a3(struct v4l2_subdev *sd)
{}

static int gc08a3_power_on(struct device *dev)
{}

static int gc08a3_power_off(struct device *dev)
{}

static int gc08a3_enum_mbus_code(struct v4l2_subdev *sd,
				 struct v4l2_subdev_state *sd_state,
				 struct v4l2_subdev_mbus_code_enum *code)
{}

static int gc08a3_enum_frame_size(struct v4l2_subdev *subdev,
				  struct v4l2_subdev_state *sd_state,
				  struct v4l2_subdev_frame_size_enum *fse)
{}

static int gc08a3_update_cur_mode_controls(struct gc08a3 *gc08a3,
					   const struct gc08a3_mode *mode)
{}

static void gc08a3_update_pad_format(struct gc08a3 *gc08a3,
				     const struct gc08a3_mode *mode,
				     struct v4l2_mbus_framefmt *fmt)
{}

static int gc08a3_set_format(struct v4l2_subdev *sd,
			     struct v4l2_subdev_state *state,
			     struct v4l2_subdev_format *fmt)
{}

static int gc08a3_get_selection(struct v4l2_subdev *sd,
				struct v4l2_subdev_state *state,
				struct v4l2_subdev_selection *sel)
{}

static int gc08a3_init_state(struct v4l2_subdev *sd,
			     struct v4l2_subdev_state *state)
{}

static int gc08a3_set_ctrl_hflip(struct gc08a3 *gc08a3, u32 ctrl_val)
{}

static int gc08a3_set_ctrl_vflip(struct gc08a3 *gc08a3, u32 ctrl_val)
{}

static int gc08a3_test_pattern(struct gc08a3 *gc08a3, u32 pattern_menu)
{}

static int gc08a3_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops gc08a3_ctrl_ops =;

static int gc08a3_start_streaming(struct gc08a3 *gc08a3)
{}

static int gc08a3_stop_streaming(struct gc08a3 *gc08a3)
{}

static int gc08a3_s_stream(struct v4l2_subdev *subdev, int enable)
{}

static const struct v4l2_subdev_video_ops gc08a3_video_ops =;

static const struct v4l2_subdev_pad_ops gc08a3_subdev_pad_ops =;

static const struct v4l2_subdev_core_ops gc08a3_core_ops =;

static const struct v4l2_subdev_ops gc08a3_subdev_ops =;

static const struct v4l2_subdev_internal_ops gc08a3_internal_ops =;

static int gc08a3_get_regulators(struct device *dev, struct gc08a3 *gc08a3)
{}

static int gc08a3_parse_fwnode(struct gc08a3 *gc08a3)
{}

static u64 gc08a3_to_pixel_rate(u32 f_index)
{}

static int gc08a3_init_controls(struct gc08a3 *gc08a3)
{}

static int gc08a3_identify_module(struct gc08a3 *gc08a3)
{}

static int gc08a3_probe(struct i2c_client *client)
{}

static void gc08a3_remove(struct i2c_client *client)
{}

static const struct of_device_id gc08a3_of_match[] =;
MODULE_DEVICE_TABLE(of, gc08a3_of_match);

static DEFINE_RUNTIME_DEV_PM_OPS(gc08a3_pm_ops,
				 gc08a3_power_off,
				 gc08a3_power_on,
				 NULL);

static struct i2c_driver gc08a3_i2c_driver =;
module_i2c_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();