From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3414C433F5 for ; Thu, 10 Mar 2022 13:31:51 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 08A3B1920; Thu, 10 Mar 2022 14:31:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 08A3B1920 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646919110; bh=npwve240amQqeC1g4LfcE8ZFfIXSuBK8Z3a14nUL5Ac=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kLvsxDuTd96VwukRBdTd8VLzAZdg3dZfPGdHUKdL1LmCVLOXraFSL+XKEgcAB95GJ vYUkoAFwwHL12aNikxgdxOVprxNEHyM1A2WUIxTUOt2yJTkX5yZaCtTHum8ivlvQ0N 6slrKwt7ovZh9ZqjPx6VDdt43s38SSVyQIQi8liQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 47E8DF800FD; Thu, 10 Mar 2022 14:30:58 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9979FF8015B; Thu, 10 Mar 2022 14:30:56 +0100 (CET) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BFD89F800FD for ; Thu, 10 Mar 2022 14:30:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BFD89F800FD Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="c3tLczAr"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="EgYyZCQT" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 3A6D621106; Thu, 10 Mar 2022 13:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1646919050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IdMoscUHeBFhWMurW1GS4RiCANKcBpaoFNOj4zpNIDE=; b=c3tLczArDvXysxqYd9jnYY9TVDMTdiouXRhLiNe2ijbBkDo2WQ1rarZ+n+YgFUfnoUXZaD dGr9Wm3tWaHI32mDoNIF27Khdd1tfRGR0EEIsVAOTe47sBHKf6BeacmnChOxaegLwqm24R KVFcvHZlhI1w3DbwS9F0NtkmMxQiPXA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1646919050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IdMoscUHeBFhWMurW1GS4RiCANKcBpaoFNOj4zpNIDE=; b=EgYyZCQTrpl2LGFCw31ygV68jTm9ZLPoWBVYHSiJCUBMmTeREOozEyKmZseMnz4oxcBhSY NzvoLdl7rbeNRPCQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 1D953A3B83; Thu, 10 Mar 2022 13:30:50 +0000 (UTC) Date: Thu, 10 Mar 2022 14:30:50 +0100 Message-ID: From: Takashi Iwai To: Cezary Rojewski Subject: Re: [PATCH v4 01/17] ALSA: hda: Add helper macros for DSP capable devices In-Reply-To: <20220309204029.89040-2-cezary.rojewski@intel.com> References: <20220309204029.89040-1-cezary.rojewski@intel.com> <20220309204029.89040-2-cezary.rojewski@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, upstream@semihalf.com, harshapriya.n@intel.com, rad@semihalf.com, pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, broonie@kernel.org, ranjani.sridharan@linux.intel.com, amadeuszx.slawinski@linux.intel.com, cujomalainey@chromium.org, lma@semihalf.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Wed, 09 Mar 2022 21:40:13 +0100, Cezary Rojewski wrote: > > HDAudio drivers make heavy use of I/O operations. Declare a range of > update, read and write helpers similar to those available for HDAudio > legacy driver. These macros are used by AVS driver to improve code > readability. > > Signed-off-by: Cezary Rojewski Acked-by: Takashi Iwai thanks, Takashi > --- > include/sound/hdaudio.h | 2 ++ > include/sound/hdaudio_ext.h | 50 +++++++++++++++++++++++++++++++++++++ > 2 files changed, 52 insertions(+) > > diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h > index 6a90ce405e60..69907260b9ce 100644 > --- a/include/sound/hdaudio.h > +++ b/include/sound/hdaudio.h > @@ -448,6 +448,8 @@ static inline u16 snd_hdac_reg_readw(struct hdac_bus *bus, void __iomem *addr) > > #define snd_hdac_reg_writel(bus, addr, val) writel(val, addr) > #define snd_hdac_reg_readl(bus, addr) readl(addr) > +#define snd_hdac_reg_writeq(bus, addr, val) writeq(val, addr) > +#define snd_hdac_reg_readq(bus, addr) readq(addr) > > /* > * macros for easy use > diff --git a/include/sound/hdaudio_ext.h b/include/sound/hdaudio_ext.h > index b0c8e4936168..d26234f9ee46 100644 > --- a/include/sound/hdaudio_ext.h > +++ b/include/sound/hdaudio_ext.h > @@ -2,6 +2,8 @@ > #ifndef __SOUND_HDAUDIO_EXT_H > #define __SOUND_HDAUDIO_EXT_H > > +#include > +#include > #include > > int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev, > @@ -144,6 +146,54 @@ void snd_hdac_ext_bus_link_power(struct hdac_device *codec, bool enable); > writew(((readw(addr + reg) & ~(mask)) | (val)), \ > addr + reg) > > +#define snd_hdac_adsp_writeb(chip, reg, value) \ > + snd_hdac_reg_writeb(chip, (chip)->dsp_ba + (reg), value) > +#define snd_hdac_adsp_readb(chip, reg) \ > + snd_hdac_reg_readb(chip, (chip)->dsp_ba + (reg)) > +#define snd_hdac_adsp_writew(chip, reg, value) \ > + snd_hdac_reg_writew(chip, (chip)->dsp_ba + (reg), value) > +#define snd_hdac_adsp_readw(chip, reg) \ > + snd_hdac_reg_readw(chip, (chip)->dsp_ba + (reg)) > +#define snd_hdac_adsp_writel(chip, reg, value) \ > + snd_hdac_reg_writel(chip, (chip)->dsp_ba + (reg), value) > +#define snd_hdac_adsp_readl(chip, reg) \ > + snd_hdac_reg_readl(chip, (chip)->dsp_ba + (reg)) > +#define snd_hdac_adsp_writeq(chip, reg, value) \ > + snd_hdac_reg_writeq(chip, (chip)->dsp_ba + (reg), value) > +#define snd_hdac_adsp_readq(chip, reg) \ > + snd_hdac_reg_readq(chip, (chip)->dsp_ba + (reg)) > + > +#define snd_hdac_adsp_updateb(chip, reg, mask, val) \ > + snd_hdac_adsp_writeb(chip, reg, \ > + (snd_hdac_adsp_readb(chip, reg) & ~(mask)) | (val)) > +#define snd_hdac_adsp_updatew(chip, reg, mask, val) \ > + snd_hdac_adsp_writew(chip, reg, \ > + (snd_hdac_adsp_readw(chip, reg) & ~(mask)) | (val)) > +#define snd_hdac_adsp_updatel(chip, reg, mask, val) \ > + snd_hdac_adsp_writel(chip, reg, \ > + (snd_hdac_adsp_readl(chip, reg) & ~(mask)) | (val)) > +#define snd_hdac_adsp_updateq(chip, reg, mask, val) \ > + snd_hdac_adsp_writeq(chip, reg, \ > + (snd_hdac_adsp_readq(chip, reg) & ~(mask)) | (val)) > + > +#define snd_hdac_adsp_readb_poll(chip, reg, val, cond, delay_us, timeout_us) \ > + readb_poll_timeout((chip)->dsp_ba + (reg), val, cond, \ > + delay_us, timeout_us) > +#define snd_hdac_adsp_readw_poll(chip, reg, val, cond, delay_us, timeout_us) \ > + readw_poll_timeout((chip)->dsp_ba + (reg), val, cond, \ > + delay_us, timeout_us) > +#define snd_hdac_adsp_readl_poll(chip, reg, val, cond, delay_us, timeout_us) \ > + readl_poll_timeout((chip)->dsp_ba + (reg), val, cond, \ > + delay_us, timeout_us) > +#define snd_hdac_adsp_readq_poll(chip, reg, val, cond, delay_us, timeout_us) \ > + readq_poll_timeout((chip)->dsp_ba + (reg), val, cond, \ > + delay_us, timeout_us) > +#define snd_hdac_stream_readb_poll(strm, reg, val, cond, delay_us, timeout_us) \ > + readb_poll_timeout((strm)->sd_addr + AZX_REG_ ## reg, val, cond, \ > + delay_us, timeout_us) > +#define snd_hdac_stream_readl_poll(strm, reg, val, cond, delay_us, timeout_us) \ > + readl_poll_timeout((strm)->sd_addr + AZX_REG_ ## reg, val, cond, \ > + delay_us, timeout_us) > > struct hdac_ext_device; > > -- > 2.25.1 >