diff options
author | Tasos Sahanidis <tasos@tasossah.com> | 2023-03-29 07:14:38 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-03-29 09:28:17 +0300 |
commit | 69a6c1ba4238ef5ce01afb6f9e1b9be79b765d5f (patch) | |
tree | 919c71b93da4f4f9a0ae084153ce1b15cb27787a /sound/pci/ymfpci/ymfpci.h | |
parent | 081364d7039395d5759dda17f6904d7e99d39f4b (diff) | |
download | linux-69a6c1ba4238ef5ce01afb6f9e1b9be79b765d5f.tar.xz |
ALSA: ymfpci: Move allocation of saved registers to struct snd_ymfpci
The registers were previously allocated when CONFIG_PM_SLEEP was set,
however this only saved an insignificant amount of memory otherwise.
Signed-off-by: Tasos Sahanidis <tasos@tasossah.com>
Link: https://lore.kernel.org/r/20230329041440.177363-3-tasos@tasossah.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ymfpci/ymfpci.h')
-rw-r--r-- | sound/pci/ymfpci/ymfpci.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sound/pci/ymfpci/ymfpci.h b/sound/pci/ymfpci/ymfpci.h index 2103654c650f..04e2800049cd 100644 --- a/sound/pci/ymfpci/ymfpci.h +++ b/sound/pci/ymfpci/ymfpci.h @@ -268,6 +268,35 @@ struct snd_ymfpci_pcm { u32 shift; }; +static const int saved_regs_index[] = { + /* spdif */ + YDSXGR_SPDIFOUTCTRL, + YDSXGR_SPDIFOUTSTATUS, + YDSXGR_SPDIFINCTRL, + /* volumes */ + YDSXGR_PRIADCLOOPVOL, + YDSXGR_NATIVEDACINVOL, + YDSXGR_NATIVEDACOUTVOL, + YDSXGR_BUF441OUTVOL, + YDSXGR_NATIVEADCINVOL, + YDSXGR_SPDIFLOOPVOL, + YDSXGR_SPDIFOUTVOL, + YDSXGR_ZVOUTVOL, + YDSXGR_LEGACYOUTVOL, + /* address bases */ + YDSXGR_PLAYCTRLBASE, + YDSXGR_RECCTRLBASE, + YDSXGR_EFFCTRLBASE, + YDSXGR_WORKBASE, + /* capture set up */ + YDSXGR_MAPOFREC, + YDSXGR_RECFORMAT, + YDSXGR_RECSLOTSR, + YDSXGR_ADCFORMAT, + YDSXGR_ADCSLOTSR, +}; +#define YDSXGR_NUM_SAVED_REGS ARRAY_SIZE(saved_regs_index) + struct snd_ymfpci { int irq; @@ -345,7 +374,7 @@ struct snd_ymfpci { const struct firmware *dsp_microcode; const struct firmware *controller_microcode; - u32 *saved_regs; + u32 saved_regs[YDSXGR_NUM_SAVED_REGS]; u32 saved_ydsxgr_mode; u16 saved_dsxg_legacy; u16 saved_dsxg_elegacy; |