ASoC: rockchip: pdm: add default regs
authorSugar Zhang <sugar.zhang@rock-chips.com>
Wed, 3 Apr 2019 13:40:47 +0000 (21:40 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 4 Apr 2019 08:04:05 +0000 (15:04 +0700)
This patch add default regs value for controller.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rockchip_pdm.c

index ba61a4b27d3996a965955415df3e946a265705d2..984d99889a65ac03bb9153e37801e7a4e0e4d72e 100644 (file)
@@ -361,11 +361,19 @@ static bool rockchip_pdm_volatile_reg(struct device *dev, unsigned int reg)
        }
 }
 
+static const struct reg_default rockchip_pdm_reg_defaults[] = {
+       {0x04, 0x78000017},
+       {0x08, 0x0bb8ea60},
+       {0x18, 0x0000001f},
+};
+
 static const struct regmap_config rockchip_pdm_regmap_config = {
        .reg_bits = 32,
        .reg_stride = 4,
        .val_bits = 32,
        .max_register = PDM_VERSION,
+       .reg_defaults = rockchip_pdm_reg_defaults,
+       .num_reg_defaults = ARRAY_SIZE(rockchip_pdm_reg_defaults),
        .writeable_reg = rockchip_pdm_wr_reg,
        .readable_reg = rockchip_pdm_rd_reg,
        .volatile_reg = rockchip_pdm_volatile_reg,