#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regulator/consumer.h>
#include <linux/gpio/consumer.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>
#define AD5820_POWER_DOWN …
#define AD5820_DAC_SHIFT …
#define AD5820_RAMP_MODE_LINEAR …
#define AD5820_RAMP_MODE_64_16 …
#define CODE_TO_RAMP_US(s) …
#define RAMP_US_TO_CODE(c) …
#define to_ad5820_device(sd) …
struct ad5820_device { … };
static int ad5820_write(struct ad5820_device *coil, u16 data)
{ … }
static int ad5820_update_hw(struct ad5820_device *coil)
{ … }
static int ad5820_power_off(struct ad5820_device *coil, bool standby)
{ … }
static int ad5820_power_on(struct ad5820_device *coil, bool restore)
{ … }
static int ad5820_set_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops ad5820_ctrl_ops = …;
static int ad5820_init_controls(struct ad5820_device *coil)
{ … }
static int ad5820_registered(struct v4l2_subdev *subdev)
{ … }
static int
ad5820_set_power(struct v4l2_subdev *subdev, int on)
{ … }
static int ad5820_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ … }
static int ad5820_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ … }
static const struct v4l2_subdev_core_ops ad5820_core_ops = …;
static const struct v4l2_subdev_ops ad5820_ops = …;
static const struct v4l2_subdev_internal_ops ad5820_internal_ops = …;
static int __maybe_unused ad5820_suspend(struct device *dev)
{ … }
static int __maybe_unused ad5820_resume(struct device *dev)
{ … }
static int ad5820_probe(struct i2c_client *client)
{ … }
static void ad5820_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id ad5820_id_table[] = …;
MODULE_DEVICE_TABLE(i2c, ad5820_id_table);
static const struct of_device_id ad5820_of_table[] = …;
MODULE_DEVICE_TABLE(of, ad5820_of_table);
static SIMPLE_DEV_PM_OPS(ad5820_pm, ad5820_suspend, ad5820_resume);
static struct i2c_driver ad5820_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;