summaryrefslogtreecommitdiff
path: root/sound/pci/oxygen/xonar_dg.c
diff options
context:
space:
mode:
authorRoman Volkov <v1ron@mail.ru>2014-01-24 16:18:20 +0400
committerClemens Ladisch <clemens@ladisch.de>2014-01-29 23:45:53 +0400
commit3f49a66f6ceff1c87b49858644771c17763902ab (patch)
tree7f483ae4302e890874e6c9aa32580de330f9828d /sound/pci/oxygen/xonar_dg.c
parentfc114e9fbaf555e2d7fbfe144dac716142e22331 (diff)
downloadlinux-3f49a66f6ceff1c87b49858644771c17763902ab.tar.xz
ALSA: oxygen: Xonar DG(X): cleanup and minor changes
Remove old SPI control functions, change anti-pop init sequence, remove some garbage from structures. The 'Apply' functions must be called at the mixer initialization, otherwise mixer settings sometimes will not be applied at startup. Signed-off-by: Roman Volkov <v1ron@mail.ru> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/pci/oxygen/xonar_dg.c')
-rw-r--r--sound/pci/oxygen/xonar_dg.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/sound/pci/oxygen/xonar_dg.c b/sound/pci/oxygen/xonar_dg.c
index 6cec934e6628..ed6f199f8a38 100644
--- a/sound/pci/oxygen/xonar_dg.c
+++ b/sound/pci/oxygen/xonar_dg.c
@@ -123,29 +123,6 @@ int cs4245_shadow_control(struct oxygen *chip, enum cs4245_shadow_operation op)
return 0;
}
-void cs4245_write(struct oxygen *chip, unsigned int reg, u8 value)
-{
- struct dg *data = chip->model_data;
-
- oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER |
- OXYGEN_SPI_DATA_LENGTH_3 |
- OXYGEN_SPI_CLOCK_1280 |
- (0 << OXYGEN_SPI_CODEC_SHIFT) |
- OXYGEN_SPI_CEN_LATCH_CLOCK_HI,
- CS4245_SPI_ADDRESS_S |
- CS4245_SPI_WRITE_S |
- (reg << 8) | value);
- data->cs4245_shadow[reg] = value;
-}
-
-void cs4245_write_cached(struct oxygen *chip, unsigned int reg, u8 value)
-{
- struct dg *data = chip->model_data;
-
- if (value != data->cs4245_shadow[reg])
- cs4245_write(chip, reg, value);
-}
-
static void cs4245_init(struct oxygen *chip)
{
struct dg *data = chip->model_data;
@@ -171,8 +148,8 @@ static void cs4245_init(struct oxygen *chip)
CS4245_PGA_SOFT | CS4245_PGA_ZERO;
data->cs4245_shadow[CS4245_PGA_B_CTRL] = 0;
data->cs4245_shadow[CS4245_PGA_A_CTRL] = 0;
- data->cs4245_shadow[CS4245_DAC_A_CTRL] = 4;
- data->cs4245_shadow[CS4245_DAC_B_CTRL] = 4;
+ data->cs4245_shadow[CS4245_DAC_A_CTRL] = 8;
+ data->cs4245_shadow[CS4245_DAC_B_CTRL] = 8;
cs4245_shadow_control(chip, CS4245_LOAD_FROM_SHADOW);
snd_component_add(chip->card, "CS4245");
@@ -182,15 +159,14 @@ void dg_init(struct oxygen *chip)
{
struct dg *data = chip->model_data;
- data->output_sel = 0;
- data->input_sel = 3;
- data->hp_vol_att = 2 * 16;
+ data->output_sel = PLAYBACK_DST_HP_FP;
+ data->input_sel = CAPTURE_SRC_MIC;
cs4245_init(chip);
oxygen_write16(chip, OXYGEN_GPIO_CONTROL,
GPIO_OUTPUT_ENABLE | GPIO_HP_REAR | GPIO_INPUT_ROUTE);
- oxygen_write16(chip, OXYGEN_GPIO_DATA, GPIO_INPUT_ROUTE);
- msleep(2500); /* anti-pop delay */
+ /* anti-pop delay, wait some time before enabling the output */
+ msleep(2500);
oxygen_write16(chip, OXYGEN_GPIO_DATA,
GPIO_OUTPUT_ENABLE | GPIO_INPUT_ROUTE);
}