aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/internal.h
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/internal.h
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/internal.h')
-rw-r--r--drivers/base/regmap/internal.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
new file mode 100644
index 000000000000..7e61504a7ac3
--- /dev/null
+++ b/drivers/base/regmap/internal.h
@@ -0,0 +1,45 @@
1/*
2 * Register map access API internal header
3 *
4 * Copyright 2011 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef _REGMAP_INTERNAL_H
14#define _REGMAP_INTERNAL_H
15
16#include <linux/regmap.h>
17
18struct regmap;
19
20struct regmap_format {
21 size_t buf_size;
22 size_t reg_bytes;
23 size_t val_bytes;
24 void (*format_write)(struct regmap *map,
25 unsigned int reg, unsigned int val);
26 void (*format_reg)(void *buf, unsigned int reg);
27 void (*format_val)(void *buf, unsigned int val);
28 unsigned int (*parse_val)(void *buf);
29};
30
31struct regmap {
32 struct mutex lock;
33
34 struct device *dev; /* Device we do I/O on */
35 void *work_buf; /* Scratch buffer used to format I/O */
36 struct regmap_format format; /* Buffer format */
37 const struct regmap_bus *bus;
38
39 unsigned int max_register;
40 bool (*writeable_reg)(struct device *dev, unsigned int reg);
41 bool (*readable_reg)(struct device *dev, unsigned int reg);
42 bool (*volatile_reg)(struct device *dev, unsigned int reg);
43};
44
45#endif