diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-07-25 12:40:39 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:57:59 -0400 |
commit | 18b5d32f201462ef7ed3c01773a88b4645128158 (patch) | |
tree | 3c6c631104fee79f581bb0d7b23332c76a0d56d1 /sound/pci/ca0106/ca0106_main.c | |
parent | 485100706b4b397f8072c756839878f634e21f85 (diff) |
[ALSA] ca0106: Add more symbol SPI register names and use them
Add more symbol name for SPI register values. Change the SPI_XXX_BIT defines
from the bit number to a mask. Saves having to write (1<<SPI_XXX_BIT) all the
time to convert to mask. We never end up wanting the bit number.
Use all the symbol names for the SPI DAC init sequence. The sequence is
exactly the same as it was before.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/ca0106/ca0106_main.c')
-rw-r--r-- | sound/pci/ca0106/ca0106_main.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 36b7cdda7c41..252710e4f5c8 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -467,10 +467,10 @@ static const int spi_dacd_reg[] = { | |||
467 | [PCM_UNKNOWN_CHANNEL] = SPI_DACD1_REG, | 467 | [PCM_UNKNOWN_CHANNEL] = SPI_DACD1_REG, |
468 | }; | 468 | }; |
469 | static const int spi_dacd_bit[] = { | 469 | static const int spi_dacd_bit[] = { |
470 | [PCM_FRONT_CHANNEL] = 1<<SPI_DACD4_BIT, | 470 | [PCM_FRONT_CHANNEL] = SPI_DACD4_BIT, |
471 | [PCM_REAR_CHANNEL] = 1<<SPI_DACD0_BIT, | 471 | [PCM_REAR_CHANNEL] = SPI_DACD0_BIT, |
472 | [PCM_CENTER_LFE_CHANNEL]= 1<<SPI_DACD2_BIT, | 472 | [PCM_CENTER_LFE_CHANNEL]= SPI_DACD2_BIT, |
473 | [PCM_UNKNOWN_CHANNEL] = 1<<SPI_DACD1_BIT, | 473 | [PCM_UNKNOWN_CHANNEL] = SPI_DACD1_BIT, |
474 | }; | 474 | }; |
475 | 475 | ||
476 | /* open_playback callback */ | 476 | /* open_playback callback */ |
@@ -1258,28 +1258,29 @@ static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct s | |||
1258 | return 0; | 1258 | return 0; |
1259 | } | 1259 | } |
1260 | 1260 | ||
1261 | #define SPI_REG(reg, value) (((reg) << SPI_REG_SHIFT) | (value)) | ||
1261 | static unsigned int spi_dac_init[] = { | 1262 | static unsigned int spi_dac_init[] = { |
1262 | 0x00ff, | 1263 | SPI_REG(SPI_LDA1_REG, SPI_DA_BIT_0dB), /* 0dB dig. attenuation */ |
1263 | 0x02ff, | 1264 | SPI_REG(SPI_RDA1_REG, SPI_DA_BIT_0dB), |
1264 | 0x0400, | 1265 | SPI_REG(SPI_PL_REG, 0x00), |
1265 | 0x0520, | 1266 | SPI_REG(SPI_PL_REG, SPI_PL_BIT_L_L | SPI_PL_BIT_R_R), |
1266 | 0x0620, /* Set 24 bit. Was 0x0600 */ | 1267 | SPI_REG(SPI_FMT_REG, SPI_FMT_BIT_RJ | SPI_IWL_BIT_24), |
1267 | 0x08ff, | 1268 | SPI_REG(SPI_LDA2_REG, SPI_DA_BIT_0dB), |
1268 | 0x0aff, | 1269 | SPI_REG(SPI_RDA2_REG, SPI_DA_BIT_0dB), |
1269 | 0x0cff, | 1270 | SPI_REG(SPI_LDA3_REG, SPI_DA_BIT_0dB), |
1270 | 0x0eff, | 1271 | SPI_REG(SPI_RDA3_REG, SPI_DA_BIT_0dB), |
1271 | 0x10ff, | 1272 | SPI_REG(SPI_MASTDA_REG, SPI_DA_BIT_0dB), |
1272 | 0x1200, | 1273 | SPI_REG(9, 0x00), |
1273 | 0x1400, | 1274 | SPI_REG(SPI_MS_REG, 0x00), |
1274 | 0x1480, | 1275 | SPI_REG(SPI_MS_REG, SPI_RATE_BIT_256), |
1275 | 0x1800, | 1276 | SPI_REG(12, 0x00), |
1276 | 0x1aff, | 1277 | SPI_REG(SPI_LDA4_REG, SPI_DA_BIT_0dB), |
1277 | 0x1cff, | 1278 | SPI_REG(SPI_RDA4_REG, SPI_DA_BIT_0dB), |
1278 | 0x1e00, | 1279 | SPI_REG(15, 0x00), |
1279 | 0x0530, | 1280 | SPI_REG(SPI_PL_REG, SPI_PL_BIT_L_L | SPI_PL_BIT_R_R | SPI_IZD_BIT), |
1280 | 0x0602, | 1281 | SPI_REG(SPI_FMT_REG, SPI_FMT_BIT_I2S), |
1281 | 0x0622, | 1282 | SPI_REG(SPI_FMT_REG, SPI_FMT_BIT_I2S | SPI_IWL_BIT_24), |
1282 | 0x140e, | 1283 | SPI_REG(SPI_MS_REG, SPI_DACD0_BIT | SPI_DACD1_BIT | SPI_DACD2_BIT), |
1283 | }; | 1284 | }; |
1284 | 1285 | ||
1285 | static unsigned int i2c_adc_init[][2] = { | 1286 | static unsigned int i2c_adc_init[][2] = { |