linux/drivers/media/i2c/ad5820.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * drivers/media/i2c/ad5820.c
 *
 * AD5820 DAC driver for camera voice coil focus.
 *
 * Copyright (C) 2008 Nokia Corporation
 * Copyright (C) 2007 Texas Instruments
 * Copyright (C) 2016 Pavel Machek <[email protected]>
 *
 * Contact: Tuukka Toivonen <[email protected]>
 *	    Sakari Ailus <[email protected]>
 *
 * Based on af_d88.c by Texas Instruments.
 */

#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>

/* Register definitions */
#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)
{}

/*
 * Calculate status word and write it to the device based on current
 * values of V4L2 controls. It is assumed that the stored V4L2 control
 * values are properly limited and rounded.
 */
static int ad5820_update_hw(struct ad5820_device *coil)
{}

/*
 * Power handling
 */
static int ad5820_power_off(struct ad5820_device *coil, bool standby)
{}

static int ad5820_power_on(struct ad5820_device *coil, bool restore)
{}

/*
 * V4L2 controls
 */
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)
{}

/*
 * V4L2 subdev operations
 */
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 =;

/*
 * I2C driver
 */
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();