linux/sound/soc/codecs/ak4458.c

// SPDX-License-Identifier: GPL-2.0
//
// Audio driver for AK4458 DAC
//
// Copyright (C) 2016 Asahi Kasei Microdevices Corporation
// Copyright 2018 NXP

#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <sound/initval.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/tlv.h>

#include "ak4458.h"

#define AK4458_NUM_SUPPLIES
static const char *ak4458_supply_names[AK4458_NUM_SUPPLIES] =;

enum ak4458_type {};

struct ak4458_drvdata {};

/* AK4458 Codec Private Data */
struct ak4458_priv {};

static const struct reg_default ak4458_reg_defaults[] =;

/*
 * Volume control:
 * from -127 to 0 dB in 0.5 dB steps (mute instead of -127.5 dB)
 */
static DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);

/*
 * DEM1 bit DEM0 bit Mode
 * 0 0 44.1kHz
 * 0 1 OFF (default)
 * 1 0 48kHz
 * 1 1 32kHz
 */
static const char * const ak4458_dem_select_texts[] =;

/*
 * SSLOW, SD, SLOW bits Digital Filter Setting
 * 0, 0, 0 : Sharp Roll-Off Filter
 * 0, 0, 1 : Slow Roll-Off Filter
 * 0, 1, 0 : Short delay Sharp Roll-Off Filter
 * 0, 1, 1 : Short delay Slow Roll-Off Filter
 * 1, *, * : Super Slow Roll-Off Filter
 */
static const char * const ak4458_digfil_select_texts[] =;

/*
 * DZFB: Inverting Enable of DZF
 * 0: DZF goes H at Zero Detection
 * 1: DZF goes L at Zero Detection
 */
static const char * const ak4458_dzfb_select_texts[] =;

/*
 * SC1-0 bits: Sound Mode Setting
 * 0 0 : Sound Mode 0
 * 0 1 : Sound Mode 1
 * 1 0 : Sound Mode 2
 * 1 1 : Reserved
 */
static const char * const ak4458_sc_select_texts[] =;

/* FIR2-0 bits: FIR Filter Mode Setting */
static const char * const ak4458_fir_select_texts[] =;

/* ATS1-0 bits Attenuation Speed */
static const char * const ak4458_ats_select_texts[] =;

/* DIF2 bit Audio Interface Format Setting(BICK fs) */
static const char * const ak4458_dif_select_texts[] =;

static const struct soc_enum ak4458_dac1_dem_enum =;
static const struct soc_enum ak4458_dac2_dem_enum =;
static const struct soc_enum ak4458_dac3_dem_enum =;
static const struct soc_enum ak4458_dac4_dem_enum =;
static const struct soc_enum ak4458_digfil_enum =;
static const struct soc_enum ak4458_dzfb_enum =;
static const struct soc_enum ak4458_sm_enum =;
static const struct soc_enum ak4458_fir_enum =;
static const struct soc_enum ak4458_ats_enum =;
static const struct soc_enum ak4458_dif_enum =;

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

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

static const struct snd_kcontrol_new ak4458_snd_controls[] =;

/* ak4458 dapm widgets */
static const struct snd_soc_dapm_widget ak4458_dapm_widgets[] =;

static const struct snd_soc_dapm_route ak4458_intercon[] =;

/* ak4497 controls */
static const struct snd_kcontrol_new ak4497_snd_controls[] =;

/* ak4497 dapm widgets */
static const struct snd_soc_dapm_widget ak4497_dapm_widgets[] =;

/* ak4497 dapm routes */
static const struct snd_soc_dapm_route ak4497_intercon[] =;

static int ak4458_get_tdm_mode(struct ak4458_priv *ak4458)
{}

static int ak4458_rstn_control(struct snd_soc_component *component, int bit)
{}

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

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

static const int att_speed[] =;

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

static int ak4458_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
			       unsigned int rx_mask, int slots, int slot_width)
{}

#define AK4458_FORMATS

static const unsigned int ak4458_rates[] =;

static const struct snd_pcm_hw_constraint_list ak4458_rate_constraints =;

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

static const struct snd_soc_dai_ops ak4458_dai_ops =;

static struct snd_soc_dai_driver ak4458_dai =;

static struct snd_soc_dai_driver ak4497_dai =;

static void ak4458_reset(struct ak4458_priv *ak4458, bool active)
{}

#ifdef CONFIG_PM
static int __maybe_unused ak4458_runtime_suspend(struct device *dev)
{}

static int __maybe_unused ak4458_runtime_resume(struct device *dev)
{}
#endif /* CONFIG_PM */

static const struct snd_soc_component_driver soc_codec_dev_ak4458 =;

static const struct snd_soc_component_driver soc_codec_dev_ak4497 =;

static const struct regmap_config ak4458_regmap =;

static const struct ak4458_drvdata ak4458_drvdata =;

static const struct ak4458_drvdata ak4497_drvdata =;

static const struct dev_pm_ops ak4458_pm =;

static int ak4458_i2c_probe(struct i2c_client *i2c)
{}

static void ak4458_i2c_remove(struct i2c_client *i2c)
{}

static const struct of_device_id ak4458_of_match[] =;
MODULE_DEVICE_TABLE(of, ak4458_of_match);

static struct i2c_driver ak4458_i2c_driver =;

module_i2c_driver();

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