[Raspberry Pi Original Development] JohnMolton94:
UPDATE:

I managed to repo-sync for kernel 5.15, and was taking a look at its structure, and tried searching for textual references of "hifiberry", to get an idea of where the driver files should go. I also tried to do a search for "wm8960", and found it in a lot of places already! I also found a mention of "Waveshare wm8960 soundcard" in "common/arch/arm/boot/dts/overlays/README".

Does this mean that the Waveshare wm8960 support is already there in the 5.15 kernel? What steps do I need to take, so that when I build/compile this kernel, and patch it to my current AOSP 13 image, I can see the Waveshare wm8960 card as a selectable option?

I have a feeling that I need to put specific files in some places, and define a few references somewhere. But what places should they exactly go to, and which files exactly, is where I am stuck and quite unsure.

It would be a amazing if I could get a hint about the important files, their intended locations, and the relevant definitions, to enable the sound card. I have provided my keyword search output, and the contents of the waveshare drivers from their website for your reference.

For => grep -r -l "wm8960" Rpi\ Kernel/common

Rpi Kernel/common/sound/soc/mediatek/mt2701/Makefile

Rpi Kernel/common/sound/soc/mediatek/mt2701/mt2701-wm8960.c

Rpi Kernel/common/sound/soc/fsl/p1022_rdk.c

Rpi Kernel/common/sound/soc/fsl/fsl-asoc-card.c

Rpi Kernel/common/sound/soc/codecs/wm8960.c

Rpi Kernel/common/sound/soc/codecs/wm8960.h

Rpi Kernel/common/sound/soc/codecs/Makefile

Rpi Kernel/common/include/sound/wm8960.h

Rpi Kernel/common/arch/powerpc/boot/dts/fsl/p1022rdk.dts

Rpi Kernel/common/arch/arm/boot/dts/uniphier-pxs2-gentil.dts

Rpi Kernel/common/arch/arm/boot/dts/mt7623a-rfb-emmc.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/README

Rpi Kernel/common/arch/arm/boot/dts/overlays/Makefile

Rpi Kernel/common/arch/arm/boot/dts/overlays/wm8960-soundcard-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/imx7d-nitrogen7.dts

Rpi Kernel/common/arch/arm/boot/dts/imx7d-sdb.dts

Rpi Kernel/common/arch/arm/boot/dts/mt7623n-rfb-emmc.dts

Rpi Kernel/common/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi

Rpi Kernel/common/arch/arm/boot/dts/exynos4412-itop-elite.dts

Rpi Kernel/common/arch/arm/boot/dts/mt7623a-rfb-nand.dts

Rpi Kernel/common/arch/arm64/boot/dts/freescale/imx8mm-nitrogen-r2.dts

Rpi Kernel/common/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts

Rpi Kernel/common/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt

Rpi Kernel/common/Documentation/devicetree/bindings/sound/mt2701-wm8960.txt

Rpi Kernel/common/Documentation/devicetree/bindings/sound/wm8960.txt

For => grep -r -l "hifiberry" Rpi\ Kernel/common

Rpi Kernel/common/sound/soc/bcm/allo-boss-dac.c

Rpi Kernel/common/sound/soc/bcm/hifiberry_dacplushd.c

Rpi Kernel/common/sound/soc/bcm/hifiberry_dacplus.c

Rpi Kernel/common/sound/soc/bcm/hifiberry_dacplusadc.c

Rpi Kernel/common/sound/soc/bcm/hifiberry_dacplusdsp.c

Rpi Kernel/common/sound/soc/bcm/rpi-simple-soundcard.c

Rpi Kernel/common/sound/soc/bcm/Makefile

Rpi Kernel/common/sound/soc/bcm/rpi-wm8804-soundcard.c

Rpi Kernel/common/sound/soc/bcm/hifiberry_dacplusadcpro.c

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-dacplushd-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-dacplusadcpro-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-amp3-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-digi-pro-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-dacplusdsp-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-dacplusadc-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts

Rpi Kernel/common/arch/arm/boot/dts/overlays/README

Rpi Kernel/common/arch/arm/boot/dts/overlays/Makefile

Rpi Kernel/common/arch/arm/boot/dts/overlays/hifiberry-amp100-overlay.dts

Rpi Kernel/common/drivers/clk/clk-hifiberry-dacpro.c

Rpi Kernel/common/drivers/clk/Makefile

Rpi Kernel/common/drivers/clk/clk-hifiberry-dachd.c

And this is what the file contents of the Waveshare Drivers from their website look like:

LICENSE builddtbo.sh wm8960-soundcard wm8960-soundcard.service

Makefile dkms.conf wm8960-soundcard.c wm8960.c

README.md install.sh wm8960-soundcard.dtbo wm8960.h

asound.conf uninstall.sh wm8960-soundcard.dts wm8960_asound.state