Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / media / i2c / ccs / ccs-reg-access.h
blob78c43f92d99acf29ee7b2f18d317a773c57fce0b
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * include/media/ccs/ccs-reg-access.h
5 * Generic driver for MIPI CCS/SMIA/SMIA++ compliant camera sensors
7 * Copyright (C) 2020 Intel Corporation
8 * Copyright (C) 2011--2012 Nokia Corporation
9 * Contact: Sakari Ailus <sakari.ailus@linux.intel.com>
12 #ifndef SMIAPP_REGS_H
13 #define SMIAPP_REGS_H
15 #include <linux/i2c.h>
16 #include <linux/types.h>
18 #include "ccs-regs.h"
20 #define CCS_REG_ADDR(reg) ((u16)reg)
22 struct ccs_sensor;
24 int ccs_read_addr_no_quirk(struct ccs_sensor *sensor, u32 reg, u32 *val);
25 int ccs_read_addr(struct ccs_sensor *sensor, u32 reg, u32 *val);
26 int ccs_read_addr_8only(struct ccs_sensor *sensor, u32 reg, u32 *val);
27 int ccs_read_addr_noconv(struct ccs_sensor *sensor, u32 reg, u32 *val);
28 int ccs_write_addr_no_quirk(struct ccs_sensor *sensor, u32 reg, u32 val);
29 int ccs_write_addr(struct ccs_sensor *sensor, u32 reg, u32 val);
30 int ccs_write_data_regs(struct ccs_sensor *sensor, struct ccs_reg *regs,
31 size_t num_regs);
33 unsigned int ccs_reg_width(u32 reg);
34 u32 ccs_reg_conv(struct ccs_sensor *sensor, u32 reg, u32 val);
36 #define ccs_read(sensor, reg_name, val) \
37 ccs_read_addr(sensor, CCS_R_##reg_name, val)
39 #define ccs_write(sensor, reg_name, val) \
40 ccs_write_addr(sensor, CCS_R_##reg_name, val)
42 #endif