Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
sound/soc/codecs/rt5616.c
static void rt5616_i2c_shutdown(struct i2c_client *client) { struct rt5616_priv *rt5616 = i2c_get_clientdata(client); regmap_write(rt5616->regmap, RT5616_HP_VOL, 0xc8c8); regmap_write(rt5616->regmap, RT5616_LOUT_CTRL1, 0xc8c8); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5631.c
static void rt5631_write_index(struct snd_soc_component *component, unsigned int reg, unsigned int value) { snd_soc_component_write(component, RT5631_INDEX_ADD, reg); snd_soc_component_write(component, RT5631_INDEX_DATA, value); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5631.c
static unsigned int rt5631_read_index(struct snd_soc_component *component, unsigned int reg) { unsigned int value; snd_soc_component_write(component, RT5631_INDEX_ADD, reg); value = snd_soc_component_read(component, RT5631_INDEX_DATA); return value; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5631.c
static bool rt5631_volatile_register(struct device *dev, unsigned int reg) { switch (reg) { case RT5631_RESET: case RT5631_INT_ST_IRQ_CTRL_2: case RT5631_INDEX_ADD: case RT5631_INDEX_DATA: case RT5631_EQ_CTRL: return true; default: return false; } }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5631.c
static int check_dacl_to_spkmixl(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); unsigned int reg; reg = snd_soc_component_read(component, RT5631_SPK_MIXER_CTRL); return !(re...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5631.c
static void onebit_depop_power_stage(struct snd_soc_component *component, int enable) { unsigned int soft_vol, hp_zc; snd_soc_component_update_bits(component, RT5631_DEPOP_FUN_CTRL_2, RT5631_EN_ONE_BIT_DEPOP, 0); /* keep soft volume and zero c...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5631.c
static int set_dmic_params(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); switch (rt5631->rx_rate) { case 4410...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5640.c
static int is_using_asrc(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); if (!rt5640->asrc_en) return 0; r...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5640.c
static int rt5640_hp_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); switch (event) { case SND_SOC_DAPM_P...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5640.c
static void rt5640_enable_micbias1_ovcd_irq(struct snd_soc_component *component) { struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); snd_soc_component_update_bits(component, RT5640_IRQ_CTRL2, RT5640_IRQ_MB1_OC_MASK, RT5640_IRQ_MB1_OC_NOR); rt5640->ovcd_irq_en...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5640.c
static void rt5640_clear_micbias1_ovcd(struct snd_soc_component *component) { snd_soc_component_update_bits(component, RT5640_IRQ_CTRL2, RT5640_MB1_OC_STATUS, 0); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5640.c
static void rt5640_cancel_work(void *data) { struct rt5640_priv *rt5640 = data; cancel_delayed_work_sync(&rt5640->jack_work); cancel_delayed_work_sync(&rt5640->bp_work); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5640.c
static void rt5640_remove(struct snd_soc_component *component) { rt5640_reset(component); } #ifdef CONFIG_PM
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5645.c
static int rt5645_hweq_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; uinfo->count = RT5645_HWEQ_NUM * sizeof(struct rt5645_eq_param_s); return 0; }
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5645.c
static bool rt5645_validate_hweq(unsigned short reg) { if ((reg >= 0x1a4 && reg <= 0x1cd) || (reg >= 0x1e5 && reg <= 0x1f8) || (reg == RT5645_EQ_CTRL2)) return true; return false; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5645.c
static int set_dmic_clk(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); int idx, rate; rate = rt5645->sysclk / rl62...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5645.c
static int rt5645_enable_hweq(struct snd_soc_component *component) { struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); int i; for (i = 0; i < RT5645_HWEQ_NUM; i++) { if (rt5645_validate_hweq(rt5645->eq_param[i].reg)) regmap_write(rt5645->regmap, rt5645->eq_param[i].reg, ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5645.c
static int rt5645_lout_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_POST_PMU: hp_amp_power(component, 1); snd_soc_component_update...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5645.c
static int rt5645_set_micbias2_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_PRE_PMU: snd_soc_component_update_bits(component, RT5645_...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5645.c
static int rt5645_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_component *component = dai->component; struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); unsigned int reg_val = 0; if (freq == rt5645->sysclk...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5645.c
static void rt5645_rcclock_work(struct work_struct *work) { struct rt5645_priv *rt5645 = container_of(work, struct rt5645_priv, rcclock_work.work); regmap_update_bits(rt5645->regmap, RT5645_MICBIAS, RT5645_PWR_CLK25M_MASK, RT5645_PWR_CLK25M_PD); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5645.c
static int rt5645_probe(struct snd_soc_component *component) { struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); rt5645->component = component; switch (rt5645->codec_type) { case CODEC_TYPE_RT5645: snd_soc_da...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5651.c
static int rt5651_bst2_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_POST_PMU: snd_soc_component_update_bits(component, RT5651_PWR_ANLG...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5651.c
static void rt5651_enable_micbias1_for_ovcd(struct snd_soc_component *component) { struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_force_enable_pin_unlocked(dapm, "LDO"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "micbias1"); snd_soc_...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5651.c
static void rt5651_disable_micbias1_for_ovcd(struct snd_soc_component *component) { struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_disable_pin_unlocked(dapm, "Platform Clock"); snd_soc_dapm_disable_pin_unlocked(dapm, "micbias1"); snd_so...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5651.c
static void rt5651_disable_micbias1_ovcd_irq(struct snd_soc_component *component) { struct rt5651_priv *rt5651 = snd_soc_component_get_drvdata(component); snd_soc_component_update_bits(component, RT5651_IRQ_CTRL2, RT5651_IRQ_MB1_OC_MASK, RT5651_IRQ_MB1_OC_BP); rt5651->ovcd_irq_en...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5651.c
static void rt5651_clear_micbias1_ovcd(struct snd_soc_component *component) { snd_soc_component_update_bits(component, RT5651_IRQ_CTRL2, RT5651_MB1_OC_CLR, 0); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5651.c
static bool rt5651_support_button_press(struct rt5651_priv *rt5651) { if (!rt5651->hp_jack) return false; return (rt5651->hp_jack->status & SND_JACK_MICROPHONE) && rt5651->gpiod_hp_det == NULL; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5659.c
static int rt5659_button_detect(struct snd_soc_component *component) { int btn_type, val; val = snd_soc_component_read(component, RT5659_4BTN_IL_CMD_1); btn_type = val & 0xfff0; snd_soc_component_write(component, RT5659_4BTN_IL_CMD_1, val); return btn_type; }
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5659.c
static irqreturn_t rt5659_irq(int irq, void *data) { struct rt5659_priv *rt5659 = data; queue_delayed_work(system_power_efficient_wq, &rt5659->jack_detect_work, msecs_to_jiffies(250)); return IRQ_HANDLED; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5659.c
static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *w, struct snd_soc_dapm_widget *sink) { unsigned int val; struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); val = snd_soc_component_read(component, RT5659_GLB_CLK); val &= RT5659_SCLK_SRC_MASK; i...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5659.c
static int set_dmic_power(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { switch (event) { case SND_SOC_DAPM_POST_PMU: msleep(450); break; default: return 0; } return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5659.c
static int rt5659_resume(struct snd_soc_component *component) { struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); regcache_cache_only(rt5659->regmap, false); regcache_sync(rt5659->regmap); return 0; } #else #define rt5659_suspend NULL #define rt5659_resume NULL #endif #define RT5659_STE...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5660.c
static bool rt5660_volatile_register(struct device *dev, unsigned int reg) { int i; for (i = 0; i < ARRAY_SIZE(rt5660_ranges); i++) if ((reg >= rt5660_ranges[i].window_start && reg <= rt5660_ranges[i].window_start + rt5660_ranges[i].window_len) || (reg >= rt5660_ranges[i].range_min && ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5660.c
static int rt5660_is_sys_clk_from_pll(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); unsigned int val; val = snd_soc_component_read(component, RT5660_GLB_CLK); val &= R...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5660.c
static int rt5660_suspend(struct snd_soc_component *component) { struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); regcache_cache_only(rt5660->regmap, true); regcache_mark_dirty(rt5660->regmap); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5660.c
static int rt5660_parse_dt(struct rt5660_priv *rt5660, struct device *dev) { rt5660->pdata.in1_diff = device_property_read_bool(dev, "realtek,in1-differential"); rt5660->pdata.in3_diff = device_property_read_bool(dev, "realtek,in3-differential"); rt5660->pdata.poweroff_codec_in_suspend = device...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5663.c
int rt5663_sel_asrc_clk_src(struct snd_soc_component *component, unsigned int filter_mask, unsigned int clk_src) { struct rt5663_priv *rt5663 = snd_soc_component_get_drvdata(component); unsigned int asrc2_mask = 0; unsigned int asrc2_value = 0; unsigned int asrc3_mask = 0; unsigned...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5663.c
static int rt5663_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct snd_soc_component *component = dai->component; unsigned int reg_val = 0; switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBM_CFM: break; case SND_SOC_DAIFMT_CBS_CFS: reg_val |= RT5663_I2S_MS_S; brea...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5663.c
static int rt5663_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) { struct snd_soc_component *component = dai->component; struct rt5663_priv *rt5663 = snd_soc_component_get_drvdata(component);...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5663.c
static int rt5663_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) { struct snd_soc_component *component = dai->component; struct rt5663_priv *rt5663 = snd_soc_component_get_drvdata(component); unsigned int reg; dev_dbg(component->dev, "%s ratio = %d\n", __func__, ratio); if (rt5663->codec_ver =...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5663.c
static void rt5663_remove(struct snd_soc_component *component) { struct rt5663_priv *rt5663 = snd_soc_component_get_drvdata(component); regmap_write(rt5663->regmap, RT5663_RESET, 0); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static bool rt5665_volatile_register(struct device *dev, unsigned int reg) { switch (reg) { case RT5665_RESET: case RT5665_EJD_CTRL_2: case RT5665_GPIO_STA: case RT5665_INT_ST_1: case RT5665_IL_CMD_1: case RT5665_4BTN_IL_CMD_1: case RT5665_PSV_IL_CMD_1: case RT5665_AJD1_CTRL: case RT5665_JD_CTRL_3:...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static irqreturn_t rt5665_irq(int irq, void *data) { struct rt5665_priv *rt5665 = data; mod_delayed_work(system_power_efficient_wq, &rt5665->jack_detect_work, msecs_to_jiffies(250)); return IRQ_HANDLED; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static int rt5665_set_jack_detect(struct snd_soc_component *component, struct snd_soc_jack *hs_jack, void *data) { struct rt5665_priv *rt5665 = snd_soc_component_get_drvdata(component); switch (rt5665->pdata.jd_src) { case RT5665_JD1: regmap_update_bits(rt5665->regmap, RT56...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static int set_dmic_clk(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct rt5665_priv *rt5665 = snd_soc_component_get_drvdata(component); int pd, idx; pd = rl6231_get_pre_div(...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static int rt5665_set_verf(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_PRE_PMU: switch (w->shift) { case RT5665_PWR_VREF1_BIT: snd_...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static int rt5665_probe(struct snd_soc_component *component) { struct rt5665_priv *rt5665 = snd_soc_component_get_drvdata(component); rt5665->component = component; schedule_delayed_work(&rt5665->calibrate_work, msecs_to_jiffies(100)); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static void rt5665_remove(struct snd_soc_component *component) { struct rt5665_priv *rt5665 = snd_soc_component_get_drvdata(component); regmap_write(rt5665->regmap, RT5665_RESET, 0); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static int rt5665_suspend(struct snd_soc_component *component) { struct rt5665_priv *rt5665 = snd_soc_component_get_drvdata(component); regcache_cache_only(rt5665->regmap, true); regcache_mark_dirty(rt5665->regmap); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static int rt5665_parse_dt(struct rt5665_priv *rt5665, struct device *dev) { rt5665->pdata.in1_diff = of_property_read_bool(dev->of_node, "realtek,in1-differential"); rt5665->pdata.in2_diff = of_property_read_bool(dev->of_node, "realtek,in2-differential"); rt5665->pdata.in3_diff = of_property_r...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5665.c
static void rt5665_i2c_shutdown(struct i2c_client *client) { struct rt5665_priv *rt5665 = i2c_get_clientdata(client); regmap_write(rt5665->regmap, RT5665_RESET, 0); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5668.c
static int rt5668_button_detect(struct snd_soc_component *component) { int btn_type, val; val = snd_soc_component_read(component, RT5668_4BTN_IL_CMD_1); btn_type = val & 0xfff0; snd_soc_component_write(component, RT5668_4BTN_IL_CMD_1, val); pr_debug("%s btn_type=%x\n", __func__, btn_type); return btn_typ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5668.c
static void rt5668_enable_push_button_irq(struct snd_soc_component *component, bool enable) { if (enable) { snd_soc_component_update_bits(component, RT5668_SAR_IL_CMD_1, RT5668_SAR_BUTT_DET_MASK, RT5668_...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5668.c
static int rt5668_headset_detect(struct snd_soc_component *component, int jack_insert) { struct rt5668_priv *rt5668 = snd_soc_component_get_drvdata(component); struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); unsigned int val, count; if (jack_insert) {...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5668.c
static int is_sys_clk_from_pll1(struct snd_soc_dapm_widget *w, struct snd_soc_dapm_widget *sink) { unsigned int val; struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); val = snd_soc_component_read(component, RT5668_GLB_CLK); val &= RT5668_SCLK_SRC_MASK; ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5668.c
static int rt5655_set_verf(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_PRE_PMU: switch (w->shift) { case RT5668_PWR_VREF1_BIT: snd_...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5668.c
static int rt5668_parse_dt(struct rt5668_priv *rt5668, struct device *dev) { of_property_read_u32(dev->of_node, "realtek,dmic1-data-pin", &rt5668->pdata.dmic1_data_pin); of_property_read_u32(dev->of_node, "realtek,dmic1-clk-pin", &rt5668->pdata.dmic1_clk_pin); of_pr...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5668.c
static void rt5668_i2c_shutdown(struct i2c_client *client) { struct rt5668_priv *rt5668 = i2c_get_clientdata(client); rt5668_reset(rt5668->regmap); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static bool rt5670_volatile_register(struct device *dev, unsigned int reg) { int i; for (i = 0; i < ARRAY_SIZE(rt5670_ranges); i++) { if ((reg >= rt5670_ranges[i].window_start && reg <= rt5670_ranges[i].window_start + rt5670_ranges[i].window_len) || (reg >= rt5670_ranges[i].range_min && ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static void rt5670_update_ad_da_mixer_dac1_m_bits(struct rt5670_priv *rt5670) { int val = RT5670_M_DAC1_L | RT5670_M_DAC1_R; if (rt5670->dac1_mixl_dac1_switch && rt5670->dac1_playback_switch_l) val &= ~RT5670_M_DAC1_L; if (rt5670->dac1_mixr_dac1_switch && rt5670->dac1_playback_switch_r) val &= ~RT5670_M...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); if (rt5670->sysclk_src == RT...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static int is_using_asrc(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); unsigned int reg, shift, val; switch (source->shift) { case 0: reg = RT5670_ASRC_3; shift = 0; br...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static int can_use_asrc(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); if (rt5670->sysclk > rt5670->lrck[RT5670_A...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static int rt5670_put_dac1_mix_dac1_switch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcont...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static int rt5670_spk_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); if (!rt5670->gpio1_is_ext_spk_en) ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static int rt5670_bst2_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_POST_PMU: snd_soc_component_update_bits(component, RT5670_PWR_ANLG...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static int rt5670_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) { struct snd_soc_component *component = dai->component; dev_dbg(component->dev, "%s ratio=%d\n", __func__, ratio); if (dai->id != RT5670_AIF1) return 0; if ((ratio % 50) == 0) snd_soc_component_update_bits(component, RT5670...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5670.c
static int rt5670_probe(struct snd_soc_component *component) { struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); switch (snd_soc_component_read(component, RT5670_RESET) & RT5670_ID_MASK) { case RT5670_ID_5670: ca...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677-spi.c
int rt5677_spi_write(u32 addr, const void *txbuf, size_t len) { u32 offset; int status = 0; struct spi_transfer t; struct spi_message m; u8 buf[RT5677_SPI_HEADER + RT5677_SPI_BURST_LEN + 1]; u8 *body = buf + RT5677_SPI_HEADER; u8 spi_cmd; const u8 *cb = txbuf; if (!g_spi) return -ENODEV; if (...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5677-spi.h
static inline int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw) { return -EINVAL; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static bool rt5677_volatile_register(struct device *dev, unsigned int reg) { int i; for (i = 0; i < ARRAY_SIZE(rt5677_ranges); i++) { if (reg >= rt5677_ranges[i].range_min && reg <= rt5677_ranges[i].range_max) { return true; } } switch (reg) { case RT5677_RESET: case RT5677_SLIMBUS_P...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static int rt5677_load_dsp_from_file(struct rt5677_priv *rt5677) { const struct firmware *fwp; struct device *dev = rt5677->component->dev; int ret = 0; ret = request_firmware(&fwp, "rt5677_elf_vad", dev); if (ret) { dev_err(dev, "Request rt5677_elf_vad failed %d\n", ret); return ret; } dev_info(...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static int rt5677_dsp_vad_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = rt5677->d...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static int can_use_asrc(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component); if (rt5677->sysclk > rt5677->lrck[RT5677_A...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static int rt5677_bst1_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component); switch (event) { case SND_SOC_DA...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static int rt5677_if1_adc_tdm_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component); unsigned int value; ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static int rt5677_pll_calc(const unsigned int freq_in, const unsigned int freq_out, struct rl6231_pll_code *pll_code) { if (RT5677_PLL_INP_MIN > freq_in) return -EINVAL; return rl6231_pll_calc(freq_in, freq_out, pll_code); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static void rt5677_gpio_set(struct gpio_chip *chip, unsigned offset, int value) { struct rt5677_priv *rt5677 = gpiochip_get_data(chip); switch (offset) { case RT5677_GPIO1 ... RT5677_GPIO5: regmap_update_bits(rt5677->regmap, RT5677_GPIO_CTRL2, 0x1 << (offset...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static int rt5677_gpio_direction_out(struct gpio_chip *chip, unsigned offset, int value) { struct rt5677_priv *rt5677 = gpiochip_get_data(chip); switch (offset) { case RT5677_GPIO1 ... RT5677_GPIO5: regmap_update_bits(rt5677->regmap, RT5677_GPIO_CTRL2, ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static int rt5677_read(void *context, unsigned int reg, unsigned int *val) { struct i2c_client *client = context; struct rt5677_priv *rt5677 = i2c_get_clientdata(client); if (rt5677->is_dsp_mode) { if (reg > 0xff) { mutex_lock(&rt5677->dsp_pri_lock); rt5677_dsp_mode_i2c_write(rt5677, RT5677_PRIV...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static bool rt5677_check_hotword(struct rt5677_priv *rt5677) { int reg_gpio; if (!rt5677->is_dsp_mode) return false; if (regmap_read(rt5677->regmap, RT5677_GPIO_CTRL1, &reg_gpio)) return false; if ((reg_gpio & RT5677_GPIO1_PIN_MASK) == RT5677_GPIO1_PIN_IRQ) return false; /* Set GPIO1 pin back ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static void rt5677_irq_disable(struct irq_data *data) { struct rt5677_priv *rt5677 = irq_data_get_irq_chip_data(data); rt5677->irq_en &= ~rt5677_irq_descs[data->hwirq].enable_mask; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5677.c
static void rt5677_i2c_remove(struct i2c_client *i2c) { rt5677_free_gpio(i2c); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5682-i2c.c
static void rt5682_i2c_shutdown(struct i2c_client *client) { struct rt5682_priv *rt5682 = i2c_get_clientdata(client); disable_irq(client->irq); cancel_delayed_work_sync(&rt5682->jack_detect_work); cancel_delayed_work_sync(&rt5682->jd_check_work); rt5682_reset(rt5682); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5682-sdw.c
static int rt5682_sdw_write(void *context, unsigned int reg, unsigned int val) { struct device *dev = context; struct rt5682_priv *rt5682 = dev_get_drvdata(dev); regmap_write(rt5682->sdw_regmap, RT5682_SDW_CMD, 1); regmap_write(rt5682->sdw_regmap, RT5682_SDW_ADDR_H, (reg >> 8) & 0xff); regmap_write(rt5682->...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5682-sdw.c
static int rt5682_sdw_init(struct device *dev, struct regmap *regmap, struct sdw_slave *slave) { struct rt5682_priv *rt5682; int ret; rt5682 = devm_kzalloc(dev, sizeof(*rt5682), GFP_KERNEL); if (!rt5682) return -ENOMEM; dev_set_drvdata(dev, rt5682); rt5682->slave = slave; ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5682-sdw.c
static int rt5682_update_status(struct sdw_slave *slave, enum sdw_slave_status status) { struct rt5682_priv *rt5682 = dev_get_drvdata(&slave->dev); rt5682->status = status; if (status == SDW_SLAVE_UNATTACHED) rt5682->hw_init = false; /* * Perform initialization only if ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5682-sdw.c
static int rt5682_clock_config(struct device *dev) { struct rt5682_priv *rt5682 = dev_get_drvdata(dev); unsigned int clk_freq, value; clk_freq = (rt5682->params.curr_dr_freq >> 1); switch (clk_freq) { case RT5682_CLK_FREQ_12000000HZ: value = 0x0; break; case RT5682_CLK_FREQ_6000000HZ: value =...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5682-sdw.c
static int rt5682_sdw_probe(struct sdw_slave *slave, const struct sdw_device_id *id) { struct regmap *regmap; regmap = devm_regmap_init_sdw(slave, &rt5682_sdw_regmap); if (IS_ERR(regmap)) return -EINVAL; rt5682_sdw_init(&slave->dev, regmap, slave); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5682.c
static int rt5682_button_detect(struct snd_soc_component *component) { int btn_type, val; val = snd_soc_component_read(component, RT5682_4BTN_IL_CMD_1); btn_type = val & 0xfff0; snd_soc_component_write(component, RT5682_4BTN_IL_CMD_1, val); dev_dbg(component->dev, "%s btn_type=%x\n", __func__, btn_type); ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5682.c
static int set_filter_clk(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component); int ref, val, reg, idx; static const int...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5682.c
static int is_using_asrc(struct snd_soc_dapm_widget *w, struct snd_soc_dapm_widget *sink) { unsigned int reg, shift, val; struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); switch (w->shift) { case RT5682_ADC_STO1_ASRC_SFT: reg = RT5682_PLL_TRACK_3; shif...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5682.c
static int rt5682_hp_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_PRE_PMU: snd_soc_component_update_bits(component, RT5682_HP_CTRL_2, ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5682.c
static int rt5682_set_verf(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_PRE_PMU: switch (w->shift) { case RT5682_PWR_VREF1_BIT: snd_...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5682.c
static int rt5682_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component); switch (level) { case SND_SOC_BIAS_PREPARE: regmap_update_bits(rt5682->regmap, RT5682_PWR_ANLG_1, RT5...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/rt5682.c
static unsigned long rt5682_bclk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct rt5682_priv *rt5682 = container_of(hw, struct rt5682_priv, dai_clks_hw[RT5682_DAI_BCLK_IDX]); unsigned int bclks_per_wclk; regmap_read(rt5682->regmap, RT5682_TDM...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5682.c
int rt5682_register_dai_clks(struct rt5682_priv *rt5682) { struct device *dev = rt5682->i2c_dev; struct rt5682_platform_data *pdata = &rt5682->pdata; struct clk_hw *dai_clk_hw; int i, ret; for (i = 0; i < RT5682_DAI_NUM_CLKS; ++i) { struct clk_init_data init = {}; const struct clk_hw *parent; da...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5682.c
static int rt5682_probe(struct snd_soc_component *component) { struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component); struct sdw_slave *slave; unsigned long time; struct snd_soc_dapm_context *dapm = &component->dapm; rt5682->component = component; if (rt5682->is_sdw) { slave = rt5682-...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/rt5682s.c
static void rt5682s_jd_check_handler(struct work_struct *work) { struct rt5682s_priv *rt5682s = container_of(work, struct rt5682s_priv, jd_check_work.work); if (snd_soc_component_read(rt5682s->component, RT5682S_AJD1_CTRL) & RT5682S_JDH_RS_MASK) { schedule_delayed_work(&rt5682s->jack_detect_work, ...
[ 0, 0 ]