// SPDX-License-Identifier: GPL-2.0-only
/*
 * OmniVision ov9282 Camera Sensor Driver
 *
 * Copyright (C) 2021 Intel Corporation
 */
#include <linux/unaligned.h>

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>

#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>

/* Streaming Mode */
#define OV9282_REG_MODE_SELECT	0x0100
#define OV9282_MODE_STANDBY	0x00
#define OV9282_MODE_STREAMING	0x01

#define OV9282_REG_PLL_CTRL_0D	0x030d
#define OV9282_PLL_CTRL_0D_RAW8		0x60
#define OV9282_PLL_CTRL_0D_RAW10	0x50

#define OV9282_REG_TIMING_HTS	0x380c
#define OV9282_TIMING_HTS_MAX	0x7fff

/* Lines per frame */
#define OV9282_REG_LPFR		0x380e

/* Chip ID */
#define OV9282_REG_ID		0x300a
#define OV9282_ID		0x9281

/* Exposure control */
#define OV9282_REG_EXPOSURE	0x3500
#define OV9282_EXPOSURE_MIN	1
#define OV9282_EXPOSURE_OFFSET	12
#define OV9282_EXPOSURE_STEP	1
#define OV9282_EXPOSURE_DEFAULT	0x0282

/* Analog gain control */
#define OV9282_REG_AGAIN	0x3509
#define OV9282_AGAIN_MIN	0x10
#define OV9282_AGAIN_MAX	0xff
#define OV9282_AGAIN_STEP	1
#define OV9282_AGAIN_DEFAULT	0x10

/* Group hold register */
#define OV9282_REG_HOLD		0x3308

#define OV9282_REG_ANA_CORE_2	0x3662
#define OV9282_ANA_CORE2_RAW8	0x07
#define OV9282_ANA_CORE2_RAW10	0x05

#define OV9282_REG_TIMING_FORMAT_1	0x3820
#define OV9282_REG_TIMING_FORMAT_2	0x3821
#define OV9282_FLIP_BIT			BIT(2)

#define OV9282_REG_MIPI_CTRL00	0x4800
#define OV9282_GATED_CLOCK	BIT(5)

/* Input clock rate */
#define OV9282_INCLK_RATE	24000000

/* CSI2 HW configuration */
#define OV9282_LINK_FREQ	400000000
#define OV9282_NUM_DATA_LANES	2

/* Pixel rate */
#define OV9282_PIXEL_RATE_10BIT		(OV9282_LINK_FREQ * 2 * \
					 OV9282_NUM_DATA_LANES / 10)
#define OV9282_PIXEL_RATE_8BIT		(OV9282_LINK_FREQ * 2 * \
					 OV9282_NUM_DATA_LANES / 8)

/*
 * OV9282 native and active pixel array size.
 * 8 dummy rows/columns on each edge of a 1280x800 active array
 */
#define OV9282_NATIVE_WIDTH		1296U
#define OV9282_NATIVE_HEIGHT		816U
#define OV9282_PIXEL_ARRAY_LEFT		8U
#define OV9282_PIXEL_ARRAY_TOP		8U
#define OV9282_PIXEL_ARRAY_WIDTH	1280U
#define OV9282_PIXEL_ARRAY_HEIGHT	800U

#define OV9282_REG_MIN		0x00
#define OV9282_REG_MAX		0xfffff

static const char * const ov9282_supply_names[] = {
	"avdd",		/* Analog power */
	"dovdd",	/* Digital I/O power */
	"dvdd",		/* Digital core power */
};

#define OV9282_NUM_SUPPLIES ARRAY_SIZE(ov9282_supply_names)

/**
 * struct ov9282_reg - ov9282 sensor register
 * @address: Register address
 * @val: Register value
 */
struct ov9282_reg {
	u16 address;
	u8 val;
};

/**
 * struct ov9282_reg_list - ov9282 sensor register list
 * @num_of_regs: Number of registers in the list
 * @regs: Pointer to register list
 */
struct ov9282_reg_list {
	u32 num_of_regs;
	const struct ov9282_reg *regs;
};

/**
 * struct ov9282_mode - ov9282 sensor mode structure
 * @width: Frame width
 * @height: Frame height
 * @hblank_min: Minimum horizontal blanking in lines for non-continuous[0] and
 *		continuous[1] clock modes
 * @vblank: Vertical blanking in lines
 * @vblank_min: Minimum vertical blanking in lines
 * @vblank_max: Maximum vertical blanking in lines
 * @link_freq_idx: Link frequency index
 * @crop: on-sensor cropping for this mode
 * @reg_list: Register list for sensor mode
 */
struct ov9282_mode {
	u32 width;
	u32 height;
	u32 hblank_min[2];
	u32 vblank;
	u32 vblank_min;
	u32 vblank_max;
	u32 link_freq_idx;
	struct v4l2_rect crop;
	struct ov9282_reg_list reg_list;
};

/**
 * struct ov9282 - ov9282 sensor device structure
 * @dev: Pointer to generic device
 * @sd: V4L2 sub-device
 * @pad: Media pad. Only one pad supported
 * @reset_gpio: Sensor reset gpio
 * @inclk: Sensor input clock
 * @supplies: Regulator supplies for the sensor
 * @ctrl_handler: V4L2 control handler
 * @link_freq_ctrl: Pointer to link frequency control
 * @hblank_ctrl: Pointer to horizontal blanking control
 * @vblank_ctrl: Pointer to vertical blanking control
 * @exp_ctrl: Pointer to exposure control
 * @again_ctrl: Pointer to analog gain control
 * @pixel_rate: Pointer to pixel rate control
 * @vblank: Vertical blanking in lines
 * @noncontinuous_clock: Selection of CSI2 noncontinuous clock mode
 * @cur_mode: Pointer to current selected sensor mode
 * @code: Mbus code currently selected
 * @mutex: Mutex for serializing sensor controls
 */
