Re: [RFC PATCH] ASoC: Intel: use common helpers to detect CPUs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 17 Jun 2019 19:18:27 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> On Mon, Jun 17, 2019 at 05:31:53PM +0200, Pierre-Louis Bossart wrote:
> > On 6/17/19 4:47 PM, Mark Brown wrote:  
> > > On Tue, May 28, 2019 at 03:02:55PM -0500, Pierre-Louis Bossart
> > > wrote: 
> > > > 2. is there a better way to do this for all Intel chips or do
> > > > we keep this in sound/? Andy?  
> 
> It's better to discuss with x86 maintainers.
> 
> > > ARM has platform detection stuff in the architecture code,
> > > something similar seems sensible for x86?  
> > 
> > Well yes, we already have x86_match_cpu() but that won't work with
> > COMPILE_TEST (asm/ headers don't exist) and this leads to
> > duplication of code. All we really need here is a yeah/nay answer
> > from a help that hides those details away.  
> 
> I don't see much advantage here. Without specific driver data it will
> be degraded to something like:
> 
> 	if (bootcpu.model == INTEL_CPU_...)
> 		...
> 
> with slight exception to heterogeneous SoCs.
> 
> In order to be compile tested we might introduce a header under
> include/platform_data/x86 with these inliners like:
> 
> static inline bool is_x86_model_XX(void)
> {
> 	return bootcpu.model == XX; // it might be done in more
> generic way? }
> 

You might also want to look at other drivers that do some kind of
platform detection.

There is:
tools/power/x86/turbostat/turbostat.c
which has few is_xxx() functions, and:
drivers/gpu/drm/i915/i915_drv.h
which has quite a lot of IS_XXX macros, although they are used to
detect PCI VGA devices, but maybe some code could be shared, with
separate device specific ids.

Amadeusz
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux