1
2
3
4
5
6
7
8
9
10
11 #ifndef SMIAPP_REGS_H
12 #define SMIAPP_REGS_H
13
14 #include <linux/i2c.h>
15 #include <linux/types.h>
16
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))
20
21
22 #define SMIAPP_REG_FLAG_FLOAT (1 << 24)
23
24 #define SMIAPP_REG_8BIT 1
25 #define SMIAPP_REG_16BIT 2
26 #define SMIAPP_REG_32BIT 4
27
28 struct smiapp_sensor;
29
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);
35
36 #endif