aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5631.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/rt5631.c')
-rw-r--r--sound/soc/codecs/rt5631.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c
index 1ba27db660a6..6d7b7ca7d530 100644
--- a/sound/soc/codecs/rt5631.c
+++ b/sound/soc/codecs/rt5631.c
@@ -1612,29 +1612,6 @@ static int rt5631_probe(struct snd_soc_codec *codec)
1612 return 0; 1612 return 0;
1613} 1613}
1614 1614
1615static int rt5631_remove(struct snd_soc_codec *codec)
1616{
1617 rt5631_set_bias_level(codec, SND_SOC_BIAS_OFF);
1618 return 0;
1619}
1620
1621#ifdef CONFIG_PM
1622static int rt5631_suspend(struct snd_soc_codec *codec)
1623{
1624 rt5631_set_bias_level(codec, SND_SOC_BIAS_OFF);
1625 return 0;
1626}
1627
1628static int rt5631_resume(struct snd_soc_codec *codec)
1629{
1630 rt5631_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1631 return 0;
1632}
1633#else
1634#define rt5631_suspend NULL
1635#define rt5631_resume NULL
1636#endif
1637
1638#define RT5631_STEREO_RATES SNDRV_PCM_RATE_8000_96000 1615#define RT5631_STEREO_RATES SNDRV_PCM_RATE_8000_96000
1639#define RT5631_FORMAT (SNDRV_PCM_FMTBIT_S16_LE | \ 1616#define RT5631_FORMAT (SNDRV_PCM_FMTBIT_S16_LE | \
1640 SNDRV_PCM_FMTBIT_S20_3LE | \ 1617 SNDRV_PCM_FMTBIT_S20_3LE | \
@@ -1672,10 +1649,8 @@ static struct snd_soc_dai_driver rt5631_dai[] = {
1672 1649
1673static struct snd_soc_codec_driver soc_codec_dev_rt5631 = { 1650static struct snd_soc_codec_driver soc_codec_dev_rt5631 = {
1674 .probe = rt5631_probe, 1651 .probe = rt5631_probe,
1675 .remove = rt5631_remove,
1676 .suspend = rt5631_suspend,
1677 .resume = rt5631_resume,
1678 .set_bias_level = rt5631_set_bias_level, 1652 .set_bias_level = rt5631_set_bias_level,
1653 .suspend_bias_off = true,
1679 .controls = rt5631_snd_controls, 1654 .controls = rt5631_snd_controls,
1680 .num_controls = ARRAY_SIZE(rt5631_snd_controls), 1655 .num_controls = ARRAY_SIZE(rt5631_snd_controls),
1681 .dapm_widgets = rt5631_dapm_widgets, 1656 .dapm_widgets = rt5631_dapm_widgets,
@@ -1686,10 +1661,20 @@ static struct snd_soc_codec_driver soc_codec_dev_rt5631 = {
1686 1661
1687static const struct i2c_device_id rt5631_i2c_id[] = { 1662static const struct i2c_device_id rt5631_i2c_id[] = {
1688 { "rt5631", 0 }, 1663 { "rt5631", 0 },
1664 { "alc5631", 0 },
1689 { } 1665 { }
1690}; 1666};
1691MODULE_DEVICE_TABLE(i2c, rt5631_i2c_id); 1667MODULE_DEVICE_TABLE(i2c, rt5631_i2c_id);
1692 1668
1669#ifdef CONFIG_OF
1670static struct of_device_id rt5631_i2c_dt_ids[] = {
1671 { .compatible = "realtek,rt5631"},
1672 { .compatible = "realtek,alc5631"},
1673 { }
1674};
1675MODULE_DEVICE_TABLE(of, rt5631_i2c_dt_ids);
1676#endif
1677
1693static const struct regmap_config rt5631_regmap_config = { 1678static const struct regmap_config rt5631_regmap_config = {
1694 .reg_bits = 8, 1679 .reg_bits = 8,
1695 .val_bits = 16, 1680 .val_bits = 16,
@@ -1734,6 +1719,7 @@ static struct i2c_driver rt5631_i2c_driver = {
1734 .driver = { 1719 .driver = {
1735 .name = "rt5631", 1720 .name = "rt5631",
1736 .owner = THIS_MODULE, 1721 .owner = THIS_MODULE,
1722 .of_match_table = of_match_ptr(rt5631_i2c_dt_ids),
1737 }, 1723 },
1738 .probe = rt5631_i2c_probe, 1724 .probe = rt5631_i2c_probe,
1739 .remove = rt5631_i2c_remove, 1725 .remove = rt5631_i2c_remove,