1 /* SPDX-License-Identifier: GPL-2.0-only */
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>
15 #include <linux/i2c.h>
16 #include <linux/types.h>
20 #define CCS_REG_ADDR(reg) ((u16)reg)
24 int ccs_read_addr(struct ccs_sensor
*sensor
, u32 reg
, u32
*val
);
25 int ccs_read_addr_8only(struct ccs_sensor
*sensor
, u32 reg
, u32
*val
);
26 int ccs_read_addr_noconv(struct ccs_sensor
*sensor
, u32 reg
, u32
*val
);
27 int ccs_write_addr(struct ccs_sensor
*sensor
, u32 reg
, u32 val
);
28 int ccs_write_data_regs(struct ccs_sensor
*sensor
, struct ccs_reg
*regs
,
31 u32
ccs_reg_conv(struct ccs_sensor
*sensor
, u32 reg
, u32 val
);
33 #define ccs_read(sensor, reg_name, val) \
34 ccs_read_addr(sensor, CCS_R_##reg_name, val)
36 #define ccs_write(sensor, reg_name, val) \
37 ccs_write_addr(sensor, CCS_R_##reg_name, val)