[ALSA] oxygen: reduce SPI clock frequency for AK4396/WM8785
authorClemens Ladisch <clemens@ladisch.de>
Mon, 21 Jan 2008 07:51:19 +0000 (08:51 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 31 Jan 2008 16:30:07 +0000 (17:30 +0100)
According to the datasheets, the SPI clock cycle must be at least 200 ns
for the AK4396 and the WM8785, so we cannot use the default 160 ns.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/pci/oxygen/oxygen.c
sound/pci/oxygen/oxygen_io.c

index 0a7c6135c0726708498cf966c0a934ec79f1b5fb..35b26014925f4a0b38ff2d550b134a1198bf1051 100644 (file)
@@ -166,7 +166,7 @@ static void ak4396_write(struct oxygen *chip, unsigned int codec,
        };
        oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER |
                         OXYGEN_SPI_DATA_LENGTH_2 |
-                        OXYGEN_SPI_CLOCK_160 |
+                        OXYGEN_SPI_CLOCK_320 |
                         (codec_spi_map[codec] << OXYGEN_SPI_CODEC_SHIFT) |
                         OXYGEN_SPI_CEN_LATCH_CLOCK_HI,
                         AK4396_WRITE | (reg << 8) | value);
@@ -176,7 +176,7 @@ static void wm8785_write(struct oxygen *chip, u8 reg, unsigned int value)
 {
        oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER |
                         OXYGEN_SPI_DATA_LENGTH_2 |
-                        OXYGEN_SPI_CLOCK_160 |
+                        OXYGEN_SPI_CLOCK_320 |
                         (3 << OXYGEN_SPI_CODEC_SHIFT) |
                         OXYGEN_SPI_CEN_LATCH_CLOCK_LO,
                         (reg << 9) | value);
index ebafc65dc345a1626bdf75b38366b394ef54b1ee..d0cdce041dd800b589eb1e9a649191c1793a0044 100644 (file)
@@ -174,7 +174,7 @@ void oxygen_write_spi(struct oxygen *chip, u8 control, unsigned int data)
 {
        unsigned int count;
 
-       /* should not need more than 3.84 us (24 * 160 ns) */
+       /* should not need more than 7.68 us (24 * 320 ns) */
        count = 10;
        while ((oxygen_read8(chip, OXYGEN_SPI_CONTROL) & OXYGEN_SPI_BUSY)
               && count > 0) {