Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111024
b: refs/heads/master
c: 4f50d2f
h: refs/heads/master
v: v3
  • Loading branch information
Clemens Ladisch committed Sep 22, 2008
1 parent b5cca7d commit 0549d88
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c2bc4ff58d7aabcf1fc96134200d685d796ae425
refs/heads/master: 4f50d2fd00da451261f51f28e929ebd161068422
21 changes: 19 additions & 2 deletions trunk/sound/pci/oxygen/virtuoso.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ MODULE_DEVICE_TABLE(pci, xonar_ids);
#define GPIO_DX_FRONT_PANEL 0x0002
#define GPIO_DX_INPUT_ROUTE 0x0100

#define I2C_DEVICE_PCM1796(i) (0x98 + ((i) << 1)) /* 10011, ADx=i, /W=0 */
#define I2C_DEVICE_CS4398 0x9e /* 10011, AD1=1, AD0=1, /W=0 */
#define I2C_DEVICE_CS4362A 0x30 /* 001100, AD0=0, /W=0 */

Expand All @@ -142,8 +143,8 @@ struct xonar_data {

static void xonar_gpio_changed(struct oxygen *chip);

static void pcm1796_write(struct oxygen *chip, unsigned int codec,
u8 reg, u8 value)
static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec,
u8 reg, u8 value)
{
/* maps ALSA channel pair number to SPI output */
static const u8 codec_map[4] = {
Expand All @@ -157,6 +158,22 @@ static void pcm1796_write(struct oxygen *chip, unsigned int codec,
(reg << 8) | value);
}

static inline void pcm1796_write_i2c(struct oxygen *chip, unsigned int codec,
u8 reg, u8 value)
{
oxygen_write_i2c(chip, I2C_DEVICE_PCM1796(codec), reg, value);
}

static void pcm1796_write(struct oxygen *chip, unsigned int codec,
u8 reg, u8 value)
{
if ((chip->model.function_flags & OXYGEN_FUNCTION_2WIRE_SPI_MASK) ==
OXYGEN_FUNCTION_SPI)
pcm1796_write_spi(chip, codec, reg, value);
else
pcm1796_write_i2c(chip, codec, reg, value);
}

static void cs4398_write(struct oxygen *chip, u8 reg, u8 value)
{
oxygen_write_i2c(chip, I2C_DEVICE_CS4398, reg, value);
Expand Down

0 comments on commit 0549d88

Please sign in to comment.