Merge branch 'work.regset' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux/fpc-iii.git] / drivers / media / i2c / smiapp / smiapp-regs.h
blob8fda6ed5668c2a5faf273e957ee610b770acfbb7
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
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>
9 */
11 #ifndef SMIAPP_REGS_H
12 #define SMIAPP_REGS_H
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
28 struct smiapp_sensor;
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);
36 #endif