[alsa-devel] Fwd: [PATCH 29/46] Input: touchscreen: use wrapper for pxa2xx ac97 registers
On Fri, Oct 18, 2019 at 8:48 PM Dmitry Torokhov dmitry.torokhov@gmail.com wrote:
On Fri, Oct 18, 2019 at 05:41:44PM +0200, Arnd Bergmann wrote:
To avoid a dependency on the pxa platform header files with hardcoded registers, change the driver to call a wrapper in the pxa2xx-ac97-lib that encapsulates all the other ac97 stuff.
Not supper happy about adding module dependencies. Can we include mach/regs-ac97.h from include/sound/pxa2xx-lib.h and use static inlines? Someone needs to include mach/regs-ac97.h in the end...
Or there is something later in the series that needs it?
One of the goals of the series is to completely remove all mach/*.h headers and place them somewhere else, ideally inaccessible to device drivers.
In case of mach/regs-ac97.h, the later patch "ASoC: pxa: ac97: use normal MMIO accessors" passes the physical register base address as a platform device resource that gets ioremapped in the ac97 driver, rather than hardcoding the virtual address in a global header.
I agree that the exported function is still ugly, but I hope it's enough of an improvement over the previous state that we can do it anyway.
If you have any better ideas though, I can give that a try, too. One possibility would be a higher-level interface exported on top of 'struct snd_ac97', but I could not figure out how to do this.
Arnd
On Fri, Oct 18, 2019 at 09:39:31PM +0200, Arnd Bergmann wrote:
On Fri, Oct 18, 2019 at 8:48 PM Dmitry Torokhov dmitry.torokhov@gmail.com wrote:
On Fri, Oct 18, 2019 at 05:41:44PM +0200, Arnd Bergmann wrote:
To avoid a dependency on the pxa platform header files with hardcoded registers, change the driver to call a wrapper in the pxa2xx-ac97-lib that encapsulates all the other ac97 stuff.
Not supper happy about adding module dependencies. Can we include mach/regs-ac97.h from include/sound/pxa2xx-lib.h and use static inlines? Someone needs to include mach/regs-ac97.h in the end...
Or there is something later in the series that needs it?
One of the goals of the series is to completely remove all mach/*.h headers and place them somewhere else, ideally inaccessible to device drivers.
In case of mach/regs-ac97.h, the later patch "ASoC: pxa: ac97: use normal MMIO accessors" passes the physical register base address as a platform device resource that gets ioremapped in the ac97 driver, rather than hardcoding the virtual address in a global header.
I agree that the exported function is still ugly, but I hope it's enough of an improvement over the previous state that we can do it anyway.
If you have any better ideas though, I can give that a try, too. One possibility would be a higher-level interface exported on top of 'struct snd_ac97', but I could not figure out how to do this.
No, I do mot really have better ideas given your stated goals and I guess there is not really much benefit on spending too much effort polishing essentially one driver.
Acked-by: Dmitry Torokhov dmitry.torokhov@gmail.com
Thanks.
participants (2)
-
Arnd Bergmann
-
Dmitry Torokhov