diff options
author | Adrian Knoth <adi@drcomp.erfurt.thur.de> | 2013-07-05 11:27:55 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-07-05 14:50:18 +0200 |
commit | ce13f3f33a32895da9304a9f9cb865f337dd0933 (patch) | |
tree | 34ab4a0ee01d911c20caa34d4702a10ff37eac9e /sound/pci/rme9652 | |
parent | b2ed6326874b1bf5410871d83df4086a395ab13b (diff) |
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: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme9652')
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 32a87dcecfa..118d727150e 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -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) { - 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) { + 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) - hdspm->control_register |= regmask; + *reg |= regmask; else - hdspm->control_register &= ~regmask; - hdspm_write(hdspm, HDSPM_controlRegister, hdspm->control_register); + *reg &= ~regmask; + + hdspm_write(hdspm, target_reg, *reg); return 0; } |