linux/sound/soc/codecs/wm9705.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * wm9705.c  --  ALSA Soc WM9705 codec support
 *
 * Copyright 2008 Ian Molton <[email protected]>
 */

#include <linux/init.h>
#include <linux/slab.h>
#include <linux/mfd/wm97xx.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/regmap.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/ac97/codec.h>
#include <sound/ac97/compat.h>
#include <sound/initval.h>
#include <sound/soc.h>

#define WM9705_VENDOR_ID
#define WM9705_VENDOR_ID_MASK

struct wm9705_priv {};

static const struct reg_default wm9705_reg_defaults[] =;

static const struct regmap_config wm9705_regmap_config =;

static const struct snd_kcontrol_new wm9705_snd_ac97_controls[] =;

static const char *wm9705_mic[] =;
static const char *wm9705_rec_sel[] =;

static SOC_ENUM_SINGLE_DECL(wm9705_enum_mic,
			    AC97_GENERAL_PURPOSE, 8, wm9705_mic);
static SOC_ENUM_SINGLE_DECL(wm9705_enum_rec_l,
			    AC97_REC_SEL, 8, wm9705_rec_sel);
static SOC_ENUM_SINGLE_DECL(wm9705_enum_rec_r,
			    AC97_REC_SEL, 0, wm9705_rec_sel);

/* Headphone Mixer */
static const struct snd_kcontrol_new wm9705_hp_mixer_controls[] =;

/* Mic source */
static const struct snd_kcontrol_new wm9705_mic_src_controls =;

/* Capture source */
static const struct snd_kcontrol_new wm9705_capture_selectl_controls =;
static const struct snd_kcontrol_new wm9705_capture_selectr_controls =;

/* DAPM widgets */
static const struct snd_soc_dapm_widget wm9705_dapm_widgets[] =;

/* Audio map
 * WM9705 has no switches to disable the route from the inputs to the HP mixer
 * so in order to prevent active inputs from forcing the audio outputs to be
 * constantly enabled, we use the mutes on those inputs to simulate such
 * controls.
 */
static const struct snd_soc_dapm_route wm9705_audio_map[] =;

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

#define WM9705_AC97_RATES

static const struct snd_soc_dai_ops wm9705_dai_ops =;

static struct snd_soc_dai_driver wm9705_dai[] =;

#ifdef CONFIG_PM
static int wm9705_soc_suspend(struct snd_soc_component *component)
{}

static int wm9705_soc_resume(struct snd_soc_component *component)
{}
#else
#define wm9705_soc_suspend
#define wm9705_soc_resume
#endif

static int wm9705_soc_probe(struct snd_soc_component *component)
{}

static void wm9705_soc_remove(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_component_dev_wm9705 =;

static int wm9705_probe(struct platform_device *pdev)
{}

static struct platform_driver wm9705_codec_driver =;

module_platform_driver();

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