linux/sound/soc/codecs/isabelle.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * isabelle.c - Low power high fidelity audio codec driver
 *
 * Copyright (c) 2012 Texas Instruments, Inc
 *
 * Initially based on sound/soc/codecs/twl6040.c
 */
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/regmap.h>
#include <linux/i2c.h>
#include <linux/slab.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/tlv.h>
#include <sound/jack.h>
#include <sound/initval.h>
#include <asm/div64.h>
#include "isabelle.h"


/* Register default values for ISABELLE driver. */
static const struct reg_default isabelle_reg_defs[] =;

static const char *isabelle_rx1_texts[] =;
static const char *isabelle_rx2_texts[] =;

static const struct soc_enum isabelle_rx1_enum[] =;

static const struct soc_enum isabelle_rx2_enum[] =;

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

static const struct snd_kcontrol_new rx2_mux_controls =;

/* TX input selection */
static const char *isabelle_atx_texts[] =;
static const char *isabelle_vtx_texts[] =;

static const struct soc_enum isabelle_atx_enum[] =;

static const struct soc_enum isabelle_vtx_enum[] =;

static const struct snd_kcontrol_new atx_mux_controls =;

static const struct snd_kcontrol_new vtx_mux_controls =;

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

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

static SOC_ENUM_SINGLE_DECL(isabelle_amic1_enum,
			    ISABELLE_AMIC_CFG_REG, 5,
			    isabelle_amic1_texts);

static SOC_ENUM_SINGLE_DECL(isabelle_amic2_enum,
			    ISABELLE_AMIC_CFG_REG, 4,
			    isabelle_amic2_texts);

static const struct snd_kcontrol_new amic1_control =;

static const struct snd_kcontrol_new amic2_control =;

static const char *isabelle_st_audio_texts[] =;

static const char *isabelle_st_voice_texts[] =;

static const struct soc_enum isabelle_st_audio_enum[] =;

static const struct soc_enum isabelle_st_voice_enum[] =;

static const struct snd_kcontrol_new st_audio_control =;

static const struct snd_kcontrol_new st_voice_control =;

/* Mixer controls */
static const struct snd_kcontrol_new isabelle_hs_left_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_hs_right_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_hf_left_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_hf_right_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_ep_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_aux_left_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_aux_right_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_dpga1_left_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_dpga1_right_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_dpga2_left_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_dpga2_right_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_dpga3_left_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_dpga3_right_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_rx1_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_rx2_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_rx3_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_rx4_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_rx5_mixer_controls[] =;

static const struct snd_kcontrol_new isabelle_rx6_mixer_controls[] =;

static const struct snd_kcontrol_new ep_path_enable_control =;

/* TLV Declarations */
static const DECLARE_TLV_DB_SCALE(mic_amp_tlv, 0, 100, 0);
static const DECLARE_TLV_DB_SCALE(afm_amp_tlv, -3300, 300, 0);
static const DECLARE_TLV_DB_SCALE(dac_tlv, -1200, 200, 0);
static const DECLARE_TLV_DB_SCALE(hf_tlv, -5000, 200, 0);

/* from -63 to 0 dB in 1 dB steps */
static const DECLARE_TLV_DB_SCALE(dpga_tlv, -6300, 100, 1);

/* from -63 to 9 dB in 1 dB steps */
static const DECLARE_TLV_DB_SCALE(rx_tlv, -6300, 100, 1);

static const DECLARE_TLV_DB_SCALE(st_tlv, -2700, 300, 1);
static const DECLARE_TLV_DB_SCALE(tx_tlv, -600, 100, 0);

static const struct snd_kcontrol_new isabelle_snd_controls[] =;

static const struct snd_soc_dapm_widget isabelle_dapm_widgets[] =;

static const struct snd_soc_dapm_route isabelle_intercon[] =;

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

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

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

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

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

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

/* Rates supported by Isabelle driver */
#define ISABELLE_RATES

/* Formates supported by Isabelle driver. */
#define ISABELLE_FORMATS

static const struct snd_soc_dai_ops isabelle_hs_dai_ops =;

static const struct snd_soc_dai_ops isabelle_hf_dai_ops =;

static const struct snd_soc_dai_ops isabelle_line_dai_ops =;

static const struct snd_soc_dai_ops isabelle_ul_dai_ops =;

/* ISABELLE dai structure */
static struct snd_soc_dai_driver isabelle_dai[] =;

static const struct snd_soc_component_driver soc_component_dev_isabelle =;

static const struct regmap_config isabelle_regmap_config =;

static int isabelle_i2c_probe(struct i2c_client *i2c)
{}

static const struct i2c_device_id isabelle_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, isabelle_i2c_id);

static struct i2c_driver isabelle_i2c_driver =;

module_i2c_driver();

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