@@ -182,9 +182,13 @@ static struct reg_default tfa9879_regs[] = {
{ TFA9879_HIGH_PASS_FILTER, 0x0004 }, /* 0x12 */
{ TFA9879_VOLUME_CONTROL, 0x10bd }, /* 0x13 */
{ TFA9879_MISC_CONTROL, 0x0000 }, /* 0x14 */
- { TFA9879_MISC_STATUS, 0x0000 }, /* 0x15, read-only */
};
+static bool tfa9879_volatile_reg(struct device *dev, unsigned int reg)
+{
+ return reg == TFA9879_MISC_STATUS;
+}
+
static const DECLARE_TLV_DB_SCALE(volume_tlv, -7050, 50, 1);
static const DECLARE_TLV_DB_SCALE(tb_gain_tlv, -1800, 200, 0);
static const char * const tb_freq_text[] = {
@@ -240,6 +244,7 @@ static const struct regmap_config tfa9879_regmap = {
.reg_bits = 8,
.val_bits = 16,
+ .volatile_reg = tfa9879_volatile_reg,
.max_register = TFA9879_MISC_STATUS,
.reg_defaults = tfa9879_regs,
.num_reg_defaults = ARRAY_SIZE(tfa9879_regs),
@@ -285,7 +290,7 @@ static int tfa9879_i2c_probe(struct i2c_client *i2c,
return PTR_ERR(tfa9879->regmap);
/* Ensure the device is in reset state */
- for (i = 0; i < ARRAY_SIZE(tfa9879_regs) - 1; i++)
+ for (i = 0; i < ARRAY_SIZE(tfa9879_regs); i++)
regmap_write(tfa9879->regmap,
tfa9879_regs[i].reg, tfa9879_regs[i].def);