ALSA: hda: Direct MMIO accesses
authorTakashi Iwai <tiwai@suse.de>
Wed, 7 Aug 2019 18:32:08 +0000 (20:32 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 8 Aug 2019 14:36:18 +0000 (16:36 +0200)
commit19abfefd4c7604993d1c31e098a3f48bdafe334d
treea0c62c7b642d4d1b02058548f44e94e485c44894
parent619a1f195f93276dc8c6e33fe057e007adc9c288
ALSA: hda: Direct MMIO accesses

HD-audio drivers access to the mmio registers indirectly via the
corresponding bus->io_ops callbacks.  This is because some platform
(notably Tegra SoC) requires the word-aligned access.  But it's rather
a rare case, and other platforms suffer from the penalties by indirect
calls unnecessarily.

This patch is an attempt to optimize and cleanup for this situation.
Now the special aligned access is used only when a new kconfig
CONFIG_SND_HDA_ALIGNED_MMIO is set.  And the HD-audio core itself
provides the aligned MMIO access helpers instead of the driver side.
If Kconfig isn't set (as default), the standard helpers like readl()
or writel() are used directly.

A couple of places in ASoC Intel drivers have the access via io_ops
reg_writel(), and they are replaced with the direct writel() calls.

And now with this patch, the whole bus->io_ops becomes empty, so it's
dropped completely.  The bus initialization functions are changed
accordingly as well to drop the whole bus->io_ops.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 files changed:
include/sound/hdaudio.h
include/sound/hdaudio_ext.h
sound/hda/Kconfig
sound/hda/ext/hdac_ext_bus.c
sound/hda/hdac_bus.c
sound/pci/hda/Kconfig
sound/pci/hda/hda_controller.c
sound/pci/hda/hda_controller.h
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_tegra.c
sound/soc/intel/skylake/skl.c
sound/soc/sof/intel/hda-bus.c
sound/soc/sof/intel/hda-dsp.c