diff options
Diffstat (limited to 'sound/soc/codecs/wm8731.c')
-rw-r--r-- | sound/soc/codecs/wm8731.c | 184 |
1 files changed, 135 insertions, 49 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index cd0ece650f31..03a6bb9b8773 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -85,74 +85,160 @@ static const u16 wm8731_reg[WM8731_CACHEREGNUM] = { static struct snd_soc_dai_mode wm8731_modes[] = { /* codec frame and clock master modes */ /* 8k */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_8000, WM8731_DIR, 0, - 1536, SND_SOC_FSB(64)}, - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_8000, WM8731_DIR, 0, - 2304, SND_SOC_FSB(64)}, - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_8000, WM8731_DIR, 0, - 1408, SND_SOC_FSB(64)}, - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_8000, WM8731_DIR, 0, - 2112, SND_SOC_FSB(64)}, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_8000, + .pcmdir = WM8731_DIR, + .fs = 1536, + .bfs = SND_SOC_FSB(64), + }, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_8000, + .pcmdir = WM8731_DIR, + .fs = 2304, + .bfs = SND_SOC_FSB(64), + }, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_8000, + .pcmdir = WM8731_DIR, + .fs = 1408, + .bfs = SND_SOC_FSB(64), + }, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_8000, + .pcmdir = WM8731_DIR, + .fs = 2112, + .bfs = SND_SOC_FSB(64), + }, /* 32k */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_32000, WM8731_DIR, 0, - 384, SND_SOC_FSB(64)}, - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_32000, WM8731_DIR, 0, - 576, SND_SOC_FSB(64)}, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_32000, + .pcmdir = WM8731_DIR, + .fs = 384, + .bfs = SND_SOC_FSB(64), + }, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_32000, + .pcmdir = WM8731_DIR, + .fs = 576, + .bfs = SND_SOC_FSB(64), + }, /* 44.1k & 48k */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, - WM8731_DIR, 0, 256, SND_SOC_FSB(64)}, - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, - WM8731_DIR, 0, 384, SND_SOC_FSB(64)}, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, + .pcmdir = WM8731_DIR, + .fs = 256, + .bfs = SND_SOC_FSB(64), + }, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, + .pcmdir = WM8731_DIR, + .fs = 384, + .bfs = SND_SOC_FSB(64), + }, /* 88.2 & 96k */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000, - WM8731_DIR, 0, 128, SND_SOC_FSB(64)}, - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000, - WM8731_DIR, 0, 192, SND_SOC_FSB(64)}, - + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000, + .pcmdir = WM8731_DIR, + .fs = 128, + .bfs = SND_SOC_FSB(64), + + }, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000, + .pcmdir = WM8731_DIR, + .fs = 192, + .bfs = SND_SOC_FSB(64), + }, /* USB codec frame and clock master modes */ /* 8k */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_8000, WM8731_DIR, - SND_SOC_DAI_BFS_DIV, 1500, SND_SOC_FSBD(1)}, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_8000, + .pcmdir = WM8731_DIR, + .flags = SND_SOC_DAI_BFS_DIV, + .fs = 1500, + .bfs = SND_SOC_FSBD(1), + }, /* 44.1k */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_44100, WM8731_DIR, - SND_SOC_DAI_BFS_DIV, 272, SND_SOC_FSBD(1)}, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_44100, + .pcmdir = WM8731_DIR, + .flags = SND_SOC_DAI_BFS_DIV, + .fs = 272, + .bfs = SND_SOC_FSBD(1), + }, /* 48k */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_48000, WM8731_DIR, - SND_SOC_DAI_BFS_DIV, 250, SND_SOC_FSBD(1)}, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_48000, + .pcmdir = WM8731_DIR, + .flags = SND_SOC_DAI_BFS_DIV, + .fs = 250, + .bfs = SND_SOC_FSBD(1), + }, /* 88.2k */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_88200, WM8731_DIR, - SND_SOC_DAI_BFS_DIV, 136, SND_SOC_FSBD(1)}, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_88200, + .pcmdir = WM8731_DIR, + .flags = SND_SOC_DAI_BFS_DIV, + .fs = 136, + .bfs = SND_SOC_FSBD(1), + }, /* 96k */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, SNDRV_PCM_RATE_96000, WM8731_DIR, - SND_SOC_DAI_BFS_DIV, 125, SND_SOC_FSBD(1)}, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = SNDRV_PCM_RATE_96000, + .pcmdir = WM8731_DIR, + .flags = SND_SOC_DAI_BFS_DIV, + .fs = 125, + .bfs = SND_SOC_FSBD(1), + }, /* codec frame and clock slave modes */ - {WM8731_DAIFMT | SND_SOC_DAIFMT_CBS_CFS, SND_SOC_DAITDM_LRDW(0,0), - WM8731_HIFI_BITS, WM8731_RATES, WM8731_DIR, SND_SOC_DAI_BFS_DIV, - SND_SOC_FS_ALL, SND_SOC_FSBD_ALL}, + { + .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBS_CFS, + .pcmfmt = WM8731_HIFI_BITS, + .pcmrate = WM8731_RATES, + .pcmdir = WM8731_DIR, + .flags = SND_SOC_DAI_BFS_DIV, + .fs = SND_SOC_FS_ALL, + .bfs = SND_SOC_FSBD_ALL, + }, }; /* |