struct ov9282 {
	struct device *dev;
	struct v4l2_subdev sd;
	struct media_pad pad;
	struct gpio_desc *reset_gpio;
	struct clk *inclk;
	struct regulator_bulk_data supplies[OV9282_NUM_SUPPLIES];
	struct v4l2_ctrl_handler ctrl_handler;
	struct v4l2_ctrl *link_freq_ctrl;
	struct v4l2_ctrl *hblank_ctrl;
	struct v4l2_ctrl *vblank_ctrl;
	struct {
		struct v4l2_ctrl *exp_ctrl;
		struct v4l2_ctrl *again_ctrl;
	};
	struct v4l2_ctrl *pixel_rate;
	u32 vblank;
	bool noncontinuous_clock;
	const struct ov9282_mode *cur_mode;
	u32 code;
	struct mutex mutex;
};

static const s64 link_freq[] = {
	OV9282_LINK_FREQ,
};

/*
 * Common registers
 *
 * Note: Do NOT include a software reset (0x0103, 0x01) in any of these
 * register arrays as some settings are written as part of ov9282_power_on,
 * and the reset will clear them.
 */
static const struct ov9282_reg common_regs[] = {
	{0x0302, 0x32},
	{0x030e, 0x02},
	{0x3001, 0x00},
	{0x3004, 0x00},
	{0x3005, 0x00},
	{0x3006, 0x04},
	{0x3011, 0x0a},
	{0x3013, 0x18},
	{0x301c, 0xf0},
	{0x3022, 0x01},
	{0x3030, 0x10},
	{0x3039, 0x32},
	{0x303a, 0x00},
	{0x3503, 0x08},
	{0x3505, 0x8c},
	{0x3507, 0x03},
	{0x3508, 0x00},
	{0x3610, 0x80},
	{0x3611, 0xa0},
	{0x3620, 0x6e},
	{0x3632, 0x56},
	{0x3633, 0x78},
	{0x3666, 0x00},
	{0x366f, 0x5a},
	{0x3680, 0x84},
	{0x3712, 0x80},
	{0x372d, 0x22},
	{0x3731, 0x80},
	{0x3732, 0x30},
	{0x377d, 0x22},
	{0x3788, 0x02},
	{0x3789, 0xa4},
	{0x378a, 0x00},
	{0x378b, 0x4a},
	{0x3799, 0x20},
	{0x3881, 0x42},
	{0x38a8, 0x02},
	{0x38a9, 0x80},
	{0x38b1, 0x00},
	{0x38c4, 0x00},
	{0x38c5, 0xc0},
	{0x38c6, 0x04},
	{0x38c7, 0x80},
	{0x3920, 0xff},
	{0x4010, 0x40},
	{0x4043, 0x40},
	{0x4307, 0x30},
	{0x4317, 0x00},
	{0x4501, 0x00},
	{0x450a, 0x08},
	{0x4601, 0x04},
	{0x470f, 0x00},
	{0x4f07, 0x00},
	{0x5000, 0x9f},
	{0x5001, 0x00},
	{0x5e00, 0x00},
	{0x5d00, 0x07},
	{0x5d01, 0x00},
	{0x0101, 0x01},
	{0x1000, 0x03},
	{0x5a08, 0x84},
};

static struct ov9282_reg_list common_regs_list = {
	.num_of_regs = ARRAY_SIZE(common_regs),
	.regs = common_regs,
};

#define MODE_1280_800		0
#define MODE_1280_720		1
#define MODE_640_400		2

#define DEFAULT_MODE		MODE_1280_720

/* Sensor mode registers */
static const struct ov9282_reg mode_1280x800_regs[] = {
	{0x3778, 0x00},
	{0x3800, 0x00},
	{0x3801, 0x00},
	{0x3802, 0x00},
	{0x3803, 0x00},
	{0x3804, 0x05},
	{0x3805, 0x0f},
	{0x3806, 0x03},
	{0x3807, 0x2f},
	{0x3808, 0x05},
	{0x3809, 0x00},
	{0x380a, 0x03},
	{0x380b, 0x20},
	{0x3810, 0x00},
	{0x3811, 0x08},
	{0x3812, 0x00},
	{0x3813, 0x08},
	{0x3814, 0x11},
	{0x3815, 0x11},
	{0x3820, 0x40},
	{0x3821, 0x00},
	{0x4003, 0x40},
	{0x4008, 0x04},
	{0x4009, 0x0b},
	{0x400c, 0x00},
	{0x400d, 0x07},
	{0x4507, 0x00},
	{0x4509, 0x00},
};

static const struct ov9282_reg mode_1280x720_regs[] = {
	{0x3778, 0x00},
	{0x3800, 0x00},
	{0x3801, 0x00},
	{0x3802, 0x00},
	{0x3803, 0x00},
	{0x3804, 0x05},
	{0x3805, 0x0f},
	{0x3806, 0x02},
	{0x3807, 0xdf},
	{0x3808, 0x05},
	{0x3809, 0x00},
	{0x380a, 0x02},
	{0x380b, 0xd0},
	{0x3810, 0x00},
	{0x3811, 0x08},
	{0x3812, 0x00},
	{0x3813, 0x08},
	{0x3814, 0x11},
	{0x3815, 0x11},
	{0x3820, 0x3c},
	{0x3821, 0x84},
	{0x4003, 0x40},
	{0x4008, 0x02},
	{0x4009, 0x05},
	{0x400c, 0x00},
	{0x400d, 0x03},
	{0x4507, 0x00},
	{0x4509, 0x80},
};

static const struct ov9282_reg mode_640x400_regs[] = {
	{0x3778, 0x10},
	{0x3800, 0x00},
	{0x3801, 0x00},
	{0x3802, 0x00},
	{0x3803, 0x00},
	{0x3804, 0x05},
	{0x3805, 0x0f},
	{0x3806, 0x03},
	{0x3807, 0x2f},
	{0x3808, 0x02},
	{0x3809, 0x80},
	{0x380a, 0x01},
	{0x380b, 0x90},
	{0x3810, 0x00},
	{0x3811, 0x04},
	{0x3812, 0x00},
	{0x3813, 0x04},
	{0x3814, 0x31},
	{0x3815, 0x22},
	{0x3820, 0x60},
	{0x3821, 0x01},
	{0x4008, 0x02},
	{0x4009, 0x05},
	{0x400c, 0x00},
	{0x400d, 0x03},
	{0x4507, 0x03},
	{0x4509, 0x80},
};

