Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
sound/soc/codecs/tscs454.c
static int pll_power_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 tscs454 *tscs454 = snd_soc_component_get_drvdata(component); bool enable; bool pll1; unsigned int ms...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/tscs454.c
static inline int aif_set_provider(struct snd_soc_component *component, unsigned int aif_id, bool provider) { unsigned int reg; unsigned int mask; unsigned int val; int ret; switch (aif_id) { case TSCS454_DAI1_ID: reg = R_I2SP1CTL; break; case TSCS454_DAI2_ID: ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/tscs454.c
static int tscs454_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_component *component = dai->component; struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); unsigned int val; int bclk_dai; dev_dbg(component->dev, "%s(...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/tscs454.c
static int tscs454_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct snd_soc_component *component = dai->component; struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); struct aif *aif = &tscs454->aifs[dai->id]; int ret; ret = set_aif_provider_from_fmt(component, aif, fmt); if...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/tscs454.c
static int set_aif_sample_format(struct snd_soc_component *component, snd_pcm_format_t format, int aif_id) { unsigned int reg; unsigned int width; int ret; switch (snd_pcm_format_width(format)) { case 16: width = FV_WL_16; break; case 20: width = FV_WL_20; ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl4030.c
static void twl4030_get_board_param_values(struct twl4030_board_params *board_params, struct device_node *node) { int value; of_property_read_u32(node, "ti,digimic_delay", &board_params->digimic_delay); of_property_read_u32(node, "ti,ramp_delay_value", &boar...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl4030.c
static int twl4030_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { switch (level) { case SND_SOC_BIAS_ON: break; case SND_SOC_BIAS_PREPARE: break; case SND_SOC_BIAS_STANDBY: if (snd_soc_component_get_bias_level(component) == SND...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/twl4030.c
static int twl4030_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); if (twl4030->master_substream) { twl4030->slave_substream = subs...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl4030.c
static void twl4030_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); if (twl4030->master_substream == substream) twl4030->master_...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/twl4030.c
static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_component *component = codec_dai->component; struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); switch (freq) { case 19200000: cas...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/twl4030.c
static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { struct snd_soc_component *component = codec_dai->component; struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); u8 old_format, format; old_format = twl4030_read(component, TWL40...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl4030.c
static int twl4030_set_tristate(struct snd_soc_dai *dai, int tristate) { struct snd_soc_component *component = dai->component; u8 reg = twl4030_read(component, TWL4030_REG_AUDIO_IF); if (tristate) reg |= TWL4030_AIF_TRI_EN; else reg &= ~TWL4030_AIF_TRI_EN; return twl4030_write(component, TWL4030_RE...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl4030.c
static int twl4030_codec_probe(struct platform_device *pdev) { return devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_twl4030, twl4030_dai, ARRAY_SIZE(twl4030_dai)); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
static inline void twl6040_update_dl12_cache(struct snd_soc_component *component, u8 reg, u8 value) { struct twl6040_data *priv = snd_soc_component_get_drvdata(component); switch (reg) { case TWL6040_REG_HSLCTL: case TWL6040_REG_HSRCTL: case TWL6040_REG_EARCTL: case TWL6040_REG_H...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
static int twl6040_write(struct snd_soc_component *component, unsigned int reg, unsigned int value) { struct twl6040 *twl6040 = to_twl6040(component); if (reg >= TWL6040_CACHEREGNUM) return -EIO; twl6040_update_dl12_cache(component, reg, value); if (twl6040_can_write_to_chip(comp...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
static int twl6040_soc_dapm_put_vibra_enum(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; unsigned int val;...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
int twl6040_get_dl1_gain(struct snd_soc_component *component) { struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); if (snd_soc_dapm_get_pin_status(dapm, "EP")) return -1; if (snd_soc_dapm_get_pin_status(dapm, "HSOR") || snd_soc_dapm_get_pin_status(dapm, "HSOL")) { u8 val =...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
static int twl6040_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { struct twl6040 *twl6040 = to_twl6040(component); struct twl6040_data *priv = snd_soc_component_get_drvdata(component); int ret = 0; switch (level) { case SND_SOC_BIAS_ON: ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
static int twl6040_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; struct twl6040_data *priv = snd_soc_component_get_drvdata(component); snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_R...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
static int twl6040_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; struct twl6040_data *priv = snd_soc_component_get_drvdata(component); int r...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
static int twl6040_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; struct twl6040 *twl6040 = to_twl6040(component); struct twl6040_data *priv = snd_soc_component_get_drvdata(component); int ret; if (!pri...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_component *component = codec_dai->component; struct twl6040_data *priv = snd_soc_component_get_drvdata(component); switch (clk_id) { case TWL6040_SYSCLK_S...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/twl6040.c
static int twl6040_probe(struct snd_soc_component *component) { struct twl6040_data *priv; struct platform_device *pdev = to_platform_device(component->dev); int ret = 0; priv = devm_kzalloc(component->dev, sizeof(*priv), GFP_KERNEL); if (priv == NULL) return -ENOMEM; snd_soc_component_set_drvdata(co...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/uda1334.c
static int uda1334_codec_probe(struct platform_device *pdev) { struct uda1334_priv *uda1334; int ret; uda1334 = devm_kzalloc(&pdev->dev, sizeof(struct uda1334_priv), GFP_KERNEL); if (!uda1334) return -ENOMEM; platform_set_drvdata(pdev, uda1334); uda1334->mute = devm_gpiod_get(&pdev->dev, "nxp,mute",...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/uda134x.c
static inline void uda134x_reset(struct snd_soc_component *component) { struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); unsigned int mask = 1 << 6; regmap_update_bits(uda134x->regmap, UDA134X_STATUS0, mask, mask); msleep(1); regmap_update_bits(uda134x->regmap, UDA134X_STATUS0, mask,...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/uda134x.c
static void uda134x_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); if (uda134x->master_substream == substream) uda134x->master...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/uda134x.c
static int uda134x_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { struct snd_soc_component *component = codec_dai->component; struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); pr_debug("%s fmt: %08X\n", __func__, fmt); if ((fmt & SND_SOC_DA...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/uda1380.c
static int uda1380_set_dai_fmt_both(struct snd_soc_dai *codec_dai, unsigned int fmt) { struct snd_soc_component *component = codec_dai->component; int iface; iface = uda1380_read_reg_cache(component, UDA1380_IFACE); iface &= ~(R01_SFORI_MASK | R01_SIM | R01_SFORO_MASK); s...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/uda1380.c
static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; u16 clk = uda1380_read_reg_cache(component, UDA1380_CLK); if (clk & R00_DAC_CLK) { u16 pm = uda1380_read_reg_cache(component,...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/uda1380.c
static int uda1380_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { int pm = uda1380_read_reg_cache(component, UDA1380_PM); int reg; struct uda1380_platform_data *pdata = component->dev->platform_data; switch (level) { case SND_SOC_BIAS_ON...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
static inline void wcd_clsh_set_buck_mode(struct snd_soc_component *comp, int mode) { if (mode == CLS_H_HIFI) snd_soc_component_update_bits(comp, WCD9XXX_A_ANA_RX_SUPPLIES, WCD9XXX_A_ANA_RX_VPOS_PWR_LVL_MASK, ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
static void wcd_clsh_buck_ctrl(struct wcd_clsh_ctrl *ctrl, int mode, bool enable) { struct snd_soc_component *comp = ctrl->comp; if ((enable && (++ctrl->buck_users == 1)) || (!enable && (--ctrl->buck_users == 0))) snd_soc_component_update_bits(comp, WCD9XXX_A_ANA_RX_SUPPLIE...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
static void wcd_clsh_v3_set_hph_mode(struct snd_soc_component *component, int mode) { u8 val; switch (mode) { case CLS_H_NORMAL: val = 0x00; break; case CLS_AB: case CLS_H_ULP: val = 0x0C; break; case CLS_AB_HIFI: case CLS_H_HIFI: val = 0x08; ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
void wcd_clsh_set_hph_mode(struct wcd_clsh_ctrl *ctrl, int mode) { struct snd_soc_component *comp = ctrl->comp; if (ctrl->codec_version >= WCD937X) wcd_clsh_v3_set_hph_mode(comp, mode); else wcd_clsh_v2_set_hph_mode(comp, mode); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
static void wcd_clsh_set_flyback_current(struct snd_soc_component *comp, int mode) { snd_soc_component_update_bits(comp, WCD9XXX_RX_BIAS_FLYB_BUFF, WCD9XXX_RX_BIAS_FLYB_VPOS_5_UA_MASK, 0x0A); snd_soc_component_update_bits(comp, WCD9XXX_RX_BIA...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
static void wcd_clsh_v3_set_flyback_mode(struct snd_soc_component *component, int mode) { if (mode == CLS_H_HIFI || mode == CLS_H_LOHIFI || mode == CLS_AB_HIFI || mode == CLS_AB_LOHIFI) { snd_soc_component_update_bits(component, WCD9XXX_ANA_RX_SUPPLIES, 0x04, ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
static void wcd_clsh_v3_force_iq_ctl(struct snd_soc_component *component, int mode, bool enable) { if (enable) { snd_soc_component_update_bits(component, WCD9XXX_FLYBACK_VNEGDAC_CTRL_2, 0xE0, 0xA0); usleep_range(100, 110); snd_soc_com...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
static void wcd_clsh_v3_flyback_ctrl(struct snd_soc_component *component, struct wcd_clsh_ctrl *ctrl, int mode, bool enable) { if ((enable && (++ctrl->flyback_users == 1)) || (!enable && (--ctrl->flyback_users == 0))) { snd_soc_compo...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
static void wcd_clsh_v3_state_hph_r(struct wcd_clsh_ctrl *ctrl, int req_state, bool is_enable, int mode) { struct snd_soc_component *component = ctrl->comp; if (mode == CLS_H_NORMAL) { dev_dbg(component->dev, "%s: Normal mode not applicable for hph_r\n", __func__...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-clsh-v2.c
void wcd_clsh_ctrl_free(struct wcd_clsh_ctrl *ctrl) { kfree(ctrl); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
static inline int wcd_mbhc_write_field(const struct wcd_mbhc *mbhc, int field, int val) { if (!mbhc->fields[field].reg) return 0; return snd_soc_component_write_field(mbhc->component, mbhc->fields[field].reg, mbhc->fields[field].mas...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
static void wcd_mbhc_curr_micbias_control(const struct wcd_mbhc *mbhc, const enum wcd_mbhc_cs_mb_en_flag cs_mb_en) { if (mbhc->mbhc_cb->mbhc_micbias_control) return; switch (cs_mb_en) { case WCD_MBHC_EN_CS: wcd_mbhc_write_field(mbhc, WCD_MBHC_MICB_CTRL, 0); wcd_mbhc_wri...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
static void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion, enum snd_jack_types jack_type) { WARN_ON(!mutex_is_locked(&mbhc->lock)); if (!insertion) wcd_mbhc_report_plug_removal(mbhc, jack_type); else wcd_mbhc_report_plug_insertion(mbhc, jack_type); }
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
static void wcd_mbhc_find_plug_and_report(struct wcd_mbhc *mbhc, enum wcd_mbhc_plug_type plug_type) { if (mbhc->current_plug == plug_type) return; mutex_lock(&mbhc->lock); switch (plug_type) { case MBHC_PLUG_TYPE_HEADPHONE: wcd_mbhc_report_plug(mbhc, 1, SND_J...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
static int wcd_get_voltage_from_adc(u8 val, int micbias) { return ((val * 125 * micbias) / (WCD_MBHC_ADC_MICBIAS_MV * 10)); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
static int wcd_measure_adc_once(struct wcd_mbhc *mbhc, int mux_ctl) { struct device *dev = mbhc->dev; u8 adc_timeout = 0; u8 adc_complete = 0; u8 adc_result; int retry = 6; int ret; int output_mv = 0; u8 adc_en; wcd_mbhc_write_field(mbhc, WCD_MBHC_ADC_MODE, 0); adc_en = wcd_mbhc_read_field(mbhc, W...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
static void wcd_mbhc_adc_update_fsm_source(struct wcd_mbhc *mbhc, enum wcd_mbhc_plug_type plug_type) { bool micbias2 = false; switch (plug_type) { case MBHC_PLUG_TYPE_HEADPHONE: wcd_mbhc_write_field(mbhc, WCD_MBHC_BTN_ISRC_CTL, 3); break; case MBHC_PLUG_TYPE_...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
static void wcd_mbhc_bcs_enable(struct wcd_mbhc *mbhc, int plug_type, bool enable) { switch (plug_type) { case MBHC_PLUG_TYPE_HEADSET: case MBHC_PLUG_TYPE_HEADPHONE: if (mbhc->mbhc_cb->bcs_enable) mbhc->mbhc_cb->bcs_enable(mbhc->component, enable); break; default: ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
static int wcd_mbhc_get_spl_hs_thres(struct wcd_mbhc *mbhc) { int hs_threshold, micbias_mv; micbias_mv = wcd_mbhc_get_micbias(mbhc); if (mbhc->cfg->hs_thr && mbhc->cfg->micb_mv != WCD_MBHC_ADC_MICBIAS_MV) { if (mbhc->cfg->micb_mv == micbias_mv) hs_threshold = mbhc->cfg->hs_thr; else hs_thres...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
int wcd_mbhc_get_impedance(struct wcd_mbhc *mbhc, uint32_t *zl, uint32_t *zr) { *zl = mbhc->zl; *zr = mbhc->zr; if (*zl && *zr) return 0; else return -EINVAL; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.c
void wcd_mbhc_deinit(struct wcd_mbhc *mbhc) { mutex_lock(&mbhc->lock); wcd_cancel_hs_detect_plug(mbhc, &mbhc->correct_plug_swch); mutex_unlock(&mbhc->lock); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd-mbhc-v2.h
static inline void wcd_mbhc_stop(struct wcd_mbhc *mbhc) {}
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int slim_rx_mux_get(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kc); struct wcd9335_codec *wcd = dev_get_drvdata(w->dapm->dev); u32 port_id = w->shift; ucontrol->value.enumerated.item[0] = wcd->r...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_int_dem_inp_mux_put(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { struct soc_enum *e = (struct soc_enum *)kc->private_value; struct snd_soc_component *component; int reg, val; component = snd_soc_dapm_kcontrol_component(kc); val = uc...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_set_mix_interpolator_rate(struct snd_soc_dai *dai, int rate_val, u32 rate) { struct snd_soc_component *component = dai->component; struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); struct wcd9335_slim_ch *ch; int val, j; list_for_eac...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct wcd_slim_codec_dai_data *dai_data; struct wcd9335_codec *wcd; struct slim_stream_config *cfg; wcd = snd_soc_component_get_drvdata(dai->component); dai_data = &wcd->dai[dai->...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_rx_hph_mode_get(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *component = snd_soc_kcontrol_component(kc); struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); ucontrol->value.enumerated.item[0] = wcd->hph_m...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_codec_enable_adc(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kc, int event) { struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_PRE_PMU: wcd9335_codec_set_tx_hold(comp, w->reg, true); bre...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static u16 wcd9335_codec_get_amic_pwlvl_reg(struct snd_soc_component *comp, int amic) { u16 pwr_level_reg = 0; switch (amic) { case 1: case 2: pwr_level_reg = WCD9335_ANA_AMIC1; break; case 3: case 4: pwr_level_reg = WCD9335_ANA_AMIC3; break; ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_codec_hphl_dac_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kc, int event) { struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); int hph_mode = wcd->hph_mode; u8 dem_i...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_codec_lineout_dac_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kc, int event) { struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); switch (event) { case SND_SOC_...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_codec_ear_dac_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kc, int event) { struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); switch (event) { case SND_SOC_DAPM_PRE...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_codec_enable_rx_bias(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kc, int event) { struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); switch (event) { case SND_SOC_DAPM_P...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_codec_enable_ear_pa(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kc, int event) { struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); switch (event) { case SND_SOC_DAPM_POST_PMU: usleep_range(5000, 5500); snd_soc_component...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static void wcd9335_teardown_irqs(struct wcd9335_codec *wcd) { int i; for (i = 0; i < WCD9335_SLIM_NUM_PORT_REG; i++) regmap_write(wcd->if_regmap, WCD9335_SLIM_PGD_PORT_INT_EN0 + i, 0x00); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_disable_mclk(struct wcd9335_codec *wcd) { if (wcd->clk_mclk_users <= 0) return -EINVAL; if (--wcd->clk_mclk_users == 0) { if (wcd->clk_rco_users > 0) { regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP, WCD9335_ANA_CLK_MCLK_SRC_MASK, ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static void wcd9335_codec_init(struct snd_soc_component *component) { struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); int i; regmap_update_bits(wcd->regmap, WCD9335_CODEC_RPM_CLK_GATE, WCD9335_CODEC_RPM_CLK_GATE_MCLK_GATE_MASK, 0); regmap_update_bits(wcd->regmap, WCD9335_CODE...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_codec_probe(struct snd_soc_component *component) { struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); int ret; int i; snd_soc_component_init_regmap(component, wcd->regmap); wcd->clsh_ctrl = wcd_clsh_ctrl_alloc(component, WCD9335); if (IS_ERR(wcd->clsh_ctrl)) return PTR_ERR...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd9335.c
static int wcd9335_slim_status(struct slim_device *sdev, enum slim_device_status status) { struct device *dev = &sdev->dev; struct device_node *ifc_dev_np; struct wcd9335_codec *wcd; int ret; wcd = dev_get_drvdata(dev); ifc_dev_np = of_parse_phandle(dev->of_node, "slim-ifc-...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_disable_ana_bias_and_syclk(struct wcd934x_codec *wcd) { mutex_lock(&wcd->sysclk_mutex); if (--wcd->sysclk_users != 0) { mutex_unlock(&wcd->sysclk_mutex); return 0; } mutex_unlock(&wcd->sysclk_mutex); regmap_update_bits(wcd->regmap, WCD934X_CLK_SYS_MCLK_PRG, WC...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_get_version(struct wcd934x_codec *wcd) { int val1, val2, ver, ret; struct regmap *regmap; u16 id_minor; u32 version_mask = 0; regmap = wcd->regmap; ver = 0; ret = regmap_bulk_read(regmap, WCD934X_CHIP_TIER_CTRL_CHIP_ID_BYTE0, (u8 *)&id_minor, sizeof(u16)); ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static void wcd934x_enable_efuse_sensing(struct wcd934x_codec *wcd) { int rc, val; __wcd934x_cdc_mclk_enable(wcd, true); regmap_update_bits(wcd->regmap, WCD934X_CHIP_TIER_CTRL_EFUSE_CTL, WCD934X_EFUSE_SENSE_STATE_MASK, WCD934X_EFUSE_SENSE_STATE_DEF); regmap_update_bit...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int swclk_gate_enable(struct clk_hw *hw) { return wcd934x_swrm_clock(to_wcd934x_codec(hw), true); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int swclk_gate_is_enabled(struct clk_hw *hw) { struct wcd934x_codec *wcd = to_wcd934x_codec(hw); int ret, val; regmap_read(wcd->regmap, WCD934X_CDC_CLK_RST_CTRL_SWR_CONTROL, &val); ret = val & WCD934X_CDC_SWR_CLK_EN_MASK; return ret; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static unsigned long swclk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { return parent_rate / 2; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static struct clk *wcd934x_register_mclk_output(struct wcd934x_codec *wcd) { struct clk *parent = wcd->extclk; struct device *dev = wcd->dev; struct device_node *np = dev->parent->of_node; const char *parent_clk_name = NULL; const char *clk_name = "mclk"; struct clk_hw *hw; struct clk_init_data init; i...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_get_micbias_val(struct device *dev, const char *micbias, u32 *micb_mv) { int mv; if (of_property_read_u32(dev->parent->of_node, micbias, &mv)) { dev_err(dev, "%s value not found, using default\n", micbias); mv = WCD934X_DEF_MICBIAS_MV; } else { m...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_comp_init(struct snd_soc_component *component) { struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); wcd934x_hw_init(wcd); wcd934x_enable_efuse_sensing(wcd); wcd934x_get_version(wcd); return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static void wcd934x_mbhc_mbhc_bias_control(struct snd_soc_component *component, bool enable) { snd_soc_component_write_field(component, WCD934X_ANA_MBHC_ELECT, WCD934X_ANA_MBHC_BIAS_EN, enable); }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static void wcd934x_mbhc_hph_l_pull_up_control(struct snd_soc_component *component, enum mbhc_hs_pullup_iref pull_up_cur) { if (pull_up_cur < I_OFF || pull_up_cur > I_3P0_UA || pull_up_cur == I_DEFAULT) pull_up_cur = I_2P0_UA; snd_soc_component_write_field(component, WCD934X...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_get_micb_vout_ctl_val(u32 micb_mv) { if (micb_mv < 1000 || micb_mv > 2850) return -EINVAL; return (micb_mv - 1000) / 50; }
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *component, int micb_num, bool req_en) { struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); int rc, micb_mv; if (micb_num != MIC_BIAS_2) return -EINVAL; if (wcd934x->micb2_m...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_comp_probe(struct snd_soc_component *component) { struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); int i; snd_soc_component_init_regmap(component, wcd->regmap); wcd->component = component; wcd->clsh_ctrl = wcd_clsh_ctrl_alloc(component, wcd->version); if (IS_ERR(wcd->clsh_ct...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static uint32_t get_iir_band_coeff(struct snd_soc_component *component, int iir_idx, int band_idx, int coeff_idx) { u32 value = 0; int reg, b2_reg; reg = WCD934X_CDC_SIDETONE_IIR0_IIR_COEF_B1_CTL + 16 * iir_idx; b2_reg = WCD934X_CDC_SIDETONE_IIR0_IIR_COEF_B2_CTL + 16 * iir_id...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_put_iir_band_audio_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); struct wcd_iir_filter_ctl *ctl = (struct wcd_iir_filter_ctl *)kcontrol->private_value; ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int slim_tx_mixer_get(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kc); struct wcd934x_codec *wcd = dev_get_drvdata(dapm->dev); struct soc_mixer_control *mixer = (struct soc_mixer_control *...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_codec_enable_mix_path(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kc, int event) { struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); int offset_val = 0; u16 gain_reg, mix_reg; int val = 0; gain_reg = WCD934X_CDC_RX0_...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static u32 wcd934x_get_dmic_sample_rate(struct snd_soc_component *comp, unsigned int dmic, struct wcd934x_codec *wcd) { u8 tx_stream_fs; u8 adc_mux_index = 0, adc_mux_sel = 0; bool dec_found = false; u16 adc_mux_ctl_reg, tx_fs_reg;...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_codec_enable_micbias(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 micb_num = w->shift; switch (event) { ...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_codec_set_jack(struct snd_soc_component *comp, struct snd_soc_jack *jack, void *data) { struct wcd934x_codec *wcd = dev_get_drvdata(comp->dev); int ret = 0; if (!wcd->mbhc) return -ENOTSUPP; if (jack && !wcd->mbhc_started) { ret = wcd_mbhc_start(wc...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd934x.c
static int wcd934x_codec_parse_data(struct wcd934x_codec *wcd) { struct device *dev = &wcd->sdev->dev; struct wcd_mbhc_config *cfg = &wcd->mbhc_cfg; struct device_node *ifc_dev_np; ifc_dev_np = of_parse_phandle(dev->of_node, "slim-ifc-dev", 0); if (!ifc_dev_np) { dev_err(dev, "No Interface device found\...
[ 1, 0 ]
Linux Kernel
sound/soc/codecs/wcd938x-sdw.c
int wcd938x_sdw_hw_params(struct wcd938x_sdw_priv *wcd, struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct sdw_port_config port_config[WCD938X_MAX_SWR_PORTS]; unsigned long ch_mask; ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd938x-sdw.c
int wcd938x_sdw_set_sdw_stream(struct wcd938x_sdw_priv *wcd, struct snd_soc_dai *dai, void *stream, int direction) { wcd->sruntime = stream; return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd938x-sdw.c
static int wcd9380_update_status(struct sdw_slave *slave, enum sdw_slave_status status) { return 0; }
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd938x.c
static int wcd938x_ear_pa_put_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); if (wcd938x->comp1_enab...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd938x.c
static int wcd938x_ldoh_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = wc...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd938x.c
static int wcd938x_ldoh_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); if (wcd938x->ldoh == ucontrol->value....
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd938x.c
static bool wcd938x_mbhc_micb_en_status(struct snd_soc_component *component, int micb_num) { u8 val; if (micb_num == MIC_BIAS_2) { val = snd_soc_component_read_field(component, WCD938X_ANA_MICB2, WCD938X_ANA_MICB2_ENABLE_MASK); ...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd938x.c
static void wcd938x_mbhc_moisture_config(struct snd_soc_component *component) { struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); if (wcd938x->mbhc_cfg.moist_rref == R_OFF) { snd_soc_component_write_field(component, WCD938X_MBHC_NEW_CTL_2, WCD938X_M_RTH_...
[ 0, 0 ]
Linux Kernel
sound/soc/codecs/wcd938x.c
static void wcd938x_mbhc_moisture_polling_ctrl(struct snd_soc_component *component, bool enable) { snd_soc_component_write_field(component, WCD938X_MBHC_NEW_INT_MOISTURE_DET_POLLING_CTRL, WCD938X_MOISTURE_EN_POLLING_MA...
[ 0, 0 ]