Received: by 10.213.65.68 with SMTP id h4csp60726imn; Mon, 19 Mar 2018 19:37:09 -0700 (PDT) X-Google-Smtp-Source: AG47ELvIAarqSxJgh4Ydw4btklQBria1z8zGC2ExZjn4+8ZlntwKHcaMQOHjQ9tAjQkIQbrNaTQb X-Received: by 2002:a17:902:51ce:: with SMTP id y72-v6mr14527616plh.157.1521513429574; Mon, 19 Mar 2018 19:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521513429; cv=none; d=google.com; s=arc-20160816; b=n2MxYKcJ1kCog6LmHHriquIZ23zG5vq+Z6/sx+CVZeoCJlYDBaY/MIzk7Ymvt+0/iz Fo/Pa6ifDV+OI4RowPdYhdF03wiCCGaFdzHd4+O2Hjxcc0vygQ2SfNtmTUhoo5o3p06r rSos0zMyMPdvIaX9NyQJcBgkli/T30pdqgSYGfAwj+H9GkxCKhFz16KV1bcewfKIyPcq S9nguNfHa7AG4QBdJ5K0Chu0szEWeBe9iZ0yofOOOLOSa8fOdFtwTMdKiZjOQRP7lk5+ gYi/hY1WZfEns0p9E3DcSp+lkDfWnVSzzojSAInFSgIQVdZj8h9qLFoMz7LeHT9bW+cG 1kZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:arc-authentication-results; bh=MFALDC/DTzG/q9sSz2IoKP3nYlS4qCGgAgbAsLiPNbE=; b=z+e1ZzNr81apdG5uApzOap1rmiViMYvXMFZdsYJAT7CwefD6/z19S8psBRY6BxyJ8w r/6jZhxjb03rJPHrVq2T0HFQqzpivczBuF6/7C7cPBkD9lIUuifoYNoeYcefcvtNVPjI igBuxG+rkAJF2OGVL/J4dJB2qSHGxO6eFAQJNWsDFcNjqFwQWg0QgWYwG/LEL3tIs4S3 EV3PGG3MJhs1bi+tPcqVc4D4msAn6lOTHPD3RjHrcTmM6HInnZEQ33aQD2hNNqZT4TwU WiomOzlT+fzne5XD1vyQGAQ2923/eI5ZtAKCQCaLvcgIFIysyHWuX2mNdQDeW1C9cqGF ccmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34-v6si622903plz.589.2018.03.19.19.36.55; Mon, 19 Mar 2018 19:37:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751524AbeCTCgD (ORCPT + 99 others); Mon, 19 Mar 2018 22:36:03 -0400 Received: from mx.socionext.com ([202.248.49.38]:15573 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbeCTCgB (ORCPT ); Mon, 19 Mar 2018 22:36:01 -0400 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 20 Mar 2018 11:36:00 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 70B15180B82; Tue, 20 Mar 2018 11:36:00 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Tue, 20 Mar 2018 11:36:00 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 1E3604037B; Tue, 20 Mar 2018 11:36:00 +0900 (JST) Received: from DESKTOPFLNNJ4T (unknown [10.213.132.95]) by yuzu.css.socionext.com (Postfix) with ESMTP id EBC66120534; Tue, 20 Mar 2018 11:35:59 +0900 (JST) From: "Katsuhiro Suzuki" To: "'Mark Brown'" , =?iso-2022-jp?B?U3V6dWtpLCBLYXRzdWhpcm8vGyRCTmtMWhsoQiAbJEI+IUduGyhC?= Cc: , "Masami Hiramatsu" , "Jassi Brar" , , References: <20180314123900.19505-1-suzuki.katsuhiro@socionext.com> <20180314162609.GV2186@sirena.org.uk> <001101d3bf39$6e3933c0$4aab9b40$@socionext.com> <20180320011216.GN2186@sirena.org.uk> In-Reply-To: <20180320011216.GN2186@sirena.org.uk> Subject: Re: [PATCH] ASoC: uniphier: evea: add switch for changing source of line-in Date: Tue, 20 Mar 2018 11:35:56 +0900 Message-ID: <001d01d3bff4$2cef92e0$86ceb8a0$@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHTu5FuzEJuYhG2tk6R1XBNqubmsKPPVE6AgAdyUOCAAPxXAIAAnAaA Content-Language: ja x-securitypolicycheck: OK by SHieldMailChecker v2.5.2 x-shieldmailcheckerpolicyversion: POLICY180220 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Mark, > -----Original Message----- > From: Mark Brown [mailto:broonie@kernel.org] > Sent: Tuesday, March 20, 2018 10:12 AM > To: Suzuki, Katsuhiro > Cc: alsa-devel@alsa-project.org; Masami Hiramatsu ; > Jassi Brar ; linux-arm-kernel@lists.infradead.org; > linux-kernel@vger.kernel.org > Subject: Re: [PATCH] ASoC: uniphier: evea: add switch for changing source of line-in > > On Mon, Mar 19, 2018 at 01:19:10PM +0900, Katsuhiro Suzuki wrote: > > > > I'll apply for now but this should really be a DAPM control so that we > > > can power down things connected to the disconnected line inputs when > > > recording. > > > Thanks a lot for your suggestion. I tried to change the implementation to DAPM > > control as follows: > > > I can see the value of ALINSW1 register at 'Line In 1 Mux',0 using > > amixer get 'Line In 1 Mux',0 > > > But I can't change the value. > > amixer set 'Line In 1 Mux',0 LIN2 > > Simple mixer control 'Line In 1 Mux',0 > > Capabilities: enum > > Items: 'LIN1' 'LIN2' 'LIN3' > > Item0: 'LIN1' > > > Would you tell me what is wrong... > > Ugh, I *have* run into that before but I can't remember what triggers it > and your code doesn't have any mistakes I can spot. Unfortunately I'm Thank you for reviewing. > at Linaro Connect this week and don't have a test system I can poke at > with me to remind myself, and I'm still travelling next week > unfortunately. > I see, no problem. Have a nice trip! > I'd add some trace to the set code path to make sure everything is being > called as expected. It's somemthing really small that's hard to make a > warning for in the code IIRC. I traced some DAPM codes. The 'get' function as follows: int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { //... mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); if (e->reg != SND_SOC_NOPM && dapm_kcontrol_is_powered(kcontrol)) { int ret = soc_dapm_read(dapm, e->reg, ®_val); The soc_dapm_read() reads real value of register. It's simple. But 'put' function is mysterious for me... int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { //... change = dapm_kcontrol_set_value(kcontrol, val); if (e->reg != SND_SOC_NOPM) reg_change = soc_dapm_test_bits(dapm, e->reg, mask, val); dapm_kcontrol_set_value() has stored value into dapm_kcontrol_data. And soc_dapm_test_bits() has just checked value of a register and returned need update or not. It seems anyone does not update a register in this function. I tried to change soc_dapm_test_bits() -> soc_dapm_update_bits(), so I can change value of register using amixer. But I feel this change was wrong. And I found dapm_seq_run_coalesced() calls soc_dapm_update_bits(). Unfortunately this function has not been called even if I run amixer. Anyway, I'll continue to study about DAPM codes. Regards, -- Katsuhiro Suzuki