/* Supported sensor mode configurations */
static const struct ov9282_mode supported_modes[] = {
	[MODE_1280_800] = {
		.width = 1280,
		.height = 800,
		.hblank_min = { 250, 176 },
		.vblank = 1022,
		.vblank_min = 110,
		.vblank_max = 51540,
		.link_freq_idx = 0,
		.crop = {
			.left = OV9282_PIXEL_ARRAY_LEFT,
			.top = OV9282_PIXEL_ARRAY_TOP,
			.width = 1280,
			.height = 800
		},
		.reg_list = {
			.num_of_regs = ARRAY_SIZE(mode_1280x800_regs),
			.regs = mode_1280x800_regs,
		},
	},
	[MODE_1280_720] = {
		.width = 1280,
		.height = 720,
		.hblank_min = { 250, 176 },
		.vblank = 1022,
		.vblank_min = 41,
		.vblank_max = 51540,
		.link_freq_idx = 0,
		.crop = {
			/*
			 * Note that this mode takes the top 720 lines from the
			 * 800 of the sensor. It does not take a middle crop.
			 */
			.left = OV9282_PIXEL_ARRAY_LEFT,
			.top = OV9282_PIXEL_ARRAY_TOP,
			.width = 1280,
			.height = 720
		},
		.reg_list = {
			.num_of_regs = ARRAY_SIZE(mode_1280x720_regs),
			.regs = mode_1280x720_regs,
		},
	},
	[MODE_640_400] = {
		.width = 640,
		.height = 400,
		.hblank_min = { 890, 816 },
		.vblank = 1022,
		.vblank_min = 22,
		.vblank_max = 51540,
		.link_freq_idx = 0,
		.crop = {
			.left = OV9282_PIXEL_ARRAY_LEFT,
			.top = OV9282_PIXEL_ARRAY_TOP,
			.width = 1280,
			.height = 800
		},
		.reg_list = {
			.num_of_regs = ARRAY_SIZE(mode_640x400_regs),
			.regs = mode_640x400_regs,
		},
	},
};

/**
 * to_ov9282() - ov9282 V4L2 sub-device to ov9282 device.
 * @subdev: pointer to ov9282 V4L2 sub-device
 *
 * Return: pointer to ov9282 device
 */
static inline struct ov9282 *to_ov9282(struct v4l2_subdev *subdev)
{
	return container_of(subdev, struct ov9282, sd);
}

/**
 * ov9282_read_reg() - Read registers.
 * @ov9282: pointer to ov9282 device
 * @reg: register address
 * @len: length of bytes to read. Max supported bytes is 4
 * @val: pointer to register value to be filled.
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_read_reg(struct ov9282 *ov9282, u16 reg, u32 len, u32 *val)
{
	struct i2c_client *client = v4l2_get_subdevdata(&ov9282->sd);
	struct i2c_msg msgs[2] = {0};
	u8 addr_buf[2] = {0};
	u8 data_buf[4] = {0};
	int ret;

	if (WARN_ON(len > 4))
		return -EINVAL;

	put_unaligned_be16(reg, addr_buf);

	/* Write register address */
	msgs[0].addr = client->addr;
	msgs[0].flags = 0;
	msgs[0].len = ARRAY_SIZE(addr_buf);
	msgs[0].buf = addr_buf;

	/* Read data from register */
	msgs[1].addr = client->addr;
	msgs[1].flags = I2C_M_RD;
	msgs[1].len = len;
	msgs[1].buf = &data_buf[4 - len];

	ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
	if (ret != ARRAY_SIZE(msgs))
		return -EIO;

	*val = get_unaligned_be32(data_buf);

	return 0;
}

