1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * include/media/smiapp/smiapp-regs.h
5 * Generic driver for SMIA/SMIA++ compliant camera modules
7 * Copyright (C) 2011--2012 Nokia Corporation
8 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
14 #include <linux/i2c.h>
15 #include <linux/types.h>
17 #define SMIAPP_REG_ADDR(reg) ((u16)reg)
18 #define SMIAPP_REG_WIDTH(reg) ((u8)(reg >> 16))
19 #define SMIAPP_REG_FLAGS(reg) ((u8)(reg >> 24))
21 /* Use upper 8 bits of the type field for flags */
22 #define SMIAPP_REG_FLAG_FLOAT (1 << 24)
24 #define SMIAPP_REG_8BIT 1
25 #define SMIAPP_REG_16BIT 2
26 #define SMIAPP_REG_32BIT 4
30 int smiapp_read_no_quirk(struct smiapp_sensor
*sensor
, u32 reg
, u32
*val
);
31 int smiapp_read(struct smiapp_sensor
*sensor
, u32 reg
, u32
*val
);
32 int smiapp_read_8only(struct smiapp_sensor
*sensor
, u32 reg
, u32
*val
);
33 int smiapp_write_no_quirk(struct smiapp_sensor
*sensor
, u32 reg
, u32 val
);
34 int smiapp_write(struct smiapp_sensor
*sensor
, u32 reg
, u32 val
);