linux/sound/soc/codecs/wm8350.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * wm8350.c -- WM8350 ALSA SoC audio driver
 *
 * Copyright (C) 2007-12 Wolfson Microelectronics PLC.
 *
 * Author: Liam Girdwood <[email protected]>
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/platform_device.h>
#include <linux/mfd/wm8350/audio.h>
#include <linux/mfd/wm8350/core.h>
#include <linux/regulator/consumer.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <trace/events/asoc.h>

#include "wm8350.h"

#define WM8350_OUTn_0dB

#define WM8350_RAMP_NONE
#define WM8350_RAMP_UP
#define WM8350_RAMP_DOWN

/* We only include the analogue supplies here; the digital supplies
 * need to be available well before this driver can be probed.
 */
static const char *supply_names[] =;

struct wm8350_output {};

struct wm8350_jack_data {};

struct wm8350_data {};

/*
 * Ramp OUT1 PGA volume to minimise pops at stream startup and shutdown.
 */
static inline int wm8350_out1_ramp_step(struct wm8350_data *wm8350_data)
{}

/*
 * Ramp OUT2 PGA volume to minimise pops at stream startup and shutdown.
 */
static inline int wm8350_out2_ramp_step(struct wm8350_data *wm8350_data)
{}

/*
 * This work ramps both output PGAs at stream start/stop time to
 * minimise pop associated with DAPM power switching.
 * It's best to enable Zero Cross when ramping occurs to minimise any
 * zipper noises.
 */
static void wm8350_pga_work(struct work_struct *work)
{}

/*
 * WM8350 Controls
 */

static int pga_event(struct snd_soc_dapm_widget *w,
		     struct snd_kcontrol *kcontrol, int event)
{}

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

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

static const char *wm8350_deemp[] =;
static const char *wm8350_pol[] =;
static const char *wm8350_dacmutem[] =;
static const char *wm8350_dacmutes[] =;
static const char *wm8350_adcfilter[] =;
static const char *wm8350_adchp[] =;
static const char *wm8350_lr[] =;

static const struct soc_enum wm8350_enum[] =;

static DECLARE_TLV_DB_SCALE(pre_amp_tlv, -1200, 3525, 0);
static DECLARE_TLV_DB_SCALE(out_pga_tlv, -5700, 600, 0);
static DECLARE_TLV_DB_SCALE(dac_pcm_tlv, -7163, 36, 1);
static DECLARE_TLV_DB_SCALE(adc_pcm_tlv, -12700, 50, 1);
static DECLARE_TLV_DB_SCALE(out_mix_tlv, -1500, 300, 1);

static const DECLARE_TLV_DB_RANGE(capture_sd_tlv,
	0, 12, TLV_DB_SCALE_ITEM(-3600, 300, 1),
	13, 15, TLV_DB_SCALE_ITEM(0, 0, 0)
);

static const struct snd_kcontrol_new wm8350_snd_controls[] =;

/*
 * DAPM Controls
 */

/* Left Playback Mixer */
static const struct snd_kcontrol_new wm8350_left_play_mixer_controls[] =;

/* Right Playback Mixer */
static const struct snd_kcontrol_new wm8350_right_play_mixer_controls[] =;

/* Out4 Mixer */
static const struct snd_kcontrol_new wm8350_out4_mixer_controls[] =;

/* Out3 Mixer */
static const struct snd_kcontrol_new wm8350_out3_mixer_controls[] =;

/* Left Input Mixer */
static const struct snd_kcontrol_new wm8350_left_capt_mixer_controls[] =;

/* Right Input Mixer */
static const struct snd_kcontrol_new wm8350_right_capt_mixer_controls[] =;

/* Left Mic Mixer */
static const struct snd_kcontrol_new wm8350_left_mic_mixer_controls[] =;

/* Right Mic Mixer */
static const struct snd_kcontrol_new wm8350_right_mic_mixer_controls[] =;

/* Beep Switch */
static const struct snd_kcontrol_new wm8350_beep_switch_controls =;

/* Out4 Capture Mux */
static const struct snd_kcontrol_new wm8350_out4_capture_controls =;

static const struct snd_soc_dapm_widget wm8350_dapm_widgets[] =;

static const struct snd_soc_dapm_route wm8350_dapm_routes[] =;

static int wm8350_set_dai_sysclk(struct snd_soc_dai *codec_dai,
				 int clk_id, unsigned int freq, int dir)
{}

static int wm8350_set_clkdiv(struct snd_soc_dai *codec_dai, int div_id, int div)
{}

static int wm8350_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{}

static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream,
				struct snd_pcm_hw_params *params,
				struct snd_soc_dai *codec_dai)
{}

static int wm8350_mute(struct snd_soc_dai *dai, int mute, int direction)
{}

/* FLL divisors */
struct _fll_div {};

/* The size in bits of the fll divide multiplied by 10
 * to allow rounding later */
#define FIXED_FLL_SIZE

static inline int fll_factors(struct _fll_div *fll_div, unsigned int input,
			      unsigned int output)
{}

static int wm8350_set_fll(struct snd_soc_dai *codec_dai,
			  int pll_id, int source, unsigned int freq_in,
			  unsigned int freq_out)
{}

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

static void wm8350_hp_work(struct wm8350_data *priv,
			   struct wm8350_jack_data *jack,
			   u16 mask)
{}

static void wm8350_hpl_work(struct work_struct *work)
{}

static void wm8350_hpr_work(struct work_struct *work)
{}

static irqreturn_t wm8350_hpl_jack_handler(int irq, void *data)
{}

static irqreturn_t wm8350_hpr_jack_handler(int irq, void *data)
{}

/**
 * wm8350_hp_jack_detect - Enable headphone jack detection.
 *
 * @component:  WM8350 component
 * @which:  left or right jack detect signal
 * @jack:   jack to report detection events on
 * @report: value to report
 *
 * Enables the headphone jack detection of the WM8350.  If no report
 * is specified then detection is disabled.
 */
int wm8350_hp_jack_detect(struct snd_soc_component *component, enum wm8350_jack which,
			  struct snd_soc_jack *jack, int report)
{}
EXPORT_SYMBOL_GPL();

static irqreturn_t wm8350_mic_handler(int irq, void *data)
{}

/**
 * wm8350_mic_jack_detect - Enable microphone jack detection.
 *
 * @component:         WM8350 component
 * @jack:          jack to report detection events on
 * @detect_report: value to report when presence detected
 * @short_report:  value to report when microphone short detected
 *
 * Enables the microphone jack detection of the WM8350.  If both reports
 * are specified as zero then detection is disabled.
 */
int wm8350_mic_jack_detect(struct snd_soc_component *component,
			   struct snd_soc_jack *jack,
			   int detect_report, int short_report)
{}
EXPORT_SYMBOL_GPL();

#define WM8350_RATES

#define WM8350_FORMATS

static const struct snd_soc_dai_ops wm8350_dai_ops =;

static struct snd_soc_dai_driver wm8350_dai =;

static  int wm8350_component_probe(struct snd_soc_component *component)
{}

static void wm8350_component_remove(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_component_dev_wm8350 =;

static int wm8350_probe(struct platform_device *pdev)
{}

static struct platform_driver wm8350_codec_driver =;

module_platform_driver();

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