Deleted Added
full compact
spicds.c (170031) spicds.c (188480)
1/*
2 * Copyright (c) 2006 Konstantin Dimitrov <kosio.dimitrov@gmail.com>
3 * Copyright (c) 2001 Katsurajima Naoto <raven@katsurajima.seya.yokohama.jp>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*
2 * Copyright (c) 2006 Konstantin Dimitrov <kosio.dimitrov@gmail.com>
3 * Copyright (c) 2001 Katsurajima Naoto <raven@katsurajima.seya.yokohama.jp>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/dev/sound/pci/spicds.c 170031 2007-05-27 19:58:39Z joel $
27 * $FreeBSD: head/sys/dev/sound/pci/spicds.c 188480 2009-02-11 10:29:45Z netchild $
28 */
29
30#include <dev/sound/pcm/sound.h>
31
32#include <dev/sound/pci/spicds.h>
33
34MALLOC_DEFINE(M_SPICDS, "spicds", "SPI codec");
35

--- 193 unchanged lines hidden (view full) ---

229 spicds_wrcd(codec, 0x17, 0x022); /* 256fs, slave mode */
230
231 spicds_wrcd(codec, 0x19, 0x000); /* -12dB ADC/L */
232 spicds_wrcd(codec, 0x1a, 0x000); /* -12dB ADC/R */
233 }
234 if (codec->type == SPICDS_TYPE_AK4358)
235 spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */
236 if (codec->type == SPICDS_TYPE_AK4381)
28 */
29
30#include <dev/sound/pcm/sound.h>
31
32#include <dev/sound/pci/spicds.h>
33
34MALLOC_DEFINE(M_SPICDS, "spicds", "SPI codec");
35

--- 193 unchanged lines hidden (view full) ---

229 spicds_wrcd(codec, 0x17, 0x022); /* 256fs, slave mode */
230
231 spicds_wrcd(codec, 0x19, 0x000); /* -12dB ADC/L */
232 spicds_wrcd(codec, 0x1a, 0x000); /* -12dB ADC/R */
233 }
234 if (codec->type == SPICDS_TYPE_AK4358)
235 spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */
236 if (codec->type == SPICDS_TYPE_AK4381)
237 spicds_wrcd(codec, 0x00, 0x0f); /* I2S, 24bit, power-up */
237 spicds_wrcd(codec, 0x00, 0x8f); /* I2S, 24bit, power-up */
238 if (codec->type == SPICDS_TYPE_AK4396)
239 spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */
240 snd_mtxunlock(codec->lock);
241}
242
243void
244spicds_reinit(struct spicds_info *codec)
245{

--- 45 unchanged lines hidden (view full) ---

291 right = 255;
292 else
293 right = 127;
294 else
295 switch (codec->type) {
296 case SPICDS_TYPE_WM8770:
297 right = right + 27;
298 break;
238 if (codec->type == SPICDS_TYPE_AK4396)
239 spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */
240 snd_mtxunlock(codec->lock);
241}
242
243void
244spicds_reinit(struct spicds_info *codec)
245{

--- 45 unchanged lines hidden (view full) ---

291 right = 255;
292 else
293 right = 127;
294 else
295 switch (codec->type) {
296 case SPICDS_TYPE_WM8770:
297 right = right + 27;
298 break;
299 case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396:
299 case SPICDS_TYPE_AK4381:
300 case SPICDS_TYPE_AK4396:
300 right = right * 255 / 100;
301 break;
302 default:
303 right = right * 127 / 100;
304 }
305 if (dir == PCMDIR_REC && codec->type == SPICDS_TYPE_AK4524) {
306#if(0)
307 device_printf(codec->dev, "spicds_set(): AK4524(REC) %d/%d\n", left, right);

--- 53 unchanged lines hidden ---
301 right = right * 255 / 100;
302 break;
303 default:
304 right = right * 127 / 100;
305 }
306 if (dir == PCMDIR_REC && codec->type == SPICDS_TYPE_AK4524) {
307#if(0)
308 device_printf(codec->dev, "spicds_set(): AK4524(REC) %d/%d\n", left, right);

--- 53 unchanged lines hidden ---