/**
 * ov9282_write_reg() - Write register
 * @ov9282: pointer to ov9282 device
 * @reg: register address
 * @len: length of bytes. Max supported bytes is 4
 * @val: register value
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_write_reg(struct ov9282 *ov9282, u16 reg, u32 len, u32 val)
{
	struct i2c_client *client = v4l2_get_subdevdata(&ov9282->sd);
	u8 buf[6] = {0};

	if (WARN_ON(len > 4))
		return -EINVAL;

	put_unaligned_be16(reg, buf);
	put_unaligned_be32(val << (8 * (4 - len)), buf + 2);
	if (i2c_master_send(client, buf, len + 2) != len + 2)
		return -EIO;

	return 0;
}

/**
 * ov9282_write_regs() - Write a list of registers
 * @ov9282: pointer to ov9282 device
 * @regs: list of registers to be written
 * @len: length of registers array
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_write_regs(struct ov9282 *ov9282,
			     const struct ov9282_reg *regs, u32 len)
{
	unsigned int i;
	int ret;

	for (i = 0; i < len; i++) {
		ret = ov9282_write_reg(ov9282, regs[i].address, 1, regs[i].val);
		if (ret)
			return ret;
	}

	return 0;
}

/**
 * ov9282_update_controls() - Update control ranges based on streaming mode
 * @ov9282: pointer to ov9282 device
 * @mode: pointer to ov9282_mode sensor mode
 * @fmt: pointer to the requested mode
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_update_controls(struct ov9282 *ov9282,
				  const struct ov9282_mode *mode,
				  const struct v4l2_subdev_format *fmt)
{
	u32 hblank_min;
	s64 pixel_rate;
	int ret;

	ret = __v4l2_ctrl_s_ctrl(ov9282->link_freq_ctrl, mode->link_freq_idx);
	if (ret)
		return ret;

	pixel_rate = (fmt->format.code == MEDIA_BUS_FMT_Y10_1X10) ?
		OV9282_PIXEL_RATE_10BIT : OV9282_PIXEL_RATE_8BIT;
	ret = __v4l2_ctrl_modify_range(ov9282->pixel_rate, pixel_rate,
				       pixel_rate, 1, pixel_rate);
	if (ret)
		return ret;

	hblank_min = mode->hblank_min[ov9282->noncontinuous_clock ? 0 : 1];
	ret =  __v4l2_ctrl_modify_range(ov9282->hblank_ctrl, hblank_min,
					OV9282_TIMING_HTS_MAX - mode->width, 1,
					hblank_min);
	if (ret)
		return ret;

	return __v4l2_ctrl_modify_range(ov9282->vblank_ctrl, mode->vblank_min,
					mode->vblank_max, 1, mode->vblank);
}

/**
 * ov9282_update_exp_gain() - Set updated exposure and gain
 * @ov9282: pointer to ov9282 device
 * @exposure: updated exposure value
 * @gain: updated analog gain value
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_update_exp_gain(struct ov9282 *ov9282, u32 exposure, u32 gain)
{
	int ret;

	dev_dbg(ov9282->dev, "Set exp %u, analog gain %u",
		exposure, gain);

	ret = ov9282_write_reg(ov9282, OV9282_REG_HOLD, 1, 1);
	if (ret)
		return ret;

	ret = ov9282_write_reg(ov9282, OV9282_REG_EXPOSURE, 3, exposure << 4);
	if (ret)
		goto error_release_group_hold;

	ret = ov9282_write_reg(ov9282, OV9282_REG_AGAIN, 1, gain);

error_release_group_hold:
	ov9282_write_reg(ov9282, OV9282_REG_HOLD, 1, 0);

	return ret;
}

static int ov9282_set_ctrl_hflip(struct ov9282 *ov9282, int value)
{
	u32 current_val;
	int ret = ov9282_read_reg(ov9282, OV9282_REG_TIMING_FORMAT_2, 1,
				  &current_val);
	if (ret)
		return ret;

	if (value)
		current_val |= OV9282_FLIP_BIT;
	else
		current_val &= ~OV9282_FLIP_BIT;

	return ov9282_write_reg(ov9282, OV9282_REG_TIMING_FORMAT_2, 1,
				current_val);
}

static int ov9282_set_ctrl_vflip(struct ov9282 *ov9282, int value)
{
	u32 current_val;
	int ret = ov9282_read_reg(ov9282, OV9282_REG_TIMING_FORMAT_1, 1,
				  &current_val);
	if (ret)
		return ret;

	if (value)
		current_val |= OV9282_FLIP_BIT;
	else
		current_val &= ~OV9282_FLIP_BIT;

	return ov9282_write_reg(ov9282, OV9282_REG_TIMING_FORMAT_1, 1,
				current_val);
}

/**
 * ov9282_set_ctrl() - Set subdevice control
 * @ctrl: pointer to v4l2_ctrl structure
 *
 * Supported controls:
 * - V4L2_CID_VBLANK
 * - cluster controls:
 *   - V4L2_CID_ANALOGUE_GAIN
 *   - V4L2_CID_EXPOSURE
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_set_ctrl(struct v4l2_ctrl *ctrl)
{
	struct ov9282 *ov9282 =
		container_of(ctrl->handler, struct ov9282, ctrl_handler);
	u32 analog_gain;
	u32 exposure;
	u32 lpfr;
	int ret;

	switch (ctrl->id) {
	case V4L2_CID_VBLANK:
		ov9282->vblank = ov9282->vblank_ctrl->val;

		dev_dbg(ov9282->dev, "Received vblank %u, new lpfr %u",
			ov9282->vblank,
			ov9282->vblank + ov9282->cur_mode->height);

		ret = __v4l2_ctrl_modify_range(ov9282->exp_ctrl,
					       OV9282_EXPOSURE_MIN,
					       ov9282->vblank +
					       ov9282->cur_mode->height -
					       OV9282_EXPOSURE_OFFSET,
					       1, OV9282_EXPOSURE_DEFAULT);
		break;
	}

	/* Set controls only if sensor is in power on state */
	if (!pm_runtime_get_if_in_use(ov9282->dev))
		return 0;

	switch (ctrl->id) {
	case V4L2_CID_EXPOSURE:
		exposure = ctrl->val;
		analog_gain = ov9282->again_ctrl->val;

		dev_dbg(ov9282->dev, "Received exp %u, analog gain %u",
			exposure, analog_gain);

		ret = ov9282_update_exp_gain(ov9282, exposure, analog_gain);
		break;
	case V4L2_CID_VBLANK:
		lpfr = ov9282->vblank + ov9282->cur_mode->height;
		ret = ov9282_write_reg(ov9282, OV9282_REG_LPFR, 2, lpfr);
		break;
	case V4L2_CID_HFLIP:
		ret = ov9282_set_ctrl_hflip(ov9282, ctrl->val);
		break;
	case V4L2_CID_VFLIP:
		ret = ov9282_set_ctrl_vflip(ov9282, ctrl->val);
		break;
	case V4L2_CID_HBLANK:
		ret = ov9282_write_reg(ov9282, OV9282_REG_TIMING_HTS, 2,
				       (ctrl->val + ov9282->cur_mode->width) >> 1);
		break;
	default:
		dev_err(ov9282->dev, "Invalid control %d", ctrl->id);
		ret = -EINVAL;
	}

	pm_runtime_put(ov9282->dev);

	return ret;
}

/* V4l2 subdevice control ops*/
static const struct v4l2_ctrl_ops ov9282_ctrl_ops = {
	.s_ctrl = ov9282_set_ctrl,
};

/**
 * ov9282_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes
 * @sd: pointer to ov9282 V4L2 sub-device structure
 * @sd_state: V4L2 sub-device configuration
 * @code: V4L2 sub-device code enumeration need to be filled
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_enum_mbus_code(struct v4l2_subdev *sd,
				 struct v4l2_subdev_state *sd_state,
				 struct v4l2_subdev_mbus_code_enum *code)
{
	switch (code->index) {
	case 0:
		code->code = MEDIA_BUS_FMT_Y10_1X10;
		break;
	case 1:
		code->code = MEDIA_BUS_FMT_Y8_1X8;
		break;
	default:
		return -EINVAL;
	}

	return 0;
}

/**
 * ov9282_enum_frame_size() - Enumerate V4L2 sub-device frame sizes
 * @sd: pointer to ov9282 V4L2 sub-device structure
 * @sd_state: V4L2 sub-device configuration
 * @fsize: V4L2 sub-device size enumeration need to be filled
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_enum_frame_size(struct v4l2_subdev *sd,
				  struct v4l2_subdev_state *sd_state,
				  struct v4l2_subdev_frame_size_enum *fsize)
{
	if (fsize->index >= ARRAY_SIZE(supported_modes))
		return -EINVAL;

	if (fsize->code != MEDIA_BUS_FMT_Y10_1X10 &&
	    fsize->code != MEDIA_BUS_FMT_Y8_1X8)
		return -EINVAL;

	fsize->min_width = supported_modes[fsize->index].width;
	fsize->max_width = fsize->min_width;
	fsize->min_height = supported_modes[fsize->index].height;
	fsize->max_height = fsize->min_height;

	return 0;
}

/**
 * ov9282_fill_pad_format() - Fill subdevice pad format
 *                            from selected sensor mode
 * @ov9282: pointer to ov9282 device
 * @mode: pointer to ov9282_mode sensor mode
 * @code: mbus code to be stored
 * @fmt: V4L2 sub-device format need to be filled
 */
