linux/sound/soc/codecs/stac9766.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * stac9766.c  --  ALSA SoC STAC9766 codec support
 *
 * Copyright 2009 Jon Smirl, Digispeaker
 * Author: Jon Smirl <[email protected]>
 *
 *  Features:-
 *
 *   o Support for AC97 Codec, S/PDIF
 */

#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/regmap.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/initval.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>

#define STAC9766_VENDOR_ID
#define STAC9766_VENDOR_ID_MASK

#define AC97_STAC_DA_CONTROL
#define AC97_STAC_ANALOG_SPECIAL
#define AC97_STAC_STEREO_MIC

static const struct reg_default stac9766_reg_defaults[] =;

static const struct regmap_config stac9766_regmap_config =;

static const char *stac9766_record_mux[] =;
static const char *stac9766_mono_mux[] =;
static const char *stac9766_mic_mux[] =;
static const char *stac9766_SPDIF_mux[] =;
static const char *stac9766_popbypass_mux[] =;
static const char *stac9766_record_all_mux[] =;
static const char *stac9766_boost1[] =;
static const char *stac9766_boost2[] =;
static const char *stac9766_stereo_mic[] =;

static SOC_ENUM_DOUBLE_DECL(stac9766_record_enum,
			    AC97_REC_SEL, 8, 0, stac9766_record_mux);
static SOC_ENUM_SINGLE_DECL(stac9766_mono_enum,
			    AC97_GENERAL_PURPOSE, 9, stac9766_mono_mux);
static SOC_ENUM_SINGLE_DECL(stac9766_mic_enum,
			    AC97_GENERAL_PURPOSE, 8, stac9766_mic_mux);
static SOC_ENUM_SINGLE_DECL(stac9766_SPDIF_enum,
			    AC97_STAC_DA_CONTROL, 1, stac9766_SPDIF_mux);
static SOC_ENUM_SINGLE_DECL(stac9766_popbypass_enum,
			    AC97_GENERAL_PURPOSE, 15, stac9766_popbypass_mux);
static SOC_ENUM_SINGLE_DECL(stac9766_record_all_enum,
			    AC97_STAC_ANALOG_SPECIAL, 12,
			    stac9766_record_all_mux);
static SOC_ENUM_SINGLE_DECL(stac9766_boost1_enum,
			    AC97_MIC, 6, stac9766_boost1); /* 0/10dB */
static SOC_ENUM_SINGLE_DECL(stac9766_boost2_enum,
			    AC97_STAC_ANALOG_SPECIAL, 2, stac9766_boost2); /* 0/20dB */
static SOC_ENUM_SINGLE_DECL(stac9766_stereo_mic_enum,
			    AC97_STAC_STEREO_MIC, 2, stac9766_stereo_mic);

static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(master_tlv, -4650, 150, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(record_tlv,     0, 150, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(beep_tlv,   -4500, 300, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(mix_tlv,    -3450, 150, 0);

static const struct snd_kcontrol_new stac9766_snd_ac97_controls[] =;

static int ac97_analog_prepare(struct snd_pcm_substream *substream,
			       struct snd_soc_dai *dai)
{}

static int ac97_digital_prepare(struct snd_pcm_substream *substream,
				struct snd_soc_dai *dai)
{}

static int stac9766_set_bias_level(struct snd_soc_component *component,
				   enum snd_soc_bias_level level)
{}

static int stac9766_component_resume(struct snd_soc_component *component)
{}

static const struct snd_soc_dai_ops stac9766_dai_ops_analog =;

static const struct snd_soc_dai_ops stac9766_dai_ops_digital =;

static struct snd_soc_dai_driver stac9766_dai[] =;

static int stac9766_component_probe(struct snd_soc_component *component)
{}

static void stac9766_component_remove(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_component_dev_stac9766 =;

static int stac9766_probe(struct platform_device *pdev)
{}

static struct platform_driver stac9766_codec_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();