Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/soc/codecs/msm8916-wcd-digital.c |
static int msm8x16_wcd_codec_set_iir_gain(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
int value = 0, reg = 0;
switch (event... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/msm8916-wcd-digital.c | static void set_iir_band_coeff(struct snd_soc_component *component, int iir_idx,
int band_idx, uint32_t value) {
snd_soc_component_write(
component, (LPASS_CDC_IIR1_COEF_B2_CTL + 64 * iir_idx), (value & 0xFF));
snd_soc_component_write(component,
(LPASS... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/msm8916-wcd-digital.c | static int msm8916_wcd_digital_enable_interpolator(
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:
usleep_range(10000, 10100);
snd_soc_component_write(
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/msm8916-wcd-digital.c | static int msm8916_wcd_digital_enable_dmic(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
unsigned int dmic;
int ret;
char ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/msm8916-wcd-digital.c |
static int msm8916_wcd_digital_remove(struct platform_device *pdev) {
struct msm8916_wcd_digital_priv *priv = dev_get_drvdata(&pdev->dev);
clk_disable_unprepare(priv->mclk);
clk_disable_unprepare(priv->ahbclk);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6351.c |
static void set_hp_gain_zero(struct snd_soc_component *cmpnt) {
regmap_update_bits(cmpnt->regmap, MT6351_ZCD_CON2, 0x1f << 7, 0x8 << 7);
regmap_update_bits(cmpnt->regmap, MT6351_ZCD_CON2, 0x1f << 0, 0x8 << 0);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6351.c |
static unsigned int get_cap_reg_val(struct snd_soc_component *cmpnt,
unsigned int rate) {
switch (rate) {
case 8000:
return 0;
case 16000:
return 1;
case 32000:
return 2;
case 48000:
return 3;
case 96000:
return 4;
case 192000:
return 5;
defau... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6351.c |
static unsigned int get_play_reg_val(struct snd_soc_component *cmpnt,
unsigned int rate) {
switch (rate) {
case 8000:
return 0;
case 11025:
return 1;
case 12000:
return 2;
case 16000:
return 3;
case 22050:
return 4;
case 24000:
return 5;
case... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6351.c |
static int mt6351_codec_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) {
struct snd_soc_component *cmpnt = dai->component;
struct mt6351_priv *priv = snd_soc_component_get_drvd... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6351.c | static void hp_gain_ramp_set(struct snd_soc_component *cmpnt, int hp_gain_ctl) {
struct mt6351_priv *priv = snd_soc_component_get_drvdata(cmpnt);
int idx, old_idx, offset, reg_idx;
if (hp_gain_ctl == HP_GAIN_SET_ZERO) {
idx = 8;
old_idx = priv->ana_gain[AUDIO_ANALOG_VOLUME_HPOUTL];
} else {
idx = p... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6351.c | static void hp_zcd_enable(struct snd_soc_component *cmpnt) {
/* when adjust gain during HP buffer on */
regmap_update_bits(cmpnt->regmap, MT6351_ZCD_CON0, 0x7 << 8, 0x1 << 8);
regmap_update_bits(cmpnt->regmap, MT6351_ZCD_CON0, 0x1 << 7, 0x0 << 7);
/* timeout, 1=5ms, 0=30ms */
regmap_update_bits(cmpnt->regma... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6351.c | static int mt_ncp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
regmap_update_bits(cmpnt->regmap, MT6351_AFE_NCP_CFG1, 0xffff, 0x1515);
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6351.c | static int mt_aif_in_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6351_priv *priv = snd_soc_component_get_drvdata(cmpnt);
dev_dbg(priv->dev, "%s(), event 0x%x, rate %d\n",... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6351.c | static int mt_mic_bias_2_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
regmap_update_bits(cmpnt->regmap, MT6351_AUDENC_ANA_CON9,... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c |
int mt6358_set_mtkaif_protocol(struct snd_soc_component *cmpnt,
int mtkaif_protocol) {
struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt);
priv->mtkaif_protocol = mtkaif_protocol;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c | static int mt6358_mtkaif_tx_enable(struct mt6358_priv *priv) {
switch (priv->mtkaif_protocol) {
case MT6358_MTKAIF_PROTOCOL_2_CLK_P2:
regmap_update_bits(priv->regmap, MT6358_AFE_ADDA_MTKAIF_CFG0, 0xffff,
0x0010);
/* enable aud_pad TX fifos */
regmap_update_bits(priv->regmap, MT63... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c | static int mt6358_mtkaif_tx_disable(struct mt6358_priv *priv) {
regmap_update_bits(priv->regmap, MT6358_AFE_AUD_PAD_TOP, 0xff00, 0x3000);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c | int mt6358_mtkaif_calibration_disable(struct snd_soc_component *cmpnt) {
struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt);
regmap_update_bits(priv->regmap, MT6358_AUDIO_DIG_CFG,
RG_AUD_PAD_TOP_DAT_MISO2_LOOPBACK_MASK_SFT,
0 << RG_AUD_PAD_TOP_DAT_MISO2_LOOPBA... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c | static void hp_main_output_ramp(struct mt6358_priv *priv, bool up) {
int i, stage;
int target = 7;
for (i = 0; i <= target; i++) {
stage = up ? i : target - i;
regmap_update_bits(priv->regmap, MT6358_AUDDEC_ANA_CON1, 0x7 << 8,
stage << 8);
regmap_update_bits(priv->regmap, MT635... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c |
static void hp_pull_down(struct mt6358_priv *priv, bool enable) {
int i;
if (enable) {
for (i = 0x0; i <= 0x6; i++) {
regmap_update_bits(priv->regmap, MT6358_AUDDEC_ANA_CON4, 0x7, i);
usleep_range(600, 700);
}
} else {
for (i = 0x6; i >= 0x1; i--) {
regmap_update_bits(priv->regmap,... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c |
static bool is_valid_hp_pga_idx(int reg_idx) {
return (reg_idx >= DL_GAIN_8DB && reg_idx <= DL_GAIN_N_10DB) ||
reg_idx == DL_GAIN_N_40DB;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c |
static int mt6358_get_wov(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol);
struct mt6358_priv *priv = snd_soc_component_get_drvdata(c);
ucontrol->value.integer.value[0] = priv->wov_enabled;
retur... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c | static int mt_sgen_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt);
dev_dbg(priv->dev, "%s(), event = 0x%x\n", __func__, ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c | static int mt_aif_in_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt);
dev_info(priv->dev, "%s(), event 0x%x, rate %d\n"... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c |
static void mt6358_restore_pga(struct mt6358_priv *priv) {
unsigned int gain_l, gain_r;
gain_l = priv->ana_gain[AUDIO_ANALOG_VOLUME_MICAMP1];
gain_r = priv->ana_gain[AUDIO_ANALOG_VOLUME_MICAMP2];
regmap_update_bits(priv->regmap, MT6358_AUDENC_ANA_CON0,
RG_AUDPREAMPLGAIN_MASK_SFT,
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6358.c |
static void mt6358_parse_dt(struct mt6358_priv *priv) {
int ret;
struct device *dev = priv->dev;
ret = of_property_read_u32(dev->of_node, "mediatek,dmic-mode",
&priv->dmic_one_wire_mode);
if (ret) {
dev_warn(priv->dev, "%s() failed to read dmic-mode\n", __func__);
priv->dm... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359-accdet.c | static unsigned int adjust_eint_analog_setting(struct mt6359_accdet *priv) {
if (priv->data->eint_detect_mode == 0x3 ||
priv->data->eint_detect_mode == 0x4) {
regmap_update_bits(priv->regmap, RG_ACCDETSPARE_ADDR, 1 << 8, 0);
}
if (priv->data->eint_detect_mode == 0x4) {
if (priv->caps & ACCDET_PMIC_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6359-accdet.c | static unsigned int mt6359_accdet_jd_setting(struct mt6359_accdet *priv) {
if (priv->jd_sts == M_PLUG_IN) {
adjust_eint_digital_setting(priv);
/* adjust analog setting */
adjust_eint_analog_setting(priv);
} else if (priv->jd_sts == M_PLUG_OUT) {
/* set debounce to 1ms */
accdet_set_debounce(pri... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359-accdet.c |
static void mt6359_accdet_work(struct work_struct *work) {
struct mt6359_accdet *priv =
container_of(work, struct mt6359_accdet, accdet_work);
mutex_lock(&priv->res_lock);
priv->pre_accdet_status = priv->accdet_status;
check_jack_btn_type(priv);
if (priv->jack_plugged && priv->pre_accdet_status != pr... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c | static void mt6359_set_playback_gpio(struct mt6359_priv *priv) {
regmap_write(priv->regmap, MT6359_GPIO_MODE2_CLR, 0x0ffe);
regmap_write(priv->regmap, MT6359_GPIO_MODE2_SET, 0x0249);
/* sync mosi */
regmap_write(priv->regmap, MT6359_GPIO_MODE3_CLR, 0x6);
regmap_write(priv->regmap, MT6359_GPIO_MODE3_SET, 0x1... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c | static void mt6359_reset_playback_gpio(struct mt6359_priv *priv) {
regmap_write(priv->regmap, MT6359_GPIO_MODE2_CLR, 0x0ff8);
regmap_update_bits(priv->regmap, MT6359_GPIO_DIR0, 0x7 << 9, 0x0);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c | void mt6359_mtkaif_calibration_enable(struct snd_soc_component *cmpnt) {
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
mt6359_set_playback_gpio(priv);
mt6359_set_capture_gpio(priv);
mt6359_mtkaif_tx_enable(priv);
mt6359_set_dcxo(priv, true);
mt6359_set_aud_global_bias(priv, true);
mt6... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c |
static bool is_valid_hp_pga_idx(int reg_idx) {
return (reg_idx >= DL_GAIN_8DB && reg_idx <= DL_GAIN_N_22DB) ||
reg_idx == DL_GAIN_N_40DB;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c |
static int mt_hp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c | static int mt_mic_bias_2_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
unsigned int mic_type = priv->mux_select[M... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c | static int mt_ul_src_34_dmic_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
dev_dbg(priv->dev, "%s(), event =... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c |
static int mt_pga_l_mux_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
unsigned int mux = dapm_kcontrol_get_value(... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c |
static int mt_pga_r_mux_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
unsigned int mux = dapm_kcontrol_get_value(... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c | static int mt_hp_damp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
switch (event) {
case SND_SOC_DAPM_POST_PMD:
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c | static int mt_sdm_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
regm... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c |
static int mt6359_codec_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct snd_soc_component *cmpnt = dai->component;
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
dev_dbg(priv->dev, "%s stream %d\n", __func__, substream->str... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c |
static void mt6359_codec_remove(struct snd_soc_component *cmpnt) {
cmpnt->regmap = NULL;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/mt6359.c |
static int mt6359_platform_driver_probe(struct platform_device *pdev) {
struct mt6359_priv *priv;
int ret;
struct mt6397_chip *mt6397 = dev_get_drvdata(pdev->dev.parent);
dev_dbg(&pdev->dev, "%s(), dev name %s\n", __func__, dev_name(&pdev->dev));
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6660.c |
static int mt6660_reg_read(void *context, unsigned int reg, unsigned int *val) {
struct mt6660_chip *chip = context;
int size = mt6660_get_reg_size(reg);
int i, ret;
u8 data[4];
u32 reg_data = 0;
ret = i2c_smbus_read_i2c_block_data(chip->i2c, reg, size, data);
if (ret < 0)
return ret;
for (i = 0; ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6660.c |
static int mt6660_component_get_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct mt6660_chip *chip =
(struct mt6660_chip *)snd_soc_component_get_drvdata(componen... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/mt6660.c |
static int mt6660_component_aif_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params,
struct snd_soc_dai *dai) {
int word_len = params_physical_width(hw_params);
int aud_bit = params_width(hw_params);
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/nau8540.c | static int adc_power_control(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);
if (SND_SOC_DAPM_EVENT_ON(event)) {
mslee... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8540.c |
static int nau8540_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct snd_soc_component *component = dai->component;
struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);
const struct nau8540_osr_attr *osr;
osr = nau8540_get_osr(nau8... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8540.c |
static void nau8540_reset_chip(struct regmap *regmap) {
regmap_write(regmap, NAU8540_REG_SW_RESET, 0x00);
regmap_write(regmap, NAU8540_REG_SW_RESET, 0x00);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8540.c |
static int __maybe_unused nau8540_suspend(struct snd_soc_component *component) {
struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);
regcache_cache_only(nau8540->regmap, true);
regcache_mark_dirty(nau8540->regmap);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8540.c |
static int __maybe_unused nau8540_resume(struct snd_soc_component *component) {
struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);
regcache_cache_only(nau8540->regmap, false);
regcache_sync(nau8540->regmap);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8810.c |
static bool nau8810_readable_reg(struct device *dev, unsigned int reg) {
switch (reg) {
case NAU8810_REG_RESET ... NAU8810_REG_SMPLR:
case NAU8810_REG_DAC ... NAU8810_REG_DACGAIN:
case NAU8810_REG_ADC ... NAU8810_REG_ADCGAIN:
case NAU8810_REG_EQ1 ... NAU8810_REG_EQ5:
case NAU8810_REG_DACLIM1 ... NAU8810_RE... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8810.c | static int nau8810_eq_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct nau8810 *nau8810 = snd_soc_component_get_drvdata(component);
struct soc_bytes_ext *params = (void *)kcontrol-... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/nau8810.c |
static int check_mclk_select_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 nau8810 *nau8810 = snd_soc_component_get_drvdata(component);
unsigned int value;
regma... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8810.c |
static int nau8810_set_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir) {
struct snd_soc_component *component = dai->component;
struct nau8810 *nau8810 = snd_soc_component_get_drvdata(component);
nau8810->clk_id = clk_id;
nau8810->sysclk = freq;
dev_dbg(n... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8810.c |
static int nau8810_set_pll(struct snd_soc_dai *codec_dai, int pll_id,
int source, unsigned int freq_in,
unsigned int freq_out) {
struct snd_soc_component *component = codec_dai->component;
struct nau8810 *nau8810 = snd_soc_component_get_drvdata(component);
st... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8821.c |
static int nau8821_biq_coeff_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct soc_bytes_ext *params = (void *)kcontrol->private_value;
if (!component->regmap)
return -EINVAL;
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8821.c |
static int nau8821_biq_coeff_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct soc_bytes_ext *params = (void *)kcontrol->private_value;
void *data;
if (!component->regmap)
ret... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8821.c | static int nau8821_output_dac_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 nau8821 *nau8821 = snd_soc_component_get_drvdata(component);
switch (event) {
case ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8821.c | static bool nau8821_is_jack_inserted(struct regmap *regmap) {
bool active_high, is_high;
int status, jkdet;
regmap_read(regmap, NAU8821_R0D_JACK_DET_CTRL, &jkdet);
active_high = jkdet & NAU8821_JACK_POLARITY;
regmap_read(regmap, NAU8821_R82_GENERAL_STATUS, &status);
is_high = status & NAU8821_GPIO2_IN;
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8821.c | static void nau8821_setup_inserted_irq(struct nau8821 *nau8821) {
struct regmap *regmap = nau8821->regmap;
if (nau8821->dapm->bias_level < SND_SOC_BIAS_PREPARE)
nau8821_configure_sysclk(nau8821, NAU8821_CLK_INTERNAL, 0);
/* Chip needs one FSCLK cycle in order to generate interruptions,
* as we cannot gua... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/nau8821.c |
static void nau8821_print_device_properties(struct nau8821 *nau8821) {
struct device *dev = nau8821->dev;
dev_dbg(dev, "jkdet-enable: %d\n", nau8821->jkdet_enable);
dev_dbg(dev, "jkdet-pull-enable: %d\n", nau8821->jkdet_pull_enable);
dev_dbg(dev, "jkdet-pull-up: %d\n", nau8821->jkdet_pull_up... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/nau8821.c |
static int nau8821_i2c_probe(struct i2c_client *i2c) {
struct device *dev = &i2c->dev;
struct nau8821 *nau8821 = dev_get_platdata(&i2c->dev);
int ret, value;
if (!nau8821) {
nau8821 = devm_kzalloc(dev, sizeof(*nau8821), GFP_KERNEL);
if (!nau8821)
return -ENOMEM;
nau8821_read_device_propertie... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/nau8822.c |
static bool nau8822_writeable_reg(struct device *dev, unsigned int reg) {
switch (reg) {
case NAU8822_REG_RESET ... NAU8822_REG_JACK_DETECT_CONTROL_1:
case NAU8822_REG_DAC_CONTROL ... NAU8822_REG_LEFT_ADC_DIGITAL_VOLUME:
case NAU8822_REG_RIGHT_ADC_DIGITAL_VOLUME:
case NAU8822_REG_EQ1 ... NAU8822_REG_EQ5:
c... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8822.c | static int nau8822_config_clkdiv(struct snd_soc_dai *dai, int div, int rate) {
struct snd_soc_component *component = dai->component;
struct nau8822 *nau8822 = snd_soc_component_get_drvdata(component);
struct nau8822_pll *pll = &nau8822->pll;
int i, sclk, imclk;
switch (nau8822->div_id) {
case NAU8822_CLK_M... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8822.c |
static int nau8822_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
switch (level) {
case SND_SOC_BIAS_ON:
case SND_SOC_BIAS_PREPARE:
snd_soc_component_update_bits(component, NAU8822_REG_POWER_MANAGEMENT_1,
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/nau8822.c | static int nau8822_i2c_probe(struct i2c_client *i2c) {
struct device *dev = &i2c->dev;
struct nau8822 *nau8822 = dev_get_platdata(dev);
int ret;
if (!nau8822) {
nau8822 = devm_kzalloc(dev, sizeof(*nau8822), GFP_KERNEL);
if (nau8822 == NULL)
return -ENOMEM;
}
i2c_set_clientdata(i2c, nau8822);
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c |
static int nau8824_sema_acquire(struct nau8824 *nau8824, long timeout) {
int ret;
if (timeout) {
ret = down_timeout(&nau8824->jd_sem, timeout);
if (ret < 0)
dev_warn(nau8824->dev, "Acquire semaphore timeout\n");
} else {
ret = down_interruptible(&nau8824->jd_sem);
if (ret < 0)
dev_wa... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c | static int nau8824_output_dac_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 nau8824 *nau8824 = snd_soc_component_get_drvdata(component);
switch (event) {
case ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c | static int nau8824_pump_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 nau8824 *nau8824 = snd_soc_component_get_drvdata(component);
switch (event) {
case SND_SOC_DAPM... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c | static int dmic_clock_control(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component);
int src;
for (src = 0; src < 5; src++) {
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c |
static bool nau8824_is_jack_inserted(struct nau8824 *nau8824) {
struct snd_soc_jack *jack = nau8824->jack;
bool insert = false;
if (nau8824->irq && jack)
insert = jack->status & SND_JACK_HEADPHONE;
return insert;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c | static void nau8824_int_status_clear_all(struct regmap *regmap) {
int active_irq, clear_irq, i;
regmap_read(regmap, NAU8824_REG_IRQ, &active_irq);
for (i = 0; i < NAU8824_REG_DATA_LEN; i++) {
clear_irq = (0x1 << i);
if (active_irq & clear_irq)
regmap_write(regmap, NAU8824_REG_CLEAR_INT_REG, clear_i... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c | static int nau8824_set_pll(struct snd_soc_component *component, int pll_id,
int source, unsigned int freq_in,
unsigned int freq_out) {
struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component);
struct nau8824_fll fll_param;
int ret, fs;
fs = freq_o... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c | static void nau8824_resume_setup(struct nau8824 *nau8824) {
nau8824_config_sysclk(nau8824, NAU8824_CLK_DIS, 0);
if (nau8824->irq) {
nau8824_int_status_clear_all(nau8824->regmap);
/* Enable jack detection at sleep mode, insertion detection,
* and ejection detection.
*/
regmap_update_bits(nau88... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c |
static int nau8824_component_probe(struct snd_soc_component *component) {
struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component);
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
nau8824->dapm = dapm;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8824.c |
const char *nau8824_components(void) {
nau8824_check_quirks();
if (nau8824_quirk & NAU8824_MONO_SPEAKER)
return "cfg-spk:1";
else
return "cfg-spk:2";
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c | static inline void nau8825_sema_reset(struct nau8825 *nau8825) {
nau8825->xtalk_sem.count = 1;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c | static u32 nau8825_xtalk_sidetone(u32 sig_org, u32 sig_cros) {
u32 gain, sidetone;
if (WARN_ON(sig_org == 0 || sig_cros == 0))
return 0;
sig_org = nau8825_intlog10_dec3(sig_org);
sig_cros = nau8825_intlog10_dec3(sig_cros);
if (sig_org >= sig_cros)
gain = (sig_org - sig_cros) * 20 + GAIN_AUGMENT;
e... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c | static void nau8825_xtalk_backup(struct nau8825 *nau8825) {
int i;
if (nau8825->xtalk_baktab_initialized)
return;
for (i = 0; i < ARRAY_SIZE(nau8825_xtalk_baktab); i++)
regmap_read(nau8825->regmap, nau8825_xtalk_baktab[i].reg,
&nau8825_xtalk_baktab[i].def);
nau8825->xtalk_baktab_initi... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c | static void nau8825_xtalk_restore(struct nau8825 *nau8825, bool cause_cancel) {
int i, volume;
if (!nau8825->xtalk_baktab_initialized)
return;
for (i = 0; i < ARRAY_SIZE(nau8825_xtalk_baktab); i++) {
if (!cause_cancel &&
nau8825_xtalk_baktab[i].reg == NAU8825_REG_HSVOL_CTRL) {
/* Ramping u... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c | static void nau8825_xtalk_clean_adc(struct nau8825 *nau8825) {
regmap_update_bits(nau8825->regmap, NAU8825_REG_ANALOG_ADC_2,
NAU8825_POWERUP_ADCL | NAU8825_ADC_VREFSEL_MASK, 0);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c | static int system_clock_control(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
struct regmap *regmap = nau8825->regmap;... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c | static int nau8825_button_decode(int value) {
int buttons = 0;
if (value & BIT(0))
buttons |= SND_JACK_BTN_0;
if (value & BIT(1))
buttons |= SND_JACK_BTN_1;
if (value & BIT(2))
buttons |= SND_JACK_BTN_2;
if (value & BIT(3))
buttons |= SND_JACK_BTN_3;
if (value & BIT(4))
buttons |= SND_J... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c |
static int nau8825_component_probe(struct snd_soc_component *component) {
struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
nau8825->dapm = dapm;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c | static int nau8825_resume_setup(struct nau8825 *nau8825) {
struct regmap *regmap = nau8825->regmap;
nau8825_configure_sysclk(nau8825, NAU8825_CLK_DIS, 0);
/* Clear all interruption status */
nau8825_int_status_clear_all(regmap);
/* Enable both insertion and ejection interruptions, and then
* bypass de-b... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c | static int __maybe_unused nau8825_suspend(struct snd_soc_component *component) {
struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
disable_irq(nau8825->irq);
snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
snd_soc_dapm_disable_pin(nau8825->dapm, "SAR");
snd_soc_dapm_disabl... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c |
static void nau8825_print_device_properties(struct nau8825 *nau8825) {
int i;
struct device *dev = nau8825->dev;
dev_dbg(dev, "jkdet-enable: %d\n", nau8825->jkdet_enable);
dev_dbg(dev, "jkdet-pull-enable: %d\n", nau8825->jkdet_pull_enable);
dev_dbg(dev, "jkdet-pull-up: %d\n", nau8825->jkde... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/nau8825.c |
static void nau8825_i2c_remove(struct i2c_client *client) {} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm1681.c | static int pcm1681_set_deemph(struct snd_soc_component *component) {
struct pcm1681_private *priv = snd_soc_component_get_drvdata(component);
int i, val = -1, enable = 0;
if (priv->deemph) {
for (i = 0; i < ARRAY_SIZE(pcm1681_deemph); i++) {
if (pcm1681_deemph[i] == priv->rate) {
val = i;
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm1681.c |
static int pcm1681_put_deemph(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct pcm1681_private *priv = snd_soc_component_get_drvdata(component);
priv->deemph = ucontrol->value.in... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm1789.c |
static bool pcm1789_accessible_reg(struct device *dev, unsigned int reg) {
return reg >= PCM1789_MUTE_CONTROL && reg <= PCM1789_DAC_VOL_RIGHT;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm179x-spi.c |
static int pcm179x_spi_probe(struct spi_device *spi) {
struct regmap *regmap;
int ret;
regmap = devm_regmap_init_spi(spi, &pcm179x_regmap_config);
if (IS_ERR(regmap)) {
ret = PTR_ERR(regmap);
dev_err(&spi->dev, "Failed to allocate regmap: %d\n", ret);
return ret;
}
return pcm179x_common_init(... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm179x.c |
static bool pcm179x_accessible_reg(struct device *dev, unsigned int reg) {
return reg >= 0x10 && reg <= 0x17;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm186x.c |
static int pcm186x_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
dev_dbg(component->dev, "## %s: %d -> %d\n", __func__,
snd_soc_component_get_bias_level(component), level);
switch (level) {
case SND_SOC_BIAS_ON:
break;
case... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm186x.c | int pcm186x_probe(struct device *dev, enum pcm186x_type type, int irq,
struct regmap *regmap) {
struct pcm186x_priv *priv;
int i, ret;
priv = devm_kzalloc(dev, sizeof(struct pcm186x_priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
dev_set_drvdata(dev, priv);
priv->regmap = regmap;
f... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm3060-spi.c |
static int pcm3060_spi_probe(struct spi_device *spi) {
struct pcm3060_priv *priv;
priv = devm_kzalloc(&spi->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
spi_set_drvdata(spi, priv);
priv->regmap = devm_regmap_init_spi(spi, &pcm3060_regmap);
if (IS_ERR(priv->regmap))
return PTR_ERR(... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm3060.c | static int pcm3060_set_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir) {
struct snd_soc_component *comp = dai->component;
struct pcm3060_priv *priv = snd_soc_component_get_drvdata(comp);
unsigned int reg;
unsigned int val;
if (dir != SND_SOC_CLOCK_IN) {
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm3060.c |
static bool pcm3060_reg_readable(struct device *dev, unsigned int reg) {
return (reg >= PCM3060_REG64);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm3060.c | static bool pcm3060_reg_volatile(struct device *dev, unsigned int reg) {
return (reg == PCM3060_REG64);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.