[2/5] regmap: Expose regmap_writeable function to check if a register is writable
Commit Message
Expose the regmap_writeable function for pinctrl-upboard reference.
Signed-off-by: Nicola Lunghi <nicola.lunghi@emutex.com>
Signed-off-by: chengwei <larry.lai@yunjingtech.com>
---
drivers/base/regmap/internal.h | 5 -----
drivers/base/regmap/regmap.c | 5 +++++
include/linux/regmap.h | 6 ++++++
3 files changed, 11 insertions(+), 5 deletions(-)
Comments
On Wed, Oct 19, 2022 at 10:24:47AM +0800, chengwei wrote:
> Expose the regmap_writeable function for pinctrl-upboard reference.
Why? A driver should understand the register map of the device it is
controlling.
@@ -190,11 +190,6 @@ struct regcache_ops {
int (*drop)(struct regmap *map, unsigned int min, unsigned int max);
};
-bool regmap_cached(struct regmap *map, unsigned int reg);
-bool regmap_writeable(struct regmap *map, unsigned int reg);
-bool regmap_readable(struct regmap *map, unsigned int reg);
-bool regmap_volatile(struct regmap *map, unsigned int reg);
-bool regmap_precious(struct regmap *map, unsigned int reg);
bool regmap_writeable_noinc(struct regmap *map, unsigned int reg);
bool regmap_readable_noinc(struct regmap *map, unsigned int reg);
@@ -100,6 +100,7 @@ bool regmap_writeable(struct regmap *map, unsigned int reg)
return true;
}
+EXPORT_SYMBOL_GPL(regmap_writeable);
bool regmap_cached(struct regmap *map, unsigned int reg)
{
@@ -123,6 +124,7 @@ bool regmap_cached(struct regmap *map, unsigned int reg)
return true;
}
+EXPORT_SYMBOL_GPL(regmap_cached);
bool regmap_readable(struct regmap *map, unsigned int reg)
{
@@ -143,6 +145,7 @@ bool regmap_readable(struct regmap *map, unsigned int reg)
return true;
}
+EXPORT_SYMBOL_GPL(regmap_readable);
bool regmap_volatile(struct regmap *map, unsigned int reg)
{
@@ -160,6 +163,7 @@ bool regmap_volatile(struct regmap *map, unsigned int reg)
else
return true;
}
+EXPORT_SYMBOL_GPL(regmap_volatile);
bool regmap_precious(struct regmap *map, unsigned int reg)
{
@@ -174,6 +178,7 @@ bool regmap_precious(struct regmap *map, unsigned int reg)
return false;
}
+EXPORT_SYMBOL_GPL(regmap_precious);
bool regmap_writeable_noinc(struct regmap *map, unsigned int reg)
{
@@ -1225,6 +1225,12 @@ void regcache_mark_dirty(struct regmap *map);
bool regmap_check_range_table(struct regmap *map, unsigned int reg,
const struct regmap_access_table *table);
+bool regmap_cached(struct regmap *map, unsigned int reg);
+bool regmap_writeable(struct regmap *map, unsigned int reg);
+bool regmap_readable(struct regmap *map, unsigned int reg);
+bool regmap_volatile(struct regmap *map, unsigned int reg);
+bool regmap_precious(struct regmap *map, unsigned int reg);
+
int regmap_register_patch(struct regmap *map, const struct reg_sequence *regs,
int num_regs);
int regmap_parse_val(struct regmap *map, const void *buf,