提交 ce13f3f3 编写于 作者: A Adrian Knoth 提交者: Takashi Iwai

ALSA: hdspm - Augment HDSPM_TOGGLE_SETTING for AIO/RayDAT

The HDSPM_TOGGLE_SETTING functions alter the control_register on older
cards. On newer cards (AIO/RayDAT), they have to operate on the
settings_register instead.

This patch augments the existing functions to work with AIO/RayDAT, too.
Signed-off-by: NAdrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 b2ed6326
...@@ -3092,16 +3092,35 @@ static int snd_hdspm_get_tco_ltc_frames(struct snd_kcontrol *kcontrol, ...@@ -3092,16 +3092,35 @@ static int snd_hdspm_get_tco_ltc_frames(struct snd_kcontrol *kcontrol,
static int hdspm_toggle_setting(struct hdspm *hdspm, u32 regmask) static int hdspm_toggle_setting(struct hdspm *hdspm, u32 regmask)
{ {
return (hdspm->control_register & regmask) ? 1 : 0; u32 reg;
if (hdspm_is_raydat_or_aio(hdspm))
reg = hdspm->settings_register;
else
reg = hdspm->control_register;
return (reg & regmask) ? 1 : 0;
} }
static int hdspm_set_toggle_setting(struct hdspm *hdspm, u32 regmask, int out) static int hdspm_set_toggle_setting(struct hdspm *hdspm, u32 regmask, int out)
{ {
u32 *reg;
u32 target_reg;
if (hdspm_is_raydat_or_aio(hdspm)) {
reg = &(hdspm->settings_register);
target_reg = HDSPM_WR_SETTINGS;
} else {
reg = &(hdspm->control_register);
target_reg = HDSPM_controlRegister;
}
if (out) if (out)
hdspm->control_register |= regmask; *reg |= regmask;
else else
hdspm->control_register &= ~regmask; *reg &= ~regmask;
hdspm_write(hdspm, HDSPM_controlRegister, hdspm->control_register);
hdspm_write(hdspm, target_reg, *reg);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册