linux/sound/soc/codecs/twl6040.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ALSA SoC TWL6040 codec driver
 *
 * Author:	 Misael Lopez Cruz <[email protected]>
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/mfd/twl6040.h>

#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>

#include "twl6040.h"

enum twl6040_dai_id {};

#define TWL6040_RATES
#define TWL6040_FORMATS

#define TWL6040_OUTHS_0dB
#define TWL6040_OUTHS_M30dB
#define TWL6040_OUTHF_0dB
#define TWL6040_OUTHF_M52dB

#define TWL6040_CACHEREGNUM

struct twl6040_jack_data {};

/* codec private data */
struct twl6040_data {};

/* set of rates for each pll: low-power and high-performance */
static const unsigned int lp_rates[] =;

static const unsigned int hp_rates[] =;

static const struct snd_pcm_hw_constraint_list sysclk_constraints[] =;

#define to_twl6040(component)

static unsigned int twl6040_read(struct snd_soc_component *component, unsigned int reg)
{}

static bool twl6040_can_write_to_chip(struct snd_soc_component *component,
				  unsigned int reg)
{}

static inline void twl6040_update_dl12_cache(struct snd_soc_component *component,
					     u8 reg, u8 value)
{}

static int twl6040_write(struct snd_soc_component *component,
			unsigned int reg, unsigned int value)
{}

static void twl6040_init_chip(struct snd_soc_component *component)
{}

/* set headset dac and driver power mode */
static int headset_power_mode(struct snd_soc_component *component, int high_perf)
{}

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

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

static void twl6040_hs_jack_report(struct snd_soc_component *component,
				   struct snd_soc_jack *jack, int report)
{}

void twl6040_hs_jack_detect(struct snd_soc_component *component,
				struct snd_soc_jack *jack, int report)
{}
EXPORT_SYMBOL_GPL();

static void twl6040_accessory_work(struct work_struct *work)
{}

/* audio interrupt handler */
static irqreturn_t twl6040_audio_handler(int irq, void *data)
{}

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

/*
 * MICATT volume control:
 * from -6 to 0 dB in 6 dB steps
 */
static DECLARE_TLV_DB_SCALE(mic_preamp_tlv, -600, 600, 0);

/*
 * MICGAIN volume control:
 * from 6 to 30 dB in 6 dB steps
 */
static DECLARE_TLV_DB_SCALE(mic_amp_tlv, 600, 600, 0);

/*
 * AFMGAIN volume control:
 * from -18 to 24 dB in 6 dB steps
 */
static DECLARE_TLV_DB_SCALE(afm_amp_tlv, -1800, 600, 0);

/*
 * HSGAIN volume control:
 * from -30 to 0 dB in 2 dB steps
 */
static DECLARE_TLV_DB_SCALE(hs_tlv, -3000, 200, 0);

/*
 * HFGAIN volume control:
 * from -52 to 6 dB in 2 dB steps
 */
static DECLARE_TLV_DB_SCALE(hf_tlv, -5200, 200, 0);

/*
 * EPGAIN volume control:
 * from -24 to 6 dB in 2 dB steps
 */
static DECLARE_TLV_DB_SCALE(ep_tlv, -2400, 200, 0);

/* Left analog microphone selection */
static const char *twl6040_amicl_texts[] =;

/* Right analog microphone selection */
static const char *twl6040_amicr_texts[] =;

static const struct soc_enum twl6040_enum[] =;

static const char *twl6040_hs_texts[] =;

static const struct soc_enum twl6040_hs_enum[] =;

static const char *twl6040_hf_texts[] =;

static const struct soc_enum twl6040_hf_enum[] =;

static const char *twl6040_vibrapath_texts[] =;

static const struct soc_enum twl6040_vibra_enum[] =;

static const struct snd_kcontrol_new amicl_control =;

static const struct snd_kcontrol_new amicr_control =;

/* Headset DAC playback switches */
static const struct snd_kcontrol_new hsl_mux_controls =;

static const struct snd_kcontrol_new hsr_mux_controls =;

/* Handsfree DAC playback switches */
static const struct snd_kcontrol_new hfl_mux_controls =;

static const struct snd_kcontrol_new hfr_mux_controls =;

static const struct snd_kcontrol_new ep_path_enable_control =;

static const struct snd_kcontrol_new auxl_switch_control =;

static const struct snd_kcontrol_new auxr_switch_control =;

/* Vibra playback switches */
static const struct snd_kcontrol_new vibral_mux_controls =;

static const struct snd_kcontrol_new vibrar_mux_controls =;

/* Headset power mode */
static const char *twl6040_power_mode_texts[] =;

static SOC_ENUM_SINGLE_EXT_DECL(twl6040_power_mode_enum,
				twl6040_power_mode_texts);

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

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

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

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

int twl6040_get_dl1_gain(struct snd_soc_component *component)
{}
EXPORT_SYMBOL_GPL();

int twl6040_get_clk_id(struct snd_soc_component *component)
{}
EXPORT_SYMBOL_GPL();

int twl6040_get_trim_value(struct snd_soc_component *component, enum twl6040_trim trim)
{}
EXPORT_SYMBOL_GPL();

int twl6040_get_hs_step_size(struct snd_soc_component *component)
{}
EXPORT_SYMBOL_GPL();

static const struct snd_kcontrol_new twl6040_snd_controls[] =;

static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] =;

static const struct snd_soc_dapm_route intercon[] =;

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

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

static int twl6040_hw_params(struct snd_pcm_substream *substream,
			struct snd_pcm_hw_params *params,
			struct snd_soc_dai *dai)
{}

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

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

static void twl6040_mute_path(struct snd_soc_component *component, enum twl6040_dai_id id,
			     int mute)
{}

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

static const struct snd_soc_dai_ops twl6040_dai_ops =;

static struct snd_soc_dai_driver twl6040_dai[] =;

static int twl6040_probe(struct snd_soc_component *component)
{}

static void twl6040_remove(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_component_dev_twl6040 =;

static int twl6040_codec_probe(struct platform_device *pdev)
{}

static struct platform_driver twl6040_codec_driver =;

module_platform_driver();

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