regmap: Add hardware spinlock support

On some platforms, when reading or writing some special registers through
regmap, we should acquire one hardware spinlock to synchronize between
the multiple subsystems. Thus this patch adds the hardware spinlock
support for regmap.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Baolin Wang
2017-11-01 10:11:55 +08:00
committed by Mark Brown
parent 2bd6bf03f4
commit 8698b93647
3 changed files with 93 additions and 16 deletions

View File

@@ -273,6 +273,9 @@ typedef void (*regmap_unlock)(void *);
*
* @ranges: Array of configuration entries for virtual address ranges.
* @num_ranges: Number of range configuration entries.
* @hwlock_id: Specify the hardware spinlock id.
* @hwlock_mode: The hardware spinlock mode, should be HWLOCK_IRQSTATE,
* HWLOCK_IRQ or 0.
*/
struct regmap_config {
const char *name;
@@ -317,6 +320,9 @@ struct regmap_config {
const struct regmap_range_cfg *ranges;
unsigned int num_ranges;
unsigned int hwlock_id;
unsigned int hwlock_mode;
};
/**