Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/soc/codecs/tas2562.c |
static int tas2562_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 tas2562_data *tas2562 = snd_soc_component_get_drvdata(component);
i... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2562.c |
static int tas2562_codec_probe(struct snd_soc_component *component) {
struct tas2562_data *tas2562 = snd_soc_component_get_drvdata(component);
tas2562->component = component;
if (tas2562->sdz_gpio)
gpiod_set_value_cansleep(tas2562->sdz_gpio, 1);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2764.c |
static void tas2764_reset(struct tas2764_priv *tas2764) {
if (tas2764->reset_gpio) {
gpiod_set_value_cansleep(tas2764->reset_gpio, 0);
msleep(20);
gpiod_set_value_cansleep(tas2764->reset_gpio, 1);
usleep_range(1000, 2000);
}
snd_soc_component_write(tas2764->component, TAS2764_SW_RST, TAS2764_RST... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2764.c |
static int tas2764_codec_resume(struct snd_soc_component *component) {
struct tas2764_priv *tas2764 = snd_soc_component_get_drvdata(component);
int ret;
if (tas2764->sdz_gpio) {
gpiod_set_value_cansleep(tas2764->sdz_gpio, 1);
usleep_range(1000, 2000);
}
ret = tas2764_update_pwr_ctrl(tas2764);
if... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2764.c |
static int tas2764_mute(struct snd_soc_dai *dai, int mute, int direction) {
struct tas2764_priv *tas2764 = snd_soc_component_get_drvdata(dai->component);
tas2764->unmuted = !mute;
return tas2764_update_pwr_ctrl(tas2764);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2764.c |
static int tas2764_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 tas2764_priv *tas2764 = snd_soc_component_get_drvdata(component);
i... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2764.c |
static int tas2764_set_dai_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask,
int slots, int slot_width) {
struct snd_soc_component *component = dai->component;
struct tas2764_priv *tas2764 = snd_soc_component_get_dr... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas2770.c |
static void tas2770_reset(struct tas2770_priv *tas2770) {
if (tas2770->reset_gpio) {
gpiod_set_value_cansleep(tas2770->reset_gpio, 0);
msleep(20);
gpiod_set_value_cansleep(tas2770->reset_gpio, 1);
usleep_range(1000, 2000);
}
snd_soc_component_write(tas2770->component, TAS2770_SW_RST, TAS2770_RST... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2770.c | static int tas2770_codec_suspend(struct snd_soc_component *component) {
struct tas2770_priv *tas2770 = snd_soc_component_get_drvdata(component);
int ret = 0;
regcache_cache_only(tas2770->regmap, true);
regcache_mark_dirty(tas2770->regmap);
if (tas2770->sdz_gpio) {
gpiod_set_value_cansleep(tas2770->sdz_g... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2770.c |
static int tas2770_codec_resume(struct snd_soc_component *component) {
struct tas2770_priv *tas2770 = snd_soc_component_get_drvdata(component);
int ret;
if (tas2770->sdz_gpio) {
gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
usleep_range(1000, 2000);
} else {
ret = tas2770_update_pwr_ctrl(tas2770... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2770.c |
static int tas2770_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 tas2770_priv *tas2770 = snd_soc_component_get_drvdata(component);
i... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2770.c | static bool tas2770_volatile(struct device *dev, unsigned int reg) {
switch (reg) {
case TAS2770_PAGE:
case TAS2770_SW_RST: /* always clears after write */
case TAS2770_BO_PRV_REG0: /* has a self clearing bit */
case TAS2770_LVE_INT_REG0:
case TAS2770_LVE_INT_REG1:
case TAS2770_LAT_INT_REG0: /* Stick... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas2770.c |
static int tas2770_i2c_probe(struct i2c_client *client) {
struct tas2770_priv *tas2770;
int result;
tas2770 = devm_kzalloc(&client->dev, sizeof(struct tas2770_priv), GFP_KERNEL);
if (!tas2770)
return -ENOMEM;
tas2770->dev = &client->dev;
i2c_set_clientdata(client, tas2770);
dev_set_drvdata(&client-... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas2780.c |
static void tas2780_reset(struct tas2780_priv *tas2780) {
int ret = 0;
if (tas2780->reset_gpio) {
gpiod_set_value_cansleep(tas2780->reset_gpio, 0);
usleep_range(2000, 2050);
gpiod_set_value_cansleep(tas2780->reset_gpio, 1);
usleep_range(2000, 2050);
}
snd_soc_component_write(tas2780->componen... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2780.c | static int tas2780_codec_suspend(struct snd_soc_component *component) {
struct tas2780_priv *tas2780 = snd_soc_component_get_drvdata(component);
int ret = 0;
ret = snd_soc_component_update_bits(component, TAS2780_PWR_CTRL,
TAS2780_PWR_CTRL_MASK,
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas5086.c |
static int tas5086_register_size(struct device *dev, unsigned int reg) {
switch (reg) {
case TAS5086_CLOCK_CONTROL ... TAS5086_BKNDERR:
return 1;
case TAS5086_INPUT_MUX:
case TAS5086_PWM_OUTPUT_MUX:
return 4;
}
dev_err(dev, "Unsupported register address: %d\n", reg);
return 0;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas5086.c |
static int tas5086_reg_write(void *context, unsigned int reg,
unsigned int value) {
struct i2c_client *client = context;
unsigned int i, size;
uint8_t buf[5];
int ret;
size = tas5086_register_size(&client->dev, reg);
if (size == 0)
return -EINVAL;
buf[0] = reg;
for (... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas5086.c |
static int tas5086_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 tas5086_private *priv = snd_soc_component_get_drvdata(component);
switch (clk_id) {
case TAS5086_CLK_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas571x.c |
static int tas571x_reg_write(void *context, unsigned int reg,
unsigned int value) {
struct i2c_client *client = context;
struct tas571x_private *priv = i2c_get_clientdata(client);
unsigned int i, size;
uint8_t buf[5];
int ret;
size = tas571x_register_size(priv, reg);
buf[0] ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas571x.c |
static int tas571x_reg_read(void *context, unsigned int reg,
unsigned int *value) {
struct i2c_client *client = context;
struct tas571x_private *priv = i2c_get_clientdata(client);
uint8_t send_buf, recv_buf[4];
struct i2c_msg msgs[2];
unsigned int size;
unsigned int i;
int ret... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas571x.c |
static int tas571x_coefficient_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct i2c_client *i2c = to_i2c_client(component->dev);
int numcoef = kcontrol->private_value >> ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas571x.c |
static int tas571x_coefficient_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct i2c_client *i2c = to_i2c_client(component->dev);
int numcoef = kcontrol->private_value >> ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas571x.c |
static int tas571x_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) {
struct tas571x_private *priv = snd_soc_component_get_drvdata(dai->component);
u32 val;
switch (priv->format & SND_SOC_DAIFMT_FO... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas571x.c |
static int tas571x_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
struct tas571x_private *priv = snd_soc_component_get_drvdata(component);
int ret;
switch (level) {
case SND_SOC_BIAS_ON:
break;
case SND_SOC_BIAS_PREPARE:
break;
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas5720.c |
static int tas5720_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;
unsigned int rate = params_rate(params);
bool ssz_ds;
int ret;
switch... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas5720.c |
static int tas5720_mute(struct snd_soc_dai *dai, int mute, int direction) {
struct snd_soc_component *component = dai->component;
int ret;
ret = snd_soc_component_update_bits(component, TAS5720_DIGITAL_CTRL2_REG,
TAS5720_MUTE, mute ? TAS5720_MUTE : 0);
if (ret < 0) {
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas5720.c | static int tas5720_suspend(struct snd_soc_component *component) {
struct tas5720_data *tas5720 = snd_soc_component_get_drvdata(component);
int ret;
regcache_cache_only(tas5720->regmap, true);
regcache_mark_dirty(tas5720->regmap);
ret =
regulator_bulk_disable(ARRAY_SIZE(tas5720->supplies), tas5720->sup... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas5720.c |
static int tas5722_volume_set(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
unsigned int sel = ucontrol->value.integer.value[0];
snd_soc_component_write(component, TAS5720_VOLUME_CTR... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas5805m.c |
static int tas5805m_vol_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct tas5805m_priv *tas5805m = snd_soc_component_get_drvdata(component);
ucontrol->value.integer.value[0] = ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas5805m.c | static int tas5805m_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai) {
struct snd_soc_component *component = dai->component;
struct tas5805m_priv *tas5805m = snd_soc_component_get_drvdata(component);
struct regmap *rm = tas5805m->regmap;
unsigned int cha... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas6424.c | static int tas6424_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 tas6424_data *tas6424 = snd_soc_component_get_drvdata(component);
dev_dbg(component->dev, "%s() eve... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas6424.c | static int tas6424_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct snd_soc_component *component = dai->component;
u8 serial_format = 0;
dev_dbg(component->dev, "%s() fmt=0x%0x\n", __func__, fmt);
switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBC_CFC:
break;
de... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas6424.c | static int tas6424_power_on(struct snd_soc_component *component) {
struct tas6424_data *tas6424 = snd_soc_component_get_drvdata(component);
int ret;
u8 chan_states;
int no_auto_diags = 0;
unsigned int reg_val;
if (!regmap_read(tas6424->regmap, TAS6424_DC_DIAG_CTRL1, ®_val))
no_auto_diags = reg_val &... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tda7419.c |
static int tda7419_vol_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
struct tda7419_vol_control *tvc =
(struct tda7419_vol_control *)kcontrol->private_value;
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = tda7419_vol_is_stereo(tvc) ? 2 : 1;
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tda7419.c |
static inline int tda7419_vol_get_value(int val, unsigned int mask, int min,
int thresh, unsigned int invert) {
val &= mask;
if (val < thresh) {
if (invert)
val = 0 - val;
} else if (val > thresh) {
if (invert)
val = val - thresh;
else
val = t... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tda7419.c | static int tda7419_probe(struct i2c_client *i2c) {
struct tda7419_data *tda7419;
int i, ret;
tda7419 = devm_kzalloc(&i2c->dev, sizeof(struct tda7419_data), GFP_KERNEL);
if (tda7419 == NULL)
return -ENOMEM;
i2c_set_clientdata(i2c, tda7419);
tda7419->regmap = devm_regmap_init_i2c(i2c, &tda7419_regmap_c... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tfa9879.c |
static int tfa9879_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct snd_soc_component *component = dai->component;
struct tfa9879_priv *tfa9879 = snd_soc_component_get_drvdata(component);
int i2s_set;
int sck_pol;
switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBC_CFC:
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tfa9879.c | static int tfa9879_i2c_probe(struct i2c_client *i2c) {
struct tfa9879_priv *tfa9879;
int i;
tfa9879 = devm_kzalloc(&i2c->dev, sizeof(*tfa9879), GFP_KERNEL);
if (!tfa9879)
return -ENOMEM;
i2c_set_clientdata(i2c, tfa9879);
tfa9879->regmap = devm_regmap_init_i2c(i2c, &tfa9879_regmap);
if (IS_ERR(tfa98... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tfa989x.c |
static int tfa9895_init(struct regmap *regmap) {
return regmap_multi_reg_write(regmap, tfa9895_reg_init,
ARRAY_SIZE(tfa9895_reg_init));
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320adc3xxx.c | static int adc3xxx_gpio_direction_out(struct gpio_chip *chip,
unsigned int offset, int value) {
struct adc3xxx *adc3xxx = gpiochip_get_data(chip);
return regmap_update_bits(adc3xxx->regmap, adc3xxx_gpio_ctrl_reg[offset],
ADC3XXX_GPIO_CTRL_CFG_MASK |... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320adc3xxx.c | static int adc3xxx_gpio_get(struct gpio_chip *chip, unsigned int offset) {
struct adc3xxx *adc3xxx = gpiochip_get_data(chip);
unsigned int regval;
int ret;
ret = regmap_read(adc3xxx->regmap, adc3xxx_gpio_ctrl_reg[offset], ®val);
if (ret)
return ret;
return !!(regval & ADC3XXX_GPIO_CTRL_OUTPUT_CTRL_M... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320adcx140.c |
static bool adcx140_volatile(struct device *dev, unsigned int reg) {
switch (reg) {
case ADCX140_SW_RESET:
case ADCX140_DEV_STS0:
case ADCX140_DEV_STS1:
case ADCX140_ASI_STS:
return true;
default:
return false;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320adcx140.c | static int adcx140_reset(struct adcx140_priv *adcx140) {
int ret = 0;
if (adcx140->gpio_reset) {
gpiod_direction_output(adcx140->gpio_reset, 0);
usleep_range(30000, 100000);
gpiod_direction_output(adcx140->gpio_reset, 1);
} else {
ret = regmap_write(adcx140->regmap, ADCX140_SW_RESET, ADCX140_RES... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320adcx140.c |
static void adcx140_pwr_ctrl(struct adcx140_priv *adcx140, bool power_state) {
int pwr_ctrl = 0;
int ret = 0;
struct snd_soc_component *component = adcx140->component;
if (power_state)
pwr_ctrl = ADCX140_PWR_CFG_ADC_PDZ | ADCX140_PWR_CFG_PLL_PDZ;
if (adcx140->micbias_vg && power_state)
pwr_ctrl |= ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320adcx140.c |
static int adcx140_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 adcx140_priv *adcx140 = snd_soc_component_get_drvdata(component);
u... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320adcx140.c |
static int adcx140_configure_gpio(struct adcx140_priv *adcx140) {
int gpio_count = 0;
u32 gpio_outputs[ADCX140_NUM_GPIO_CFGS];
u32 gpio_output_val = 0;
int ret;
gpio_count = device_property_count_u32(adcx140->dev, "ti,gpio-config");
if (gpio_count == 0)
return 0;
if (gpio_count != ADCX140_NUM_GPIO_... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic23-i2c.c |
static int tlv320aic23_i2c_probe(struct i2c_client *i2c) {
struct regmap *regmap;
if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EINVAL;
regmap = devm_regmap_init_i2c(i2c, &tlv320aic23_regmap);
return tlv320aic23_probe(&i2c->dev, regmap);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic23-spi.c |
static int aic23_spi_probe(struct spi_device *spi) {
int ret;
struct regmap *regmap;
dev_dbg(&spi->dev, "probing tlv320aic23 spi device\n");
spi->mode = SPI_MODE_0;
ret = spi_setup(spi);
if (ret < 0)
return ret;
regmap = devm_regmap_init_spi(spi, &tlv320aic23_regmap);
return tlv320aic23_probe(&s... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic23.c | static int tlv320aic23_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
u16 reg = snd_soc_component_read(component, TLV320AIC23_PWR) & 0x17f;
switch (level) {
case SND_SOC_BIAS_ON:
reg &= ~(TLV320AIC23_DEVICE_PWR_OFF | TLV320AIC23_OSC... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic23.c |
static int tlv320aic23_resume(struct snd_soc_component *component) {
struct aic23 *aic23 = snd_soc_component_get_drvdata(component);
regcache_mark_dirty(aic23->regmap);
regcache_sync(aic23->regmap);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic26.c | static int aic26_mute(struct snd_soc_dai *dai, int mute, int direction) {
struct snd_soc_component *component = dai->component;
struct aic26 *aic26 = snd_soc_component_get_drvdata(component);
u16 reg;
dev_dbg(&aic26->spi->dev, "aic26_mute(dai=%p, mute=%i)\n", dai, mute);
if (mute)
reg = 0x8080;
else
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic31xx.c |
static int aic31xx_add_widgets(struct snd_soc_component *component) {
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
int ret = 0;
if (aic31xx->codec_type & DAC31XX_BIT) {
ret = snd_soc_dapm_new_controls(da... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic31xx.c | static int aic31xx_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 aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
int i;
dev_dbg(component->dev, "## %s... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic31xx.c | static int aic31xx_power_on(struct snd_soc_component *component) {
struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
int ret;
ret = regulator_bulk_enable(ARRAY_SIZE(aic31xx->supplies), aic31xx->supplies);
if (ret)
return ret;
regcache_cache_only(aic31xx->regmap, false);
ret = a... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic31xx.c |
static int aic31xx_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... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic31xx.c | static void aic31xx_configure_ocmv(struct aic31xx_priv *priv) {
struct device *dev = priv->dev;
int dvdd, avdd;
u32 value;
if (dev->fwnode &&
fwnode_property_read_u32(dev->fwnode, "ai31xx-ocmv", &value)) {
if (value <= 3) {
priv->ocmv = value;
return;
}
}
avdd = regulator_get_vo... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4-clk.c |
static int clk_aic32x4_pll_is_prepared(struct clk_hw *hw) {
struct clk_aic32x4 *pll = to_clk_aic32x4(hw);
unsigned int val;
int ret;
ret = regmap_read(pll->regmap, AIC32X4_PLLPR, &val);
if (ret < 0)
return ret;
return !!(val & AIC32X4_PLLEN);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4-clk.c |
static int clk_aic32x4_div_prepare(struct clk_hw *hw) {
struct clk_aic32x4 *div = to_clk_aic32x4(hw);
return regmap_update_bits(div->regmap, div->reg, AIC32X4_DIVEN,
AIC32X4_DIVEN);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4-clk.c |
static void clk_aic32x4_div_unprepare(struct clk_hw *hw) {
struct clk_aic32x4 *div = to_clk_aic32x4(hw);
regmap_update_bits(div->regmap, div->reg, AIC32X4_DIVEN, 0);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4-clk.c |
static int clk_aic32x4_bdiv_set_parent(struct clk_hw *hw, u8 index) {
struct clk_aic32x4 *mux = to_clk_aic32x4(hw);
return regmap_update_bits(mux->regmap, AIC32X4_IFACE3, AIC32X4_BDIVCLK_MASK,
index);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4-spi.c |
static int aic32x4_spi_probe(struct spi_device *spi) {
struct regmap *regmap;
struct regmap_config config;
config = aic32x4_regmap_config;
config.reg_bits = 7;
config.pad_bits = 1;
config.val_bits = 8;
config.read_flag_mask = 0x01;
regmap = devm_regmap_init_spi(spi, &config);
if (spi->dev.of_node)... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4-spi.c |
static void aic32x4_spi_remove(struct spi_device *spi) {
aic32x4_remove(&spi->dev);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4.c | static int aic32x4_reset_adc(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
u32 adc_reg;
switch (event) {
case SND_SOC_DAPM_POST_PMD:
adc_reg = snd_soc_component_read(component... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4.c |
static int aic32x4_get_mfp5_gpio(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
u8 val;
val = snd_soc_component_read(component, AIC32X4_GPIOCTL);
ucontrol->value.integer.value[0] = ((val ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4.c |
static int aic32x4_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 clk *mclk;
struct clk *pll;
pll = devm_clk_get(component->dev, "pll");
if (IS_ERR(pll))
return P... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4.c |
static int aic32x4_set_aosr(struct snd_soc_component *component, u8 aosr) {
return snd_soc_component_write(component, AIC32X4_AOSR, aosr);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4.c | static int aic32x4_set_processing_blocks(struct snd_soc_component *component,
u8 r_block, u8 p_block) {
struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component);
if (aic32x4->type == AIC32X4_TYPE_TAS2505) {
if (r_block || p_block > 3)
return -EINVAL... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4.c |
static int aic32x4_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 aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component);
u... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4.c | static int aic32x4_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
int ret;
static struct clk_bulk_data clocks[] = {
{.id = "madc"},
{.id = "mdac"},
{.id = "bdiv"},
};
ret = devm_clk_bulk_get(component->dev, ARRAY_SIZE(cl... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic32x4.c | static int
aic32x4_tas2505_component_probe(struct snd_soc_component *component) {
struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component);
u32 tmp_reg;
int ret;
static struct clk_bulk_data clocks[] = {
{.id = "codec_clkin"},
{.id = "pll"},
{.id = "bdiv"},
{.id = "mdac"},... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic3x-spi.c |
static int aic3x_spi_probe(struct spi_device *spi) {
struct regmap *regmap;
struct regmap_config config;
const struct spi_device_id *id = spi_get_device_id(spi);
config = aic3x_regmap;
config.reg_bits = 7;
config.pad_bits = 1;
config.val_bits = 8;
config.read_flag_mask = 0x01;
dev_dbg(&spi->dev, "p... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic3x.c | static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component =
snd_soc_dapm_kcontrol_component(kcontrol);
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
st... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic3x.c | static int aic3x_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct snd_soc_component *component = dai->component;
struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
int delay = 0;
int width = aic3x->slot_width;
if (!width)
width = su... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic3x.c | static int aic3x_set_dai_tdm_slot(struct snd_soc_dai *codec_dai,
unsigned int tx_mask, unsigned int rx_mask,
int slots, int slot_width) {
struct snd_soc_component *component = codec_dai->component;
struct aic3x_priv *aic3x = snd_soc_component_get_d... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic3x.c | static int aic3x_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
switch (level) {
case SND_SOC_BIAS_ON:
break;
case SND_SOC_BIAS_PREPARE:
if (snd_soc_component_get_b... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320aic3x.c | void aic3x_remove(struct device *dev) {
struct aic3x_priv *aic3x = dev_get_drvdata(dev);
if (aic3x->gpio_reset && !aic3x->shared_reset)
gpiod_set_value(aic3x->gpio_reset, 1);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c | static int dac33_write(struct snd_soc_component *component, unsigned int reg,
unsigned int value) {
struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
u8 data[2];
int ret = 0;
data[0] = reg & 0xff;
data[1] = value & 0xff;
dac33_write_reg_cache(component, data... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c |
static int dac33_write_locked(struct snd_soc_component *component,
unsigned int reg, unsigned int value) {
struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
int ret;
mutex_lock(&dac33->mutex);
ret = dac33_write(component, reg, value);
mutex_unlock(&dac3... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c |
static inline void dac33_soft_power(struct snd_soc_component *component,
int power) {
u8 reg;
reg = dac33_read_reg_cache(component, DAC33_PWR_CTRL);
if (power)
reg |= DAC33_PDNALLB;
else
reg &= ~(DAC33_PDNALLB | DAC33_OSCPDNB | DAC33_DACRPDNB | DAC33_DACLPDNB);
da... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c | static inline void dac33_disable_digital(struct snd_soc_component *component) {
u8 reg;
reg = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_B);
reg &= ~DAC33_BCLKON;
dac33_write(component, DAC33_SER_AUDIOIF_CTRL_B, reg);
/* Power down the Oscillator, and DACs */
reg = dac33_read_reg_cache(compone... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c | static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
int ret = 0;
if (dac33->fifo... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c | static int dac33_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
int ret;
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)... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c | static void dac33_work(struct work_struct *work) {
struct snd_soc_component *component;
struct tlv320dac33_priv *dac33;
u8 reg;
dac33 = container_of(work, struct tlv320dac33_priv, work);
component = dac33->component;
mutex_lock(&dac33->mutex);
switch (dac33->state) {
case DAC33_PREFILL:
dac33->sta... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c |
static void dac33_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct snd_soc_component *component = dai->component;
struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
dac33->substream = NULL;
}
#define CALC_BURST_RATE(bclkdiv, bclk... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c |
static int dac33_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai) {
struct snd_soc_component *component = dai->component;
struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
int ret = 0;
switch (cmd) {
case SNDRV_PCM_TRIGG... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tlv320dac33.c |
static int dac33_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) {
struct snd_soc_component *component = codec_dai->component;
struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
u8 aictrl_a, aictrl_b;
aictrl_a = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_A);
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/ts3a227e.c |
static bool ts3a227e_writeable_reg(struct device *dev, unsigned int reg) {
switch (reg) {
case TS3A227E_REG_INTERRUPT_DISABLE ... TS3A227E_REG_SWITCH_CONTROL_2:
case TS3A227E_REG_KP_THRESHOLD_1 ... TS3A227E_REG_KP_THRESHOLD_3:
return true;
default:
return false;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/ts3a227e.c | static void ts3a227e_new_jack_state(struct ts3a227e *ts3a227e,
unsigned acc_reg) {
bool plugged, mic_present;
plugged = !!(acc_reg & JACK_INSERTED);
mic_present = plugged && !!(acc_reg & EITHER_MIC_MASK);
ts3a227e->plugged = plugged;
if (mic_present != ts3a227e->mic_pres... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/ts3a227e.c | static int ts3a227e_suspend(struct device *dev) {
struct ts3a227e *ts3a227e = dev_get_drvdata(dev);
dev_dbg(ts3a227e->dev, "suspend disable irq\n");
disable_irq(ts3a227e->irq);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tscs42xx.c |
static bool tscs42xx_volatile(struct device *dev, unsigned int reg) {
switch (reg) {
case R_DACCRWRL:
case R_DACCRWRM:
case R_DACCRWRH:
case R_DACCRRDL:
case R_DACCRRDM:
case R_DACCRRDH:
case R_DACCRSTAT:
case R_DACCRADDR:
case R_PLLCTL0:
return true;
default:
return false;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tscs42xx.c |
static int coeff_ram_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component);
struct coeff_ram_ctl *ctl = (struct coeff_ram_c... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tscs42xx.c |
static inline int adc_mute(struct snd_soc_component *component) {
int ret;
ret = snd_soc_component_update_bits(component, R_CNVRTR0, RM_CNVRTR0_ADCMU,
RV_CNVRTR0_ADCMU_ENABLE);
if (ret < 0) {
dev_err(component->dev, "Failed to mute ADC (%d)\n", ret);
return ret;
}... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tscs42xx.c |
static int tscs42xx_mute_stream(struct snd_soc_dai *dai, int mute, int stream) {
struct snd_soc_component *component = dai->component;
int ret;
if (mute)
if (stream == SNDRV_PCM_STREAM_PLAYBACK)
ret = dac_mute(component);
else
ret = adc_mute(component);
else if (stream == SNDRV_PCM_STREAM_... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tscs42xx.c |
static int tscs42xx_probe(struct snd_soc_component *component) {
return set_sysclk(component);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tscs454.c |
static inline void init_coeff_ram_cache(u8 *cache) {
static const u8 norm_addrs[] = {
0x00, 0x05, 0x0a, 0x0f, 0x14, 0x19, 0x1f, 0x20, 0x25, 0x2a, 0x2f, 0x34,
0x39, 0x3f, 0x40, 0x45, 0x4a, 0x4f, 0x54, 0x59, 0x5f, 0x60, 0x65, 0x6a,
0x6f, 0x74, 0x79, 0x7f, 0x80, 0x85, 0x8c, 0x91, 0x96, 0x97, 0x9c, 0xa... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tscs454.c |
static inline void coeff_ram_init(struct coeff_ram *ram) {
init_coeff_ram_cache(ram->cache);
mutex_init(&ram->lock);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tscs454.c |
static inline void set_aif_status_inactive(struct aifs_status *status,
int aif_id, bool playback) {
u8 mask = ~(0x01 << (aif_id * 2 + !playback));
status->streams &= mask;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tscs454.c |
static bool tscs454_volatile(struct device *dev, unsigned int reg) {
switch (reg) {
case R_PLLSTAT:
case R_SPKCRRDL:
case R_SPKCRRDM:
case R_SPKCRRDH:
case R_SPKCRS:
case R_DACCRRDL:
case R_DACCRRDM:
case R_DACCRRDH:
case R_DACCRS:
case R_SUBCRRDL:
case R_SUBCRRDM:
case R_SUBCRRDH:
case ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tscs454.c |
static bool tscs454_writable(struct device *dev, unsigned int reg) {
switch (reg) {
case R_SPKCRRDL:
case R_SPKCRRDM:
case R_SPKCRRDH:
case R_DACCRRDL:
case R_DACCRRDM:
case R_DACCRRDH:
case R_SUBCRRDL:
case R_SUBCRRDM:
case R_SUBCRRDH:
return false;
default:
return true;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tscs454.c |
static inline void reserve_pll(struct pll *pll) {
mutex_lock(&pll->lock);
pll->users++;
mutex_unlock(&pll->lock);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.