Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/soc/codecs/rt5682s.c |
static int rt5682s_set_pllb_power(struct rt5682s_priv *rt5682s, int on) {
struct snd_soc_component *component = rt5682s->component;
if (on) {
snd_soc_component_update_bits(
component, RT5682S_PWR_ANLG_3,
RT5682S_PWR_LDO_PLLB | RT5682S_PWR_BIAS_PLLB | RT5682S_PWR_PLLB,
RT5682S_PWR_LDO_... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static int set_filter_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 rt5682s_priv *rt5682s = snd_soc_component_get_drvdata(component);
int ref, reg, val;
val = snd_soc_com... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c | static int set_dmic_power(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 rt5682s_priv *rt5682s = snd_soc_component_get_drvdata(component);
unsigned int delay = 50, val;
if (rt5... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static void rt5682s_set_i2s(struct rt5682s_priv *rt5682s, int id, int on) {
struct snd_soc_component *component = rt5682s->component;
int pre_div;
unsigned int p_reg, p_mask, p_sft;
unsigned int c_reg, c_mask, c_sft;
if (id == RT5682S_AIF1) {
c_reg = RT5682S_ADDA_CLK_1;
c_mask = RT5682S_I2S_M_D_MASK... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static int is_sys_clk_from_plla(struct snd_soc_dapm_widget *w,
struct snd_soc_dapm_widget *sink) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct rt5682s_priv *rt5682s = snd_soc_component_get_drvdata(component);
if ((rt5682s->sysclk_src == RT5682... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static int is_sys_clk_from_pllb(struct snd_soc_dapm_widget *w,
struct snd_soc_dapm_widget *sink) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct rt5682s_priv *rt5682s = snd_soc_component_get_drvdata(component);
if (rt5682s->sysclk_src == RT5682S... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static int is_using_asrc(struct snd_soc_dapm_widget *w,
struct snd_soc_dapm_widget *sink) {
unsigned int reg, sft, val;
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
switch (w->shift) {
case RT5682S_ADC_STO1_ASRC_SFT:
reg = RT5682S_PLL_TRACK_3;
sft ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static int rt5682s_stereo1_adc_mixl_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 rt5682s_priv *rt5682s = snd_soc_c... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static int rt5682s_set_component_sysclk(struct snd_soc_component *component,
int clk_id, int source,
unsigned int freq, int dir) {
struct rt5682s_priv *rt5682s = snd_soc_component_get_drvdata(component);
unsigned int src = 0;
if (fr... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c | static int find_pll_inter_combination(unsigned int f_in, unsigned int f_out,
struct pll_calc_map *a,
struct pll_calc_map *b) {
int i, j;
for (i = 0; i < ARRAY_SIZE(plla_table); i++) {
if (plla_table[i].freq_in == f_in && plla_table[i].... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static int rt5682s_set_bclk1_ratio(struct snd_soc_dai *dai,
unsigned int ratio) {
struct snd_soc_component *component = dai->component;
struct rt5682s_priv *rt5682s = snd_soc_component_get_drvdata(component);
rt5682s->bclk[dai->id] = ratio;
switch (ratio) {
case 256:
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c | static long rt5682s_wclk_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct rt5682s_priv *rt5682s =
container_of(hw, struct rt5682s_priv, dai_clks_hw[RT5682S_DAI_WCLK_IDX]);
struct snd_soc_component *component = rt5682s->component;
cons... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static void rt5682s_remove(struct snd_soc_component *component) {
struct rt5682s_priv *rt5682s = snd_soc_component_get_drvdata(component);
rt5682s_reset(rt5682s);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt5682s.c |
static int rt5682s_parse_dt(struct rt5682s_priv *rt5682s, struct device *dev) {
device_property_read_u32(dev, "realtek,dmic1-data-pin",
&rt5682s->pdata.dmic1_data_pin);
device_property_read_u32(dev, "realtek,dmic1-clk-pin",
&rt5682s->pdata.dmic1_clk_pin);
dev... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt700-sdw.c | static int rt700_update_status(struct sdw_slave *slave,
enum sdw_slave_status status) {
struct rt700_priv *rt700 = dev_get_drvdata(&slave->dev);
rt700->status = status;
if (status == SDW_SLAVE_UNATTACHED)
rt700->hw_init = false;
/*
* Perform initialization only if slave ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt700-sdw.c | static int rt700_sdw_probe(struct sdw_slave *slave,
const struct sdw_device_id *id) {
struct regmap *sdw_regmap, *regmap;
sdw_regmap = devm_regmap_init_sdw(slave, &rt700_sdw_regmap);
if (IS_ERR(sdw_regmap))
return PTR_ERR(sdw_regmap);
regmap = devm_regmap_init(&slave->dev, NULL,... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt700-sdw.c |
static int __maybe_unused rt700_dev_suspend(struct device *dev) {
struct rt700_priv *rt700 = dev_get_drvdata(dev);
if (!rt700->hw_init)
return 0;
cancel_delayed_work_sync(&rt700->jack_detect_work);
cancel_delayed_work_sync(&rt700->jack_btn_check_work);
regcache_cache_only(rt700->regmap, true);
retu... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt700.c | static void rt700_btn_check_handler(struct work_struct *work) {
struct rt700_priv *rt700 =
container_of(work, struct rt700_priv, jack_btn_check_work.work);
int btn_type = 0, ret;
unsigned int jack_status = 0, reg;
reg = RT700_VERB_GET_PIN_SENSE | RT700_HP_OUT;
ret = regmap_read(rt700->regmap, reg, &jac... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt700.c |
static int rt700_spk_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 rt700_priv *rt700 = snd_soc_component_get_drvdata(component);
unsigned int val_h = (1 << RT700_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca-sdw.c |
static bool rt711_sdca_mbq_volatile_register(struct device *dev,
unsigned int reg) {
switch (reg) {
case 0x2000000:
case 0x200001a:
case 0x2000046:
case 0x2000080:
case 0x2000081:
case 0x2000083:
case 0x5800000:
case 0x5800001:
case 0x5f00001:
case 0x6... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca-sdw.c | static int rt711_sdca_sdw_probe(struct sdw_slave *slave,
const struct sdw_device_id *id) {
struct regmap *regmap, *mbq_regmap;
mbq_regmap = devm_regmap_init_sdw_mbq(slave, &rt711_sdca_mbq_regmap);
if (IS_ERR(mbq_regmap))
return PTR_ERR(mbq_regmap);
regmap = devm_regmap_init... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca-sdw.c | static int __maybe_unused rt711_sdca_dev_system_suspend(struct device *dev) {
struct rt711_sdca_priv *rt711_sdca = dev_get_drvdata(dev);
struct sdw_slave *slave = dev_to_sdw_dev(dev);
int ret1, ret2;
if (!rt711_sdca->hw_init)
return 0;
mutex_lock(&rt711_sdca->disable_irq_lock);
rt711_sdca->disable_irq... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c |
static int rt711_sdca_index_write(struct rt711_sdca_priv *rt711,
unsigned int nid, unsigned int reg,
unsigned int value) {
int ret;
struct regmap *regmap = rt711->mbq_regmap;
unsigned int addr = (nid << 20) | reg;
ret = regmap_write(regmap, a... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c |
static int rt711_sdca_index_read(struct rt711_sdca_priv *rt711,
unsigned int nid, unsigned int reg,
unsigned int *value) {
int ret;
struct regmap *regmap = rt711->mbq_regmap;
unsigned int addr = (nid << 20) | reg;
ret = regmap_read(regmap, addr... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c | static int rt711_sdca_set_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *hs_jack,
void *data) {
struct rt711_sdca_priv *rt711 = snd_soc_component_get_drvdata(component);
int ret;
rt711->hs_jack = hs_jack;
ret = ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c |
static int rt711_sdca_set_fu1e_capture_ctl(struct rt711_sdca_priv *rt711) {
int err;
unsigned int ch_l, ch_r;
ch_l = (rt711->fu1e_dapm_mute || rt711->fu1e_mixer_l_mute) ? 0x01 : 0x00;
ch_r = (rt711->fu1e_dapm_mute || rt711->fu1e_mixer_r_mute) ? 0x01 : 0x00;
err = regmap_write(rt711->regmap,
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c |
static int rt711_sdca_fu1e_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt711_sdca_priv *rt711 = snd_soc_component_get_drvdata(component);
ucontrol->value.integer... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c |
static int rt711_sdca_mux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component =
snd_soc_dapm_kcontrol_component(kcontrol);
struct rt711_sdca_priv *rt711 = snd_soc_component_get_drvdata(component);
unsigned int val = 0, ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c |
static int rt711_sdca_fu0f_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 rt711_sdca_priv *rt711 = snd_soc_component_get_drvdata(component);
switch (event) {
case... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c |
static int rt711_sdca_fu1e_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 rt711_sdca_priv *rt711 = snd_soc_component_get_drvdata(component);
switch (event) {
case... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c |
static int rt711_sdca_pde29_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 rt711_sdca_priv *rt711 = snd_soc_component_get_drvdata(component);
unsigned char ps0 = 0x... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdca.c |
static int rt711_sdca_parse_dt(struct rt711_sdca_priv *rt711,
struct device *dev) {
device_property_read_u32(dev, "realtek,jd-src", &rt711->jd_src);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdw.c | static int rt711_update_status(struct sdw_slave *slave,
enum sdw_slave_status status) {
struct rt711_priv *rt711 = dev_get_drvdata(&slave->dev);
rt711->status = status;
if (status == SDW_SLAVE_UNATTACHED)
rt711->hw_init = false;
/*
* Perform initialization only if slave ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711-sdw.c | static int __maybe_unused rt711_dev_system_suspend(struct device *dev) {
struct rt711_priv *rt711 = dev_get_drvdata(dev);
struct sdw_slave *slave = dev_to_sdw_dev(dev);
int ret;
if (!rt711->hw_init)
return 0;
mutex_lock(&rt711->disable_irq_lock);
rt711->disable_irq = true;
ret = sdw_update_no_pm(sla... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt711.c | static int rt711_calibration(struct rt711_priv *rt711) {
unsigned int val, loop = 0;
struct device *dev;
struct regmap *regmap = rt711->regmap;
int ret = 0;
mutex_lock(&rt711->calibrate_mutex);
regmap_write(rt711->regmap, RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D0);
dev = regmap_get_device(regmap);
rt7... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711.c | static int rt711_set_amp_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component);
struct soc_mixer_control *mc =
(st... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711.c | static int rt711_mux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component =
snd_soc_dapm_kcontrol_component(kcontrol);
struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component);
unsigned int reg, val = 0, nid;
int ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711.c |
static int rt711_adc_09_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 rt711_priv *rt711 = snd_soc_component_get_drvdata(component);
switch (event) {
case SND_SOC_DA... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711.c | static int rt711_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/rt711.c |
static void rt711_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/rt711.c |
int rt711_clock_config(struct device *dev) {
struct rt711_priv *rt711 = dev_get_drvdata(dev);
unsigned int clk_freq, value;
clk_freq = (rt711->params.curr_dr_freq >> 1);
switch (clk_freq) {
case RT711_CLK_FREQ_12000000HZ:
value = 0x0;
break;
case RT711_CLK_FREQ_6000000HZ:
value = 0x1;
bre... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt711.c | int rt711_init(struct device *dev, struct regmap *sdw_regmap,
struct regmap *regmap, struct sdw_slave *slave) {
struct rt711_priv *rt711;
int ret;
rt711 = devm_kzalloc(dev, sizeof(*rt711), GFP_KERNEL);
if (!rt711)
return -ENOMEM;
dev_set_drvdata(dev, rt711);
rt711->slave = slave;
rt71... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca-sdw.c |
static bool rt715_sdca_readable_register(struct device *dev, unsigned int reg) {
switch (reg) {
case 0x201a ... 0x2027:
case 0x2029 ... 0x202a:
case 0x202d ... 0x2034:
case 0x2200 ... 0x2204:
case 0x2206 ... 0x2212:
case 0x2230 ... 0x2239:
case 0x2f5b:
case SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_SMPU... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca-sdw.c | static int rt715_sdca_sdw_probe(struct sdw_slave *slave,
const struct sdw_device_id *id) {
struct regmap *mbq_regmap, *regmap;
mbq_regmap = devm_regmap_init_sdw_mbq(slave, &rt715_sdca_mbq_regmap);
if (IS_ERR(mbq_regmap))
return PTR_ERR(mbq_regmap);
regmap = devm_regmap_init... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca-sdw.c |
static int rt715_sdca_sdw_remove(struct sdw_slave *slave) {
struct rt715_sdca_priv *rt715 = dev_get_drvdata(&slave->dev);
if (rt715->first_hw_init)
pm_runtime_disable(&slave->dev);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca-sdw.c |
static int __maybe_unused rt715_dev_suspend(struct device *dev) {
struct rt715_sdca_priv *rt715 = dev_get_drvdata(dev);
if (!rt715->hw_init)
return 0;
regcache_cache_only(rt715->regmap, true);
regcache_mark_dirty(rt715->regmap);
regcache_cache_only(rt715->mbq_regmap, true);
regcache_mark_dirty(rt715-... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca.c |
static int rt715_sdca_index_write(struct rt715_sdca_priv *rt715,
unsigned int nid, unsigned int reg,
unsigned int value) {
struct regmap *regmap = rt715->mbq_regmap;
unsigned int addr;
int ret;
addr = (nid << 20) | reg;
ret = regmap_write(... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca.c |
static inline unsigned int rt715_sdca_get_gain(unsigned int reg_val,
unsigned int gain_sft) {
unsigned int neg_flag = 0;
if (reg_val & BIT(15)) {
reg_val = ~(reg_val - 1) & 0xffff;
neg_flag = 1;
}
reg_val *= 1000;
reg_val >>= 8;
if (neg_flag)
reg_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca.c |
static int
rt715_sdca_set_amp_gain_8ch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt715_sdca_priv *rt715 = snd_soc_component_get_drvdata(component);
struct rt715_sdca_kcontrol_... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca.c | static int rt715_sdca_mux_put(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_dapm_kcontrol_dapm(kcontrol);
struct rt715_sdca_priv ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca.c |
static int rt715_sdca_pde23_24_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 rt715_sdca_priv *rt715 = snd_soc_component_get_drvdata(component);
switch (event) ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca.c |
static void rt715_sdca_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct rt715_sdw_stream_data *stream;
stream = snd_soc_dai_get_dma_data(dai, substream);
if (!stream)
return;
snd_soc_dai_set_dma_data(dai, substream, NULL);
kfree(stream);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdca.c | int rt715_sdca_init(struct device *dev, struct regmap *mbq_regmap,
struct regmap *regmap, struct sdw_slave *slave) {
struct rt715_sdca_priv *rt715;
int ret;
rt715 = devm_kzalloc(dev, sizeof(*rt715), GFP_KERNEL);
if (!rt715)
return -ENOMEM;
dev_set_drvdata(dev, rt715);
rt715->slave ... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdw.c | int hda_to_sdw(unsigned int nid, unsigned int verb, unsigned int payload,
unsigned int *sdw_addr_h, unsigned int *sdw_data_h,
unsigned int *sdw_addr_l, unsigned int *sdw_data_l) {
unsigned int offset_h, offset_l, e_verb;
if (((verb & 0xff) != 0) || verb == 0xf00) {
if (verb == 0x7... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdw.c | static int rt715_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_IMPL_DEF | SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
prop->quirks = SDW_SLAVE_QUIRKS_INVALID_I... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/rt715-sdw.c |
static int rt715_sdw_remove(struct sdw_slave *slave) {
struct rt715_priv *rt715 = dev_get_drvdata(&slave->dev);
if (rt715->first_hw_init)
pm_runtime_disable(&slave->dev);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt715.c |
static int rt715_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
switch (level) {
case SND_SOC_BI... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt9120.c |
static int rt9120_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct snd_soc_component *comp = dai->component;
unsigned int format;
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
format = RT9120_CFG_FMT_I2S;
break;
case SND_SOC_DAIFMT_LEFT_J:
format = RT9120_CFG_FM... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt9120.c |
static int rt9120_check_vendor_info(struct rt9120_data *data) {
unsigned int devid;
int ret;
ret = regmap_read(data->regmap, RT9120_REG_DEVID, &devid);
if (ret)
return ret;
devid = FIELD_GET(RT9120_VID_MASK, devid);
switch (devid) {
case RT9120_VENDOR_ID:
data->chip_idx = CHIP_IDX_RT9120;
b... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt9120.c |
static void rt9120_remove(struct i2c_client *i2c) {
pm_runtime_disable(&i2c->dev);
pm_runtime_set_suspended(&i2c->dev);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/rt9120.c |
static int __maybe_unused rt9120_runtime_resume(struct device *dev) {
struct rt9120_data *data = dev_get_drvdata(dev);
if (data->pwdnn_gpio) {
gpiod_set_value(data->pwdnn_gpio, 1);
msleep(RT9120_CHIPON_WAITMS);
regcache_cache_only(data->regmap, false);
regcache_sync(data->regmap);
}
return 0;... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sdw-mockup.c |
static int sdw_mockup_component_probe(struct snd_soc_component *component) {
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sdw-mockup.c |
static void sdw_mockup_component_remove(struct snd_soc_component *component) {} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sdw-mockup.c | static int sdw_mockup_read_prop(struct sdw_slave *slave) {
struct sdw_slave_prop *prop = &slave->prop;
int nval;
int i, j;
u32 bit;
unsigned long addr;
struct sdw_dpn_prop *dpn;
prop->paging_support = false;
prop->source_ports = BIT(8);
prop->sink_ports = BIT(1);
nval = hweight32(prop->source_por... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/sgtl5000.c |
static int dac_updown_depop(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) {
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
return vag_and_mute_control(component, event, DAC_POWER_EVENT);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sgtl5000.c | static int dac_info_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 0xfc - 0x3c;
return 0;
} | [
1,
0
] |
Linux Kernel | sound/soc/codecs/sgtl5000.c | static int sgtl5000_enable_regulators(struct i2c_client *client) {
int ret;
int i;
int external_vddd = 0;
struct regulator *vddd;
struct sgtl5000_priv *sgtl5000 = i2c_get_clientdata(client);
for (i = 0; i < ARRAY_SIZE(sgtl5000->supplies); i++)
sgtl5000->supplies[i].supply = supply_names[i];
vddd = r... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp-i2c.c |
static int sigmadsp_write_i2c(void *control_data, unsigned int addr,
const uint8_t data[], size_t len) {
uint8_t *buf;
int ret;
buf = kzalloc(2 + len, GFP_KERNEL | GFP_DMA);
if (!buf)
return -ENOMEM;
put_unaligned_be16(addr, buf);
memcpy(buf + 2, data, len);
ret = i2c... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp-i2c.c |
static int sigmadsp_read_i2c(void *control_data, unsigned int addr,
uint8_t data[], size_t len) {
struct i2c_client *client = control_data;
struct i2c_msg msgs[2];
uint8_t buf[2];
int ret;
put_unaligned_be16(addr, buf);
msgs[0].addr = client->addr;
msgs[0].len = sizeof(buf)... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp-i2c.c | struct sigmadsp *devm_sigmadsp_init_i2c(struct i2c_client *client,
const struct sigmadsp_ops *ops,
const char *firmware_name) {
struct sigmadsp *sigmadsp;
sigmadsp = devm_sigmadsp_init(&client->dev, ops, firmware_name);
if (IS_ERR(si... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp-regmap.c | struct sigmadsp *devm_sigmadsp_init_regmap(struct device *dev,
struct regmap *regmap,
const struct sigmadsp_ops *ops,
const char *firmware_name) {
struct sigmadsp *sigmadsp;
sigmadsp = d... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp.c |
static int sigmadsp_ctrl_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *info) {
struct sigmadsp_control *ctrl = (void *)kcontrol->private_value;
info->type = SNDRV_CTL_ELEM_TYPE_BYTES;
info->count = ctrl->num_bytes;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp.c |
static void sigmadsp_control_free(struct snd_kcontrol *kcontrol) {
struct sigmadsp_control *ctrl = (void *)kcontrol->private_value;
ctrl->kcontrol = NULL;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp.c |
static int sigmadsp_init(struct sigmadsp *sigmadsp, struct device *dev,
const struct sigmadsp_ops *ops,
const char *firmware_name) {
sigmadsp->ops = ops;
sigmadsp->dev = dev;
INIT_LIST_HEAD(&sigmadsp->ctrl_list);
INIT_LIST_HEAD(&sigmadsp->data_list);
mutex_i... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp.c |
static int sigmadsp_rate_to_index(struct sigmadsp *sigmadsp,
unsigned int rate) {
unsigned int i;
for (i = 0; i < sigmadsp->rate_constraints.count; i++) {
if (sigmadsp->rate_constraints.list[i] == rate)
return i;
}
return -EINVAL;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp.c | static bool sigmadsp_samplerate_valid(unsigned int supported,
unsigned int requested) {
if (!supported)
return true;
return supported & requested;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sigmadsp.c | int sigmadsp_attach(struct sigmadsp *sigmadsp,
struct snd_soc_component *component) {
struct sigmadsp_control *ctrl;
unsigned int samplerate_mask;
int ret;
sigmadsp->component = component;
samplerate_mask =
sigmadsp_get_samplerate_mask(sigmadsp, sigmadsp->current_samplerate);
li... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/src4xxx-i2c.c |
static int src4xxx_i2c_probe(struct i2c_client *i2c) {
return src4xxx_probe(&i2c->dev,
devm_regmap_init_i2c(i2c, &src4xxx_regmap_config), NULL);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/src4xxx.c |
static int src4xxx_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
struct snd_soc_component *component = dai->component;
struct src4xxx *src4xxx = snd_soc_component_get_drvdata(component);
unsigned int ctrl;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
ctrl = SRC4XXX... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/ssm2518.c |
static int ssm2518_mute(struct snd_soc_dai *dai, int mute, int direction) {
struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component);
unsigned int val;
if (mute)
val = SSM2518_MUTE_CTRL_MUTE_MASTER;
else
val = 0;
return regmap_update_bits(ssm2518->regmap, SSM2518_REG_MUTE_CTRL,
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/ssm2518.c |
static int ssm2518_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component);
if (ssm2518->constraints)
snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/ssm2602.c | static int ssm2602_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
switch (level) {
case SND_SOC_BIAS_ON:
regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/ssm4567.c |
static bool ssm4567_readable_reg(struct device *dev, unsigned int reg) {
switch (reg) {
case SSM4567_REG_POWER_CTRL ... SSM4567_REG_BOOST_CTRL_2:
return true;
default:
return false;
}
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sta32x.c | static void sta32x_watchdog(struct work_struct *work) {
struct sta32x_priv *sta32x =
container_of(work, struct sta32x_priv, watchdog_work.work);
struct snd_soc_component *component = sta32x->component;
unsigned int confa, confa_cached;
confa_cached = snd_soc_component_read(component, STA32X_CONFA);
reg... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sta32x.c | static int sta32x_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) {
int ret;
struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
dev_dbg(component->dev, "level = %d\n", level);
switch (level) {
case SND_SOC_BIAS_ON:
br... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/sta350.c | static int sta350_i2c_probe(struct i2c_client *i2c) {
struct device *dev = &i2c->dev;
struct sta350_priv *sta350;
int ret, i;
sta350 = devm_kzalloc(dev, sizeof(struct sta350_priv), GFP_KERNEL);
if (!sta350)
return -ENOMEM;
mutex_init(&sta350->coeff_lock);
sta350->pdata = dev_get_platdata(dev);
#ifd... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/sta350.c |
static void sta350_i2c_remove(struct i2c_client *client) {} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sta529.c |
static bool sta529_readable(struct device *dev, unsigned int reg) {
switch (reg) {
case STA529_FFXCFG0:
case STA529_FFXCFG1:
case STA529_MVOL:
case STA529_LVOL:
case STA529_RVOL:
case STA529_S2PCFG0:
case STA529_S2PCFG1:
case STA529_P2SCFG0:
case STA529_P2SCFG1:
case STA529_ADCCFG:
case STA529... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/stac9766.c |
static int stac9766_component_resume(struct snd_soc_component *component) {
struct snd_ac97 *ac97 = snd_soc_component_get_drvdata(component);
return snd_ac97_reset(ac97, true, STAC9766_VENDOR_ID,
STAC9766_VENDOR_ID_MASK);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sti-sas.c | static int sti_sas_read_reg(void *context, unsigned int reg,
unsigned int *value) {
struct sti_sas_data *drvdata = context;
int status;
u32 val;
status = regmap_read(drvdata->dac.regmap, reg, &val);
*value = (unsigned int)val;
return status;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sti-sas.c | static int sti_sas_init_sas_registers(struct snd_soc_component *component,
struct sti_sas_data *data) {
int ret;
/* Initialise bi-phase formatter to disabled */
ret = snd_soc_component_update_bits(component, STIH407_AUDIO_GLUE_CTRL,
SPDI... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sti-sas.c | static int sti_sas_dac_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
if ((fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) != SND_SOC_DAIFMT_CBC_CFC) {
dev_err(dai->component->dev, "%s: ERROR: Unsupported clocking 0x%x\n",
__func__, fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK);
return -EINVAL;
}
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/sti-sas.c |
static bool sti_sas_volatile_register(struct device *dev, unsigned int reg) {
if (reg == STIH407_AUDIO_GLUE_CTRL)
return true;
return false;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/sti-sas.c | static int sti_sas_set_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir) {
struct snd_soc_component *component = dai->component;
struct sti_sas_data *drvdata = dev_get_drvdata(component->dev);
if (dir == SND_SOC_CLOCK_OUT)
return 0;
if (clk_id != 0)
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/sti-sas.c |
static int sti_sas_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) {
struct snd_soc_component *component = dai->component;
struct sti_sas_data *drvdata = dev_get_drvdata(component->dev);
struct snd_pcm_runtime *runtime = substream->runtime;
switch (dai->id) {
... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas2552.c | static void tas2552_sw_shutdown(struct tas2552_data *tas2552, int sw_shutdown) {
u8 cfg1_reg = 0;
if (!tas2552->component)
return;
if (sw_shutdown)
cfg1_reg = TAS2552_SWS;
snd_soc_component_update_bits(tas2552->component, TAS2552_CFG_1, TAS2552_SWS,
cfg1_reg);
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2552.c | static int tas2552_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir) {
struct snd_soc_component *component = dai->component;
struct tas2552_data *tas2552 = dev_get_drvdata(component->dev);
u8 reg, mask, val;
switch (clk_id) {
case TAS2552_PLL_CL... | [
1,
0
] |
Linux Kernel | sound/soc/codecs/tas2552.c |
static int tas2552_mute(struct snd_soc_dai *dai, int mute, int direction) {
u8 cfg1_reg = 0;
struct snd_soc_component *component = dai->component;
if (mute)
cfg1_reg |= TAS2552_MUTE;
snd_soc_component_update_bits(component, TAS2552_CFG_1, TAS2552_MUTE,
cfg1_reg);
return... | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2552.c |
static int tas2552_runtime_resume(struct device *dev) {
struct tas2552_data *tas2552 = dev_get_drvdata(dev);
gpiod_set_value(tas2552->enable_gpio, 1);
tas2552_sw_shutdown(tas2552, 0);
regcache_cache_only(tas2552->regmap, false);
regcache_sync(tas2552->regmap);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/soc/codecs/tas2552.c |
static int tas2552_probe(struct i2c_client *client) {
struct device *dev;
struct tas2552_data *data;
int ret;
int i;
dev = &client->dev;
data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
data->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.