Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5856f97 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull regmap updates from Mark Brown:
 "A very busy release for regmap, all fairly specialist stuff but
  useful:

   - Support for disabling locking from Bartosz Golaszewski, allowing
     users that handle their own locking to save some overhead.

   - Support for hwspinlocks in syscons in MFD from Baolin Wang, this is
     going through the regmap tree since the first users turned up some
     some cases that needed interface tweaks with 0 being used as a
     syscon identifier.

   - Support for devices with no read or write flag from Andrew F.
     Davis.

   - Basic support for devices on SoundWire buses from Vinod Koul"

* tag 'regmap-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  mfd: syscon: Add hardware spinlock support
  regmap: Allow empty read/write_flag_mask
  regcache: flat: Un-inline index lookup from cache access
  regmap: Add SoundWire bus support
  regmap: Add one flag to indicate if a hwlock should be used
  regmap: debugfs: document why we don't create the debugfs entries
  regmap: debugfs: emit a debug message when locking is disabled
  regmap: use proper part of work_buf for storing val
  regmap: potentially duplicate the name string stored in regmap
  regmap: Disable debugfs when locking is disabled
  regmap: rename regmap_lock_unlock_empty() to regmap_lock_unlock_none()
  regmap: allow to disable all locking mechanisms
  regmap: Remove the redundant config to select hwspinlock
parents dc38787a a75de772
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -16,9 +16,17 @@ Required properties:
Optional property:
- reg-io-width: the size (in bytes) of the IO accesses that should be
  performed on the device.
- hwlocks: reference to a phandle of a hardware spinlock provider node.

Examples:
gpr: iomuxc-gpr@20e0000 {
	compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
	reg = <0x020e0000 0x38>;
	hwlocks = <&hwlock1 1>;
};

hwlock1: hwspinlock@40500000 {
	...
	reg = <0x40500000 0x1000>;
	#hwlock-cells = <1>;
};
+3 −3
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
config REGMAP
	default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
	select IRQ_DOMAIN if REGMAP_IRQ
	select REGMAP_HWSPINLOCK if HWSPINLOCK=y
	bool

config REGCACHE_COMPRESSED
@@ -39,5 +38,6 @@ config REGMAP_MMIO
config REGMAP_IRQ
	bool

config REGMAP_HWSPINLOCK
	bool
config REGMAP_SOUNDWIRE
	tristate
	depends on SOUNDWIRE_BUS
+1 −0
Original line number Diff line number Diff line
@@ -13,3 +13,4 @@ obj-$(CONFIG_REGMAP_SPMI) += regmap-spmi.o
obj-$(CONFIG_REGMAP_MMIO) += regmap-mmio.o
obj-$(CONFIG_REGMAP_IRQ) += regmap-irq.o
obj-$(CONFIG_REGMAP_W1) += regmap-w1.o
obj-$(CONFIG_REGMAP_SOUNDWIRE) += regmap-sdw.o
+8 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ struct regmap {
	int async_ret;

#ifdef CONFIG_DEBUG_FS
	bool debugfs_disable;
	struct dentry *debugfs;
	const char *debugfs_name;

@@ -215,10 +216,17 @@ struct regmap_field {
extern void regmap_debugfs_initcall(void);
extern void regmap_debugfs_init(struct regmap *map, const char *name);
extern void regmap_debugfs_exit(struct regmap *map);

static inline void regmap_debugfs_disable(struct regmap *map)
{
	map->debugfs_disable = true;
}

#else
static inline void regmap_debugfs_initcall(void) { }
static inline void regmap_debugfs_init(struct regmap *map, const char *name) { }
static inline void regmap_debugfs_exit(struct regmap *map) { }
static inline void regmap_debugfs_disable(struct regmap *map) { }
#endif

/* regcache core declarations */
+10 −5
Original line number Diff line number Diff line
@@ -37,9 +37,12 @@ static int regcache_flat_init(struct regmap *map)

	cache = map->cache;

	for (i = 0; i < map->num_reg_defaults; i++)
		cache[regcache_flat_get_index(map, map->reg_defaults[i].reg)] =
				map->reg_defaults[i].def;
	for (i = 0; i < map->num_reg_defaults; i++) {
		unsigned int reg = map->reg_defaults[i].reg;
		unsigned int index = regcache_flat_get_index(map, reg);

		cache[index] = map->reg_defaults[i].def;
	}

	return 0;
}
@@ -56,8 +59,9 @@ static int regcache_flat_read(struct regmap *map,
			      unsigned int reg, unsigned int *value)
{
	unsigned int *cache = map->cache;
	unsigned int index = regcache_flat_get_index(map, reg);

	*value = cache[regcache_flat_get_index(map, reg)];
	*value = cache[index];

	return 0;
}
@@ -66,8 +70,9 @@ static int regcache_flat_write(struct regmap *map, unsigned int reg,
			       unsigned int value)
{
	unsigned int *cache = map->cache;
	unsigned int index = regcache_flat_get_index(map, reg);

	cache[regcache_flat_get_index(map, reg)] = value;
	cache[index] = value;

	return 0;
}
Loading