#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/pm_runtime.h>
#include <linux/soundwire/sdw_registers.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>
#include "rt712-sdca.h"
#include "rt712-sdca-dmic.h"
static bool rt712_sdca_dmic_readable_register(struct device *dev, unsigned int reg)
{ … }
static bool rt712_sdca_dmic_volatile_register(struct device *dev, unsigned int reg)
{ … }
static bool rt712_sdca_dmic_mbq_readable_register(struct device *dev, unsigned int reg)
{ … }
static bool rt712_sdca_dmic_mbq_volatile_register(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config rt712_sdca_dmic_regmap = …;
static const struct regmap_config rt712_sdca_dmic_mbq_regmap = …;
static int rt712_sdca_dmic_index_write(struct rt712_sdca_dmic_priv *rt712,
unsigned int nid, unsigned int reg, unsigned int value)
{ … }
static int rt712_sdca_dmic_index_read(struct rt712_sdca_dmic_priv *rt712,
unsigned int nid, unsigned int reg, unsigned int *value)
{ … }
static int rt712_sdca_dmic_index_update_bits(struct rt712_sdca_dmic_priv *rt712,
unsigned int nid, unsigned int reg, unsigned int mask, unsigned int val)
{ … }
static int rt712_sdca_dmic_io_init(struct device *dev, struct sdw_slave *slave)
{ … }
static int rt712_sdca_dmic_set_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt712_sdca_dmic_set_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt712_sdca_set_fu1e_capture_ctl(struct rt712_sdca_dmic_priv *rt712)
{ … }
static int rt712_sdca_dmic_fu1e_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt712_sdca_dmic_fu1e_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt712_sdca_fu_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
#define RT712_SDCA_PR_VALUE(xreg_base, xcount, xmax, xinvert) …
#define RT712_SDCA_FU_CTRL(xname, reg_base, xmax, xinvert, xcount) …
#define RT712_SDCA_EXT_TLV(xname, reg_base, xhandler_get,\
xhandler_put, xcount, xmax, tlv_array) …
static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -1725, 75, 0);
static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0);
static const struct snd_kcontrol_new rt712_sdca_dmic_snd_controls[] = …;
static int rt712_sdca_dmic_mux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int rt712_sdca_dmic_mux_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const char * const adc_mux_text[] = …;
static SOC_ENUM_SINGLE_DECL(
rt712_adc25_enum, SND_SOC_NOPM, 0, adc_mux_text);
static SOC_ENUM_SINGLE_DECL(
rt712_adc26_enum, SND_SOC_NOPM, 0, adc_mux_text);
static const struct snd_kcontrol_new rt712_sdca_dmic_adc25_mux = …;
static const struct snd_kcontrol_new rt712_sdca_dmic_adc26_mux = …;
static int rt712_sdca_dmic_fu1e_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int rt712_sdca_dmic_pde11_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_soc_dapm_widget rt712_sdca_dmic_dapm_widgets[] = …;
static const struct snd_soc_dapm_route rt712_sdca_dmic_audio_map[] = …;
static int rt712_sdca_dmic_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_sdca_dev_rt712_dmic = …;
static int rt712_sdca_dmic_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
int direction)
{ … }
static void rt712_sdca_dmic_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int rt712_sdca_dmic_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int rt712_sdca_dmic_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
#define RT712_STEREO_RATES …
#define RT712_FORMATS …
static const struct snd_soc_dai_ops rt712_sdca_dmic_ops = …;
static struct snd_soc_dai_driver rt712_sdca_dmic_dai[] = …;
static int rt712_sdca_dmic_init(struct device *dev, struct regmap *regmap,
struct regmap *mbq_regmap, struct sdw_slave *slave)
{ … }
static int rt712_sdca_dmic_update_status(struct sdw_slave *slave,
enum sdw_slave_status status)
{ … }
static int rt712_sdca_dmic_read_prop(struct sdw_slave *slave)
{ … }
static const struct sdw_device_id rt712_sdca_dmic_id[] = …;
MODULE_DEVICE_TABLE(sdw, rt712_sdca_dmic_id);
static int __maybe_unused rt712_sdca_dmic_dev_suspend(struct device *dev)
{ … }
static int __maybe_unused rt712_sdca_dmic_dev_system_suspend(struct device *dev)
{ … }
#define RT712_PROBE_TIMEOUT …
static int __maybe_unused rt712_sdca_dmic_dev_resume(struct device *dev)
{ … }
static const struct dev_pm_ops rt712_sdca_dmic_pm = …;
static const struct sdw_slave_ops rt712_sdca_dmic_slave_ops = …;
static int rt712_sdca_dmic_sdw_probe(struct sdw_slave *slave,
const struct sdw_device_id *id)
{ … }
static int rt712_sdca_dmic_sdw_remove(struct sdw_slave *slave)
{ … }
static struct sdw_driver rt712_sdca_dmic_sdw_driver = …;
module_sdw_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;