|
@@ -30,6 +30,7 @@ struct regmap;
|
|
struct regmap_range_cfg;
|
|
struct regmap_range_cfg;
|
|
struct regmap_field;
|
|
struct regmap_field;
|
|
struct snd_ac97;
|
|
struct snd_ac97;
|
|
|
|
+struct sdw_slave;
|
|
|
|
|
|
/* An enum of all the supported cache types */
|
|
/* An enum of all the supported cache types */
|
|
enum regcache_type {
|
|
enum regcache_type {
|
|
@@ -264,6 +265,9 @@ typedef void (*regmap_unlock)(void *);
|
|
* field is NULL but precious_table (see below) is not, the
|
|
* field is NULL but precious_table (see below) is not, the
|
|
* check is performed on such table (a register is precious if
|
|
* check is performed on such table (a register is precious if
|
|
* it belongs to one of the ranges specified by precious_table).
|
|
* it belongs to one of the ranges specified by precious_table).
|
|
|
|
+ * @disable_locking: This regmap is either protected by external means or
|
|
|
|
+ * is guaranteed not be be accessed from multiple threads.
|
|
|
|
+ * Don't use any locking mechanisms.
|
|
* @lock: Optional lock callback (overrides regmap's default lock
|
|
* @lock: Optional lock callback (overrides regmap's default lock
|
|
* function, based on spinlock or mutex).
|
|
* function, based on spinlock or mutex).
|
|
* @unlock: As above for unlocking.
|
|
* @unlock: As above for unlocking.
|
|
@@ -296,7 +300,10 @@ typedef void (*regmap_unlock)(void *);
|
|
* a read.
|
|
* a read.
|
|
* @write_flag_mask: Mask to be set in the top bytes of the register when doing
|
|
* @write_flag_mask: Mask to be set in the top bytes of the register when doing
|
|
* a write. If both read_flag_mask and write_flag_mask are
|
|
* a write. If both read_flag_mask and write_flag_mask are
|
|
- * empty the regmap_bus default masks are used.
|
|
|
|
|
|
+ * empty and zero_flag_mask is not set the regmap_bus default
|
|
|
|
+ * masks are used.
|
|
|
|
+ * @zero_flag_mask: If set, read_flag_mask and write_flag_mask are used even
|
|
|
|
+ * if they are both empty.
|
|
* @use_single_rw: If set, converts the bulk read and write operations into
|
|
* @use_single_rw: If set, converts the bulk read and write operations into
|
|
* a series of single read and write operations. This is useful
|
|
* a series of single read and write operations. This is useful
|
|
* for device that does not support bulk read and write.
|
|
* for device that does not support bulk read and write.
|
|
@@ -317,6 +324,7 @@ typedef void (*regmap_unlock)(void *);
|
|
*
|
|
*
|
|
* @ranges: Array of configuration entries for virtual address ranges.
|
|
* @ranges: Array of configuration entries for virtual address ranges.
|
|
* @num_ranges: Number of range configuration entries.
|
|
* @num_ranges: Number of range configuration entries.
|
|
|
|
+ * @use_hwlock: Indicate if a hardware spinlock should be used.
|
|
* @hwlock_id: Specify the hardware spinlock id.
|
|
* @hwlock_id: Specify the hardware spinlock id.
|
|
* @hwlock_mode: The hardware spinlock mode, should be HWLOCK_IRQSTATE,
|
|
* @hwlock_mode: The hardware spinlock mode, should be HWLOCK_IRQSTATE,
|
|
* HWLOCK_IRQ or 0.
|
|
* HWLOCK_IRQ or 0.
|
|
@@ -333,6 +341,8 @@ struct regmap_config {
|
|
bool (*readable_reg)(struct device *dev, unsigned int reg);
|
|
bool (*readable_reg)(struct device *dev, unsigned int reg);
|
|
bool (*volatile_reg)(struct device *dev, unsigned int reg);
|
|
bool (*volatile_reg)(struct device *dev, unsigned int reg);
|
|
bool (*precious_reg)(struct device *dev, unsigned int reg);
|
|
bool (*precious_reg)(struct device *dev, unsigned int reg);
|
|
|
|
+
|
|
|
|
+ bool disable_locking;
|
|
regmap_lock lock;
|
|
regmap_lock lock;
|
|
regmap_unlock unlock;
|
|
regmap_unlock unlock;
|
|
void *lock_arg;
|
|
void *lock_arg;
|
|
@@ -355,6 +365,7 @@ struct regmap_config {
|
|
|
|
|
|
unsigned long read_flag_mask;
|
|
unsigned long read_flag_mask;
|
|
unsigned long write_flag_mask;
|
|
unsigned long write_flag_mask;
|
|
|
|
+ bool zero_flag_mask;
|
|
|
|
|
|
bool use_single_rw;
|
|
bool use_single_rw;
|
|
bool can_multi_write;
|
|
bool can_multi_write;
|
|
@@ -365,6 +376,7 @@ struct regmap_config {
|
|
const struct regmap_range_cfg *ranges;
|
|
const struct regmap_range_cfg *ranges;
|
|
unsigned int num_ranges;
|
|
unsigned int num_ranges;
|
|
|
|
|
|
|
|
+ bool use_hwlock;
|
|
unsigned int hwlock_id;
|
|
unsigned int hwlock_id;
|
|
unsigned int hwlock_mode;
|
|
unsigned int hwlock_mode;
|
|
};
|
|
};
|
|
@@ -524,6 +536,10 @@ struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97,
|
|
const struct regmap_config *config,
|
|
const struct regmap_config *config,
|
|
struct lock_class_key *lock_key,
|
|
struct lock_class_key *lock_key,
|
|
const char *lock_name);
|
|
const char *lock_name);
|
|
|
|
+struct regmap *__regmap_init_sdw(struct sdw_slave *sdw,
|
|
|
|
+ const struct regmap_config *config,
|
|
|
|
+ struct lock_class_key *lock_key,
|
|
|
|
+ const char *lock_name);
|
|
|
|
|
|
struct regmap *__devm_regmap_init(struct device *dev,
|
|
struct regmap *__devm_regmap_init(struct device *dev,
|
|
const struct regmap_bus *bus,
|
|
const struct regmap_bus *bus,
|
|
@@ -561,6 +577,10 @@ struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97,
|
|
const struct regmap_config *config,
|
|
const struct regmap_config *config,
|
|
struct lock_class_key *lock_key,
|
|
struct lock_class_key *lock_key,
|
|
const char *lock_name);
|
|
const char *lock_name);
|
|
|
|
+struct regmap *__devm_regmap_init_sdw(struct sdw_slave *sdw,
|
|
|
|
+ const struct regmap_config *config,
|
|
|
|
+ struct lock_class_key *lock_key,
|
|
|
|
+ const char *lock_name);
|
|
|
|
|
|
/*
|
|
/*
|
|
* Wrapper for regmap_init macros to include a unique lockdep key and name
|
|
* Wrapper for regmap_init macros to include a unique lockdep key and name
|
|
@@ -709,6 +729,20 @@ int regmap_attach_dev(struct device *dev, struct regmap *map,
|
|
ac97, config)
|
|
ac97, config)
|
|
bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
|
|
bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * regmap_init_sdw() - Initialise register map
|
|
|
|
+ *
|
|
|
|
+ * @sdw: Device that will be interacted with
|
|
|
|
+ * @config: Configuration for register map
|
|
|
|
+ *
|
|
|
|
+ * The return value will be an ERR_PTR() on error or a valid pointer to
|
|
|
|
+ * a struct regmap.
|
|
|
|
+ */
|
|
|
|
+#define regmap_init_sdw(sdw, config) \
|
|
|
|
+ __regmap_lockdep_wrapper(__regmap_init_sdw, #config, \
|
|
|
|
+ sdw, config)
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* devm_regmap_init() - Initialise managed register map
|
|
* devm_regmap_init() - Initialise managed register map
|
|
*
|
|
*
|
|
@@ -839,6 +873,20 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
|
|
__regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \
|
|
__regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \
|
|
ac97, config)
|
|
ac97, config)
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * devm_regmap_init_sdw() - Initialise managed register map
|
|
|
|
+ *
|
|
|
|
+ * @sdw: Device that will be interacted with
|
|
|
|
+ * @config: Configuration for register map
|
|
|
|
+ *
|
|
|
|
+ * The return value will be an ERR_PTR() on error or a valid pointer
|
|
|
|
+ * to a struct regmap. The regmap will be automatically freed by the
|
|
|
|
+ * device management code.
|
|
|
|
+ */
|
|
|
|
+#define devm_regmap_init_sdw(sdw, config) \
|
|
|
|
+ __regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
|
|
|
|
+ sdw, config)
|
|
|
|
+
|
|
void regmap_exit(struct regmap *map);
|
|
void regmap_exit(struct regmap *map);
|
|
int regmap_reinit_cache(struct regmap *map,
|
|
int regmap_reinit_cache(struct regmap *map,
|
|
const struct regmap_config *config);
|
|
const struct regmap_config *config);
|