aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regmap.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-07-20 17:35:37 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-08 02:56:50 -0400
commit93de91245b66f20dd387c2745744950a11a5c436 (patch)
tree82601d13bfc2b4c678618bf55be0e05671299338 /drivers/base/regmap/regmap.c
parent73304781274200c341996f65220d36b3cda8e217 (diff)
regmap: Use a local header for API internals
Allowing the implementation to be multi-file. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/regmap.c')
-rw-r--r--drivers/base/regmap/regmap.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index e57f10f485a1..f51efeb091c5 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -15,37 +15,10 @@
15#include <linux/mutex.h> 15#include <linux/mutex.h>
16#include <linux/err.h> 16#include <linux/err.h>
17 17
18#include <linux/regmap.h>
19
20#define CREATE_TRACE_POINTS 18#define CREATE_TRACE_POINTS
21#include <trace/events/regmap.h> 19#include <trace/events/regmap.h>
22 20
23struct regmap; 21#include "internal.h"
24
25struct regmap_format {
26 size_t buf_size;
27 size_t reg_bytes;
28 size_t val_bytes;
29 void (*format_write)(struct regmap *map,
30 unsigned int reg, unsigned int val);
31 void (*format_reg)(void *buf, unsigned int reg);
32 void (*format_val)(void *buf, unsigned int val);
33 unsigned int (*parse_val)(void *buf);
34};
35
36struct regmap {
37 struct mutex lock;
38
39 struct device *dev; /* Device we do I/O on */
40 void *work_buf; /* Scratch buffer used to format I/O */
41 struct regmap_format format; /* Buffer format */
42 const struct regmap_bus *bus;
43
44 unsigned int max_register;
45 bool (*writeable_reg)(struct device *dev, unsigned int reg);
46 bool (*readable_reg)(struct device *dev, unsigned int reg);
47 bool (*volatile_reg)(struct device *dev, unsigned int reg);
48};
49 22
50static void regmap_format_4_12_write(struct regmap *map, 23static void regmap_format_4_12_write(struct regmap *map,
51 unsigned int reg, unsigned int val) 24 unsigned int reg, unsigned int val)