From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Nikula Subject: Re: [PATCH] ASoC: Fix dapm_is_shared_kcontrol so everything isn't shared Date: Thu, 26 May 2011 09:57:52 +0300 Message-ID: <20110526095752.a450fe6d.jhnikula@gmail.com> References: <1306278721-32742-1-git-send-email-swarren@nvidia.com> <20110525100155.04c8b5e1.jhnikula@gmail.com> <20110525175202.01ebfed2.jhnikula@gmail.com> <74CDBE0F657A3D45AFBB94109FB122FF0498A48449@HQMAIL01.nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ey0-f179.google.com (mail-ey0-f179.google.com [209.85.215.179]) by alsa0.perex.cz (Postfix) with ESMTP id 6448824367 for ; Thu, 26 May 2011 08:57:37 +0200 (CEST) Received: by eyg5 with SMTP id 5so200086eyg.38 for ; Wed, 25 May 2011 23:57:37 -0700 (PDT) In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF0498A48449@HQMAIL01.nvidia.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: Stephen Warren Cc: "alsa-devel@alsa-project.org" , "broonie@opensource.wolfsonmicro.com" , "lrg@ti.com" List-Id: alsa-devel@alsa-project.org On Wed, 25 May 2011 08:24:59 -0700 Stephen Warren wrote: > > Then we must skip test for widgets that are in different dapm context, > > i.e. we don't want to share mux controls if they are in different device > > instance. Does it work for you if you add the dapm test below to your > > patch? > > I suppose that's technically correct, and I'm fine adding this to the > patch. However, I'm surprised that change is needed; do we actually have > a situation where two widgets in different DAPM contexts point at the > same control definition? It seems like that'd be a bug; why would there > be two controls pointing at the same register field, yet in different > DAPM contexts? > Yes, I noticed this can happen when you have multiple same codecs in a system. Let's assume we have multiple wm8903 codecs and we have these in the driver: static const struct snd_kcontrol_new adcinput_mux = SOC_DAPM_ENUM("ADC Input", adcinput_enum); static const struct snd_soc_dapm_widget wm8903_dapm_widgets[] = { SND_SOC_DAPM_MUX("Left ADC Input", SND_SOC_NOPM, 0, 0, &adcinput_mux), }; Even the core duplicates widgets for each codec instance in this example, they still point to same adcinput_mux and thus dapm_is_shared_kcontrol() miss detects them as shared if we don't skip different dapm context. -- Jarkko