linux/sound/soc/codecs/max9860.c

// SPDX-License-Identifier: GPL-2.0
//
// Driver for the MAX9860 Mono Audio Voice Codec
//
// https://datasheets.maximintegrated.com/en/ds/MAX9860.pdf
//
// The driver does not support sidetone since the DVST register field is
// backwards with the mute near the maximum level instead of the minimum.
//
// Author: Peter Rosin <[email protected]>
//         Copyright 2016 Axentia Technologies

#include <linux/init.h>
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/kernel.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/i2c.h>
#include <linux/regulator/consumer.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>

#include "max9860.h"

struct max9860_priv {};

static int max9860_dvddio_event(struct notifier_block *nb,
				unsigned long event, void *data)
{}

static const struct reg_default max9860_reg_defaults[] =;

static bool max9860_readable(struct device *dev, unsigned int reg)
{}

static bool max9860_writeable(struct device *dev, unsigned int reg)
{}

static bool max9860_volatile(struct device *dev, unsigned int reg)
{}

static bool max9860_precious(struct device *dev, unsigned int reg)
{}

static const struct regmap_config max9860_regmap =;

static const DECLARE_TLV_DB_SCALE(dva_tlv, -9100, 100, 1);
static const DECLARE_TLV_DB_SCALE(dvg_tlv, 0, 600, 0);
static const DECLARE_TLV_DB_SCALE(adc_tlv, -1200, 100, 0);
static const DECLARE_TLV_DB_RANGE(pam_tlv,
	0, MAX9860_PAM_MAX - 1,             TLV_DB_SCALE_ITEM(-2000, 2000, 1),
	MAX9860_PAM_MAX, MAX9860_PAM_MAX,   TLV_DB_SCALE_ITEM(3000, 0, 0));
static const DECLARE_TLV_DB_SCALE(pgam_tlv, 0, 100, 0);
static const DECLARE_TLV_DB_SCALE(anth_tlv, -7600, 400, 1);
static const DECLARE_TLV_DB_SCALE(agcth_tlv, -1800, 100, 0);

static const char * const agchld_text[] =;

static SOC_ENUM_SINGLE_DECL(agchld_enum, MAX9860_MICADC,
			    MAX9860_AGCHLD_SHIFT, agchld_text);

static const char * const agcsrc_text[] =;

static SOC_ENUM_SINGLE_DECL(agcsrc_enum, MAX9860_MICADC,
			    MAX9860_AGCSRC_SHIFT, agcsrc_text);

static const char * const agcatk_text[] =;

static SOC_ENUM_SINGLE_DECL(agcatk_enum, MAX9860_MICADC,
			    MAX9860_AGCATK_SHIFT, agcatk_text);

static const char * const agcrls_text[] =;

static SOC_ENUM_SINGLE_DECL(agcrls_enum, MAX9860_MICADC,
			    MAX9860_AGCRLS_SHIFT, agcrls_text);

static const char * const filter_text[] =;

static SOC_ENUM_SINGLE_DECL(avflt_enum, MAX9860_VOICEFLTR,
			    MAX9860_AVFLT_SHIFT, filter_text);

static SOC_ENUM_SINGLE_DECL(dvflt_enum, MAX9860_VOICEFLTR,
			    MAX9860_DVFLT_SHIFT, filter_text);

static const struct snd_kcontrol_new max9860_controls[] =;

static const struct snd_soc_dapm_widget max9860_dapm_widgets[] =;

static const struct snd_soc_dapm_route max9860_dapm_routes[] =;

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

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

static const struct snd_soc_dai_ops max9860_dai_ops =;

static struct snd_soc_dai_driver max9860_dai =;

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

static const struct snd_soc_component_driver max9860_component_driver =;

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

static int max9860_resume(struct device *dev)
{}
#endif

static const struct dev_pm_ops max9860_pm_ops =;

static int max9860_probe(struct i2c_client *i2c)
{}

static void max9860_remove(struct i2c_client *i2c)
{}

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

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

static struct i2c_driver max9860_i2c_driver =;

module_i2c_driver();

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