linux/sound/pci/ice1712/psc724.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *   ALSA driver for ICEnsemble VT1724 (Envy24HT)
 *
 *   Lowlevel functions for Philips PSC724 Ultimate Edge
 *
 *	Copyright (c) 2012 Ondrej Zary <[email protected]>
 */

#include <linux/delay.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <sound/core.h>

#include "ice1712.h"
#include "envy24ht.h"
#include "psc724.h"
#include "wm8766.h"
#include "wm8776.h"

struct psc724_spec {};

/****************************************************************************/
/*  PHILIPS PSC724 ULTIMATE EDGE                                            */
/****************************************************************************/
/*
 *  VT1722 (Envy24GT) - 6 outputs, 4 inputs (only 2 used), 24-bit/96kHz
 *
 *  system configuration ICE_EEP2_SYSCONF=0x42
 *    XIN1 49.152MHz
 *    no MPU401
 *    one stereo ADC, no S/PDIF receiver
 *    three stereo DACs (FRONT, REAR, CENTER+LFE)
 *
 *  AC-Link configuration ICE_EEP2_ACLINK=0x80
 *    use I2S, not AC97
 *
 *  I2S converters feature ICE_EEP2_I2S=0x30
 *    I2S codec has no volume/mute control feature (bug!)
 *    I2S codec does not support 96KHz or 192KHz (bug!)
 *    I2S codec 24bits
 *
 *  S/PDIF configuration ICE_EEP2_SPDIF=0xc1
 *    Enable integrated S/PDIF transmitter
 *    internal S/PDIF out implemented
 *    No S/PDIF input
 *    External S/PDIF out implemented
 *
 *
 * ** connected chips **
 *
 *  WM8776
 *     2-channel DAC used for main output and stereo ADC (with 10-channel MUX)
 *     AIN1: LINE IN, AIN2: CD/VIDEO, AIN3: AUX, AIN4: Front MIC, AIN5: Rear MIC
 *     Controlled by I2C using VT1722 I2C interface:
 *          MODE (pin16) -- GND
 *          CE   (pin17) -- GND  I2C mode (address=0x34)
 *          DI   (pin18) -- SDA  (VT1722 pin70)
 *          CL   (pin19) -- SCLK (VT1722 pin71)
 *
 *  WM8766
 *      6-channel DAC used for rear & center/LFE outputs (only 4 channels used)
 *      Controlled by SPI using VT1722 GPIO pins:
 *          MODE   (pin 1) -- GPIO19 (VT1722 pin99)
 *          ML/I2S (pin11) -- GPIO18 (VT1722 pin98)
 *          MC/IWL (pin12) -- GPIO17 (VT1722 pin97)
 *          MD/DM  (pin13) -- GPIO16 (VT1722 pin96)
 *          MUTE   (pin14) -- GPIO20 (VT1722 pin101)
 *
 *  GPIO14 is used as input for headphone jack detection (1 = connected)
 *  GPIO22 is used as MUTE ALL output, grounding all 6 channels
 *
 * ** output pins and device names **
 *
 *   5.1ch name -- output connector color -- device (-D option)
 *
 *      FRONT 2ch                  -- green  -- plughw:0,0
 *      CENTER(Lch) SUBWOOFER(Rch) -- orange -- plughw:0,2,0
 *      REAR 2ch                   -- black  -- plughw:0,2,1
 */

/* codec access low-level functions */

#define GPIO_HP_JACK
#define GPIO_MUTE_SUR
#define GPIO_MUTE_ALL

#define JACK_INTERVAL

#define PSC724_SPI_DELAY

#define PSC724_SPI_DATA
#define PSC724_SPI_CLK
#define PSC724_SPI_LOAD
#define PSC724_SPI_MASK

static void psc724_wm8766_write(struct snd_wm8766 *wm, u16 addr, u16 data)
{}

static void psc724_wm8776_write(struct snd_wm8776 *wm, u8 addr, u8 data)
{}

/* mute all */

static void psc724_set_master_switch(struct snd_ice1712 *ice, bool on)
{}

static bool psc724_get_master_switch(struct snd_ice1712 *ice)
{}

/* jack detection */

static void psc724_set_jack_state(struct snd_ice1712 *ice, bool hp_connected)
{}

static void psc724_update_hp_jack_state(struct work_struct *work)
{}

static void psc724_set_jack_detection(struct snd_ice1712 *ice, bool on)
{}

static bool psc724_get_jack_detection(struct snd_ice1712 *ice)
{}

/* mixer controls */

struct psc724_control {};

static const struct psc724_control psc724_cont[] =;

static int psc724_ctl_get(struct snd_kcontrol *kcontrol,
				  struct snd_ctl_elem_value *ucontrol)
{}

static int psc724_ctl_put(struct snd_kcontrol *kcontrol,
				  struct snd_ctl_elem_value *ucontrol)
{}

static const char *front_volume	=;
static const char *front_switch	=;
static const char *front_zc	=;
static const char *front_izd	=;
static const char *front_phase	=;
static const char *front_deemph	=;
static const char *ain1_switch	=;
static const char *ain2_switch	=;
static const char *ain3_switch	=;
static const char *ain4_switch	=;
static const char *ain5_switch	=;
static const char *rear_volume	=;
static const char *clfe_volume	=;
static const char *rear_switch	=;
static const char *clfe_switch	=;
static const char *rear_phase	=;
static const char *clfe_phase	=;
static const char *rear_deemph	=;
static const char *clfe_deemph	=;
static const char *rear_clfe_izd =;
static const char *rear_clfe_zc	=;

static int psc724_add_controls(struct snd_ice1712 *ice)
{}

static void psc724_set_pro_rate(struct snd_ice1712 *ice, unsigned int rate)
{}

/* power management */

#ifdef CONFIG_PM_SLEEP
static int psc724_resume(struct snd_ice1712 *ice)
{}
#endif

/* init */

static int psc724_init(struct snd_ice1712 *ice)
{}

static void psc724_exit(struct snd_ice1712 *ice)
{}

/* PSC724 has buggy EEPROM (no 96&192kHz, all FFh GPIOs), so override it here */
static const unsigned char psc724_eeprom[] =;

struct snd_ice1712_card_info snd_vt1724_psc724_cards[] =;