On Fri, 2022-03-04 at 15:57 +0100, Cezary Rojewski wrote: > Declare base structures and core DSP operations for the avs solution. > The base structures describe PCI HDAudio bus device and platform-type > differentiations. First set of operations added controls the > lifecycle > of any Audio DSP core: (un)powering, (un)resetting and (un)stalling. > > Signed-off-by: Amadeusz Sławiński < > amadeuszx.slawinski@xxxxxxxxxxxxxxx> > Signed-off-by: Cezary Rojewski <cezary.rojewski@xxxxxxxxx> > --- > sound/soc/intel/Kconfig | 11 ++++ > sound/soc/intel/Makefile | 1 + > sound/soc/intel/avs/Makefile | 5 ++ > sound/soc/intel/avs/avs.h | 71 +++++++++++++++++++++ > sound/soc/intel/avs/dsp.c | 107 > ++++++++++++++++++++++++++++++++ > sound/soc/intel/avs/registers.h | 22 +++++++ > 6 files changed, 217 insertions(+) > create mode 100644 sound/soc/intel/avs/Makefile > create mode 100644 sound/soc/intel/avs/avs.h > create mode 100644 sound/soc/intel/avs/dsp.c > create mode 100644 sound/soc/intel/avs/registers.h > > diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig > index f3a4a907b29d..e9768c4aa1a9 100644 > --- a/sound/soc/intel/Kconfig > +++ b/sound/soc/intel/Kconfig > @@ -209,5 +209,16 @@ config SND_SOC_INTEL_KEEMBAY > If you have a Intel Keembay platform then enable this option > by saying Y or m. > > +config SND_SOC_INTEL_AVS > + tristate "Intel AVS driver" > + depends on PCI && ACPI > + depends on COMMON_CLK > + select SND_SOC_ACPI > + select SND_HDA_EXT_CORE > + help > + Enable support for Intel(R) cAVS 1.5 platforms with DSP > + capabilities. This includes Skylake, Kabylake, Amberlake and > + Apollolake. > + > # ASoC codec drivers > source "sound/soc/intel/boards/Kconfig" > diff --git a/sound/soc/intel/Makefile b/sound/soc/intel/Makefile > index 7c5038803be7..d44b2652c707 100644 > --- a/sound/soc/intel/Makefile > +++ b/sound/soc/intel/Makefile > @@ -7,6 +7,7 @@ obj-$(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM) += atom/ > obj-$(CONFIG_SND_SOC_INTEL_CATPT) += catpt/ > obj-$(CONFIG_SND_SOC_INTEL_SKYLAKE_COMMON) += skylake/ > obj-$(CONFIG_SND_SOC_INTEL_KEEMBAY) += keembay/ > +obj-$(CONFIG_SND_SOC_INTEL_AVS) += avs/ > > # Machine support > obj-$(CONFIG_SND_SOC) += boards/ > diff --git a/sound/soc/intel/avs/Makefile > b/sound/soc/intel/avs/Makefile > new file mode 100644 > index 000000000000..5f7976a95fe2 > --- /dev/null > +++ b/sound/soc/intel/avs/Makefile > @@ -0,0 +1,5 @@ > +# SPDX-License-Identifier: GPL-2.0-only > + > +snd-soc-avs-objs := dsp.o > + > +obj-$(CONFIG_SND_SOC_INTEL_AVS) += snd-soc-avs.o > diff --git a/sound/soc/intel/avs/avs.h b/sound/soc/intel/avs/avs.h > new file mode 100644 > index 000000000000..d4e6310e4bf7 > --- /dev/null > +++ b/sound/soc/intel/avs/avs.h > @@ -0,0 +1,71 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Copyright(c) 2021 Intel Corporation. All rights reserved. > + * > + * Authors: Cezary Rojewski <cezary.rojewski@xxxxxxxxx> > + * Amadeusz Slawinski <amadeuszx.slawinski@xxxxxxxxxxxxxxx> > + */ > + > +#ifndef __SOUND_SOC_INTEL_AVS_H > +#define __SOUND_SOC_INTEL_AVS_H > + > +#include <linux/device.h> > +#include <sound/hda_codec.h> > + > +struct avs_dev; > + > +struct avs_dsp_ops { > + int (* const power)(struct avs_dev *, u32, bool); > + int (* const reset)(struct avs_dev *, u32, bool); > + int (* const stall)(struct avs_dev *, u32, bool); > +}; > + > +#define avs_dsp_op(adev, op, ...) \ > + ((adev)->spec->dsp_ops->op(adev, ## __VA_ARGS__)) > + > +#define avs_platattr_test(adev, attr) \ > + ((adev)->spec->attributes & AVS_PLATATTR_##attr) AVS_PLATATTR_* don't seem to be defined in this patch? Thanks, Ranjani