Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/soc/codecs/cs42l51.c | static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
unsigned long value =
snd_soc_component_read(component, CS42L51_PCM_MIXER) & 3;
switch (value) {
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs42l51.c |
static int cs42l51_set_chan_mix(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
unsigned char val;
switch (ucontrol->value.enumerated.item[0]) {
default:
case 0:
val = CHAN_M... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l51.c | static int mclk_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm);
struct cs42l51_private *cs42l51 = snd_soc_component_get_drvdata(comp);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
retu... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs42l51.c |
static int cs42l51_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int format) {
struct snd_soc_component *component = codec_dai->component;
struct cs42l51_private *cs42l51 = snd_soc_component_get_drvdata(component);
switch (format & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SO... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l51.c |
static int cs42l51_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 cs42l51_private *cs42l51 = snd_soc_component_get_drvdata(component);
cs42l51->mclk = freq;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l52.c |
static bool cs42l52_readable_register(struct device *dev, unsigned int reg) {
switch (reg) {
case CS42L52_CHIP ... CS42L52_CHARGE_PUMP:
return true;
default:
return false;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l52.c |
static int cs42l52_get_clk(int mclk, int rate) {
int i, ret = -EINVAL;
u_int mclk1, mclk2 = 0;
for (i = 0; i < ARRAY_SIZE(clk_map_table); i++) {
if (clk_map_table[i].rate == rate) {
mclk1 = clk_map_table[i].mclk;
if (abs(mclk - mclk1) < abs(mclk - mclk2)) {
mclk2 = mclk1;
ret = i... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l52.c | static int cs42l52_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) {
struct snd_soc_component *component = codec_dai->component;
struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component);
u8 iface = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
ifac... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l52.c |
static int cs42l52_mute(struct snd_soc_dai *dai, int mute, int direction) {
struct snd_soc_component *component = dai->component;
if (mute)
snd_soc_component_update_bits(component, CS42L52_PB_CTL1,
CS42L52_PB_CTL1_MUTE_MASK,
CS42L52_PB_CTL1_M... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l52.c |
static void cs42l52_remove(struct snd_soc_component *component) {
cs42l52_free_beep(component);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l56.c |
static bool cs42l56_volatile_register(struct device *dev, unsigned int reg) {
switch (reg) {
case CS42L56_INT_STATUS:
return true;
default:
return false;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l56.c |
static void cs42l56_free_beep(struct snd_soc_component *component) {
struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component);
device_remove_file(component->dev, &dev_attr_beep);
cancel_work_sync(&cs42l56->beep_work);
cs42l56->beep = NULL;
snd_soc_component_update_bits(component, CS42L56_... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l56.c |
static void cs42l56_remove(struct snd_soc_component *component) {
cs42l56_free_beep(component);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l73.c |
static bool cs42l73_readable_register(struct device *dev, unsigned int reg) {
switch (reg) {
case CS42L73_DEVID_AB ... CS42L73_DEVID_E:
case CS42L73_REVID ... CS42L73_IM2:
return true;
default:
return false;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l73.c |
static int cs42l73_get_mclk_coeff(int mclk, int srate) {
int i;
for (i = 0; i < ARRAY_SIZE(cs42l73_mclk_coeffs); i++) {
if (cs42l73_mclk_coeffs[i].mclk == mclk &&
cs42l73_mclk_coeffs[i].srate == srate)
return i;
}
return -EINVAL;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l73.c | static int cs42l73_set_mclk(struct snd_soc_dai *dai, unsigned int freq) {
struct snd_soc_component *component = dai->component;
struct cs42l73_private *priv = snd_soc_component_get_drvdata(component);
int mclkx_coeff;
u32 mclk = 0;
u8 dmmcc = 0;
mclkx_coeff = cs42l73_get_mclkx_coeff(freq);
if (mclkx_coe... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs42l73.c | static unsigned int cs42l73_get_xspfs_coeff(u32 rate) {
int i;
for (i = 0; i < ARRAY_SIZE(cs42l73_asrc_rates); i++) {
if (cs42l73_asrc_rates[i] == rate)
return i + 1;
}
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42l83-i2c.c |
static void cs42l83_i2c_remove(struct i2c_client *i2c_client) {
struct cs42l42_private *cs42l83 = dev_get_drvdata(&i2c_client->dev);
cs42l42_common_remove(cs42l83);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42xx8-i2c.c |
static void cs42xx8_i2c_remove(struct i2c_client *i2c) {
pm_runtime_disable(&i2c->dev);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42xx8.c | static int cs42xx8_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct snd_soc_component *component = dai->component;
struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component);
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
cs42xx8-... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs42xx8.c |
static int cs42xx8_mute(struct snd_soc_dai *dai, int mute, int direction) {
struct snd_soc_component *component = dai->component;
struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component);
u8 dac_unmute =
cs42xx8->tx_channels ? ~((0x1 << cs42xx8->tx_channels) - 1) : 0;
regmap_write(cs42xx8... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs42xx8.c | static int cs42xx8_component_probe(struct snd_soc_component *component) {
struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component);
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
switch (cs42xx8->drvdata->num_adcs) {
case 3:
snd_soc_add_component_controls(componen... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c |
static int cs43130_set_pll(struct snd_soc_component *component, int pll_id,
int source, unsigned int freq_in,
unsigned int freq_out) {
int ret = 0;
struct cs43130_private *cs43130 = snd_soc_component_get_drvdata(component);
switch (freq_in) {
case 9600000:... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c |
static const struct cs43130_bitwidth_map *
cs43130_get_bitwidth_table(unsigned int bitwidth) {
int i;
for (i = 0; i < ARRAY_SIZE(cs43130_bitwidth_table); i++) {
if (cs43130_bitwidth_table[i].bitwidth == bitwidth)
return &cs43130_bitwidth_table[i];
}
return NULL;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c |
static const struct cs43130_rate_map *cs43130_get_rate_table(int fs) {
int i;
for (i = 0; i < ARRAY_SIZE(cs43130_rate_table); i++) {
if (cs43130_rate_table[i].fs == fs)
return &cs43130_rate_table[i];
}
return NULL;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c |
static int cs43130_pcm_dsd_mix(bool en, struct regmap *regmap) {
if (en) {
regmap_update_bits(regmap, CS43130_DSD_PCM_MIX_CTL,
CS43130_MIX_PCM_PREP_MASK,
1 << CS43130_MIX_PCM_PREP_SHIFT);
usleep_range(6000, 6050);
regmap_update_bits(regmap, CS43130_DSD_PCM_MI... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c |
static int cs43130_pcm_ch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
return snd_soc_get_enum_double(kcontrol, ucontrol);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c |
static int cs43130_pcm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
return snd_pcm_hw_constraint_list(
substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &cs43130_asp_constraints);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c |
static int cs43130_show_dc(struct device *dev, char *buf, u8 ch) {
struct i2c_client *client = to_i2c_client(dev);
struct cs43130_private *cs43130 = i2c_get_clientdata(client);
if (!cs43130->hpload_done)
return sysfs_emit(buf, "NO_HPLOAD\n");
else
return sysfs_emit(buf, "%u\n", cs43130->hpload_dc[ch])... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c |
static int cs43130_set_hv(struct regmap *regmap, u16 hpload_dc,
const u16 *dc_threshold) {
int i;
for (i = 0; i < CS43130_DC_THRESHOLD; i++) {
if (hpload_dc <= dc_threshold[i])
break;
}
regmap_multi_reg_write(regmap, hv_seq[i], ARRAY_SIZE(hv_seq[i]));
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c | static int cs43130_handle_device_data(struct i2c_client *i2c_client,
struct cs43130_private *cs43130) {
struct device_node *np = i2c_client->dev.of_node;
unsigned int val;
int i;
if (of_property_read_u32(np, "cirrus,xtal-ibias", &val) < 0) {
cs43130->xtal_ibias = CS43... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs43130.c |
static int __maybe_unused cs43130_runtime_suspend(struct device *dev) {
struct cs43130_private *cs43130 = dev_get_drvdata(dev);
if (cs43130->xtal_ibias != CS43130_XTAL_UNUSED)
regmap_update_bits(cs43130->regmap, CS43130_INT_MASK_1,
CS43130_XTAL_ERR_INT, 1 << CS43130_XTAL_ERR_INT_SHIFT);... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs4341.c |
static int cs4341_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 cs4341_priv *cs4341 = snd_soc_component_get_drvdata(component);
unsign... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs4341.c | static int cs4341_i2c_probe(struct i2c_client *i2c) {
struct cs4341_priv *cs4341;
cs4341 = devm_kzalloc(&i2c->dev, sizeof(*cs4341), GFP_KERNEL);
if (!cs4341)
return -ENOMEM;
i2c_set_clientdata(i2c, cs4341);
cs4341->regcfg.reg_bits = 8;
cs4341->regcfg.val_bits = 8;
cs4341->regcfg.max_register = CS43... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs4341.c |
static int __init cs4341_init(void) {
int ret = 0;
#if IS_ENABLED(CONFIG_I2C)
ret = i2c_add_driver(&cs4341_i2c_driver);
if (ret)
return ret;
#endif
#if defined(CONFIG_SPI_MASTER)
ret = spi_register_driver(&cs4341_spi_driver);
#endif
return ret;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs4349.c |
static int cs4349_mute(struct snd_soc_dai *dai, int mute, int direction) {
struct snd_soc_component *component = dai->component;
int reg;
reg = 0;
if (mute)
reg = MUTE_AB_MASK;
return snd_soc_component_update_bits(component, CS4349_MUTE, MUTE_AB_MASK,
reg);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l15.c |
static int cs47l15_adsp_power_ev(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 cs47l15 *cs47l15 = snd_soc_component_get_drvdata(component);
struct madera_priv *priv = &cs... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l15.c |
static int cs47l15_remove(struct platform_device *pdev) {
struct cs47l15 *cs47l15 = platform_get_drvdata(pdev);
pm_runtime_disable(&pdev->dev);
madera_free_bus_error_irq(&cs47l15->core, 0);
wm_adsp2_remove(&cs47l15->core.adsp[0]);
madera_set_irq_wake(cs47l15->core.madera, MADERA_IRQ_DSP_IRQ1, 0);
mader... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l24.c |
static irqreturn_t cs47l24_adsp2_irq(int irq, void *data) {
struct cs47l24_priv *priv = data;
struct arizona *arizona = priv->core.arizona;
struct arizona_voice_trigger_info info;
int serviced = 0;
int i, ret;
for (i = 1; i <= 2; ++i) {
ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]);
if (ret ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs47l35.c |
static int cs47l35_adsp_power_ev(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 cs47l35 *cs47l35 = snd_soc_component_get_drvdata(component);
struct madera_priv *priv = &cs... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs47l35.c |
static int cs47l35_set_fll(struct snd_soc_component *component, int fll_id,
int source, unsigned int fref, unsigned int fout) {
struct cs47l35 *cs47l35 = snd_soc_component_get_drvdata(component);
switch (fll_id) {
case MADERA_FLL1_REFCLK:
return madera_set_fll_refclk(&cs47l35->fll... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l35.c |
static void cs47l35_component_remove(struct snd_soc_component *component) {
struct cs47l35 *cs47l35 = snd_soc_component_get_drvdata(component);
struct madera *madera = cs47l35->core.madera;
int i;
mutex_lock(&madera->dapm_ptr_lock);
madera->dapm = NULL;
mutex_unlock(&madera->dapm_ptr_lock);
for (i = 0;... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l35.c |
static int cs47l35_remove(struct platform_device *pdev) {
struct cs47l35 *cs47l35 = platform_get_drvdata(pdev);
int i;
pm_runtime_disable(&pdev->dev);
for (i = 0; i < CS47L35_NUM_ADSP; i++)
wm_adsp2_remove(&cs47l35->core.adsp[i]);
madera_set_irq_wake(cs47l35->core.madera, MADERA_IRQ_DSP_IRQ1, 0);
ma... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l85.c |
static void cs47l85_hp_post_enable(struct snd_soc_dapm_widget *w) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
unsigned int val;
switch (w->shift) {
case MADERA_OUT1L_ENA_SHIFT:
case MADERA_OUT1R_ENA_SHIFT:
val = snd_soc_component_read(component, MADERA_OUTPUT_ENABLES_1);
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l85.c |
static int cs47l85_open(struct snd_soc_component *component,
struct snd_compr_stream *stream) {
struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component);
struct madera_priv *priv = &cs47l85->core;
struct madera *madera = ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs47l85.c |
static void cs47l85_component_remove(struct snd_soc_component *component) {
struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component);
struct madera *madera = cs47l85->core.madera;
int i;
mutex_lock(&madera->dapm_ptr_lock);
madera->dapm = NULL;
mutex_unlock(&madera->dapm_ptr_lock);
for (i = 0;... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l90.c |
static int cs47l90_set_fll(struct snd_soc_component *component, int fll_id,
int source, unsigned int fref, unsigned int fout) {
struct cs47l90 *cs47l90 = snd_soc_component_get_drvdata(component);
switch (fll_id) {
case MADERA_FLL1_REFCLK:
return madera_set_fll_refclk(&cs47l90->fll... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l90.c |
static int cs47l90_open(struct snd_soc_component *component,
struct snd_compr_stream *stream) {
struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct cs47l90 *cs47l90 = snd_soc_component_get_drvdata(component);
struct madera_priv *priv = &cs47l90->core;
struct madera *madera = ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cs47l90.c |
static int cs47l90_remove(struct platform_device *pdev) {
struct cs47l90 *cs47l90 = platform_get_drvdata(pdev);
int i;
pm_runtime_disable(&pdev->dev);
for (i = 0; i < CS47L90_NUM_ADSP; i++) {
madera_free_bus_error_irq(&cs47l90->core, i);
wm_adsp2_remove(&cs47l90->core.adsp[i]);
}
madera_set_irq_... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs47l92.c |
static void cs47l92_component_remove(struct snd_soc_component *component) {
struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component);
struct madera *madera = cs47l92->core.madera;
mutex_lock(&madera->dapm_ptr_lock);
madera->dapm = NULL;
mutex_unlock(&madera->dapm_ptr_lock);
wm_adsp2_component_r... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs53l30.c | static int cs53l30_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) {
struct cs53l30_private *priv = snd_soc_component_get_drvdata(dai->component);
int srate = params_rate(params);
int mc... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs53l30.c |
static int cs53l30_pcm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
&src_constraints);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs53l30.c | static int cs53l30_mute_stream(struct snd_soc_dai *dai, int mute, int stream) {
struct cs53l30_private *priv = snd_soc_component_get_drvdata(dai->component);
gpiod_set_value_cansleep(priv->mute_gpio, mute);
return 0;
}
#define CS53L30_RATES (SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_KNOT)
#define CS53L30_FOR... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs53l30.c | static void cs53l30_i2c_remove(struct i2c_client *client) {
struct cs53l30_private *cs53l30 = i2c_get_clientdata(client);
gpiod_set_value_cansleep(cs53l30->reset_gpio, 0);
regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies), cs53l30->supplies);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cs53l30.c | static int cs53l30_runtime_suspend(struct device *dev) {
struct cs53l30_private *cs53l30 = dev_get_drvdata(dev);
regcache_cache_only(cs53l30->regmap, true);
gpiod_set_value_cansleep(cs53l30->reset_gpio, 0);
regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies), cs53l30->supplies);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cx20442.c | static int cx20442_pm_to_v253_vsp(u8 value) {
switch (value & ~(1 << CX20442_AGC)) {
case (1 << CX20442_SPKOUT):
case (1 << CX20442_MIC):
case (1 << CX20442_SPKOUT) | (1 << CX20442_MIC):
return (bool)(value & (1 << CX20442_AGC));
}
return (value & (1 << CX20442_AGC)) ? -EINVAL : 0;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cx20442.c | static int cx20442_write(struct snd_soc_component *component, unsigned int reg,
unsigned int value) {
struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component);
int vls, vsp, old, len;
char buf[18];
if (reg >= 1)
return -EINVAL;
if (!cx20442->tty || !cx20442->tty->... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cx20442.c | static int v253_open(struct tty_struct *tty) {
int ret, len = strlen(v253_init);
if (!tty->ops->write)
return -EINVAL;
/* Won't work if no codec pointer has been passed by a card driver */
if (!tty->disc_data)
return -ENODEV;
tty->receive_room = 16;
if (tty->ops->write(tty, v253_init, len) != len... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cx20442.c | static int cx20442_component_probe(struct snd_soc_component *component) {
struct cx20442_priv *cx20442;
cx20442 = kzalloc(sizeof(struct cx20442_priv), GFP_KERNEL);
if (cx20442 == NULL)
return -ENOMEM;
cx20442->por = regulator_get(component->dev, "POR");
if (IS_ERR(cx20442->por)) {
int err = PTR_ERR(... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cx20442.c |
static int cx20442_platform_probe(struct platform_device *pdev) {
return devm_snd_soc_register_component(&pdev->dev, &cx20442_component_dev,
&cx20442_dai, 1);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cx2072x.c |
static bool cx2072x_volatile_register(struct device *dev, unsigned int reg) {
switch (reg) {
case CX2072X_VENDOR_ID:
case CX2072X_REVISION_ID:
case CX2072X_UM_INTERRUPT_CRTL_E:
case CX2072X_DIGITAL_TEST11:
case CX2072X_PORTA_PIN_SENSE:
case CX2072X_PORTB_PIN_SENSE:
case CX2072X_PORTD_PIN_SENSE:
case ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cx2072x.c | static int cx2072x_reg_write(void *context, unsigned int reg,
unsigned int value) {
__le32 raw_value;
unsigned int size;
size = cx2072x_register_size(reg);
if (reg == CX2072X_UM_INTERRUPT_CRTL_E) {
reg += 3;
size = 1;
value >>= 24;
}
raw_value = cpu_to_le32(value... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cx2072x.c | static unsigned int get_div_from_mclk(unsigned int mclk) {
unsigned int div = 8;
int i;
for (i = 0; i < ARRAY_SIZE(mclk_pre_div); i++) {
if (mclk <= mclk_pre_div[i].mclk) {
div = mclk_pre_div[i].div;
break;
}
}
return div;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cx2072x.c |
static int cx2072x_set_bias_level(struct snd_soc_component *codec,
enum snd_soc_bias_level level) {
struct cx2072x_priv *cx2072x = snd_soc_component_get_drvdata(codec);
const enum snd_soc_bias_level old_level =
snd_soc_component_get_bias_level(codec);
if (level == SND_SOC... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cx2072x.c |
static void cx2072x_disable_jack_detect(struct snd_soc_component *codec) {
struct cx2072x_priv *cx2072x = snd_soc_component_get_drvdata(codec);
regmap_write(cx2072x->regmap, CX2072X_UM_INTERRUPT_CRTL_E, 0);
regmap_write(cx2072x->regmap, CX2072X_PORTA_UNSOLICITED_RESPONSE, 0);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cx2072x.c | static int cx2072x_jack_status_check(void *data) {
struct snd_soc_component *codec = data;
struct cx2072x_priv *cx2072x = snd_soc_component_get_drvdata(codec);
unsigned int jack;
unsigned int type = 0;
int state = 0;
mutex_lock(&cx2072x->lock);
regmap_read(cx2072x->regmap, CX2072X_PORTA_PIN_SENSE, &jack... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/cx2072x.c |
static int __maybe_unused cx2072x_runtime_resume(struct device *dev) {
struct cx2072x_priv *cx2072x = dev_get_drvdata(dev);
return clk_prepare_enable(cx2072x->mclk);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/cx2072x.c |
static int cx2072x_i2c_probe(struct i2c_client *i2c) {
struct cx2072x_priv *cx2072x;
unsigned int ven_id, rev_id;
int ret;
cx2072x = devm_kzalloc(&i2c->dev, sizeof(struct cx2072x_priv), GFP_KERNEL);
if (!cx2072x)
return -ENOMEM;
cx2072x->regmap = devm_regmap_init(&i2c->dev, NULL, i2c, &cx2072x_regmap... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/da7210.c |
static int da7210_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 da7210_priv *da7210 = snd_soc_component_get_drvdata(component);
switch (clk_id) {
case DA7210_CLKSRC_MCL... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7210.c | static int da7210_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
int source, unsigned int fref,
unsigned int fout) {
struct snd_soc_component *component = codec_dai->component;
struct da7210_priv *da7210 = snd_soc_component_get_drvdata(component);
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7213.c |
static int da7213_mute(struct snd_soc_dai *dai, int mute, int direction) {
struct snd_soc_component *component = dai->component;
if (mute) {
snd_soc_component_update_bits(component, DA7213_DAC_L_CTRL, DA7213_MUTE_EN,
DA7213_MUTE_EN);
snd_soc_component_update_bits(componen... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7213.c |
static int da7213_set_component_sysclk(struct snd_soc_component *component,
int clk_id, int source,
unsigned int freq, int dir) {
struct da7213_priv *da7213 = snd_soc_component_get_drvdata(component);
int ret = 0;
if ((da7213->clk_src... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7213.c |
static enum da7213_dmic_data_sel
da7213_of_dmic_data_sel(struct snd_soc_component *component, const char *str) {
if (!strcmp(str, "lrise_rfall")) {
return DA7213_DMIC_DATA_LRISE_RFALL;
} else if (!strcmp(str, "lfall_rrise")) {
return DA7213_DMIC_DATA_LFALL_RRISE;
} else {
dev_warn(component->dev, "In... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7213.c |
static void da7213_power_off(void *data) {
struct da7213_priv *da7213 = data;
regulator_bulk_disable(DA7213_NUM_SUPPLIES, da7213->supplies);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7213.c | static int da7213_i2c_probe(struct i2c_client *i2c) {
struct da7213_priv *da7213;
int i, ret;
da7213 = devm_kzalloc(&i2c->dev, sizeof(*da7213), GFP_KERNEL);
if (!da7213)
return -ENOMEM;
i2c_set_clientdata(i2c, da7213);
for (i = 0; i < DA7213_NUM_SUPPLIES; ++i)
da7213->supplies[i].supply = da7213_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c | static int da7218_tonegen_freq_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component);
struct soc_mixer_control *m... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c |
static enum da7218_micbias_voltage
da7218_of_micbias_lvl(struct snd_soc_component *component, u32 val) {
switch (val) {
case 1200:
return DA7218_MICBIAS_1_2V;
case 1600:
return DA7218_MICBIAS_1_6V;
case 1800:
return DA7218_MICBIAS_1_8V;
case 2000:
return DA7218_MICBIAS_2_0V;
case 2200:
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c |
static enum da7218_mic_amp_in_sel
da7218_of_mic_amp_in_sel(struct snd_soc_component *component, const char *str) {
if (!strcmp(str, "diff")) {
return DA7218_MIC_AMP_IN_SEL_DIFF;
} else if (!strcmp(str, "se_p")) {
return DA7218_MIC_AMP_IN_SEL_SE_P;
} else if (!strcmp(str, "se_n")) {
return DA7218_MIC_... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c |
static enum da7218_dmic_data_sel
da7218_of_dmic_data_sel(struct snd_soc_component *component, const char *str) {
if (!strcmp(str, "lrise_rfall")) {
return DA7218_DMIC_DATA_LRISE_RFALL;
} else if (!strcmp(str, "lfall_rrise")) {
return DA7218_DMIC_DATA_LFALL_RRISE;
} else {
dev_warn(component->dev, "In... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c |
static enum da7218_hpldet_jack_debounce
da7218_of_jack_debounce(struct snd_soc_component *component, u32 val) {
switch (val) {
case 0:
return DA7218_HPLDET_JACK_DEBOUNCE_OFF;
case 2:
return DA7218_HPLDET_JACK_DEBOUNCE_2;
case 3:
return DA7218_HPLDET_JACK_DEBOUNCE_3;
case 4:
return DA7218_HPLD... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c | static int da7218_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component);
int ret;
switch (level) {
case SND_SOC_BIAS_ON:
break;
case SND_SOC_BIAS_PREPARE:
if (snd_soc... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c |
static void da7218_remove(struct snd_soc_component *component) {
struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component);
regulator_bulk_disable(DA7218_NUM_SUPPLIES, da7218->supplies);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c | static int da7218_resume(struct snd_soc_component *component) {
struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component);
if (!da7218->jack)
snd_soc_component_write(component, DA7218_SYSTEM_ACTIVE,
DA7218_SYSTEM_ACTIVE_MASK);
da7218_set_bias_level(component, SND_SOC_... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c |
static bool da7218_volatile_register(struct device *dev, unsigned int reg) {
switch (reg) {
case DA7218_STATUS1:
case DA7218_SOFT_RESET:
case DA7218_SYSTEM_STATUS:
case DA7218_CALIB_CTRL:
case DA7218_CALIB_OFFSET_AUTO_M_1:
case DA7218_CALIB_OFFSET_AUTO_U_1:
case DA7218_CALIB_OFFSET_AUTO_M_2:
case DA7... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7218.c |
static int da7218_i2c_probe(struct i2c_client *i2c) {
struct da7218_priv *da7218;
int ret;
da7218 = devm_kzalloc(&i2c->dev, sizeof(*da7218), GFP_KERNEL);
if (!da7218)
return -ENOMEM;
i2c_set_clientdata(i2c, da7218);
if (i2c->dev.of_node)
da7218->dev_id = da7218_of_get_id(&i2c->dev);
else
d... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/da7219-aad.c | static enum da7219_aad_micbias_pulse_lvl
da7219_aad_fw_micbias_pulse_lvl(struct device *dev, u32 val) {
switch (val) {
case 2800:
return DA7219_AAD_MICBIAS_PULSE_LVL_2_8V;
case 2900:
return DA7219_AAD_MICBIAS_PULSE_LVL_2_9V;
default:
dev_warn(dev, "Invalid micbias pulse level");
return DA7219_AA... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219-aad.c |
static enum da7219_aad_jack_rem_deb
da7219_aad_fw_jack_rem_deb(struct device *dev, u32 val) {
switch (val) {
case 1:
return DA7219_AAD_JACK_REM_DEB_1MS;
case 5:
return DA7219_AAD_JACK_REM_DEB_5MS;
case 10:
return DA7219_AAD_JACK_REM_DEB_10MS;
case 20:
return DA7219_AAD_JACK_REM_DEB_20MS;
de... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c |
static int da7219_enum_locked_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
int ret;
mutex_lock(&da72... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c | static int da7219_mic_pga_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 da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
switch (event) {
case SND_S... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c | static int da7219_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 da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
int ret = 0;
if ((da7219->clk_src == clk_... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c |
static enum da7219_micbias_voltage da7219_fw_micbias_lvl(struct device *dev,
u32 val) {
switch (val) {
case 1600:
return DA7219_MICBIAS_1_6V;
case 1800:
return DA7219_MICBIAS_1_8V;
case 2000:
return DA7219_MICBIAS_2_0V;
case 2200:
retur... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c | static int da7219_wclk_prepare(struct clk_hw *hw) {
struct da7219_priv *da7219 =
container_of(hw, struct da7219_priv, dai_clks_hw[DA7219_DAI_WCLK_IDX]);
struct snd_soc_component *component = da7219->component;
if (!da7219->master)
return -EINVAL;
snd_soc_component_update_bits(component, DA7219_DAI_C... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c |
static void da7219_wclk_unprepare(struct clk_hw *hw) {
struct da7219_priv *da7219 =
container_of(hw, struct da7219_priv, dai_clks_hw[DA7219_DAI_WCLK_IDX]);
struct snd_soc_component *component = da7219->component;
if (!da7219->master)
return;
snd_soc_component_update_bits(component, DA7219_DAI_CLK_M... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c |
static long da7219_wclk_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct da7219_priv *da7219 =
container_of(hw, struct da7219_priv, dai_clks_hw[DA7219_DAI_WCLK_IDX]);
if (!da7219->master)
return -EINVAL;
if (rate < 11025)
re... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c |
static int da7219_bclk_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct da7219_priv *da7219 =
container_of(hw, struct da7219_priv, dai_clks_hw[DA7219_DAI_BCLK_IDX]);
struct snd_soc_component *component = da7219->component;
unsigned long fac... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c |
static void da7219_free_dai_clks(struct snd_soc_component *component) {
struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
struct device_node *np = component->dev->of_node;
int i;
if (np)
of_clk_del_provider(np);
for (i = DA7219_DAI_NUM_CLKS - 1; i >= 0; --i) {
if (da7219->dai_c... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/da7219.c | static void da7219_handle_pdata(struct snd_soc_component *component) {
struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
struct da7219_pdata *pdata = da7219->pdata;
if (pdata) {
u8 micbias_lvl = 0;
da7219->wakeup_source = pdata->wakeup_source;
switch (pdata->micbias_lvl) {
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/da732x.c |
static int da732x_adc_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:
switch (w->reg) {
case DA732X_REG_ADC1_PD:
snd_s... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da732x.c |
static bool da732x_volatile(struct device *dev, unsigned int reg) {
switch (reg) {
case DA732X_REG_HPL_DAC_OFF_CNTL:
case DA732X_REG_HPR_DAC_OFF_CNTL:
return true;
default:
return false;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/da9055.c |
static bool da9055_volatile_register(struct device *dev, unsigned int reg) {
switch (reg) {
case DA9055_STATUS1:
case DA9055_PLL_STATUS:
case DA9055_AUX_L_GAIN_STATUS:
case DA9055_AUX_R_GAIN_STATUS:
case DA9055_MIC_L_GAIN_STATUS:
case DA9055_MIC_R_GAIN_STATUS:
case DA9055_MIXIN_L_GAIN_STATUS:
case DA... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.