Skip to content

Commit

Permalink
ASoC: core: Try to use regmap if the driver doesn't set up any I/O
Browse files Browse the repository at this point in the history
Since most new drivers are expected to use regmap and since frequently the
only thing we need to do in the CODEC probe function is configure the I/O
try to initialise the register I/O using regmap if the driver hasn't done
so after probe().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
  • Loading branch information
Mark Brown committed Jul 3, 2012
1 parent 081413f commit 38cbf95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,10 @@ static int soc_probe_codec(struct snd_soc_card *card,
}
}

/* If the driver didn't set I/O up try regmap */
if (!codec->control_data)
snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);

if (driver->controls)
snd_soc_add_codec_controls(codec, driver->controls,
driver->num_controls);
Expand Down

0 comments on commit 38cbf95

Please sign in to comment.