diff options
author | Liam Girdwood <lrg@ti.com> | 2011-07-04 06:10:15 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-07-04 15:41:07 -0400 |
commit | f1442bc1e9bd5ff4c2470d66075d066e535a2c86 (patch) | |
tree | 4042a6e01058d504cf8dba8484d32832547c33c3 /sound/soc/soc-core.c | |
parent | 469bb638dc2a6ea87ea56256f25cc964deb3cf2b (diff) |
ASoC: core - Add platform read and write.
In preparation for ASoC Dynamic PCM (AKA DSP) support.
Allow platform driver to perform IO. Intended for platform DAPM.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d49f0ed56f9c..d08abf4e3eb3 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1640,6 +1640,36 @@ int snd_soc_codec_writable_register(struct snd_soc_codec *codec, | |||
1640 | } | 1640 | } |
1641 | EXPORT_SYMBOL_GPL(snd_soc_codec_writable_register); | 1641 | EXPORT_SYMBOL_GPL(snd_soc_codec_writable_register); |
1642 | 1642 | ||
1643 | int snd_soc_platform_read(struct snd_soc_platform *platform, | ||
1644 | unsigned int reg) | ||
1645 | { | ||
1646 | unsigned int ret; | ||
1647 | |||
1648 | if (!platform->driver->read) { | ||
1649 | dev_err(platform->dev, "platform has no read back\n"); | ||
1650 | return -1; | ||
1651 | } | ||
1652 | |||
1653 | ret = platform->driver->read(platform, reg); | ||
1654 | dev_dbg(platform->dev, "read %x => %x\n", reg, ret); | ||
1655 | |||
1656 | return ret; | ||
1657 | } | ||
1658 | EXPORT_SYMBOL_GPL(snd_soc_platform_read); | ||
1659 | |||
1660 | int snd_soc_platform_write(struct snd_soc_platform *platform, | ||
1661 | unsigned int reg, unsigned int val) | ||
1662 | { | ||
1663 | if (!platform->driver->write) { | ||
1664 | dev_err(platform->dev, "platform has no write back\n"); | ||
1665 | return -1; | ||
1666 | } | ||
1667 | |||
1668 | dev_dbg(platform->dev, "write %x = %x\n", reg, val); | ||
1669 | return platform->driver->write(platform, reg, val); | ||
1670 | } | ||
1671 | EXPORT_SYMBOL_GPL(snd_soc_platform_write); | ||
1672 | |||
1643 | /** | 1673 | /** |
1644 | * snd_soc_new_ac97_codec - initailise AC97 device | 1674 | * snd_soc_new_ac97_codec - initailise AC97 device |
1645 | * @codec: audio codec | 1675 | * @codec: audio codec |