summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tas571x.c
diff options
context:
space:
mode:
authorPetr Kulhavy <petr@barix.com>2016-03-31 18:41:25 +0200
committerMark Brown <broonie@kernel.org>2016-03-31 10:25:38 -0700
commita593ed09040fa611f37953afe455e64c7653160d (patch)
tree9f0743b9896eef94692cbf5ea7662e877421191f /sound/soc/codecs/tas571x.c
parent630e413dc24da0c2373fd7592aeb0e08cea71cd1 (diff)
downloadlinux-stable-a593ed09040fa611f37953afe455e64c7653160d.tar.gz
linux-stable-a593ed09040fa611f37953afe455e64c7653160d.tar.bz2
linux-stable-a593ed09040fa611f37953afe455e64c7653160d.zip
ASoC: tas571x: added missing register literals
The list of TAS571x registers was incomplete. Added the missing register definitions up to the register 0x25. Added volatile and read-only register tables into tas5711_regmap_config and tas5717_regmap_config. The chip has 256 registers in total. But from address 0x29 on (0x26 to 0x28 are reserved) the register width varies between 20, 12 and 8 bytes, which the register map cannot represent. Signed-off-by: Petr Kulhavy <petr@barix.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/tas571x.c')
-rw-r--r--sound/soc/codecs/tas571x.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c
index aafee9bbe01a..ef6c8d9b251a 100644
--- a/sound/soc/codecs/tas571x.c
+++ b/sound/soc/codecs/tas571x.c
@@ -57,6 +57,10 @@ static int tas571x_register_size(struct tas571x_private *priv, unsigned int reg)
case TAS571X_CH1_VOL_REG:
case TAS571X_CH2_VOL_REG:
return priv->chip->vol_reg_size;
+ case TAS571X_INPUT_MUX_REG:
+ case TAS571X_CH4_SRC_SELECT_REG:
+ case TAS571X_PWM_MUX_REG:
+ return 4;
default:
return 1;
}
@@ -259,6 +263,26 @@ static const struct snd_kcontrol_new tas5711_controls[] = {
1, 1),
};
+static const struct regmap_range tas571x_readonly_regs_range[] = {
+ regmap_reg_range(TAS571X_CLK_CTRL_REG, TAS571X_DEV_ID_REG),
+};
+
+static const struct regmap_range tas571x_volatile_regs_range[] = {
+ regmap_reg_range(TAS571X_CLK_CTRL_REG, TAS571X_ERR_STATUS_REG),
+ regmap_reg_range(TAS571X_OSC_TRIM_REG, TAS571X_OSC_TRIM_REG),
+};
+
+static const struct regmap_access_table tas571x_write_regs = {
+ .no_ranges = tas571x_readonly_regs_range,
+ .n_no_ranges = ARRAY_SIZE(tas571x_readonly_regs_range),
+};
+
+static const struct regmap_access_table tas571x_volatile_regs = {
+ .yes_ranges = tas571x_volatile_regs_range,
+ .n_yes_ranges = ARRAY_SIZE(tas571x_volatile_regs_range),
+
+};
+
static const struct reg_default tas5711_reg_defaults[] = {
{ 0x04, 0x05 },
{ 0x05, 0x40 },
@@ -278,6 +302,8 @@ static const struct regmap_config tas5711_regmap_config = {
.reg_defaults = tas5711_reg_defaults,
.num_reg_defaults = ARRAY_SIZE(tas5711_reg_defaults),
.cache_type = REGCACHE_RBTREE,
+ .wr_table = &tas571x_write_regs,
+ .volatile_table = &tas571x_volatile_regs,
};
static const struct tas571x_chip tas5711_chip = {
@@ -332,6 +358,8 @@ static const struct regmap_config tas5717_regmap_config = {
.reg_defaults = tas5717_reg_defaults,
.num_reg_defaults = ARRAY_SIZE(tas5717_reg_defaults),
.cache_type = REGCACHE_RBTREE,
+ .wr_table = &tas571x_write_regs,
+ .volatile_table = &tas571x_volatile_regs,
};
/* This entry is reused for tas5719 as the software interface is identical. */