Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/soc/codecs/pcm3060.c | static void pcm3060_parse_dt(const struct device_node *np,
struct pcm3060_priv *priv) {
priv->out_se = of_property_read_bool(np, "ti,out-single-ended");
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm3168a-i2c.c |
static int pcm3168a_i2c_probe(struct i2c_client *i2c) {
struct regmap *regmap;
regmap = devm_regmap_init_i2c(i2c, &pcm3168a_regmap);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
return pcm3168a_probe(&i2c->dev, regmap);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm3168a.c |
static int pcm3168a_mute(struct snd_soc_dai *dai, int mute, int direction) {
struct snd_soc_component *component = dai->component;
struct pcm3168a_priv *pcm3168a = snd_soc_component_get_drvdata(component);
regmap_write(pcm3168a->regmap, PCM3168A_DAC_MUTE, mute ? 0xff : 0);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm3168a.c |
static int pcm3168a_set_dai_fmt(struct snd_soc_dai *dai, unsigned int format) {
struct snd_soc_component *component = dai->component;
struct pcm3168a_priv *pcm3168a = snd_soc_component_get_drvdata(component);
struct pcm3168a_io_params *io_params = &pcm3168a->io_params[dai->id];
bool provider_mode;
switch (f... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm3168a.c | void pcm3168a_remove(struct device *dev) {
struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev);
gpiod_set_value_cansleep(pcm3168a->gpio_rst, 1);
pm_runtime_disable(dev);
#ifndef CONFIG_PM
pcm3168a_disable(dev);
#endif
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm3168a.c | static int pcm3168a_rt_resume(struct device *dev) {
struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev);
int ret;
ret = clk_prepare_enable(pcm3168a->scki);
if (ret) {
dev_err(dev, "Failed to enable mclk: %d\n", ret);
return ret;
}
ret =
regulator_bulk_enable(ARRAY_SIZE(pcm3168a->supplies),... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm3168a.c |
static int pcm3168a_rt_suspend(struct device *dev) {
struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev);
regcache_cache_only(pcm3168a->regmap, true);
pcm3168a_disable(dev);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x-i2c.c | static int pcm512x_i2c_probe(struct i2c_client *i2c) {
struct regmap *regmap;
struct regmap_config config = pcm512x_regmap;
config.read_flag_mask = 0x80;
config.write_flag_mask = 0x80;
regmap = devm_regmap_init_i2c(i2c, &config);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
return pcm512x_probe(&i2c... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x-spi.c |
static int pcm512x_spi_probe(struct spi_device *spi) {
struct regmap *regmap;
int ret;
regmap = devm_regmap_init_spi(spi, &pcm512x_regmap);
if (IS_ERR(regmap)) {
ret = PTR_ERR(regmap);
return ret;
}
return pcm512x_probe(&spi->dev, regmap);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x.c |
static int pcm512x_overclock_pll_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component);
ucontrol->value.int... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x.c |
static int pcm512x_overclock_pll_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component);
switch (snd_soc_com... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x.c |
static int
pcm512x_digital_playback_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component);
mutex_lock... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x.c |
static unsigned long pcm512x_dac_max(struct pcm512x_priv *pcm512x,
unsigned long rate) {
return rate + rate * pcm512x->overclock_dac / 100;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x.c | static int pcm512x_hw_rule_rate(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct pcm512x_priv *pcm512x = rule->private;
struct snd_interval ranges[2];
int frame_size;
frame_size = snd_soc_params_to_frame_size(params);
if (frame_size < 0)
return fram... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x.c | static int pcm512x_dai_startup_slave(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct snd_soc_component *component = dai->component;
struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component);
struct device *dev = dai->dev;
struct regmap *r... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x.c |
static int pcm512x_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct snd_soc_component *component = dai->component;
struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component);
switch (pcm512x->fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x.c |
static int pcm512x_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
struct pcm512x_priv *pcm512x = dev_get_drvdata(component->dev);
int ret;
switch (level) {
case SND_SOC_BIAS_ON:
case SND_SOC_BIAS_PREPARE:
break;
case SND_SOC_BIAS... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/pcm512x.c |
void pcm512x_remove(struct device *dev) {
struct pcm512x_priv *pcm512x = dev_get_drvdata(dev);
pm_runtime_disable(dev);
if (!IS_ERR(pcm512x->sclk))
clk_disable_unprepare(pcm512x->sclk);
regulator_bulk_disable(ARRAY_SIZE(pcm512x->supplies), pcm512x->supplies);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rk3328_codec.c |
static int rk3328_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct rk3328_codec_priv *rk3328 =
snd_soc_component_get_drvdata(dai->component);
unsigned int val;
switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBC_CFC:
val = PIN_DIRECTION_IN | DAC_I2S_MODE_SLAVE;... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rk3328_codec.c |
static int rk3328_mute_stream(struct snd_soc_dai *dai, int mute,
int direction) {
struct rk3328_codec_priv *rk3328 =
snd_soc_component_get_drvdata(dai->component);
unsigned int val;
if (mute)
val = HPOUTL_MUTE | HPOUTR_MUTE;
else
val = HPOUTL_UNMUTE | HPOUTR_UNMUTE;... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rk3328_codec.c | static int rk3328_codec_close_playback(struct rk3328_codec_priv *rk3328) {
size_t i;
gpiod_set_value(rk3328->mute, 1);
regmap_update_bits(rk3328->regmap, HPOUTL_GAIN_CTRL, HPOUTL_GAIN_MASK, 0);
regmap_update_bits(rk3328->regmap, HPOUTR_GAIN_CTRL, HPOUTR_GAIN_MASK, 0);
for (i = 0; i < ARRAY_SIZE(playback_cl... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rk3328_codec.c |
static bool rk3328_codec_volatile_reg(struct device *dev, unsigned int reg) {
switch (reg) {
case CODEC_RESET:
return true;
default:
return false;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rk817_codec.c | static int rk817_init(struct snd_soc_component *component) {
struct rk817_codec_priv *rk817 = snd_soc_component_get_drvdata(component);
snd_soc_component_write(component, RK817_CODEC_DDAC_POPD_DACST, 0x02);
snd_soc_component_write(component, RK817_CODEC_DDAC_SR_LMT0, 0x02);
snd_soc_component_write(component, R... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rk817_codec.c |
static void rk817_remove(struct snd_soc_component *component) {
snd_soc_component_exit_regmap(component);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rk817_codec.c |
static void rk817_codec_parse_dt_property(struct device *dev,
struct rk817_codec_priv *rk817) {
struct device_node *node;
node = of_get_child_by_name(dev->parent->of_node, "codec");
if (!node) {
dev_dbg(dev, "%s() Can not get child: codec\n", __func__);
}
rk817... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rk817_codec.c |
static int rk817_platform_remove(struct platform_device *pdev) {
struct rk817_codec_priv *rk817 = platform_get_drvdata(pdev);
clk_disable_unprepare(rk817->mclk);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rl6231.c | int rl6231_get_pre_div(struct regmap *map, unsigned int reg, int sft) {
int pd, val;
regmap_read(map, reg, &val);
val = (val >> sft) & 0x7;
switch (val) {
case 0:
case 1:
case 2:
case 3:
pd = val + 1;
break;
case 4:
pd = 6;
break;
case 5:
pd = 8;
break;
case 6:
pd = ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rl6231.c |
static unsigned int find_best_div(unsigned int in, unsigned int max,
unsigned int div) {
unsigned int d;
if (in <= max)
return 1;
d = in / max;
if (in % max)
d++;
while (div % d != 0)
d++;
return d;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rl6231.c |
int rl6231_get_clk_info(int sclk, int rate) {
int i;
static const int pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
if (sclk <= 0 || rate <= 0)
return -EINVAL;
rate = rate << 8;
for (i = 0; i < ARRAY_SIZE(pd); i++)
if (sclk == rate * pd[i])
return i;
return -EINVAL;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static int rt1011_reg_init(struct snd_soc_component *component) {
struct rt1011_priv *rt1011 = snd_soc_component_get_drvdata(component);
regmap_multi_reg_write(rt1011->regmap, init_list, ARRAY_SIZE(init_list));
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static bool rt1011_validate_bq_drc_coeff(unsigned short reg) {
if ((reg == RT1011_DAC_SET_1) ||
(reg >= RT1011_ADC_SET && reg <= RT1011_ADC_SET_1) ||
(reg == RT1011_ADC_SET_4) || (reg == RT1011_ADC_SET_5) ||
(reg == RT1011_MIXER_1) || (reg == RT1011_A_TIMING_1) ||
(reg >= RT1011_POWER_7 && re... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static int rt1011_bq_drc_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 128;
uinfo->value.integer.max = 0x17ffffff;
return 0;
}
#define RT1011_BQ_DRC(xname) ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static int rt1011_i2s_ref_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct rt1011_priv *rt1011 = snd_soc_component_get_drvdata(component);
rt1011->i2s_ref = ucontrol->value.e... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static int rt1011_get_clk_info(int sclk, int rate) {
int i;
static const int pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
if (sclk <= 0 || rate <= 0)
return -EINVAL;
rate = rate << 8;
for (i = 0; i < ARRAY_SIZE(pd); i++)
if (sclk == rate * pd[i])
return i;
return -EINVAL;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static void rt1011_remove(struct snd_soc_component *component) {
struct rt1011_priv *rt1011 = snd_soc_component_get_drvdata(component);
cancel_work_sync(&rt1011->cali_work);
rt1011_reset(rt1011->regmap);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static int rt1011_resume(struct snd_soc_component *component) {
struct rt1011_priv *rt1011 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt1011->regmap, false);
regcache_sync(rt1011->regmap);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static int rt1011_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
switch (level) {
case SND_SOC_BIAS_OFF:
snd_soc_component_write(component, RT1011_SYSTEM_RESET_1, 0x0000);
snd_soc_component_write(component, RT1011_SYSTEM_RESET_2, 0x0000... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static int rt1011_parse_dp(struct rt1011_priv *rt1011, struct device *dev) {
device_property_read_u32(dev, "realtek,temperature_calib",
&rt1011->temperature_calib);
device_property_read_u32(dev, "realtek,r0_calib", &rt1011->r0_calib);
dev_dbg(dev, "%s: r0_calib: 0x%x, temperature_cali... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static int rt1011_i2c_probe(struct i2c_client *i2c) {
struct rt1011_priv *rt1011;
int ret;
unsigned int val;
rt1011 = devm_kzalloc(&i2c->dev, sizeof(struct rt1011_priv), GFP_KERNEL);
if (!rt1011)
return -ENOMEM;
i2c_set_clientdata(i2c, rt1011);
rt1011_parse_dp(rt1011, &i2c->dev);
rt1011->regmap... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1011.c |
static void rt1011_i2c_shutdown(struct i2c_client *client) {
struct rt1011_priv *rt1011 = i2c_get_clientdata(client);
rt1011_reset(rt1011->regmap);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1015.c |
static int rt1015_bypass_boost_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
ucontrol->value.integer.v... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1015.c |
static int rt1015_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct snd_soc_component *component = dai->component;
unsigned int reg_val = 0, reg_val2 = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
reg_val |= RT1015_TCON_TDM_MS_M;
break;
case SND_SOC_DAIFM... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1015.c |
static int rt1015_set_component_sysclk(struct snd_soc_component *component,
int clk_id, int source,
unsigned int freq, int dir) {
struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
unsigned int reg_val = 0;
if (fre... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1015.c |
static void rt1015_remove(struct snd_soc_component *component) {
struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
regmap_write(rt1015->regmap, RT1015_RESET, 0);
}
#define RT1015_STEREO_RATES SNDRV_PCM_RATE_8000_192000
#define RT1015_FORMATS ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1015.c |
static int rt1015_i2c_probe(struct i2c_client *i2c) {
struct rt1015_platform_data *pdata = dev_get_platdata(&i2c->dev);
struct rt1015_priv *rt1015;
int ret;
unsigned int val;
rt1015 = devm_kzalloc(&i2c->dev, sizeof(*rt1015), GFP_KERNEL);
if (!rt1015)
return -ENOMEM;
i2c_set_clientdata(i2c, rt1015);... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1015.c |
static void rt1015_i2c_shutdown(struct i2c_client *client) {
struct rt1015_priv *rt1015 = i2c_get_clientdata(client);
regmap_write(rt1015->regmap, RT1015_RESET, 0);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1015p.c | static int rt1015p_suspend(struct snd_soc_component *component) {
struct rt1015p_priv *rt1015p = snd_soc_component_get_drvdata(component);
rt1015p->calib_done = false;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1016.c |
static bool rt1016_readable_register(struct device *dev, unsigned int reg) {
switch (reg) {
case RT1016_RESET:
case RT1016_PADS_CTRL_1:
case RT1016_PADS_CTRL_2:
case RT1016_I2C_CTRL:
case RT1016_VOL_CTRL_1:
case RT1016_VOL_CTRL_2:
case RT1016_VOL_CTRL_3:
case RT1016_ANA_CTRL_1:
case RT1016_MUX_SEL:... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1016.c |
static int rt1016_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct snd_soc_component *component = dai->component;
struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
unsigned int reg_val = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
reg_v... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1016.c |
static int rt1016_set_component_sysclk(struct snd_soc_component *component,
int clk_id, int source,
unsigned int freq, int dir) {
struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
unsigned int reg_val = 0;
if (fre... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1016.c |
static int rt1016_probe(struct snd_soc_component *component) {
struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
rt1016->component = component;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1016.c |
static void rt1016_remove(struct snd_soc_component *component) {
struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
regmap_write(rt1016->regmap, RT1016_RESET, 0);
}
#define RT1016_STEREO_RATES SNDRV_PCM_RATE_8000_48000
#define RT1016_FORMATS ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1016.c |
static int rt1016_i2c_probe(struct i2c_client *i2c) {
struct rt1016_priv *rt1016;
int ret;
unsigned int val;
rt1016 = devm_kzalloc(&i2c->dev, sizeof(struct rt1016_priv), GFP_KERNEL);
if (rt1016 == NULL)
return -ENOMEM;
i2c_set_clientdata(i2c, rt1016);
rt1016->regmap = devm_regmap_init_i2c(i2c, &rt... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1019.c |
static int rt1019_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct snd_soc_component *component = dai->component;
unsigned int reg_val = 0, reg_val2 = 0;
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
case SND_SOC_DAIFMT_NB_NF:
break;
case SND_SOC_DAIFMT_IB_NF:
reg_val2 |= RT1019_TDM_BCLK_I... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1019.c |
static int rt1019_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir) {
struct snd_soc_component *component = dai->component;
struct rt1019_priv *rt1019 = snd_soc_component_get_drvdata(component);
unsigned int reg_val = 0;
if (freq == rt1019->sysclk... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1305.c |
static int rt1305_reg_init(struct snd_soc_component *component) {
struct rt1305_priv *rt1305 = snd_soc_component_get_drvdata(component);
regmap_multi_reg_write(rt1305->regmap, init_list, RT1305_INIT_REG_LEN);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1305.c |
static int rt1305_get_clk_info(int sclk, int rate) {
int i;
static const int pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
if (sclk <= 0 || rate <= 0)
return -EINVAL;
rate = rate << 8;
for (i = 0; i < ARRAY_SIZE(pd); i++)
if (sclk == rate * pd[i])
return i;
return -EINVAL;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1305.c |
static int rt1305_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct snd_soc_component *component = dai->component;
struct rt1305_priv *rt1305 = snd_soc_component_get_drvdata(component);
unsigned int reg_val = 0, reg1_val = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1305.c |
static int rt1305_set_component_sysclk(struct snd_soc_component *component,
int clk_id, int source,
unsigned int freq, int dir) {
struct rt1305_priv *rt1305 = snd_soc_component_get_drvdata(component);
unsigned int reg_val = 0;
if (fre... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1305.c |
static void rt1305_remove(struct snd_soc_component *component) {
struct rt1305_priv *rt1305 = snd_soc_component_get_drvdata(component);
rt1305_reset(rt1305->regmap);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1305.c | static int rt1305_suspend(struct snd_soc_component *component) {
struct rt1305_priv *rt1305 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt1305->regmap, true);
regcache_mark_dirty(rt1305->regmap);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1305.c |
static int rt1305_i2c_probe(struct i2c_client *i2c) {
struct rt1305_priv *rt1305;
int ret;
unsigned int val;
rt1305 = devm_kzalloc(&i2c->dev, sizeof(struct rt1305_priv), GFP_KERNEL);
if (rt1305 == NULL)
return -ENOMEM;
i2c_set_clientdata(i2c, rt1305);
rt1305->regmap = devm_regmap_init_i2c(i2c, &rt... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1308-sdw.c | static int rt1308_read_prop(struct sdw_slave *slave) {
struct sdw_slave_prop *prop = &slave->prop;
int nval, i;
u32 bit;
unsigned long addr;
struct sdw_dpn_prop *dpn;
prop->scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY;
prop->pagin... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1308-sdw.c | static int rt1308_update_status(struct sdw_slave *slave,
enum sdw_slave_status status) {
struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(&slave->dev);
rt1308->status = status;
if (status == SDW_SLAVE_UNATTACHED)
rt1308->hw_init = false;
/*
* Perform initialization only... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1308-sdw.c |
static int rt1308_bus_config(struct sdw_slave *slave,
struct sdw_bus_params *params) {
struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(&slave->dev);
int ret;
memcpy(&rt1308->params, params, sizeof(*params));
ret = rt1308_clock_config(&slave->dev);
if (ret < 0)
dev_err(&sla... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1308-sdw.c |
static int rt1308_classd_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 rt1308_sdw_priv *rt1308 = snd_soc_component_get_drvdata(component);
switch (event) {
case SN... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1308-sdw.c | static int rt1308_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
int direction) {
struct sdw_stream_data *stream;
if (!sdw_stream)
return 0;
stream = kzalloc(sizeof(*stream), GFP_KERNEL);
if (!stream)
return -ENOMEM;
stream->sdw_stream = sdw_stream;
if... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1308-sdw.c | static int rt1308_sdw_set_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask,
int slots, int slot_width) {
struct snd_soc_component *component = dai->component;
struct rt1308_sdw_priv *rt1308 = snd_soc_component_get_drvd... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1308-sdw.c | static int rt1308_sdw_component_probe(struct snd_soc_component *component) {
struct rt1308_sdw_priv *rt1308 = snd_soc_component_get_drvdata(component);
int ret;
rt1308->component = component;
rt1308_sdw_parse_dt(rt1308, &rt1308->sdw_slave->dev);
ret = pm_runtime_resume(component->dev);
if (ret < 0 && ret ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1308-sdw.c | static int rt1308_sdw_init(struct device *dev, struct regmap *regmap,
struct sdw_slave *slave) {
struct rt1308_sdw_priv *rt1308;
int ret;
rt1308 = devm_kzalloc(dev, sizeof(*rt1308), GFP_KERNEL);
if (!rt1308)
return -ENOMEM;
dev_set_drvdata(dev, rt1308);
rt1308->sdw_slave = s... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1308.c |
static int rt1308_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct snd_soc_component *component = dai->component;
struct rt1308_priv *rt1308 = snd_soc_component_get_drvdata(component);
unsigned int reg_val = 0, reg1_val = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBS_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1308.c |
static int rt1308_resume(struct snd_soc_component *component) {
struct rt1308_priv *rt1308 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt1308->regmap, false);
regcache_sync(rt1308->regmap);
return 0;
}
#else
#define rt1308_suspend NULL
#define rt1308_resume NULL
#endif
#define RT1308_STE... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1316-sdw.c |
static int rt1316_pde24_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 rt1316_sdw_priv *rt1316 = snd_soc_component_get_drvdata(component);
unsigned char ps0 = 0x0, ps3 ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1316-sdw.c |
static int rt1316_sdw_remove(struct sdw_slave *slave) {
struct rt1316_sdw_priv *rt1316 = dev_get_drvdata(&slave->dev);
if (rt1316->first_hw_init)
pm_runtime_disable(&slave->dev);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1318-sdw.c |
static bool rt1318_volatile_register(struct device *dev, unsigned int reg) {
switch (reg) {
case 0x2f55:
case 0x3000 ... 0x3001:
case 0xc000:
case 0xc301:
case 0xc410:
case 0xc430 ... 0xc431:
case 0xdb06:
case 0xdb12:
case 0xdb1d ... 0xdb1f:
case 0xdb35:
case 0xdb37:
case 0xdb8a ... 0xdb92:
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1318-sdw.c |
static int rt1318_classd_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 rt1318_sdw_priv *rt1318 = snd_soc_component_get_drvdata(component);
unsigned char ps0 = 0x0, ps... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt1318-sdw.c | static int rt1318_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
int direction) {
struct sdw_stream_data *stream;
if (!sdw_stream)
return 0;
stream = kzalloc(sizeof(*stream), GFP_KERNEL);
if (!stream)
return -ENOMEM;
stream->sdw_stream = sdw_stream;
if... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt1318-sdw.c |
static void rt1318_sdw_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct sdw_stream_data *stream;
stream = snd_soc_dai_get_dma_data(dai, substream);
snd_soc_dai_set_dma_data(dai, substream, NULL);
kfree(stream);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt274.c |
static int rt274_jack_detect(struct rt274_priv *rt274, bool *hp, bool *mic) {
unsigned int buf;
int ret;
*hp = false;
*mic = false;
if (!rt274->component)
return -EINVAL;
ret = regmap_read(rt274->regmap, RT274_GET_HP_SENSE, &buf);
if (ret)
return ret;
*hp = buf & 0x80000000;
ret = regmap_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt274.c | static int rt274_mic_detect(struct snd_soc_component *component,
struct snd_soc_jack *jack, void *data) {
struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component);
rt274->jack = jack;
if (jack == NULL) {
regmap_update_bits(rt274->regmap, RT274_EAPD_GPIO_IRQ_CTRL, RT27... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt274.c |
static int rt274_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
switch (level) {
case SND_SOC_BIAS_PREPARE:
if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) {
snd_soc_component_write(component, RT274_SET_AUDIO_P... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt274.c |
static void rt274_remove(struct snd_soc_component *component) {
struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component);
cancel_delayed_work_sync(&rt274->jack_detect_work);
rt274->component = NULL;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt286.c | static void rt286_index_sync(struct snd_soc_component *component) {
struct rt286_priv *rt286 = snd_soc_component_get_drvdata(component);
int i;
for (i = 0; i < INDEX_CACHE_SIZE; i++) {
snd_soc_component_write(component, rt286->index_cache[i].reg,
rt286->index_cache[i].def);
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt286.c |
static int rt286_probe(struct snd_soc_component *component) {
struct rt286_priv *rt286 = snd_soc_component_get_drvdata(component);
rt286->component = component;
INIT_DELAYED_WORK(&rt286->jack_detect_work, rt286_jack_detect_work);
if (rt286->i2c->irq)
schedule_delayed_work(&rt286->jack_detect_work, msecs_... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt298.c | static int rt298_mic_detect(struct snd_soc_component *component,
struct snd_soc_jack *jack, void *data) {
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298->jack = jack;
if (jack) {
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt298.c |
static int rt298_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
switch (level) {
case SND_SOC_BIAS_PREPARE:
if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) {
snd_soc_component_write(component, RT298_SET_AUDIO_P... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt298.c | static irqreturn_t rt298_irq(int irq, void *data) {
struct rt298_priv *rt298 = data;
bool hp = false;
bool mic = false;
int ret, status = 0;
ret = rt298_jack_detect(rt298, &hp, &mic);
regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x1, 0x1);
if (ret == 0) {
if (hp)
status |= SND_JACK_HEADP... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt298.c |
static void rt298_remove(struct snd_soc_component *component) {
struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
cancel_delayed_work_sync(&rt298->jack_detect_work);
rt298->component = NULL;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5514-spi.c | static void rt5514_schedule_copy(struct rt5514_dsp *rt5514_dsp) {
u8 buf[8];
if (!rt5514_dsp->substream)
return;
rt5514_dsp->get_size = 0;
rt5514_spi_burst_read(RT5514_BUFFER_VOICE_BASE, (u8 *)&buf, sizeof(buf));
rt5514_dsp->buf_base = buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24;
rt5514_spi_b... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5514-spi.c |
static int rt5514_spi_hw_free(struct snd_soc_component *component,
struct snd_pcm_substream *substream) {
struct rt5514_dsp *rt5514_dsp = snd_soc_component_get_drvdata(component);
mutex_lock(&rt5514_dsp->dma_lock);
rt5514_dsp->substream = NULL;
mutex_unlock(&rt5514_dsp->dma_lock)... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5514-spi.c |
static snd_pcm_uframes_t
rt5514_spi_pcm_pointer(struct snd_soc_component *component,
struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct rt5514_dsp *rt5514_dsp = snd_soc_component_get_drvdata(component);
return bytes_to_frames(runtime, rt551... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5514-spi.c |
static int rt5514_spi_pcm_probe(struct snd_soc_component *component) {
struct rt5514_dsp *rt5514_dsp;
int ret;
rt5514_dsp = devm_kzalloc(component->dev, sizeof(*rt5514_dsp), GFP_KERNEL);
if (!rt5514_dsp)
return -ENOMEM;
rt5514_dsp->dev = &rt5514_spi->dev;
mutex_init(&rt5514_dsp->dma_lock);
INIT_DE... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5514-spi.c |
static int __maybe_unused rt5514_resume(struct device *dev) {
struct rt5514_dsp *rt5514_dsp = dev_get_drvdata(dev);
int irq = to_spi_device(dev)->irq;
u8 buf[8];
if (device_may_wakeup(dev))
disable_irq_wake(irq);
if (rt5514_dsp) {
if (rt5514_dsp->substream) {
rt5514_spi_burst_read(RT5514_IRQ_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5514.c |
static int rt5514_dsp_voice_wake_up_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component);
ucontrol->value.integer.... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5514.c |
static int rt5514_set_dmic_clk(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component);
int idx;
idx = rt5514_calc_d... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5514.c |
static int rt5514_i2s_use_asrc(struct snd_soc_dapm_widget *source,
struct snd_soc_dapm_widget *sink) {
struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component);
return (rt5514->sysclk > rt5... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5514.c |
static int rt5514_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir) {
struct snd_soc_component *component = dai->component;
struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component);
unsigned int reg_val = 0;
if (freq == rt5514->sysclk... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5616.c |
static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
struct snd_soc_dapm_widget *sink) {
unsigned int val;
val = snd_soc_component_read(snd_soc_dapm_to_component(source->dapm),
RT5616_GLB_CLK);
val &= RT5616_SCLK_SRC_MASK;
if (val == ... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5616.c |
static int rt5616_bst2_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
switch (event) {
case SND_SOC_DAPM_POST_PMU:
snd_soc_component_update_bits(component, RT5616_PWR_ANLG... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5616.c | static int rt5616_suspend(struct snd_soc_component *component) {
struct rt5616_priv *rt5616 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt5616->regmap, true);
regcache_mark_dirty(rt5616->regmap);
return 0;
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.