Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77d531bf authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'xonar-dg' of git://git.alsa-project.org/alsa-kprivate into for-next

This completes the hardware support for the Asus Xonar DG/DGX cards,
and makes them actually usable.

This is v4 of Roman's patch set with some small formatting changes.
parents cd262518 3f49a66f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
snd-oxygen-lib-objs := oxygen_io.o oxygen_lib.o oxygen_mixer.o oxygen_pcm.o
snd-oxygen-objs := oxygen.o xonar_dg.o
snd-oxygen-objs := oxygen.o xonar_dg_mixer.o xonar_dg.o
snd-virtuoso-objs := virtuoso.o xonar_lib.o \
	xonar_pcm179x.o xonar_cs43xx.o xonar_wm87x6.o xonar_hdmi.o

+5 −2
Original line number Diff line number Diff line
@@ -102,6 +102,9 @@
#define CS4245_ADC_OVFL		0x02
#define CS4245_ADC_UNDRFL	0x01

#define CS4245_SPI_ADDRESS_S	(0x9e << 16)
#define CS4245_SPI_WRITE_S	(0 << 16)

#define CS4245_SPI_ADDRESS	(0x9e << 16)
#define CS4245_SPI_WRITE	(0 << 16)
#define CS4245_SPI_ADDRESS	0x9e
#define CS4245_SPI_WRITE	0
#define CS4245_SPI_READ		1
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ void oxygen_write_ac97(struct oxygen *chip, unsigned int codec,
void oxygen_write_ac97_masked(struct oxygen *chip, unsigned int codec,
			      unsigned int index, u16 data, u16 mask);

void oxygen_write_spi(struct oxygen *chip, u8 control, unsigned int data);
int oxygen_write_spi(struct oxygen *chip, u8 control, unsigned int data);
void oxygen_write_i2c(struct oxygen *chip, u8 device, u8 map, u8 data);

void oxygen_reset_uart(struct oxygen *chip);
+19 −6
Original line number Diff line number Diff line
@@ -194,23 +194,36 @@ void oxygen_write_ac97_masked(struct oxygen *chip, unsigned int codec,
}
EXPORT_SYMBOL(oxygen_write_ac97_masked);

void oxygen_write_spi(struct oxygen *chip, u8 control, unsigned int data)
static int oxygen_wait_spi(struct oxygen *chip)
{
	unsigned int count;

	/* should not need more than 30.72 us (24 * 1.28 us) */
	count = 10;
	while ((oxygen_read8(chip, OXYGEN_SPI_CONTROL) & OXYGEN_SPI_BUSY)
	       && count > 0) {
	/*
	 * Higher timeout to be sure: 200 us;
	 * actual transaction should not need more than 40 us.
	 */
	for (count = 50; count > 0; count--) {
		udelay(4);
		--count;
		if ((oxygen_read8(chip, OXYGEN_SPI_CONTROL) &
						OXYGEN_SPI_BUSY) == 0)
			return 0;
	}
	snd_printk(KERN_ERR "oxygen: SPI wait timeout\n");
	return -EIO;
}

int oxygen_write_spi(struct oxygen *chip, u8 control, unsigned int data)
{
	/*
	 * We need to wait AFTER initiating the SPI transaction,
	 * otherwise read operations will not work.
	 */
	oxygen_write8(chip, OXYGEN_SPI_DATA1, data);
	oxygen_write8(chip, OXYGEN_SPI_DATA2, data >> 8);
	if (control & OXYGEN_SPI_DATA_LENGTH_3)
		oxygen_write8(chip, OXYGEN_SPI_DATA3, data >> 16);
	oxygen_write8(chip, OXYGEN_SPI_CONTROL, control);
	return oxygen_wait_spi(chip);
}
EXPORT_SYMBOL(oxygen_write_spi);

+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ void oxygen_update_dac_routing(struct oxygen *chip)
	if (chip->model.update_center_lfe_mix)
		chip->model.update_center_lfe_mix(chip, chip->dac_routing > 2);
}
EXPORT_SYMBOL(oxygen_update_dac_routing);

static int upmix_put(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value)
{
Loading