From: Takashi Iwai Subject: Re: [PATCH] ASoC: dapm - Refactor widget IO functions in preparation for platform widgets. Date: Fri, 10 Jun 2011 16:58:41 +0200 Message-ID: References: <1307643049-3819-1-git-send-email-lrg@ti.com> <4DF22DCE.8040406@ti.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 58C87103CCD for ; Fri, 10 Jun 2011 16:58:45 +0200 (CEST) In-Reply-To: <4DF22DCE.8040406@ti.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Liam Girdwood Cc: "alsa-devel@alsa-project.org" , Mark Brown List-Id: alsa-devel@alsa-project.org At Fri, 10 Jun 2011 15:44:30 +0100, Liam Girdwood wrote: > > On 10/06/11 13:11, Takashi Iwai wrote: > > At Thu, 9 Jun 2011 19:10:49 +0100, > > Liam Girdwood wrote: > >> > >> Currently widget IO is tightly coupled to the CODEC drivers. Future platform DSP > >> devices have mixer components that can alter power usage and hence require full > >> DAPM support. > >> > >> This provides a generic widget IO operation wrapper in preparation for > >> future patches that implement platform driver DAPM. > >> > >> Signed-off-by: Liam Girdwood > >> --- > >> sound/soc/soc-dapm.c | 55 ++++++++++++++++++++++++++++++++++++++++++++----- > >> 1 files changed, 49 insertions(+), 6 deletions(-) > >> > >> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c > >> index 34106bc..7b7af9f 100644 > >> --- a/sound/soc/soc-dapm.c > >> +++ b/sound/soc/soc-dapm.c > >> @@ -124,6 +124,49 @@ static inline struct snd_soc_dapm_widget *dapm_cnew_widget( > >> return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL); > >> } > >> > >> +static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg) > >> +{ > >> + if (w->codec) > >> + return snd_soc_read(w->codec, reg); > >> + return 0; > >> +} > >> + > >> +static int soc_widget_write(struct snd_soc_dapm_widget *w,int reg, int val) > > > > Missing space after comma. > > Thanks, didn't see that. > > > > >> +{ > >> + if (w->codec) > >> + return snd_soc_write(w->codec, reg, val); > >> + return 0; > >> +} > >> + > >> +int soc_widget_update_bits(struct snd_soc_dapm_widget *w, unsigned short reg, > >> + unsigned int mask, unsigned int value) > > > > Do you want to expose this and soc_widget_test_bits()? > > Or just forgotten static? > > > > The original intention was that they may have been used by the ABE but this seems unlikely now. > > I'll make them static for V2 and remove test_bits since it's not used. Sounds reasonable. thanks, Takashi