It all started in the pxa device-tree submission here : https://lkml.org/lkml/2016/2/25/965
It will be maintained in : git fetch https://github.com/rjarzmik/linux.git work/ac97
And now it transformed into this RFC, which would bring a ground for AC'97 devices closer to the linux device/driver model.
The driving ideas are still the same, and I put them in [1] for memory. This is the second opus of the RFC. I'm intending to stop the RFC cycle here if possible and have a true PATCH v1 submission after this RFC v2 unless there is a deep design flaw uncovered.
I took into account Mark's and Takashi's remarks, I hope I forgot none. All the changes should be documented in the first 2 patches mainly. I also added : - the AC97 link clock For now, bus code doesn't disable it in suspend and re-enable in resume, leaving the controller decide. I'm still pondering if for S2RAM (as opposed to runtime suspend), bus code should disable the clock.
- the .h guards I'm not particularly happy with my naming even for v2, feel free to propose anything better, the codec.h is particularly ugly.
- statics and namespace pollution I made more functions static, limiting further the namespace pollution.
- Kconfig/Makefile layout change I get the feeling that the KConfig "select" flavor would have better been a "depends on" one. And yet I didn't find a good way to enforce it, because of the way sound/soc/codecs/Kconfig is designed, and I'm afraid to break the structure by doing a "depends on AC97_BUS_NEW" in WM9713 configuration.
Let's have another review cycle, that will let me test this serie more thoroughly, especially the suspend/resume and the reset in the resume, which doesn't work, and requires me to test more deeply. I'll also test by removing the wm9713 change to see how robust the implementation is.
Happy review.
-- Robert
Robert Jarzmik (7): ALSA: ac97: split out the generic ac97 registers ALSA: ac97: add an ac97 bus ASoC: add new ac97 bus support ASoC: wm9713: add ac97 new bus support ASoC: pxa: switch to new ac97 bus support ARM: pxa: mioa701 convert to the new AC97 bus ASoC: mioa701_wm9713: convert to new ac97 bus
arch/arm/mach-pxa/mioa701.c | 12 +- include/sound/ac97/codec.h | 111 ++++++++++++ include/sound/ac97/compat.h | 21 +++ include/sound/ac97/controller.h | 80 +++++++++ include/sound/ac97/regs.h | 262 +++++++++++++++++++++++++++ include/sound/ac97_codec.h | 239 +------------------------ include/sound/pxa2xx-lib.h | 15 +- sound/Kconfig | 2 + sound/Makefile | 1 + sound/ac97/Kconfig | 18 ++ sound/ac97/Makefile | 8 + sound/ac97/ac97_core.h | 10 ++ sound/ac97/bus.c | 381 ++++++++++++++++++++++++++++++++++++++++ sound/ac97/codec.c | 15 ++ sound/ac97/snd_ac97_compat.c | 104 +++++++++++ sound/arm/Kconfig | 1 - sound/arm/pxa2xx-ac97-lib.c | 39 ++-- sound/soc/Kconfig | 4 + sound/soc/codecs/Kconfig | 1 + sound/soc/codecs/wm9713.c | 62 ++++++- sound/soc/pxa/Kconfig | 4 +- sound/soc/pxa/mioa701_wm9713.c | 4 +- sound/soc/pxa/pxa2xx-ac97.c | 20 ++- 23 files changed, 1132 insertions(+), 282 deletions(-) create mode 100644 include/sound/ac97/codec.h create mode 100644 include/sound/ac97/compat.h create mode 100644 include/sound/ac97/controller.h create mode 100644 include/sound/ac97/regs.h create mode 100644 sound/ac97/Kconfig create mode 100644 sound/ac97/Makefile create mode 100644 sound/ac97/ac97_core.h create mode 100644 sound/ac97/bus.c create mode 100644 sound/ac97/codec.c create mode 100644 sound/ac97/snd_ac97_compat.c