static void ov9282_fill_pad_format(struct ov9282 *ov9282,
				   const struct ov9282_mode *mode,
				   u32 code,
				   struct v4l2_subdev_format *fmt)
{
	fmt->format.width = mode->width;
	fmt->format.height = mode->height;
	fmt->format.code = code;
	fmt->format.field = V4L2_FIELD_NONE;
	fmt->format.colorspace = V4L2_COLORSPACE_RAW;
	fmt->format.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
	fmt->format.quantization = V4L2_QUANTIZATION_DEFAULT;
	fmt->format.xfer_func = V4L2_XFER_FUNC_NONE;
}

/**
 * ov9282_get_pad_format() - Get subdevice pad format
 * @sd: pointer to ov9282 V4L2 sub-device structure
 * @sd_state: V4L2 sub-device configuration
 * @fmt: V4L2 sub-device format need to be set
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_get_pad_format(struct v4l2_subdev *sd,
				 struct v4l2_subdev_state *sd_state,
				 struct v4l2_subdev_format *fmt)
{
	struct ov9282 *ov9282 = to_ov9282(sd);

	mutex_lock(&ov9282->mutex);

	if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
		struct v4l2_mbus_framefmt *framefmt;

		framefmt = v4l2_subdev_state_get_format(sd_state, fmt->pad);
		fmt->format = *framefmt;
	} else {
		ov9282_fill_pad_format(ov9282, ov9282->cur_mode, ov9282->code,
				       fmt);
	}

	mutex_unlock(&ov9282->mutex);

	return 0;
}

/**
 * ov9282_set_pad_format() - Set subdevice pad format
 * @sd: pointer to ov9282 V4L2 sub-device structure
 * @sd_state: V4L2 sub-device configuration
 * @fmt: V4L2 sub-device format need to be set
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_set_pad_format(struct v4l2_subdev *sd,
				 struct v4l2_subdev_state *sd_state,
				 struct v4l2_subdev_format *fmt)
{
	struct ov9282 *ov9282 = to_ov9282(sd);
	const struct ov9282_mode *mode;
	u32 code;
	int ret = 0;

	mutex_lock(&ov9282->mutex);

	mode = v4l2_find_nearest_size(supported_modes,
				      ARRAY_SIZE(supported_modes),
				      width, height,
				      fmt->format.width,
				      fmt->format.height);
	if (fmt->format.code == MEDIA_BUS_FMT_Y8_1X8)
		code = MEDIA_BUS_FMT_Y8_1X8;
	else
		code = MEDIA_BUS_FMT_Y10_1X10;

	ov9282_fill_pad_format(ov9282, mode, code, fmt);

	if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
		struct v4l2_mbus_framefmt *framefmt;

		framefmt = v4l2_subdev_state_get_format(sd_state, fmt->pad);
		*framefmt = fmt->format;
	} else {
		ret = ov9282_update_controls(ov9282, mode, fmt);
		if (!ret) {
			ov9282->cur_mode = mode;
			ov9282->code = code;
		}
	}

	mutex_unlock(&ov9282->mutex);

	return ret;
}

/**
 * ov9282_init_state() - Initialize sub-device state
 * @sd: pointer to ov9282 V4L2 sub-device structure
 * @sd_state: V4L2 sub-device configuration
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_init_state(struct v4l2_subdev *sd,
			     struct v4l2_subdev_state *sd_state)
{
	struct ov9282 *ov9282 = to_ov9282(sd);
	struct v4l2_subdev_format fmt = { 0 };

	fmt.which = sd_state ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
	ov9282_fill_pad_format(ov9282, &supported_modes[DEFAULT_MODE],
			       ov9282->code, &fmt);

	return ov9282_set_pad_format(sd, sd_state, &fmt);
}

static const struct v4l2_rect *
__ov9282_get_pad_crop(struct ov9282 *ov9282,
		      struct v4l2_subdev_state *sd_state,
		      unsigned int pad, enum v4l2_subdev_format_whence which)
{
	switch (which) {
	case V4L2_SUBDEV_FORMAT_TRY:
		return v4l2_subdev_state_get_crop(sd_state, pad);
	case V4L2_SUBDEV_FORMAT_ACTIVE:
		return &ov9282->cur_mode->crop;
	}

	return NULL;
}

static int ov9282_get_selection(struct v4l2_subdev *sd,
				struct v4l2_subdev_state *sd_state,
				struct v4l2_subdev_selection *sel)
{
	switch (sel->target) {
	case V4L2_SEL_TGT_CROP: {
		struct ov9282 *ov9282 = to_ov9282(sd);

		mutex_lock(&ov9282->mutex);
		sel->r = *__ov9282_get_pad_crop(ov9282, sd_state, sel->pad,
						sel->which);
		mutex_unlock(&ov9282->mutex);

		return 0;
	}

	case V4L2_SEL_TGT_NATIVE_SIZE:
		sel->r.top = 0;
		sel->r.left = 0;
		sel->r.width = OV9282_NATIVE_WIDTH;
		sel->r.height = OV9282_NATIVE_HEIGHT;

		return 0;

	case V4L2_SEL_TGT_CROP_DEFAULT:
	case V4L2_SEL_TGT_CROP_BOUNDS:
		sel->r.top = OV9282_PIXEL_ARRAY_TOP;
		sel->r.left = OV9282_PIXEL_ARRAY_LEFT;
		sel->r.width = OV9282_PIXEL_ARRAY_WIDTH;
		sel->r.height = OV9282_PIXEL_ARRAY_HEIGHT;

		return 0;
	}

	return -EINVAL;
}

/**
 * ov9282_start_streaming() - Start sensor stream
 * @ov9282: pointer to ov9282 device
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_start_streaming(struct ov9282 *ov9282)
{
	const struct ov9282_reg bitdepth_regs[2][2] = {
		{
			{OV9282_REG_PLL_CTRL_0D, OV9282_PLL_CTRL_0D_RAW10},
			{OV9282_REG_ANA_CORE_2, OV9282_ANA_CORE2_RAW10},
		}, {
			{OV9282_REG_PLL_CTRL_0D, OV9282_PLL_CTRL_0D_RAW8},
			{OV9282_REG_ANA_CORE_2, OV9282_ANA_CORE2_RAW8},
		}
	};
	const struct ov9282_reg_list *reg_list;
	int bitdepth_index;
	int ret;

	/* Write common registers */
	ret = ov9282_write_regs(ov9282, common_regs_list.regs,
				common_regs_list.num_of_regs);
	if (ret) {
		dev_err(ov9282->dev, "fail to write common registers");
		return ret;
	}

	bitdepth_index = ov9282->code == MEDIA_BUS_FMT_Y10_1X10 ? 0 : 1;
	ret = ov9282_write_regs(ov9282, bitdepth_regs[bitdepth_index], 2);
	if (ret) {
		dev_err(ov9282->dev, "fail to write bitdepth regs");
		return ret;
	}

	/* Write sensor mode registers */
	reg_list = &ov9282->cur_mode->reg_list;
	ret = ov9282_write_regs(ov9282, reg_list->regs, reg_list->num_of_regs);
	if (ret) {
		dev_err(ov9282->dev, "fail to write initial registers");
		return ret;
	}

	/* Setup handler will write actual exposure and gain */
	ret =  __v4l2_ctrl_handler_setup(ov9282->sd.ctrl_handler);
	if (ret) {
		dev_err(ov9282->dev, "fail to setup handler");
		return ret;
	}

	/* Start streaming */
	ret = ov9282_write_reg(ov9282, OV9282_REG_MODE_SELECT,
			       1, OV9282_MODE_STREAMING);
	if (ret) {
		dev_err(ov9282->dev, "fail to start streaming");
		return ret;
	}

	return 0;
}

