Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: pierre-louis.bossart@linux.intel.com,
	alsa-devel@alsa-project.org, filip.kaczmarski@intel.com,
	harshapriya.n@intel.com, marcin.barlik@intel.com,
	zwisler@google.com, lgirdwood@gmail.com, tiwai@suse.com,
	filip.proborszcz@intel.com, broonie@kernel.org,
	michal.wasko@intel.com, cujomalainey@chromium.org,
	ppapierkowski@habana.ai, vamshi.krishna.gopal@intel.com
Subject: Re: [PATCH 01/13] ASoC: Intel: Add catpt device
Date: Sat, 8 Aug 2020 14:50:41 +0300	[thread overview]
Message-ID: <20200808115041.GN3703480@smile.fi.intel.com> (raw)
In-Reply-To: <20200807110649.17114-2-cezary.rojewski@intel.com>

On Fri, Aug 07, 2020 at 01:06:37PM +0200, Cezary Rojewski wrote:
> Declare base structures, registers and device routines for the catpt
> solution. Catpt deprecates and is a direct replacement for
> sound/soc/intel/haswell. Supports Lynxpoint and Wildcat Point both.


...

> +struct catpt_mregion {
> +	u32 start;
> +	u32 end;
> +	bool busy;
> +	struct list_head node;
> +};

I'm wondering if struct resource can be used instead.

You know that you may introduce a new type of resource if you want to.

> +static inline size_t catpt_mregion_size(const struct catpt_mregion *reg)
> +{
> +	return reg->end - reg->start + 1;
> +}
> +
> +/* True if region r1 intersects region r2 */
> +static inline bool catpt_mregion_intersects(struct catpt_mregion *r1,
> +					    struct catpt_mregion *r2)
> +{
> +	return (r1->start >= r2->start && r1->start <= r2->end) ||
> +	       (r1->end >= r2->start && r1->end <= r2->end);
> +}
> +
> +static inline bool catpt_mregion_intersecting(struct catpt_mregion *r1,
> +					      struct catpt_mregion *r2,
> +					      struct catpt_mregion *ret)
> +{
> +	if (!catpt_mregion_intersects(r1, r2))
> +		return false;
> +	ret->start = max(r1->start, r2->start);
> +	ret->end = min(r1->end, r2->end);
> +	return true;
> +}

Yeah, it reminds the existing resource infrastructure. Why to repeat it?


-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-08-08 11:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 11:06 [PATCH 00/13] ASoC: Intel: Catpt - Lynx and Wildcat point Cezary Rojewski
2020-08-07 11:06 ` [PATCH 01/13] ASoC: Intel: Add catpt device Cezary Rojewski
2020-08-08 11:50   ` Andy Shevchenko [this message]
2020-08-11 10:04     ` Cezary Rojewski
2020-08-07 11:06 ` [PATCH 02/13] ASoC: Intel: catpt: Define DSP operations Cezary Rojewski
2020-08-07 11:06 ` [PATCH 03/13] ASoC: Intel: catpt: Firmware loading and context restore Cezary Rojewski
2020-08-07 11:06 ` [PATCH 04/13] ASoC: Intel: catpt: Implement IPC protocol Cezary Rojewski
2020-08-07 11:06 ` [PATCH 05/13] ASoC: Intel: catpt: Add IPC messages Cezary Rojewski
2020-08-07 11:06 ` [PATCH 06/13] ASoC: Intel: catpt: PCM operations Cezary Rojewski
2020-08-07 11:06 ` [PATCH 07/13] ASoC: Intel: catpt: Event tracing Cezary Rojewski
2020-08-07 15:09   ` Mark Brown
2020-08-10  7:16     ` Cezary Rojewski
2020-08-11  7:30       ` Cezary Rojewski
2020-08-11  9:40         ` Mark Brown
2020-08-07 11:06 ` [PATCH 08/13] ASoC: Intel: catpt: Simple sysfs attributes Cezary Rojewski
2020-08-07 15:00   ` Mark Brown
2020-08-10  7:17     ` Cezary Rojewski
2020-08-07 11:06 ` [PATCH 09/13] ASoC: Intel: Select catpt and deprecate haswell Cezary Rojewski
2020-08-07 11:06 ` [PATCH 10/13] ASoC: Intel: haswell: Remove haswell-solution specific code Cezary Rojewski
2020-08-07 11:06 ` [PATCH 11/13] ASoC: Intel: broadwell: " Cezary Rojewski
2020-08-07 11:06 ` [PATCH 12/13] ASoC: Intel: bdw-5650: " Cezary Rojewski
2020-08-07 11:06 ` [PATCH 13/13] ASoC: Intel: bdw-5677: " Cezary Rojewski
2020-08-07 11:09 ` [PATCH 00/13] ASoC: Intel: Catpt - Lynx and Wildcat point Cezary Rojewski
2020-08-07 13:05 ` Amadeusz Sławiński

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=20200808115041.GN3703480@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=cujomalainey@chromium.org \
    --cc=filip.kaczmarski@intel.com \
    --cc=filip.proborszcz@intel.com \
    --cc=harshapriya.n@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=marcin.barlik@intel.com \
    --cc=michal.wasko@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ppapierkowski@habana.ai \
    --cc=tiwai@suse.com \
    --cc=vamshi.krishna.gopal@intel.com \
    --cc=zwisler@google.com \
    /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