linux/drivers/media/i2c/gc05a2.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Driver for GalaxyCore gc05a2 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 GC05A2_REG_TEST_PATTERN_EN
#define GC05A2_REG_TEST_PATTERN_IDX
#define GC05A2_TEST_PATTERN_EN

#define GC05A2_STREAMING_REG

#define GC05A2_FLIP_REG
#define GC05A2_FLIP_H_MASK
#define GC05A2_FLIP_V_MASK

#define GC05A2_EXP_REG
#define GC05A2_EXP_MARGIN
#define GC05A2_EXP_MIN
#define GC05A2_EXP_STEP

#define GC05A2_AGAIN_REG
#define GC05A2_AGAIN_MIN
#define GC05A2_AGAIN_MAX
#define GC05A2_AGAIN_STEP

#define GC05A2_FRAME_LENGTH_REG
#define GC05A2_VTS_MAX

#define GC05A2_REG_CHIP_ID
#define GC05A2_CHIP_ID

#define GC05A2_NATIVE_WIDTH
#define GC05A2_NATIVE_HEIGHT

#define GC05A2_DEFAULT_CLK_FREQ
#define GC05A2_MBUS_CODE
#define GC05A2_DATA_LANES
#define GC05A2_RGB_DEPTH
#define GC05A2_SLEEP_US

static const char *const gc05a2_test_pattern_menu[] =;

static const s64 gc05a2_link_freq_menu_items[] =;

static const char *const gc05a2_supply_name[] =;

struct gc05a2 {};

struct gc05a2_reg_list {};

static const struct cci_reg_sequence mode_2592x1944[] =;

static const struct cci_reg_sequence mode_1280x720[] =;

static const struct cci_reg_sequence mode_table_common[] =;

struct gc05a2_mode {};

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

static inline struct gc05a2 *to_gc05a2(struct v4l2_subdev *sd)
{}

static int gc05a2_power_on(struct device *dev)
{}

static int gc05a2_power_off(struct device *dev)
{}

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

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

static int gc05a2_update_cur_mode_controls(struct gc05a2 *gc05a2,
					   const struct gc05a2_mode *mode)
{}

static void gc05a2_update_pad_format(struct gc05a2 *gc08a3,
				     const struct gc05a2_mode *mode,
				     struct v4l2_mbus_framefmt *fmt)
{}

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

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

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

static int gc05a2_set_ctrl_hflip(struct gc05a2 *gc05a2, u32 ctrl_val)
{}

static int gc05a2_set_ctrl_vflip(struct gc05a2 *gc05a2, u32 ctrl_val)
{}

static int gc05a2_test_pattern(struct gc05a2 *gc05a2, u32 pattern_menu)
{}

static int gc05a2_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops gc05a2_ctrl_ops =;

static int gc05a2_identify_module(struct gc05a2 *gc05a2)
{}

static int gc05a2_start_streaming(struct gc05a2 *gc05a2)
{}

static int gc05a2_stop_streaming(struct gc05a2 *gc05a2)
{}

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

static const struct v4l2_subdev_video_ops gc05a2_video_ops =;

static const struct v4l2_subdev_pad_ops gc05a2_subdev_pad_ops =;

static const struct v4l2_subdev_core_ops gc05a2_core_ops =;

static const struct v4l2_subdev_ops gc05a2_subdev_ops =;

static const struct v4l2_subdev_internal_ops gc05a2_internal_ops =;

static int gc05a2_get_regulators(struct device *dev, struct gc05a2 *gc05a2)
{}

static int gc05a2_parse_fwnode(struct gc05a2 *gc05a2)
{}

static u64 gc05a2_to_pixel_rate(u32 f_index)
{}

static int gc05a2_init_controls(struct gc05a2 *gc05a2)
{}

static int gc05a2_probe(struct i2c_client *client)
{}

static void gc05a2_remove(struct i2c_client *client)
{}

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

static DEFINE_RUNTIME_DEV_PM_OPS(gc05a2_pm_ops,
				 gc05a2_power_off,
				 gc05a2_power_on,
				 NULL);

static struct i2c_driver gc05a2_i2c_driver =;
module_i2c_driver();

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