Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	alsa-devel@alsa-project.org, broonie@kernel.org,
	Jeeja KP <jeeja.kp@intel.com>
Subject: Re: [PATCH v6 1/3] ALSA: hdac_ext: add extended HDA bus
Date: Tue, 9 Jun 2015 15:36:51 +0530	[thread overview]
Message-ID: <20150609100651.GT28601@localhost> (raw)
In-Reply-To: <s5hmw0aqkch.wl-tiwai@suse.de>

On Mon, Jun 08, 2015 at 05:40:46PM +0200, Takashi Iwai wrote:
> At Mon, 8 Jun 2015 21:00:14 +0530,
> Vinod Koul wrote:
> > 
> > On Mon, Jun 08, 2015 at 03:38:22PM +0530, Vinod Koul wrote:
> > > > > +#define snd_hdac_ext_bus_ppcap_updateb(dev, reg, mask, val) \
> > > > > +	snd_hdac_ext_bus_ppcap_writeb(dev, reg, \
> > > > > +			       (snd_hdac_ext_bus_ppcap_readb(dev, reg) & \
> > > > > +				~(mask)) | (val))
> > > > 
> > > > It's not necessarily good to wrap all with such macros.
> > > > For azx_write*(), I kept them as is for reducing the amount of useless
> > > > code rewrites.  But for new codes, I don't think it's always worth...
> > > Actually while updating the patch for ext I was wondering about this too.
> > > 
> > > So we cna remove these and use snd_hdac_chip_writel/w/b here
> > As Jeeja pointed we can't use snd_hdac_chip_writel as we need to use a
> > different base. So we cna move this to use plain writel only
> > 
> > Any other ideas?
> 
> I don't think you need to access via io_ops redirection as these are
> SKL specific registers.  Use plain readl()/writel() and keep things
> as simple as possible.
> 
> (And better to avoid w and b variants.)
Okay I have removed all these macros but ended up defining one generic update
macros (most of the places we are doing read and write, so better to use
update macro

/* update register macro */
#define snd_hdac_updatel(addr, reg, mask, val) \
	writel(addr, reg, (readl(addr, reg) & ~(mask)) | (val))

yes its updatel to signify that it uses writel and readl

Let me know if you are fine with this approach

-- 
~Vinod

  reply	other threads:[~2015-06-09 10:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04  9:53 [PATCH v6 0/3] ALSA: HDA: add extended HDA Vinod Koul
2015-06-04  9:53 ` [PATCH v6 1/3] ALSA: hdac_ext: add extended HDA bus Vinod Koul
2015-06-08  9:00   ` Takashi Iwai
2015-06-08 10:08     ` Vinod Koul
2015-06-08 15:30       ` Vinod Koul
2015-06-08 15:40         ` Takashi Iwai
2015-06-09 10:06           ` Vinod Koul [this message]
2015-06-09 10:37             ` Takashi Iwai
2015-06-08  9:03   ` Takashi Iwai
2015-06-08 10:10     ` Vinod Koul
2015-06-08 15:24       ` Vinod Koul
2015-06-08 15:37         ` Takashi Iwai
2015-06-08 15:55           ` Vinod Koul
2015-06-04  9:53 ` [PATCH v6 2/3] ALSA: hdac_ext: add hdac extended controller Vinod Koul
2015-06-08  9:12   ` Takashi Iwai
2015-06-08 15:32     ` Vinod Koul
2015-06-08 15:42       ` Takashi Iwai
2015-06-08 16:00         ` Vinod Koul
2015-06-04  9:53 ` [PATCH v6 3/3] ALSA: hdac_ext: add extended stream capabilities Vinod Koul

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=20150609100651.GT28601@localhost \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jeeja.kp@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --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