diff options
author | Adrian Knoth <adi@drcomp.erfurt.thur.de> | 2013-07-05 11:27:54 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-07-05 14:50:11 +0200 |
commit | b2ed6326874b1bf5410871d83df4086a395ab13b (patch) | |
tree | dde1017017587fd9df4874ba5c1bdb7a26fd60a9 /sound/pci/rme9652 | |
parent | 384f778fd924cc843acf93c23f52cb168cb3f02a (diff) | |
download | op-kernel-dev-b2ed6326874b1bf5410871d83df4086a395ab13b.zip op-kernel-dev-b2ed6326874b1bf5410871d83df4086a395ab13b.tar.gz |
ALSA: hdspm - Introduce hdspm_is_raydat_or_aio()
RME RayDAT and AIO cards are new designs with different register
settings. Since we need to distinguish them from older cards multiple
times in the driver, refactor the code into a separate helper function.
No functional change intended.
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 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index a0fc961..32a87dc 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -1011,6 +1011,12 @@ static inline int HDSPM_bit2freq(int n) return bit2freq_tab[n]; } +static bool hdspm_is_raydat_or_aio(struct hdspm *hdspm) +{ + return ((AIO == hdspm->io_type) || (RayDAT == hdspm->io_type)); +} + + /* Write/read to/from HDSPM with Adresses in Bytes not words but only 32Bit writes are allowed */ @@ -5142,9 +5148,8 @@ static int snd_hdspm_set_defaults(struct hdspm * hdspm) all_in_all_mixer(hdspm, 0 * UNITY_GAIN); - if (hdspm->io_type == AIO || hdspm->io_type == RayDAT) { + if (hdspm_is_raydat_or_aio(hdspm)) hdspm_write(hdspm, HDSPM_WR_SETTINGS, hdspm->settings_register); - } /* set a default rate so that the channel map is set up. */ hdspm_set_rate(hdspm, 48000, 1); |