linux/sound/soc/codecs/ak4671.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * ak4671.c  --  audio driver for AK4671
 *
 * Copyright (C) 2009 Samsung Electronics Co.Ltd
 * Author: Joonyoung Shim <[email protected]>
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <sound/tlv.h>

#include "ak4671.h"


/* ak4671 register cache & default register settings */
static const struct reg_default ak4671_reg_defaults[] =;

/*
 * LOUT1/ROUT1 output volume control:
 * from -24 to 6 dB in 6 dB steps (mute instead of -30 dB)
 */
static DECLARE_TLV_DB_SCALE(out1_tlv, -3000, 600, 1);

/*
 * LOUT2/ROUT2 output volume control:
 * from -33 to 6 dB in 3 dB steps (mute instead of -33 dB)
 */
static DECLARE_TLV_DB_SCALE(out2_tlv, -3300, 300, 1);

/*
 * LOUT3/ROUT3 output volume control:
 * from -6 to 3 dB in 3 dB steps
 */
static DECLARE_TLV_DB_SCALE(out3_tlv, -600, 300, 0);

/*
 * Mic amp gain control:
 * from -15 to 30 dB in 3 dB steps
 * REVISIT: The actual min value(0x01) is -12 dB and the reg value 0x00 is not
 * available
 */
static DECLARE_TLV_DB_SCALE(mic_amp_tlv, -1500, 300, 0);

static const struct snd_kcontrol_new ak4671_snd_controls[] =;

/* event handlers */
static int ak4671_out2_event(struct snd_soc_dapm_widget *w,
		struct snd_kcontrol *kcontrol, int event)
{}

/* Output Mixers */
static const struct snd_kcontrol_new ak4671_lout1_mixer_controls[] =;

static const struct snd_kcontrol_new ak4671_rout1_mixer_controls[] =;

static const struct snd_kcontrol_new ak4671_lout2_mixer_controls[] =;

static const struct snd_kcontrol_new ak4671_rout2_mixer_controls[] =;

static const struct snd_kcontrol_new ak4671_lout3_mixer_controls[] =;

static const struct snd_kcontrol_new ak4671_rout3_mixer_controls[] =;

/* Input MUXs */
static const char *ak4671_lin_mux_texts[] =;
static SOC_ENUM_SINGLE_DECL(ak4671_lin_mux_enum,
			    AK4671_MIC_SIGNAL_SELECT, 0,
			    ak4671_lin_mux_texts);
static const struct snd_kcontrol_new ak4671_lin_mux_control =;

static const char *ak4671_rin_mux_texts[] =;
static SOC_ENUM_SINGLE_DECL(ak4671_rin_mux_enum,
			    AK4671_MIC_SIGNAL_SELECT, 2,
			    ak4671_rin_mux_texts);
static const struct snd_kcontrol_new ak4671_rin_mux_control =;

static const struct snd_soc_dapm_widget ak4671_dapm_widgets[] =;

static const struct snd_soc_dapm_route ak4671_intercon[] =;

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

static int ak4671_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
		unsigned int freq, int dir)
{}

static int ak4671_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{}

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

#define AK4671_RATES

#define AK4671_FORMATS

static const struct snd_soc_dai_ops ak4671_dai_ops =;

static struct snd_soc_dai_driver ak4671_dai =;

static const struct snd_soc_component_driver soc_component_dev_ak4671 =;

static const struct regmap_config ak4671_regmap =;

static int ak4671_i2c_probe(struct i2c_client *client)
{}

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

static struct i2c_driver ak4671_i2c_driver =;

module_i2c_driver();

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