From: Cássio Gabriel Date: Mon, 6 Apr 2026 03:20:06 +0000 (-0300) Subject: ALSA: gusmax: add ISA suspend and resume callbacks X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b64e52380abfd368baa8a53d73336ffcd52c0c0;p=thirdparty%2Fkernel%2Flinux.git ALSA: gusmax: add ISA suspend and resume callbacks gusmax still leaves its ISA PM callbacks disabled even though the shared GF1 suspend and resume path now exists. This board needs one extra piece of PM glue around the shared GF1 helpers. The attached WSS codec has its own register image that must be saved and restored across suspend, and the MAX control register must be rewritten on resume before the codec and GF1 sides are brought back. Use the existing wss->suspend() and wss->resume() hooks for the codec, then wire the driver up to the shared GUS suspend and resume helpers for the GF1 side. Signed-off-by: Cássio Gabriel Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20260406-b4-alsa-gus-isa-pm-v1-4-b6829a7457cd@gmail.com --- diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index b572411c44228..f1fd7ff2121de 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c @@ -328,12 +328,38 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev) return 0; } +#ifdef CONFIG_PM +static int snd_gusmax_suspend(struct device *dev, unsigned int n, + pm_message_t state) +{ + struct snd_card *card = dev_get_drvdata(dev); + struct snd_gusmax *maxcard = card->private_data; + + maxcard->wss->suspend(maxcard->wss); + return snd_gus_suspend(maxcard->gus); +} + +static int snd_gusmax_resume(struct device *dev, unsigned int n) +{ + struct snd_card *card = dev_get_drvdata(dev); + struct snd_gusmax *maxcard = card->private_data; + + /* Restore the board routing latch before resuming the codec and GF1. */ + outb(maxcard->gus->max_cntrl_val, GUSP(maxcard->gus, MAXCNTRLPORT)); + maxcard->wss->resume(maxcard->wss); + return snd_gus_resume(maxcard->gus); +} +#endif + #define DEV_NAME "gusmax" static struct isa_driver snd_gusmax_driver = { .match = snd_gusmax_match, .probe = snd_gusmax_probe, - /* FIXME: suspend/resume */ +#ifdef CONFIG_PM + .suspend = snd_gusmax_suspend, + .resume = snd_gusmax_resume, +#endif .driver = { .name = DEV_NAME },