/*
* SPI 0 -> 1st AK4396 (front)
- * SPI 1 -> 2nd AK4396 (side)
+ * SPI 1 -> 2nd AK4396 (surround)
* SPI 2 -> 3rd AK4396 (center/LFE)
* SPI 3 -> WM8785
- * SPI 4 -> 4th AK4396 (rear)
+ * SPI 4 -> 4th AK4396 (back)
*
* GPIO 0 -> DFS0 of AK5385
* GPIO 1 -> DFS1 of AK5385
{
/* maps ALSA channel pair number to SPI output */
static const u8 codec_spi_map[4] = {
- 0, 4, 2, 1
+ 0, 1, 2, 4
};
oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER_WRITE |
OXYGEN_SPI_DATA_LENGTH_2 |
oxygen_write16(chip, OXYGEN_I2S_C_FORMAT, 0x010a);
oxygen_set_bits32(chip, OXYGEN_SPDIF_CONTROL, OXYGEN_SPDIF_MAGIC2);
oxygen_write32(chip, OXYGEN_SPDIF_OUTPUT_BITS, chip->spdif_bits);
- oxygen_write16(chip, OXYGEN_PLAY_ROUTING, 0x6c00);
+ oxygen_write16(chip, OXYGEN_PLAY_ROUTING, 0xe100);
oxygen_write8(chip, OXYGEN_REC_ROUTING, 0x10);
oxygen_write8(chip, OXYGEN_ADC_MONITOR, 0x00);
oxygen_write8(chip, OXYGEN_A_MONITOR_ROUTING, 0xe4);
static int upmix_info(struct snd_kcontrol *ctl, struct snd_ctl_elem_info *info)
{
static const char *const names[3] = {
- "Front", "Front+Rear", "Front+Rear+Side"
+ "Front", "Front+Surround", "Front+Surround+Back"
};
info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
info->count = 1;
void oxygen_update_dac_routing(struct oxygen *chip)
{
- /*
- * hardware channel order: front, side, center/lfe, rear
- * ALSA channel order: front, rear, center/lfe, side
- */
static const unsigned int reg_values[3] = {
- 0x6c00, 0x2c00, 0x2000
+ 0xe100, /* front <- 0, surround <- 1, center <- 2, back <- 3 */
+ 0xe000, /* front <- 0, surround <- 0, center <- 2, back <- 3 */
+ 0x2000 /* front <- 0, surround <- 0, center <- 2, back <- 0 */
};
+ u8 channels;
unsigned int reg_value;
- if ((oxygen_read8(chip, OXYGEN_PLAY_CHANNELS) &
- OXYGEN_PLAY_CHANNELS_MASK) == OXYGEN_PLAY_CHANNELS_2)
+ channels = oxygen_read8(chip, OXYGEN_PLAY_CHANNELS) &
+ OXYGEN_PLAY_CHANNELS_MASK;
+ if (channels == OXYGEN_PLAY_CHANNELS_2)
reg_value = reg_values[chip->dac_routing];
+ else if (channels == OXYGEN_PLAY_CHANNELS_8)
+ reg_value = 0x6c00; /* surround <- 3, back <- 1 */
else
- reg_value = 0x6c00;
+ reg_value = 0xe100;
oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value, 0xff00);
}
/*
* SPI 0 -> 1st PCM1796 (front)
- * SPI 1 -> 2nd PCM1796 (side)
+ * SPI 1 -> 2nd PCM1796 (surround)
* SPI 2 -> 3rd PCM1796 (center/LFE)
- * SPI 4 -> 4th PCM1796 (rear)
+ * SPI 4 -> 4th PCM1796 (back)
*
* GPIO 2 -> M0 of CS5381
* GPIO 3 -> M1 of CS5381
{
/* maps ALSA channel pair number to SPI output */
static const u8 codec_map[4] = {
- 0, 4, 2, 1
+ 0, 1, 2, 4
};
oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER_WRITE |
OXYGEN_SPI_DATA_LENGTH_2 |