Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
163d4c53
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
163d4c53
编写于
16年前
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/fix/hda' into topic/hda
上级
34c25350
e044c39a
无相关合并请求
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
77 addition
and
0 deletion
+77
-0
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_realtek.c
+77
-0
未找到文件。
sound/pci/hda/patch_realtek.c
浏览文件 @
163d4c53
...
...
@@ -306,6 +306,13 @@ struct alc_spec {
/* for PLL fix */
hda_nid_t pll_nid;
unsigned int pll_coef_idx, pll_coef_bit;
#ifdef SND_HDA_NEEDS_RESUME
#define ALC_MAX_PINS 16
unsigned int num_pins;
hda_nid_t pin_nids[ALC_MAX_PINS];
unsigned int pin_cfgs[ALC_MAX_PINS];
#endif
};
/*
...
...
@@ -2789,6 +2796,64 @@ static void alc_free(struct hda_codec *codec)
codec->spec = NULL; /* to be sure */
}
#ifdef SND_HDA_NEEDS_RESUME
static void store_pin_configs(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
hda_nid_t nid, end_nid;
end_nid = codec->start_nid + codec->num_nodes;
for (nid = codec->start_nid; nid < end_nid; nid++) {
unsigned int wid_caps = get_wcaps(codec, nid);
unsigned int wid_type =
(wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
if (wid_type != AC_WID_PIN)
continue;
if (spec->num_pins >= ARRAY_SIZE(spec->pin_nids))
break;
spec->pin_nids[spec->num_pins] = nid;
spec->pin_cfgs[spec->num_pins] =
snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CONFIG_DEFAULT, 0);
spec->num_pins++;
}
}
static void resume_pin_configs(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
int i;
for (i = 0; i < spec->num_pins; i++) {
hda_nid_t pin_nid = spec->pin_nids[i];
unsigned int pin_config = spec->pin_cfgs[i];
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_0,
pin_config & 0x000000ff);
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_1,
(pin_config & 0x0000ff00) >> 8);
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_2,
(pin_config & 0x00ff0000) >> 16);
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_3,
pin_config >> 24);
}
}
static int alc_resume(struct hda_codec *codec)
{
resume_pin_configs(codec);
codec->patch_ops.init(codec);
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
return 0;
}
#else
#define store_pin_configs(codec)
#endif
/*
*/
static struct hda_codec_ops alc_patch_ops = {
...
...
@@ -2797,6 +2862,9 @@ static struct hda_codec_ops alc_patch_ops = {
.init = alc_init,
.free = alc_free,
.unsol_event = alc_unsol_event,
#ifdef SND_HDA_NEEDS_RESUME
.resume = alc_resume,
#endif
#ifdef CONFIG_SND_HDA_POWER_SAVE
.check_power_status = alc_check_power_status,
#endif
...
...
@@ -3826,6 +3894,7 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
spec->num_mux_defs = 1;
spec->input_mux = &spec->private_imux;
store_pin_configs(codec);
return 1;
}
...
...
@@ -5244,6 +5313,7 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
}
spec->num_mixers++;
store_pin_configs(codec);
return 1;
}
...
...
@@ -10307,6 +10377,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;
store_pin_configs(codec);
return 1;
}
...
...
@@ -11441,6 +11512,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;
store_pin_configs(codec);
return 1;
}
...
...
@@ -12224,6 +12296,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
spec->mixers[spec->num_mixers] = alc269_capture_mixer;
spec->num_mixers++;
store_pin_configs(codec);
return 1;
}
...
...
@@ -13310,6 +13383,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
spec->mixers[spec->num_mixers] = alc861_capture_mixer;
spec->num_mixers++;
store_pin_configs(codec);
return 1;
}
...
...
@@ -14421,6 +14495,7 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;
store_pin_configs(codec);
return 1;
}
...
...
@@ -16252,6 +16327,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
spec->mixers[spec->num_mixers] = alc662_capture_mixer;
spec->num_mixers++;
store_pin_configs(codec);
return 1;
}
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部