linux/drivers/media/i2c/dw9807-vcm.c

// SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2018 Intel Corporation

#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>

#define DW9807_MAX_FOCUS_POS
/*
 * This sets the minimum granularity for the focus positions.
 * A value of 1 gives maximum accuracy for a desired focus position.
 */
#define DW9807_FOCUS_STEPS
/*
 * This acts as the minimum granularity of lens movement.
 * Keep this value power of 2, so the control steps can be
 * uniformly adjusted for gradual lens movement, with desired
 * number of control steps.
 */
#define DW9807_CTRL_STEPS
#define DW9807_CTRL_DELAY_US

#define DW9807_CTL_ADDR
/*
 * DW9807 separates two registers to control the VCM position.
 * One for MSB value, another is LSB value.
 */
#define DW9807_MSB_ADDR
#define DW9807_LSB_ADDR
#define DW9807_STATUS_ADDR
#define DW9807_MODE_ADDR
#define DW9807_RESONANCE_ADDR

#define MAX_RETRY

struct dw9807_device {};

static inline struct dw9807_device *sd_to_dw9807_vcm(
					struct v4l2_subdev *subdev)
{}

static int dw9807_i2c_check(struct i2c_client *client)
{}

static int dw9807_set_dac(struct i2c_client *client, u16 data)
{}

static int dw9807_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops dw9807_vcm_ctrl_ops =;

static int dw9807_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{}

static int dw9807_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{}

static const struct v4l2_subdev_internal_ops dw9807_int_ops =;

static const struct v4l2_subdev_ops dw9807_ops =;

static void dw9807_subdev_cleanup(struct dw9807_device *dw9807_dev)
{}

static int dw9807_init_controls(struct dw9807_device *dev_vcm)
{}

static int dw9807_probe(struct i2c_client *client)
{}

static void dw9807_remove(struct i2c_client *client)
{}

/*
 * This function sets the vcm position, so it consumes least current
 * The lens position is gradually moved in units of DW9807_CTRL_STEPS,
 * to make the movements smoothly.
 */
static int __maybe_unused dw9807_vcm_suspend(struct device *dev)
{}

/*
 * This function sets the vcm position to the value set by the user
 * through v4l2_ctrl_ops s_ctrl handler
 * The lens position is gradually moved in units of DW9807_CTRL_STEPS,
 * to make the movements smoothly.
 */
static int  __maybe_unused dw9807_vcm_resume(struct device *dev)
{}

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

static const struct dev_pm_ops dw9807_pm_ops =;

static struct i2c_driver dw9807_i2c_driver =;

module_i2c_driver();

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