#include <linux/delay.h>
#include <linux/gcd.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>
#include <linux/irqchip/irq-madera.h>
#include <linux/mfd/madera/core.h>
#include <linux/mfd/madera/registers.h>
#include <linux/mfd/madera/pdata.h>
#include <sound/madera-pdata.h>
#include <dt-bindings/sound/madera.h>
#include "madera.h"
#define MADERA_AIF_BCLK_CTRL …
#define MADERA_AIF_TX_PIN_CTRL …
#define MADERA_AIF_RX_PIN_CTRL …
#define MADERA_AIF_RATE_CTRL …
#define MADERA_AIF_FORMAT …
#define MADERA_AIF_RX_BCLK_RATE …
#define MADERA_AIF_FRAME_CTRL_1 …
#define MADERA_AIF_FRAME_CTRL_2 …
#define MADERA_AIF_FRAME_CTRL_3 …
#define MADERA_AIF_FRAME_CTRL_4 …
#define MADERA_AIF_FRAME_CTRL_5 …
#define MADERA_AIF_FRAME_CTRL_6 …
#define MADERA_AIF_FRAME_CTRL_7 …
#define MADERA_AIF_FRAME_CTRL_8 …
#define MADERA_AIF_FRAME_CTRL_9 …
#define MADERA_AIF_FRAME_CTRL_10 …
#define MADERA_AIF_FRAME_CTRL_11 …
#define MADERA_AIF_FRAME_CTRL_12 …
#define MADERA_AIF_FRAME_CTRL_13 …
#define MADERA_AIF_FRAME_CTRL_14 …
#define MADERA_AIF_FRAME_CTRL_15 …
#define MADERA_AIF_FRAME_CTRL_16 …
#define MADERA_AIF_FRAME_CTRL_17 …
#define MADERA_AIF_FRAME_CTRL_18 …
#define MADERA_AIF_TX_ENABLES …
#define MADERA_AIF_RX_ENABLES …
#define MADERA_AIF_FORCE_WRITE …
#define MADERA_DSP_CONFIG_1_OFFS …
#define MADERA_DSP_CONFIG_2_OFFS …
#define MADERA_DSP_CLK_SEL_MASK …
#define MADERA_DSP_CLK_SEL_SHIFT …
#define MADERA_DSP_RATE_MASK …
#define MADERA_DSP_RATE_SHIFT …
#define MADERA_SYSCLK_6MHZ …
#define MADERA_SYSCLK_12MHZ …
#define MADERA_SYSCLK_24MHZ …
#define MADERA_SYSCLK_49MHZ …
#define MADERA_SYSCLK_98MHZ …
#define MADERA_DSPCLK_9MHZ …
#define MADERA_DSPCLK_18MHZ …
#define MADERA_DSPCLK_36MHZ …
#define MADERA_DSPCLK_73MHZ …
#define MADERA_DSPCLK_147MHZ …
#define MADERA_FLL_VCO_CORNER …
#define MADERA_FLL_MAX_FREF …
#define MADERA_FLL_MAX_N …
#define MADERA_FLL_MIN_FOUT …
#define MADERA_FLL_MAX_FOUT …
#define MADERA_FLL_MAX_FRATIO …
#define MADERA_FLL_MAX_REFDIV …
#define MADERA_FLL_OUTDIV …
#define MADERA_FLL_VCO_MULT …
#define MADERA_FLLAO_MAX_FREF …
#define MADERA_FLLAO_MIN_N …
#define MADERA_FLLAO_MAX_N …
#define MADERA_FLLAO_MAX_FBDIV …
#define MADERA_FLLHJ_INT_MAX_N …
#define MADERA_FLLHJ_INT_MIN_N …
#define MADERA_FLLHJ_FRAC_MAX_N …
#define MADERA_FLLHJ_FRAC_MIN_N …
#define MADERA_FLLHJ_LOW_THRESH …
#define MADERA_FLLHJ_MID_THRESH …
#define MADERA_FLLHJ_MAX_THRESH …
#define MADERA_FLLHJ_LOW_GAINS …
#define MADERA_FLLHJ_MID_GAINS …
#define MADERA_FLLHJ_HIGH_GAINS …
#define MADERA_FLL_SYNCHRONISER_OFFS …
#define CS47L35_FLL_SYNCHRONISER_OFFS …
#define MADERA_FLL_CONTROL_1_OFFS …
#define MADERA_FLL_CONTROL_2_OFFS …
#define MADERA_FLL_CONTROL_3_OFFS …
#define MADERA_FLL_CONTROL_4_OFFS …
#define MADERA_FLL_CONTROL_5_OFFS …
#define MADERA_FLL_CONTROL_6_OFFS …
#define MADERA_FLL_GAIN_OFFS …
#define MADERA_FLL_CONTROL_7_OFFS …
#define MADERA_FLL_EFS_2_OFFS …
#define MADERA_FLL_SYNCHRONISER_1_OFFS …
#define MADERA_FLL_SYNCHRONISER_2_OFFS …
#define MADERA_FLL_SYNCHRONISER_3_OFFS …
#define MADERA_FLL_SYNCHRONISER_4_OFFS …
#define MADERA_FLL_SYNCHRONISER_5_OFFS …
#define MADERA_FLL_SYNCHRONISER_6_OFFS …
#define MADERA_FLL_SYNCHRONISER_7_OFFS …
#define MADERA_FLL_SPREAD_SPECTRUM_OFFS …
#define MADERA_FLL_GPIO_CLOCK_OFFS …
#define MADERA_FLL_CONTROL_10_OFFS …
#define MADERA_FLL_CONTROL_11_OFFS …
#define MADERA_FLL1_DIGITAL_TEST_1_OFFS …
#define MADERA_FLLAO_CONTROL_1_OFFS …
#define MADERA_FLLAO_CONTROL_2_OFFS …
#define MADERA_FLLAO_CONTROL_3_OFFS …
#define MADERA_FLLAO_CONTROL_4_OFFS …
#define MADERA_FLLAO_CONTROL_5_OFFS …
#define MADERA_FLLAO_CONTROL_6_OFFS …
#define MADERA_FLLAO_CONTROL_7_OFFS …
#define MADERA_FLLAO_CONTROL_8_OFFS …
#define MADERA_FLLAO_CONTROL_9_OFFS …
#define MADERA_FLLAO_CONTROL_10_OFFS …
#define MADERA_FLLAO_CONTROL_11_OFFS …
#define MADERA_FMT_DSP_MODE_A …
#define MADERA_FMT_DSP_MODE_B …
#define MADERA_FMT_I2S_MODE …
#define MADERA_FMT_LEFT_JUSTIFIED_MODE …
#define madera_fll_err(_fll, fmt, ...) …
#define madera_fll_warn(_fll, fmt, ...) …
#define madera_fll_dbg(_fll, fmt, ...) …
#define madera_aif_err(_dai, fmt, ...) …
#define madera_aif_warn(_dai, fmt, ...) …
#define madera_aif_dbg(_dai, fmt, ...) …
static const int madera_dsp_bus_error_irqs[MADERA_MAX_ADSP] = …;
int madera_clk_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
EXPORT_SYMBOL_GPL(…);
static void madera_spin_sysclk(struct madera_priv *priv)
{ … }
int madera_sysclk_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
EXPORT_SYMBOL_GPL(…);
static int madera_check_speaker_overheat(struct madera *madera,
bool *warn, bool *shutdown)
{ … }
int madera_spk_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
EXPORT_SYMBOL_GPL(…);
static irqreturn_t madera_thermal_warn(int irq, void *data)
{ … }
int madera_init_overheat(struct madera_priv *priv)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_free_overheat(struct madera_priv *priv)
{ … }
EXPORT_SYMBOL_GPL(…);
static int madera_get_variable_u32_array(struct device *dev,
const char *propname,
u32 *dest, int n_max,
int multiple)
{ … }
static void madera_prop_get_inmode(struct madera_priv *priv)
{ … }
static void madera_prop_get_pdata(struct madera_priv *priv)
{ … }
int madera_core_init(struct madera_priv *priv)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_core_free(struct madera_priv *priv)
{ … }
EXPORT_SYMBOL_GPL(…);
static void madera_debug_dump_domain_groups(const struct madera_priv *priv)
{ … }
int madera_domain_clk_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_out1_demux_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_out1_demux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
static int madera_inmux_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const char * const madera_inmux_texts[] = …;
static SOC_ENUM_SINGLE_DECL(madera_in1muxl_enum,
MADERA_ADC_DIGITAL_VOLUME_1L,
MADERA_IN1L_SRC_SHIFT,
madera_inmux_texts);
static SOC_ENUM_SINGLE_DECL(madera_in1muxr_enum,
MADERA_ADC_DIGITAL_VOLUME_1R,
MADERA_IN1R_SRC_SHIFT,
madera_inmux_texts);
static SOC_ENUM_SINGLE_DECL(madera_in2muxl_enum,
MADERA_ADC_DIGITAL_VOLUME_2L,
MADERA_IN2L_SRC_SHIFT,
madera_inmux_texts);
static SOC_ENUM_SINGLE_DECL(madera_in2muxr_enum,
MADERA_ADC_DIGITAL_VOLUME_2R,
MADERA_IN2R_SRC_SHIFT,
madera_inmux_texts);
const struct snd_kcontrol_new madera_inmux[] = …;
EXPORT_SYMBOL_GPL(…);
static const char * const madera_dmode_texts[] = …;
static SOC_ENUM_SINGLE_DECL(madera_in1dmode_enum,
MADERA_IN1L_CONTROL,
MADERA_IN1_MODE_SHIFT,
madera_dmode_texts);
static SOC_ENUM_SINGLE_DECL(madera_in2dmode_enum,
MADERA_IN2L_CONTROL,
MADERA_IN2_MODE_SHIFT,
madera_dmode_texts);
static SOC_ENUM_SINGLE_DECL(madera_in3dmode_enum,
MADERA_IN3L_CONTROL,
MADERA_IN3_MODE_SHIFT,
madera_dmode_texts);
const struct snd_kcontrol_new madera_inmode[] = …;
EXPORT_SYMBOL_GPL(…);
static bool madera_can_change_grp_rate(const struct madera_priv *priv,
unsigned int reg)
{ … }
static int madera_adsp_rate_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct soc_enum madera_adsp_rate_enum[] = …;
const struct snd_kcontrol_new madera_adsp_rate_controls[] = …;
EXPORT_SYMBOL_GPL(…);
static int madera_write_adsp_clk_setting(struct madera_priv *priv,
struct wm_adsp *dsp,
unsigned int freq)
{ … }
int madera_set_adsp_clk(struct madera_priv *priv, int dsp_num,
unsigned int freq)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_rate_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
static void madera_configure_input_mode(struct madera *madera)
{ … }
int madera_init_inputs(struct snd_soc_component *component)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct snd_soc_dapm_route madera_mono_routes[] = …;
int madera_init_outputs(struct snd_soc_component *component,
const struct snd_soc_dapm_route *routes,
int n_mono_routes, int n_real)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_init_bus_error_irq(struct madera_priv *priv, int dsp_num,
irq_handler_t handler)
{ … }
EXPORT_SYMBOL_GPL(…);
void madera_free_bus_error_irq(struct madera_priv *priv, int dsp_num)
{ … }
EXPORT_SYMBOL_GPL(…);
const char * const madera_mixer_texts[] = …;
EXPORT_SYMBOL_GPL(…);
const unsigned int madera_mixer_values[] = …;
EXPORT_SYMBOL_GPL(…);
const DECLARE_TLV_DB_SCALE(madera_ana_tlv, 0, 100, 0);
EXPORT_SYMBOL_GPL(…);
const DECLARE_TLV_DB_SCALE(madera_eq_tlv, -1200, 100, 0);
EXPORT_SYMBOL_GPL(…);
const DECLARE_TLV_DB_SCALE(madera_digital_tlv, -6400, 50, 0);
EXPORT_SYMBOL_GPL(…);
const DECLARE_TLV_DB_SCALE(madera_noise_tlv, -13200, 600, 0);
EXPORT_SYMBOL_GPL(…);
const DECLARE_TLV_DB_SCALE(madera_ng_tlv, -12000, 600, 0);
EXPORT_SYMBOL_GPL(…);
const DECLARE_TLV_DB_SCALE(madera_mixer_tlv, -3200, 100, 0);
EXPORT_SYMBOL_GPL(…);
const char * const madera_rate_text[MADERA_RATE_ENUM_SIZE] = …;
EXPORT_SYMBOL_GPL(…);
const unsigned int madera_rate_val[MADERA_RATE_ENUM_SIZE] = …;
EXPORT_SYMBOL_GPL(…);
static const char * const madera_dfc_width_text[MADERA_DFC_WIDTH_ENUM_SIZE] = …;
static const unsigned int madera_dfc_width_val[MADERA_DFC_WIDTH_ENUM_SIZE] = …;
static const char * const madera_dfc_type_text[MADERA_DFC_TYPE_ENUM_SIZE] = …;
static const unsigned int madera_dfc_type_val[MADERA_DFC_TYPE_ENUM_SIZE] = …;
const struct soc_enum madera_dfc_width[] = …;
EXPORT_SYMBOL_GPL(…);
const struct soc_enum madera_dfc_type[] = …;
EXPORT_SYMBOL_GPL(…);
const struct soc_enum madera_isrc_fsh[] = …;
EXPORT_SYMBOL_GPL(…);
const struct soc_enum madera_isrc_fsl[] = …;
EXPORT_SYMBOL_GPL(…);
const struct soc_enum madera_asrc1_rate[] = …;
EXPORT_SYMBOL_GPL(…);
const struct soc_enum madera_asrc1_bidir_rate[] = …;
EXPORT_SYMBOL_GPL(…);
const struct soc_enum madera_asrc2_rate[] = …;
EXPORT_SYMBOL_GPL(…);
static const char * const madera_vol_ramp_text[] = …;
SOC_ENUM_SINGLE_DECL(madera_in_vd_ramp,
MADERA_INPUT_VOLUME_RAMP,
MADERA_IN_VD_RAMP_SHIFT,
madera_vol_ramp_text);
EXPORT_SYMBOL_GPL(…);
SOC_ENUM_SINGLE_DECL(madera_in_vi_ramp,
MADERA_INPUT_VOLUME_RAMP,
MADERA_IN_VI_RAMP_SHIFT,
madera_vol_ramp_text);
EXPORT_SYMBOL_GPL(…);
SOC_ENUM_SINGLE_DECL(madera_out_vd_ramp,
MADERA_OUTPUT_VOLUME_RAMP,
MADERA_OUT_VD_RAMP_SHIFT,
madera_vol_ramp_text);
EXPORT_SYMBOL_GPL(…);
SOC_ENUM_SINGLE_DECL(madera_out_vi_ramp,
MADERA_OUTPUT_VOLUME_RAMP,
MADERA_OUT_VI_RAMP_SHIFT,
madera_vol_ramp_text);
EXPORT_SYMBOL_GPL(…);
static const char * const madera_lhpf_mode_text[] = …;
SOC_ENUM_SINGLE_DECL(madera_lhpf1_mode,
MADERA_HPLPF1_1,
MADERA_LHPF1_MODE_SHIFT,
madera_lhpf_mode_text);
EXPORT_SYMBOL_GPL(…);
SOC_ENUM_SINGLE_DECL(madera_lhpf2_mode,
MADERA_HPLPF2_1,
MADERA_LHPF2_MODE_SHIFT,
madera_lhpf_mode_text);
EXPORT_SYMBOL_GPL(…);
SOC_ENUM_SINGLE_DECL(madera_lhpf3_mode,
MADERA_HPLPF3_1,
MADERA_LHPF3_MODE_SHIFT,
madera_lhpf_mode_text);
EXPORT_SYMBOL_GPL(…);
SOC_ENUM_SINGLE_DECL(madera_lhpf4_mode,
MADERA_HPLPF4_1,
MADERA_LHPF4_MODE_SHIFT,
madera_lhpf_mode_text);
EXPORT_SYMBOL_GPL(…);
static const char * const madera_ng_hold_text[] = …;
SOC_ENUM_SINGLE_DECL(madera_ng_hold,
MADERA_NOISE_GATE_CONTROL,
MADERA_NGATE_HOLD_SHIFT,
madera_ng_hold_text);
EXPORT_SYMBOL_GPL(…);
static const char * const madera_in_hpf_cut_text[] = …;
SOC_ENUM_SINGLE_DECL(madera_in_hpf_cut_enum,
MADERA_HPF_CONTROL,
MADERA_IN_HPF_CUT_SHIFT,
madera_in_hpf_cut_text);
EXPORT_SYMBOL_GPL(…);
static const char * const madera_in_dmic_osr_text[MADERA_OSR_ENUM_SIZE] = …;
static const unsigned int madera_in_dmic_osr_val[MADERA_OSR_ENUM_SIZE] = …;
const struct soc_enum madera_in_dmic_osr[] = …;
EXPORT_SYMBOL_GPL(…);
static const char * const madera_anc_input_src_text[] = …;
static const char * const madera_anc_channel_src_text[] = …;
const struct soc_enum madera_anc_input_src[] = …;
EXPORT_SYMBOL_GPL(…);
static const char * const madera_anc_ng_texts[] = …;
SOC_ENUM_SINGLE_DECL(madera_anc_ng_enum, SND_SOC_NOPM, 0, madera_anc_ng_texts);
EXPORT_SYMBOL_GPL(…);
static const char * const madera_out_anc_src_text[] = …;
const struct soc_enum madera_output_anc_src[] = …;
EXPORT_SYMBOL_GPL(…);
int madera_dfc_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_lp_mode_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
const struct snd_kcontrol_new madera_dsp_trigger_output_mux[] = …;
EXPORT_SYMBOL_GPL(…);
const struct snd_kcontrol_new madera_drc_activity_output_mux[] = …;
EXPORT_SYMBOL_GPL(…);
static void madera_in_set_vu(struct madera_priv *priv, bool enable)
{ … }
int madera_in_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol,
int event)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_out_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_hp_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_anc_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol,
int event)
{ … }
EXPORT_SYMBOL_GPL(…);
static const unsigned int madera_opclk_ref_48k_rates[] = …;
static const unsigned int madera_opclk_ref_44k1_rates[] = …;
static int madera_set_opclk(struct snd_soc_component *component,
unsigned int clk, unsigned int freq)
{ … }
static int madera_get_sysclk_setting(unsigned int freq)
{ … }
static int madera_get_legacy_dspclk_setting(struct madera *madera,
unsigned int freq)
{ … }
static int madera_get_dspclk_setting(struct madera *madera,
unsigned int freq,
unsigned int *clock_2_val)
{ … }
static int madera_set_outclk(struct snd_soc_component *component,
unsigned int source, unsigned int freq)
{ … }
int madera_set_sysclk(struct snd_soc_component *component, int clk_id,
int source, unsigned int freq, int dir)
{ … }
EXPORT_SYMBOL_GPL(…);
static int madera_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static const int madera_48k_bclk_rates[] = …;
static const int madera_44k1_bclk_rates[] = …;
static const unsigned int madera_sr_vals[] = …;
#define MADERA_192K_48K_RATE_MASK …
#define MADERA_192K_44K1_RATE_MASK …
#define MADERA_192K_RATE_MASK …
#define MADERA_384K_48K_RATE_MASK …
#define MADERA_384K_44K1_RATE_MASK …
#define MADERA_384K_RATE_MASK …
static const struct snd_pcm_hw_constraint_list madera_constraint = …;
static int madera_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int madera_hw_params_rate(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int madera_aif_cfg_changed(struct snd_soc_component *component,
int base, int bclk, int lrclk, int frame)
{ … }
static int madera_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int madera_is_syncclk(int clk_id)
{ … }
static int madera_dai_set_sysclk(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{ … }
static int madera_set_tristate(struct snd_soc_dai *dai, int tristate)
{ … }
static void madera_set_channels_to_mask(struct snd_soc_dai *dai,
unsigned int base,
int channels, unsigned int mask)
{ … }
static int madera_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
unsigned int rx_mask, int slots, int slot_width)
{ … }
const struct snd_soc_dai_ops madera_dai_ops = …;
EXPORT_SYMBOL_GPL(…);
const struct snd_soc_dai_ops madera_simple_dai_ops = …;
EXPORT_SYMBOL_GPL(…);
int madera_init_dai(struct madera_priv *priv, int id)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct { … } fll_sync_fratios[] = …;
static const unsigned int pseudo_fref_max[MADERA_FLL_MAX_FRATIO] = …;
struct madera_fll_gains { … };
static const struct madera_fll_gains madera_fll_sync_gains[] = …;
static const struct madera_fll_gains madera_fll_main_gains[] = …;
static int madera_find_sync_fratio(unsigned int fref, int *fratio)
{ … }
static int madera_find_main_fratio(unsigned int fref, unsigned int fout,
int *fratio)
{ … }
static int madera_find_fratio(struct madera_fll *fll, unsigned int fref,
bool sync, int *fratio)
{ … }
static int madera_calc_fratio(struct madera_fll *fll,
struct madera_fll_cfg *cfg,
unsigned int fref, bool sync)
{ … }
static int madera_find_fll_gain(struct madera_fll *fll,
struct madera_fll_cfg *cfg,
unsigned int fref,
const struct madera_fll_gains *gains,
int n_gains)
{ … }
static int madera_calc_fll(struct madera_fll *fll,
struct madera_fll_cfg *cfg,
unsigned int fref, bool sync)
{ … }
static bool madera_write_fll(struct madera *madera, unsigned int base,
struct madera_fll_cfg *cfg, int source,
bool sync, int gain)
{ … }
static int madera_is_enabled_fll(struct madera_fll *fll, int base)
{ … }
static int madera_wait_for_fll(struct madera_fll *fll, bool requested)
{ … }
static bool madera_set_fll_phase_integrator(struct madera_fll *fll,
struct madera_fll_cfg *ref_cfg,
bool sync)
{ … }
static int madera_set_fll_clks_reg(struct madera_fll *fll, bool ena,
unsigned int reg, unsigned int mask,
unsigned int shift)
{ … }
static inline int madera_set_fll_clks(struct madera_fll *fll, int base, bool ena)
{ … }
static inline int madera_set_fllao_clks(struct madera_fll *fll, int base, bool ena)
{ … }
static inline int madera_set_fllhj_clks(struct madera_fll *fll, int base, bool ena)
{ … }
static void madera_disable_fll(struct madera_fll *fll)
{ … }
static int madera_enable_fll(struct madera_fll *fll)
{ … }
static int madera_apply_fll(struct madera_fll *fll)
{ … }
int madera_set_fll_syncclk(struct madera_fll *fll, int source,
unsigned int fref, unsigned int fout)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_set_fll_refclk(struct madera_fll *fll, int source,
unsigned int fref, unsigned int fout)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_init_fll(struct madera *madera, int id, int base,
struct madera_fll *fll)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct reg_sequence madera_fll_ao_32K_49M_patch[] = …;
static const struct reg_sequence madera_fll_ao_32K_45M_patch[] = …;
struct madera_fllao_patch { … };
static const struct madera_fllao_patch madera_fllao_settings[] = …;
static int madera_enable_fll_ao(struct madera_fll *fll,
const struct reg_sequence *patch,
unsigned int patch_size)
{ … }
static int madera_disable_fll_ao(struct madera_fll *fll)
{ … }
int madera_set_fll_ao_refclk(struct madera_fll *fll, int source,
unsigned int fin, unsigned int fout)
{ … }
EXPORT_SYMBOL_GPL(…);
static int madera_fllhj_disable(struct madera_fll *fll)
{ … }
static int madera_fllhj_apply(struct madera_fll *fll, int fin)
{ … }
static int madera_fllhj_enable(struct madera_fll *fll)
{ … }
static int madera_fllhj_validate(struct madera_fll *fll,
unsigned int ref_in,
unsigned int fout)
{ … }
int madera_fllhj_set_refclk(struct madera_fll *fll, int source,
unsigned int fin, unsigned int fout)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_set_output_mode(struct snd_soc_component *component, int output,
bool differential)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool madera_eq_filter_unstable(bool mode, __be16 _a, __be16 _b)
{ … }
int madera_eq_coeff_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
int madera_lhpf_coeff_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_SOFTDEP(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;