Skip to content

Commit

Permalink
ASoC: cs42l84: Enable regcache (initially)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
  • Loading branch information
povik authored and marcan committed Oct 17, 2022
1 parent 2cc46c3 commit c51c357
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion sound/soc/codecs/cs42l84.c
Expand Up @@ -54,12 +54,35 @@ struct cs42l84_private {
int hs_type;
};

static const struct reg_default cs42l84_reg_defaults[] = {
};

bool cs42l84_volatile_register(struct device *dev, unsigned int reg)
{
switch (reg) {
case CS42L84_DEVID ... CS42L84_DEVID+5:
case CS42L84_TSRS_PLUG_INT_STATUS:
case CS42L84_PLL_LOCK_STATUS:
case CS42L84_TSRS_PLUG_STATUS:
case CS42L84_HS_DET_STATUS2:
return true;
default:
return false;
}
}

static const struct regmap_config cs42l84_regmap = {
.reg_bits = 16,
.val_bits = 8,

.volatile_reg = cs42l84_volatile_register,

.max_register = 0xffff,
.cache_type = REGCACHE_NONE,
/*
.reg_defaults = cs42l84_reg_defaults,
.num_reg_defaults = ARRAY_SIZE(cs42l84_reg_defaults),
*/
.cache_type = REGCACHE_RBTREE,

.use_single_read = true,
.use_single_write = true,
Expand Down

0 comments on commit c51c357

Please sign in to comment.