linux/sound/pci/oxygen/xonar_cs43xx.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * card driver for models with CS4398/CS4362A DACs (Xonar D1/DX)
 *
 * Copyright (c) Clemens Ladisch <[email protected]>
 */

/*
 * Xonar D1/DX
 * -----------
 *
 * CMI8788:
 *
 *   I²C <-> CS4398 (addr 1001111) (front)
 *       <-> CS4362A (addr 0011000) (surround, center/LFE, back)
 *
 *   GPI 0 <- external power present (DX only)
 *
 *   GPIO 0 -> enable output to speakers
 *   GPIO 1 -> route output to front panel
 *   GPIO 2 -> M0 of CS5361
 *   GPIO 3 -> M1 of CS5361
 *   GPIO 6 -> ?
 *   GPIO 7 -> ?
 *   GPIO 8 -> route input jack to line-in (0) or mic-in (1)
 *
 * CM9780:
 *
 *   LINE_OUT -> input of ADC
 *
 *   AUX_IN  <- aux
 *   MIC_IN  <- mic
 *   FMIC_IN <- front mic
 *
 *   GPO 0 -> route line-in (0) or AC97 output (1) to CS5361 input
 */

#include <linux/pci.h>
#include <linux/delay.h>
#include <sound/ac97_codec.h>
#include <sound/control.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>
#include "xonar.h"
#include "cm9780.h"
#include "cs4398.h"
#include "cs4362a.h"

#define GPI_EXT_POWER
#define GPIO_D1_OUTPUT_ENABLE
#define GPIO_D1_FRONT_PANEL
#define GPIO_D1_MAGIC
#define GPIO_D1_INPUT_ROUTE

#define I2C_DEVICE_CS4398
#define I2C_DEVICE_CS4362A

struct xonar_cs43xx {};

static void cs4398_write(struct oxygen *chip, u8 reg, u8 value)
{}

static void cs4398_write_cached(struct oxygen *chip, u8 reg, u8 value)
{}

static void cs4362a_write(struct oxygen *chip, u8 reg, u8 value)
{}

static void cs4362a_write_cached(struct oxygen *chip, u8 reg, u8 value)
{}

static void cs43xx_registers_init(struct oxygen *chip)
{}

static void xonar_d1_init(struct oxygen *chip)
{}

static void xonar_dx_init(struct oxygen *chip)
{}

static void xonar_d1_cleanup(struct oxygen *chip)
{}

static void xonar_d1_suspend(struct oxygen *chip)
{}

static void xonar_d1_resume(struct oxygen *chip)
{}

static void set_cs43xx_params(struct oxygen *chip,
			      struct snd_pcm_hw_params *params)
{}

static void update_cs4362a_volumes(struct oxygen *chip)
{}

static void update_cs43xx_volume(struct oxygen *chip)
{}

static void update_cs43xx_mute(struct oxygen *chip)
{}

static void update_cs43xx_center_lfe_mix(struct oxygen *chip, bool mixed)
{}

static const struct snd_kcontrol_new front_panel_switch =;

static int rolloff_info(struct snd_kcontrol *ctl,
			struct snd_ctl_elem_info *info)
{}

static int rolloff_get(struct snd_kcontrol *ctl,
		       struct snd_ctl_elem_value *value)
{}

static int rolloff_put(struct snd_kcontrol *ctl,
		       struct snd_ctl_elem_value *value)
{}

static const struct snd_kcontrol_new rolloff_control =;

static void xonar_d1_line_mic_ac97_switch(struct oxygen *chip,
					  unsigned int reg, unsigned int mute)
{}

static const DECLARE_TLV_DB_SCALE(cs4362a_db_scale, -6000, 100, 0);

static int xonar_d1_mixer_init(struct oxygen *chip)
{}

static void dump_cs4362a_registers(struct xonar_cs43xx *data,
				   struct snd_info_buffer *buffer)
{}

static void dump_d1_registers(struct oxygen *chip,
			      struct snd_info_buffer *buffer)
{}

static const struct oxygen_model model_xonar_d1 =;

int get_xonar_cs43xx_model(struct oxygen *chip,
			   const struct pci_device_id *id)
{}