From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org,
Mark Brown <broonie@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: Re: [RFC PATCH] ASoC: Intel: use common helpers to detect CPUs
Date: Tue, 18 Jun 2019 13:02:06 +0200 [thread overview]
Message-ID: <20190618130206.2c2ad38c@xxx> (raw)
In-Reply-To: <20190617161827.GH9224@smile.fi.intel.com>
On Mon, 17 Jun 2019 19:18:27 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> 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
next prev parent reply other threads:[~2019-06-18 10:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 20:02 [RFC PATCH] ASoC: Intel: use common helpers to detect CPUs Pierre-Louis Bossart
2019-05-29 5:18 ` Takashi Iwai
2019-06-17 14:47 ` Mark Brown
2019-06-17 15:31 ` Pierre-Louis Bossart
2019-06-17 16:18 ` Andy Shevchenko
2019-06-18 11:02 ` Amadeusz Sławiński [this message]
2019-06-18 19:26 ` Cezary Rojewski
2019-06-19 11:08 ` Andy Shevchenko
2019-06-19 11:52 ` Pierre-Louis Bossart
2019-06-19 13:04 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190618130206.2c2ad38c@xxx \
--to=amadeuszx.slawinski@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rdunlap@infradead.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox