da732x.c (c418a84a8c8f98b1a0f30cd68d0cdf40d77aed01) | da732x.c (a01da00cbccc162a86c78f61ed4ca55dad35440f) |
---|---|
1/* 2 * da732x.c --- Dialog DA732X ALSA SoC Audio Driver 3 * 4 * Copyright (C) 2012 Dialog Semiconductor GmbH 5 * 6 * Author: Michal Hajduk <Michal.Hajduk@diasemi.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 29 unchanged lines hidden (view full) --- 38 39 unsigned int sysclk; 40 bool pll_en; 41}; 42 43/* 44 * da732x register cache - default settings 45 */ | 1/* 2 * da732x.c --- Dialog DA732X ALSA SoC Audio Driver 3 * 4 * Copyright (C) 2012 Dialog Semiconductor GmbH 5 * 6 * Author: Michal Hajduk <Michal.Hajduk@diasemi.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 29 unchanged lines hidden (view full) --- 38 39 unsigned int sysclk; 40 bool pll_en; 41}; 42 43/* 44 * da732x register cache - default settings 45 */ |
46static const struct reg_default da732x_reg_cache[] = { | 46static struct reg_default da732x_reg_cache[] = { |
47 { DA732X_REG_REF1 , 0x02 }, 48 { DA732X_REG_BIAS_EN , 0x80 }, 49 { DA732X_REG_BIAS1 , 0x00 }, 50 { DA732X_REG_BIAS2 , 0x00 }, 51 { DA732X_REG_BIAS3 , 0x00 }, 52 { DA732X_REG_BIAS4 , 0x00 }, 53 { DA732X_REG_MICBIAS2 , 0x00 }, 54 { DA732X_REG_MICBIAS1 , 0x00 }, --- 1136 unchanged lines hidden (view full) --- 1191 return 0; 1192} 1193 1194#define DA732X_RATES SNDRV_PCM_RATE_8000_96000 1195 1196#define DA732X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ 1197 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) 1198 | 47 { DA732X_REG_REF1 , 0x02 }, 48 { DA732X_REG_BIAS_EN , 0x80 }, 49 { DA732X_REG_BIAS1 , 0x00 }, 50 { DA732X_REG_BIAS2 , 0x00 }, 51 { DA732X_REG_BIAS3 , 0x00 }, 52 { DA732X_REG_BIAS4 , 0x00 }, 53 { DA732X_REG_MICBIAS2 , 0x00 }, 54 { DA732X_REG_MICBIAS1 , 0x00 }, --- 1136 unchanged lines hidden (view full) --- 1191 return 0; 1192} 1193 1194#define DA732X_RATES SNDRV_PCM_RATE_8000_96000 1195 1196#define DA732X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ 1197 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) 1198 |
1199static struct snd_soc_dai_ops da732x_dai1_ops = { | 1199static const struct snd_soc_dai_ops da732x_dai_ops = { |
1200 .hw_params = da732x_hw_params, 1201 .set_fmt = da732x_set_dai_fmt, 1202 .set_sysclk = da732x_set_dai_sysclk, 1203}; 1204 | 1200 .hw_params = da732x_hw_params, 1201 .set_fmt = da732x_set_dai_fmt, 1202 .set_sysclk = da732x_set_dai_sysclk, 1203}; 1204 |
1205static struct snd_soc_dai_ops da732x_dai2_ops = { 1206 .hw_params = da732x_hw_params, 1207 .set_fmt = da732x_set_dai_fmt, 1208 .set_sysclk = da732x_set_dai_sysclk, 1209}; 1210 | |
1211static struct snd_soc_dai_driver da732x_dai[] = { 1212 { 1213 .name = "DA732X_AIFA", 1214 .id = DA732X_DAI_ID1, 1215 .base = DA732X_REG_AIFA1, 1216 .playback = { 1217 .stream_name = "AIFA Playback", 1218 .channels_min = 1, 1219 .channels_max = 2, 1220 .rates = DA732X_RATES, 1221 .formats = DA732X_FORMATS, 1222 }, 1223 .capture = { 1224 .stream_name = "AIFA Capture", 1225 .channels_min = 1, 1226 .channels_max = 2, 1227 .rates = DA732X_RATES, 1228 .formats = DA732X_FORMATS, 1229 }, | 1205static struct snd_soc_dai_driver da732x_dai[] = { 1206 { 1207 .name = "DA732X_AIFA", 1208 .id = DA732X_DAI_ID1, 1209 .base = DA732X_REG_AIFA1, 1210 .playback = { 1211 .stream_name = "AIFA Playback", 1212 .channels_min = 1, 1213 .channels_max = 2, 1214 .rates = DA732X_RATES, 1215 .formats = DA732X_FORMATS, 1216 }, 1217 .capture = { 1218 .stream_name = "AIFA Capture", 1219 .channels_min = 1, 1220 .channels_max = 2, 1221 .rates = DA732X_RATES, 1222 .formats = DA732X_FORMATS, 1223 }, |
1230 .ops = &da732x_dai1_ops, | 1224 .ops = &da732x_dai_ops, |
1231 }, 1232 { 1233 .name = "DA732X_AIFB", 1234 .id = DA732X_DAI_ID2, 1235 .base = DA732X_REG_AIFB1, 1236 .playback = { 1237 .stream_name = "AIFB Playback", 1238 .channels_min = 1, 1239 .channels_max = 2, 1240 .rates = DA732X_RATES, 1241 .formats = DA732X_FORMATS, 1242 }, 1243 .capture = { 1244 .stream_name = "AIFB Capture", 1245 .channels_min = 1, 1246 .channels_max = 2, 1247 .rates = DA732X_RATES, 1248 .formats = DA732X_FORMATS, 1249 }, | 1225 }, 1226 { 1227 .name = "DA732X_AIFB", 1228 .id = DA732X_DAI_ID2, 1229 .base = DA732X_REG_AIFB1, 1230 .playback = { 1231 .stream_name = "AIFB Playback", 1232 .channels_min = 1, 1233 .channels_max = 2, 1234 .rates = DA732X_RATES, 1235 .formats = DA732X_FORMATS, 1236 }, 1237 .capture = { 1238 .stream_name = "AIFB Capture", 1239 .channels_min = 1, 1240 .channels_max = 2, 1241 .rates = DA732X_RATES, 1242 .formats = DA732X_FORMATS, 1243 }, |
1250 .ops = &da732x_dai2_ops, | 1244 .ops = &da732x_dai_ops, |
1251 }, 1252}; 1253 1254static bool da732x_volatile(struct device *dev, unsigned int reg) 1255{ 1256 switch (reg) { 1257 case DA732X_REG_HPL_DAC_OFF_CNTL: 1258 case DA732X_REG_HPR_DAC_OFF_CNTL: --- 329 unchanged lines hidden --- | 1245 }, 1246}; 1247 1248static bool da732x_volatile(struct device *dev, unsigned int reg) 1249{ 1250 switch (reg) { 1251 case DA732X_REG_HPL_DAC_OFF_CNTL: 1252 case DA732X_REG_HPR_DAC_OFF_CNTL: --- 329 unchanged lines hidden --- |