#include <linux/acpi.h>
#include <linux/cdev.h>
#include <linux/dmi.h>
#include <linux/firmware.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include "max98390.h"
static struct reg_default max98390_reg_defaults[] = …;
static int max98390_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{ … }
static int max98390_get_bclk_sel(int bclk)
{ … }
static int max98390_set_clock(struct snd_soc_component *component,
struct snd_pcm_hw_params *params)
{ … }
static int max98390_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int max98390_dai_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask,
int slots, int slot_width)
{ … }
static int max98390_dai_set_sysclk(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{ … }
static const struct snd_soc_dai_ops max98390_dai_ops = …;
static int max98390_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const char * const max98390_switch_text[] = …;
static const char * const max98390_boost_voltage_text[] = …;
static SOC_ENUM_SINGLE_DECL(max98390_boost_voltage,
MAX98390_BOOST_CTRL0, 0,
max98390_boost_voltage_text);
static DECLARE_TLV_DB_SCALE(max98390_spk_tlv, 300, 300, 0);
static DECLARE_TLV_DB_SCALE(max98390_digital_tlv, -8000, 50, 0);
static const char * const max98390_current_limit_text[] = …;
static SOC_ENUM_SINGLE_DECL(max98390_current_limit,
MAX98390_BOOST_CTRL1, 0,
max98390_current_limit_text);
static int max98390_ref_rdc_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int max98390_ref_rdc_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int max98390_ambient_temp_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int max98390_ambient_temp_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int max98390_adaptive_rdc_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int max98390_adaptive_rdc_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int max98390_dsm_calib_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int max98390_dsm_calib_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new max98390_snd_controls[] = …;
static const struct soc_enum dai_sel_enum = …;
static const struct snd_kcontrol_new max98390_dai_controls = …;
static const struct snd_soc_dapm_widget max98390_dapm_widgets[] = …;
static const struct snd_soc_dapm_route max98390_audio_map[] = …;
static bool max98390_readable_register(struct device *dev, unsigned int reg)
{
switch (reg) {
case MAX98390_SOFTWARE_RESET ... MAX98390_INT_EN3:
case MAX98390_IRQ_CTRL ... MAX98390_WDOG_CTRL:
case MAX98390_MEAS_ADC_THERM_WARN_THRESH
... MAX98390_BROWNOUT_INFINITE_HOLD:
case MAX98390_BROWNOUT_LVL_HOLD ... DSMIG_DEBUZZER_THRESHOLD:
case DSM_VOL_ENA ... MAX98390_R24FF_REV_ID:
return true;
default:
return false;
}
};
static bool max98390_volatile_reg(struct device *dev, unsigned int reg)
{ … }
#define MAX98390_RATES …
#define MAX98390_FORMATS …
static struct snd_soc_dai_driver max98390_dai[] = …;
static int max98390_dsm_init(struct snd_soc_component *component)
{ … }
static void max98390_init_regs(struct snd_soc_component *component)
{ … }
static int max98390_probe(struct snd_soc_component *component)
{ … }
#ifdef CONFIG_PM_SLEEP
static int max98390_suspend(struct device *dev)
{ … }
static int max98390_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops max98390_pm = …;
static const struct snd_soc_component_driver soc_codec_dev_max98390 = …;
static const struct regmap_config max98390_regmap = …;
static void max98390_slot_config(struct i2c_client *i2c,
struct max98390_priv *max98390)
{ … }
static int max98390_i2c_probe(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id max98390_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, max98390_i2c_id);
#if defined(CONFIG_OF)
static const struct of_device_id max98390_of_match[] = …;
MODULE_DEVICE_TABLE(of, max98390_of_match);
#endif
#ifdef CONFIG_ACPI
static const struct acpi_device_id max98390_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, max98390_acpi_match);
#endif
static struct i2c_driver max98390_i2c_driver = …;
module_i2c_driver(…) …
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;