Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org,
	Mark Brown <broonie@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [RFC PATCH] ASoC: Intel: use common helpers to detect CPUs
Date: Mon, 17 Jun 2019 19:18:27 +0300	[thread overview]
Message-ID: <20190617161827.GH9224@smile.fi.intel.com> (raw)
In-Reply-To: <29ad7270-9aa4-a002-0f0e-21b7a61fe8a4@linux.intel.com>

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?
}

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2019-06-17 16:18 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 [this message]
2019-06-18 11:02       ` Amadeusz Sławiński
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=20190617161827.GH9224@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --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