#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <media/mipi-csi2.h>
#include <media/v4l2-async.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
#include "alvium-csi2.h"
static const struct v4l2_mbus_framefmt alvium_csi2_default_fmt = …;
static const struct alvium_pixfmt alvium_csi2_fmts[] = …;
static int alvium_read(struct alvium_dev *alvium, u32 reg, u64 *val, int *err)
{ … }
static int alvium_write(struct alvium_dev *alvium, u32 reg, u64 val, int *err)
{ … }
static int alvium_write_hshake(struct alvium_dev *alvium, u32 reg, u64 val)
{ … }
static int alvium_get_bcrm_vers(struct alvium_dev *alvium)
{ … }
static int alvium_get_fw_version(struct alvium_dev *alvium)
{ … }
static int alvium_get_bcrm_addr(struct alvium_dev *alvium)
{ … }
static int alvium_is_alive(struct alvium_dev *alvium)
{ … }
static void alvium_print_avail_mipi_fmt(struct alvium_dev *alvium)
{ … }
static void alvium_print_avail_feat(struct alvium_dev *alvium)
{ … }
static void alvium_print_avail_bayer(struct alvium_dev *alvium)
{ … }
static int alvium_get_feat_inq(struct alvium_dev *alvium)
{ … }
static int alvium_get_host_supp_csi_lanes(struct alvium_dev *alvium)
{ … }
static int alvium_set_csi_lanes(struct alvium_dev *alvium)
{ … }
static int alvium_set_lp2hs_delay(struct alvium_dev *alvium)
{ … }
static int alvium_get_csi_clk_params(struct alvium_dev *alvium)
{ … }
static int alvium_set_csi_clk(struct alvium_dev *alvium)
{ … }
static int alvium_get_img_width_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_img_height_params(struct alvium_dev *alvium)
{ … }
static int alvium_set_img_width(struct alvium_dev *alvium, u32 width)
{ … }
static int alvium_set_img_height(struct alvium_dev *alvium, u32 height)
{ … }
static int alvium_set_img_offx(struct alvium_dev *alvium, u32 offx)
{ … }
static int alvium_set_img_offy(struct alvium_dev *alvium, u32 offy)
{ … }
static int alvium_get_offx_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_offy_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_gain_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_exposure_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_red_balance_ratio_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_blue_balance_ratio_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_hue_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_black_lvl_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_gamma_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_sharpness_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_contrast_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_saturation_params(struct alvium_dev *alvium)
{ … }
static int alvium_set_bcm_mode(struct alvium_dev *alvium)
{ … }
static int alvium_get_mode(struct alvium_dev *alvium)
{ … }
static int alvium_get_avail_mipi_data_format(struct alvium_dev *alvium)
{ … }
static int alvium_setup_mipi_fmt(struct alvium_dev *alvium)
{ … }
static int alvium_set_mipi_fmt(struct alvium_dev *alvium,
const struct alvium_pixfmt *pixfmt)
{ … }
static int alvium_get_avail_bayer(struct alvium_dev *alvium)
{ … }
static int alvium_set_bayer_pattern(struct alvium_dev *alvium,
const struct alvium_pixfmt *pixfmt)
{ … }
static int alvium_get_frame_interval(struct alvium_dev *alvium,
u64 *min_fr, u64 *max_fr)
{ … }
static int alvium_set_frame_rate(struct alvium_dev *alvium, u64 fr)
{ … }
static int alvium_set_stream_mipi(struct alvium_dev *alvium, bool on)
{ … }
static int alvium_get_gain(struct alvium_dev *alvium)
{ … }
static int alvium_set_ctrl_gain(struct alvium_dev *alvium, int gain)
{ … }
static int alvium_set_ctrl_auto_gain(struct alvium_dev *alvium, bool on)
{ … }
static int alvium_get_exposure(struct alvium_dev *alvium)
{ … }
static int alvium_set_ctrl_auto_exposure(struct alvium_dev *alvium, bool on)
{ … }
static int alvium_set_ctrl_exposure(struct alvium_dev *alvium, int exposure_ns)
{ … }
static int alvium_set_ctrl_blue_balance_ratio(struct alvium_dev *alvium,
int blue)
{ … }
static int alvium_set_ctrl_red_balance_ratio(struct alvium_dev *alvium, int red)
{ … }
static int alvium_set_ctrl_awb(struct alvium_dev *alvium, bool on)
{ … }
static int alvium_set_ctrl_hue(struct alvium_dev *alvium, int val)
{ … }
static int alvium_set_ctrl_contrast(struct alvium_dev *alvium, int val)
{ … }
static int alvium_set_ctrl_saturation(struct alvium_dev *alvium, int val)
{ … }
static int alvium_set_ctrl_gamma(struct alvium_dev *alvium, int val)
{ … }
static int alvium_set_ctrl_sharpness(struct alvium_dev *alvium, int val)
{ … }
static int alvium_set_ctrl_hflip(struct alvium_dev *alvium, int val)
{ … }
static int alvium_set_ctrl_vflip(struct alvium_dev *alvium, int val)
{ … }
static int alvium_get_hw_features_params(struct alvium_dev *alvium)
{ … }
static int alvium_get_hw_info(struct alvium_dev *alvium)
{ … }
static int alvium_hw_init(struct alvium_dev *alvium)
{ … }
static int alvium_s_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval *fi)
{ … }
static int alvium_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static const struct alvium_pixfmt *
alvium_code_to_pixfmt(struct alvium_dev *alvium, u32 code)
{ … }
static int alvium_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state,
struct v4l2_subdev_frame_size_enum *fse)
{ … }
static int alvium_set_mode(struct alvium_dev *alvium,
struct v4l2_subdev_state *state)
{ … }
static int alvium_set_framefmt(struct alvium_dev *alvium,
struct v4l2_mbus_framefmt *format)
{ … }
static int alvium_s_stream(struct v4l2_subdev *sd, int enable)
{ … }
static int alvium_init_state(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state)
{ … }
static int alvium_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format)
{ … }
static int alvium_set_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
{ … }
static int alvium_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
{ … }
static int alvium_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int alvium_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops alvium_ctrl_ops = …;
static int alvium_ctrl_init(struct alvium_dev *alvium)
{ … }
static const struct v4l2_subdev_core_ops alvium_core_ops = …;
static const struct v4l2_subdev_video_ops alvium_video_ops = …;
static const struct v4l2_subdev_pad_ops alvium_pad_ops = …;
static const struct v4l2_subdev_internal_ops alvium_internal_ops = …;
static const struct v4l2_subdev_ops alvium_subdev_ops = …;
static int alvium_subdev_init(struct alvium_dev *alvium)
{ … }
static void alvium_subdev_cleanup(struct alvium_dev *alvium)
{ … }
static int alvium_get_dt_data(struct alvium_dev *alvium)
{ … }
static int alvium_set_power(struct alvium_dev *alvium, bool on)
{ … }
static int alvium_runtime_resume(struct device *dev)
{ … }
static int alvium_runtime_suspend(struct device *dev)
{ … }
static const struct dev_pm_ops alvium_pm_ops = …;
static int alvium_probe(struct i2c_client *client)
{ … }
static void alvium_remove(struct i2c_client *client)
{ … }
static const struct of_device_id alvium_of_ids[] = …;
MODULE_DEVICE_TABLE(of, alvium_of_ids);
static struct i2c_driver alvium_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;