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

Commit 77ee09c6 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Allow CODECs to flag invalid registers



This helps CODECs with sparse register maps work better with the
register cache display interface.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent a1daf67d
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -385,6 +385,7 @@ struct snd_soc_codec {
	int (*display_register)(struct snd_soc_codec *, char *,
	int (*display_register)(struct snd_soc_codec *, char *,
				size_t, unsigned int);
				size_t, unsigned int);
	int (*volatile_register)(unsigned int);
	int (*volatile_register)(unsigned int);
	int (*readable_register)(unsigned int);
	hw_write_t hw_write;
	hw_write_t hw_write;
	hw_read_t hw_read;
	hw_read_t hw_read;
	void *reg_cache;
	void *reg_cache;
+3 −0
Original line number Original line Diff line number Diff line
@@ -1156,6 +1156,9 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf)


	count += sprintf(buf, "%s registers\n", codec->name);
	count += sprintf(buf, "%s registers\n", codec->name);
	for (i = 0; i < codec->reg_cache_size; i += step) {
	for (i = 0; i < codec->reg_cache_size; i += step) {
		if (codec->readable_register && !codec->readable_register(i))
			continue;

		count += sprintf(buf + count, "%2x: ", i);
		count += sprintf(buf + count, "%2x: ", i);
		if (count >= PAGE_SIZE - 1)
		if (count >= PAGE_SIZE - 1)
			break;
			break;