/**
 * ov9282_stop_streaming() - Stop sensor stream
 * @ov9282: pointer to ov9282 device
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_stop_streaming(struct ov9282 *ov9282)
{
	return ov9282_write_reg(ov9282, OV9282_REG_MODE_SELECT,
				1, OV9282_MODE_STANDBY);
}

/**
 * ov9282_set_stream() - Enable sensor streaming
 * @sd: pointer to ov9282 subdevice
 * @enable: set to enable sensor streaming
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_set_stream(struct v4l2_subdev *sd, int enable)
{
	struct ov9282 *ov9282 = to_ov9282(sd);
	int ret;

	mutex_lock(&ov9282->mutex);

	if (enable) {
		ret = pm_runtime_resume_and_get(ov9282->dev);
		if (ret)
			goto error_unlock;

		ret = ov9282_start_streaming(ov9282);
		if (ret)
			goto error_power_off;
	} else {
		ov9282_stop_streaming(ov9282);
		pm_runtime_put(ov9282->dev);
	}

	mutex_unlock(&ov9282->mutex);

	return 0;

error_power_off:
	pm_runtime_put(ov9282->dev);
error_unlock:
	mutex_unlock(&ov9282->mutex);

	return ret;
}

/**
 * ov9282_detect() - Detect ov9282 sensor
 * @ov9282: pointer to ov9282 device
 *
 * Return: 0 if successful, -EIO if sensor id does not match
 */
static int ov9282_detect(struct ov9282 *ov9282)
{
	int ret;
	u32 val;

	ret = ov9282_read_reg(ov9282, OV9282_REG_ID, 2, &val);
	if (ret)
		return ret;

	if (val != OV9282_ID) {
		dev_err(ov9282->dev, "chip id mismatch: %x!=%x",
			OV9282_ID, val);
		return -ENXIO;
	}

	return 0;
}

static int ov9282_configure_regulators(struct ov9282 *ov9282)
{
	unsigned int i;

	for (i = 0; i < OV9282_NUM_SUPPLIES; i++)
		ov9282->supplies[i].supply = ov9282_supply_names[i];

	return devm_regulator_bulk_get(ov9282->dev,
				       OV9282_NUM_SUPPLIES,
				       ov9282->supplies);
}

/**
 * ov9282_parse_hw_config() - Parse HW configuration and check if supported
 * @ov9282: pointer to ov9282 device
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_parse_hw_config(struct ov9282 *ov9282)
{
	struct fwnode_handle *fwnode = dev_fwnode(ov9282->dev);
	struct v4l2_fwnode_endpoint bus_cfg = {
		.bus_type = V4L2_MBUS_CSI2_DPHY
	};
	struct fwnode_handle *ep;
	unsigned long rate;
	unsigned int i;
	int ret;

	if (!fwnode)
		return -ENXIO;

	/* Request optional reset pin */
	ov9282->reset_gpio = devm_gpiod_get_optional(ov9282->dev, "reset",
						     GPIOD_OUT_LOW);
	if (IS_ERR(ov9282->reset_gpio)) {
		dev_err(ov9282->dev, "failed to get reset gpio %ld",
			PTR_ERR(ov9282->reset_gpio));
		return PTR_ERR(ov9282->reset_gpio);
	}

	/* Get sensor input clock */
	ov9282->inclk = devm_clk_get(ov9282->dev, NULL);
	if (IS_ERR(ov9282->inclk)) {
		dev_err(ov9282->dev, "could not get inclk");
		return PTR_ERR(ov9282->inclk);
	}

	ret = ov9282_configure_regulators(ov9282);
	if (ret)
		return dev_err_probe(ov9282->dev, ret,
				     "Failed to get power regulators\n");

	rate = clk_get_rate(ov9282->inclk);
	if (rate != OV9282_INCLK_RATE) {
		dev_err(ov9282->dev, "inclk frequency mismatch");
		return -EINVAL;
	}

	ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
	if (!ep)
		return -ENXIO;

	ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
	fwnode_handle_put(ep);
	if (ret)
		return ret;

	ov9282->noncontinuous_clock =
		bus_cfg.bus.mipi_csi2.flags & V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;

	if (bus_cfg.bus.mipi_csi2.num_data_lanes != OV9282_NUM_DATA_LANES) {
		dev_err(ov9282->dev,
			"number of CSI2 data lanes %d is not supported",
			bus_cfg.bus.mipi_csi2.num_data_lanes);
		ret = -EINVAL;
		goto done_endpoint_free;
	}

	if (!bus_cfg.nr_of_link_frequencies) {
		dev_err(ov9282->dev, "no link frequencies defined");
		ret = -EINVAL;
		goto done_endpoint_free;
	}

	for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++)
		if (bus_cfg.link_frequencies[i] == OV9282_LINK_FREQ)
			goto done_endpoint_free;

	ret = -EINVAL;

