2 * Register map access API internal header
4 * Copyright 2011 Wolfson Microelectronics plc
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
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.
13 #ifndef _REGMAP_INTERNAL_H
14 #define _REGMAP_INTERNAL_H
16 #include <linux/regmap.h>
21 struct regmap_format
{
25 void (*format_write
)(struct regmap
*map
,
26 unsigned int reg
, unsigned int val
);
27 void (*format_reg
)(void *buf
, unsigned int reg
);
28 void (*format_val
)(void *buf
, unsigned int val
);
29 unsigned int (*parse_val
)(void *buf
);
35 struct device
*dev
; /* Device we do I/O on */
36 void *work_buf
; /* Scratch buffer used to format I/O */
37 struct regmap_format format
; /* Buffer format */
38 const struct regmap_bus
*bus
;
40 #ifdef CONFIG_DEBUG_FS
41 struct dentry
*debugfs
;
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 bool (*precious_reg
)(struct device
*dev
, unsigned int reg
);
51 bool regmap_writeable(struct regmap
*map
, unsigned int reg
);
52 bool regmap_readable(struct regmap
*map
, unsigned int reg
);
53 bool regmap_volatile(struct regmap
*map
, unsigned int reg
);
54 bool regmap_precious(struct regmap
*map
, unsigned int reg
);
56 #ifdef CONFIG_DEBUG_FS
57 extern void regmap_debugfs_initcall(void);
58 extern void regmap_debugfs_init(struct regmap
*map
);
59 extern void regmap_debugfs_exit(struct regmap
*map
);
61 void regmap_debugfs_initcall(void) { }
62 void regmap_debugfs_init(struct regmap
*map
) { }
63 void regmap_debugfs_exit(struct regmap
*map
) { }