done_endpoint_free:
	v4l2_fwnode_endpoint_free(&bus_cfg);

	return ret;
}

/* V4l2 subdevice ops */
static const struct v4l2_subdev_core_ops ov9282_core_ops = {
	.subscribe_event = v4l2_ctrl_subdev_subscribe_event,
	.unsubscribe_event = v4l2_event_subdev_unsubscribe,
};

static const struct v4l2_subdev_video_ops ov9282_video_ops = {
	.s_stream = ov9282_set_stream,
};

static const struct v4l2_subdev_pad_ops ov9282_pad_ops = {
	.enum_mbus_code = ov9282_enum_mbus_code,
	.enum_frame_size = ov9282_enum_frame_size,
	.get_fmt = ov9282_get_pad_format,
	.set_fmt = ov9282_set_pad_format,
	.get_selection = ov9282_get_selection,
};

static const struct v4l2_subdev_ops ov9282_subdev_ops = {
	.core = &ov9282_core_ops,
	.video = &ov9282_video_ops,
	.pad = &ov9282_pad_ops,
};

static const struct v4l2_subdev_internal_ops ov9282_internal_ops = {
	.init_state = ov9282_init_state,
};

/**
 * ov9282_power_on() - Sensor power on sequence
 * @dev: pointer to i2c device
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_power_on(struct device *dev)
{
	struct v4l2_subdev *sd = dev_get_drvdata(dev);
	struct ov9282 *ov9282 = to_ov9282(sd);
	int ret;

	ret = regulator_bulk_enable(OV9282_NUM_SUPPLIES, ov9282->supplies);
	if (ret < 0) {
		dev_err(dev, "Failed to enable regulators\n");
		return ret;
	}

	usleep_range(400, 600);

	gpiod_set_value_cansleep(ov9282->reset_gpio, 1);

	ret = clk_prepare_enable(ov9282->inclk);
	if (ret) {
		dev_err(ov9282->dev, "fail to enable inclk");
		goto error_reset;
	}

	usleep_range(400, 600);

	ret = ov9282_write_reg(ov9282, OV9282_REG_MIPI_CTRL00, 1,
			       ov9282->noncontinuous_clock ?
					OV9282_GATED_CLOCK : 0);
	if (ret) {
		dev_err(ov9282->dev, "fail to write MIPI_CTRL00");
		goto error_clk;
	}

	return 0;

error_clk:
	clk_disable_unprepare(ov9282->inclk);
error_reset:
	gpiod_set_value_cansleep(ov9282->reset_gpio, 0);

	regulator_bulk_disable(OV9282_NUM_SUPPLIES, ov9282->supplies);

	return ret;
}

/**
 * ov9282_power_off() - Sensor power off sequence
 * @dev: pointer to i2c device
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_power_off(struct device *dev)
{
	struct v4l2_subdev *sd = dev_get_drvdata(dev);
	struct ov9282 *ov9282 = to_ov9282(sd);

	gpiod_set_value_cansleep(ov9282->reset_gpio, 0);

	clk_disable_unprepare(ov9282->inclk);

	regulator_bulk_disable(OV9282_NUM_SUPPLIES, ov9282->supplies);

	return 0;
}

/**
 * ov9282_init_controls() - Initialize sensor subdevice controls
 * @ov9282: pointer to ov9282 device
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_init_controls(struct ov9282 *ov9282)
{
	struct v4l2_ctrl_handler *ctrl_hdlr = &ov9282->ctrl_handler;
	const struct ov9282_mode *mode = ov9282->cur_mode;
	struct v4l2_fwnode_device_properties props;
	u32 hblank_min;
	u32 lpfr;
	int ret;

	ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10);
	if (ret)
		return ret;

	/* Serialize controls with sensor device */
	ctrl_hdlr->lock = &ov9282->mutex;

	/* Initialize exposure and gain */
	lpfr = mode->vblank + mode->height;
	ov9282->exp_ctrl = v4l2_ctrl_new_std(ctrl_hdlr,
					     &ov9282_ctrl_ops,
					     V4L2_CID_EXPOSURE,
					     OV9282_EXPOSURE_MIN,
					     lpfr - OV9282_EXPOSURE_OFFSET,
					     OV9282_EXPOSURE_STEP,
					     OV9282_EXPOSURE_DEFAULT);

	ov9282->again_ctrl = v4l2_ctrl_new_std(ctrl_hdlr,
					       &ov9282_ctrl_ops,
					       V4L2_CID_ANALOGUE_GAIN,
					       OV9282_AGAIN_MIN,
					       OV9282_AGAIN_MAX,
					       OV9282_AGAIN_STEP,
					       OV9282_AGAIN_DEFAULT);

	v4l2_ctrl_cluster(2, &ov9282->exp_ctrl);

	ov9282->vblank_ctrl = v4l2_ctrl_new_std(ctrl_hdlr,
						&ov9282_ctrl_ops,
						V4L2_CID_VBLANK,
						mode->vblank_min,
						mode->vblank_max,
						1, mode->vblank);

	v4l2_ctrl_new_std(ctrl_hdlr, &ov9282_ctrl_ops, V4L2_CID_VFLIP,
			  0, 1, 1, 1);

	v4l2_ctrl_new_std(ctrl_hdlr, &ov9282_ctrl_ops, V4L2_CID_HFLIP,
			  0, 1, 1, 1);

	/* Read only controls */
	ov9282->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr, &ov9282_ctrl_ops,
					       V4L2_CID_PIXEL_RATE,
					       OV9282_PIXEL_RATE_10BIT,
					       OV9282_PIXEL_RATE_10BIT, 1,
					       OV9282_PIXEL_RATE_10BIT);

	ov9282->link_freq_ctrl = v4l2_ctrl_new_int_menu(ctrl_hdlr,
							&ov9282_ctrl_ops,
							V4L2_CID_LINK_FREQ,
							ARRAY_SIZE(link_freq) -
							1,
							mode->link_freq_idx,
							link_freq);
	if (ov9282->link_freq_ctrl)
		ov9282->link_freq_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;

	hblank_min = mode->hblank_min[ov9282->noncontinuous_clock ? 0 : 1];
	ov9282->hblank_ctrl = v4l2_ctrl_new_std(ctrl_hdlr,
						&ov9282_ctrl_ops,
						V4L2_CID_HBLANK,
						hblank_min,
						OV9282_TIMING_HTS_MAX - mode->width,
						1, hblank_min);

	ret = v4l2_fwnode_device_parse(ov9282->dev, &props);
	if (!ret) {
		/* Failure sets ctrl_hdlr->error, which we check afterwards anyway */
		v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &ov9282_ctrl_ops,
						&props);
	}

	if (ctrl_hdlr->error || ret) {
		dev_err(ov9282->dev, "control init failed: %d",
			ctrl_hdlr->error);
		v4l2_ctrl_handler_free(ctrl_hdlr);
		return ctrl_hdlr->error;
	}

	ov9282->sd.ctrl_handler = ctrl_hdlr;

	return 0;
}

/**
 * ov9282_probe() - I2C client device binding
 * @client: pointer to i2c client device
 *
 * Return: 0 if successful, error code otherwise.
 */
static int ov9282_probe(struct i2c_client *client)
{
	struct ov9282 *ov9282;
	int ret;

	ov9282 = devm_kzalloc(&client->dev, sizeof(*ov9282), GFP_KERNEL);
	if (!ov9282)
		return -ENOMEM;

	ov9282->dev = &client->dev;

	/* Initialize subdev */
	v4l2_i2c_subdev_init(&ov9282->sd, client, &ov9282_subdev_ops);
	ov9282->sd.internal_ops = &ov9282_internal_ops;
	v4l2_i2c_subdev_set_name(&ov9282->sd, client,
				 device_get_match_data(ov9282->dev), NULL);

	ret = ov9282_parse_hw_config(ov9282);
	if (ret) {
		dev_err(ov9282->dev, "HW configuration is not supported");
		return ret;
	}

	mutex_init(&ov9282->mutex);

	ret = ov9282_power_on(ov9282->dev);
	if (ret) {
		dev_err(ov9282->dev, "failed to power-on the sensor");
		goto error_mutex_destroy;
	}

	/* Check module identity */
	ret = ov9282_detect(ov9282);
	if (ret) {
		dev_err(ov9282->dev, "failed to find sensor: %d", ret);
		goto error_power_off;
	}

	/* Set default mode to first mode */
	ov9282->cur_mode = &supported_modes[DEFAULT_MODE];
	ov9282->code = MEDIA_BUS_FMT_Y10_1X10;
	ov9282->vblank = ov9282->cur_mode->vblank;

	ret = ov9282_init_controls(ov9282);
	if (ret) {
		dev_err(ov9282->dev, "failed to init controls: %d", ret);
		goto error_power_off;
	}

	/* Initialize subdev */
	ov9282->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
			    V4L2_SUBDEV_FL_HAS_EVENTS;
	ov9282->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;

	/* Initialize source pad */
	ov9282->pad.flags = MEDIA_PAD_FL_SOURCE;
	ret = media_entity_pads_init(&ov9282->sd.entity, 1, &ov9282->pad);
	if (ret) {
		dev_err(ov9282->dev, "failed to init entity pads: %d", ret);
		goto error_handler_free;
	}

	ret = v4l2_async_register_subdev_sensor(&ov9282->sd);
	if (ret < 0) {
		dev_err(ov9282->dev,
			"failed to register async subdev: %d", ret);
		goto error_media_entity;
	}

	pm_runtime_set_active(ov9282->dev);
	pm_runtime_enable(ov9282->dev);
	pm_runtime_idle(ov9282->dev);

	return 0;

error_media_entity:
	media_entity_cleanup(&ov9282->sd.entity);
error_handler_free:
	v4l2_ctrl_handler_free(ov9282->sd.ctrl_handler);
error_power_off:
	ov9282_power_off(ov9282->dev);
error_mutex_destroy:
	mutex_destroy(&ov9282->mutex);

	return ret;
}

/**
 * ov9282_remove() - I2C client device unbinding
 * @client: pointer to I2C client device
 *
 * Return: 0 if successful, error code otherwise.
 */
static void ov9282_remove(struct i2c_client *client)
{
	struct v4l2_subdev *sd = i2c_get_clientdata(client);
	struct ov9282 *ov9282 = to_ov9282(sd);

	v4l2_async_unregister_subdev(sd);
	media_entity_cleanup(&sd->entity);
	v4l2_ctrl_handler_free(sd->ctrl_handler);

	pm_runtime_disable(&client->dev);
	if (!pm_runtime_status_suspended(&client->dev))
		ov9282_power_off(&client->dev);
	pm_runtime_set_suspended(&client->dev);

	mutex_destroy(&ov9282->mutex);
}

static const struct dev_pm_ops ov9282_pm_ops = {
	SET_RUNTIME_PM_OPS(ov9282_power_off, ov9282_power_on, NULL)
};

static const struct of_device_id ov9282_of_match[] = {
	{ .compatible = "ovti,ov9281", .data = "ov9281" },
	{ .compatible = "ovti,ov9282", .data = "ov9282" },
	{ }
};

MODULE_DEVICE_TABLE(of, ov9282_of_match);

static struct i2c_driver ov9282_driver = {
	.probe = ov9282_probe,
	.remove = ov9282_remove,
	.driver = {
		.name = "ov9282",
		.pm = &ov9282_pm_ops,
		.of_match_table = ov9282_of_match,
	},
};

module_i2c_driver(ov9282_driver);

MODULE_DESCRIPTION("OmniVision ov9282 sensor driver");
MODULE_LICENSE("GPL");
