Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp50285pxb; Tue, 12 Jan 2021 19:44:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtNhCNXeNbd8ksi+pex9+7ReLgGGBXNLctnsFEJlvQ5kRJ+W22MQM5NfVqud153aj29Gk0 X-Received: by 2002:a17:907:271c:: with SMTP id w28mr117560ejk.140.1610509448972; Tue, 12 Jan 2021 19:44:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610509448; cv=none; d=google.com; s=arc-20160816; b=P/hM5g5jNiECh2ZM6sYHnV5t8TpoWD6sDWkUPFvREs1jVydzjKIujRHKut+5Dth/n8 /R7R5u5UbB8NmSR+Uw1xAxtit2b/MsBATj8joZRsDlMUMsT4qIS1sA/usevWToDZMECW OslxT+LfgbEtOI4re5kLJtG0wp2SM9Hpj10nPBgjMVjY0yngQJkJZUKajBUynOhUKvOx JupzbMr3LqseB+RJtmlOnn6bsePrwckTZnpzMItbz1j1lL6fCCh/9CmkyLQEBxVQtlH5 fRiLmGFqplOVA52EU2vu7Y8qoTC6yfZ1TcHVjf13Sajl0kTQbFuZJmQHxO/kO/hVWIBK T8gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=ePQVQAd+/wPZ+9Jbmo/h0GH4j4mDSHpvfiyowZFXDRo=; b=tzMwb8akHCjuq1o4nSZJqe5fxE6LD69Zp/erLHW3xRgDGwOrBh9F2sP2vG7XYEVCvP NtokQiR/fPwv85qsb97Fb0CYnRxydNvTxX3bwn4UWOMzVkI/SLiqDxirvfn19TxROCWJ ZEHM3TeYAMiTvJLg1eJV5JapH250pP1T0Zlri/6DeQxaLeWFNa5uE61Q5kuQgPc06upv 2pcf080XCxb6r1LUESY4238bBodwi5rOc7aEwTsQQLB/MnXeLvUXtjdWWu3W/lgeuYrf 68FQeGl1YsnTqBR2TMQDoJNrwb/LC14yLnZIbZxylWWPfyp8CjPEbbVM4/EOISAM+X5c Hwyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si361649edq.274.2021.01.12.19.43.45; Tue, 12 Jan 2021 19:44:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728384AbhAMCn0 (ORCPT + 99 others); Tue, 12 Jan 2021 21:43:26 -0500 Received: from mga07.intel.com ([134.134.136.100]:54418 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbhAMCnZ (ORCPT ); Tue, 12 Jan 2021 21:43:25 -0500 IronPort-SDR: Ku+rg2Z1mofaPAcJouo8O+gq/O5gLynOMI6BLBXHexgf054soghzH7f9gl7is1XzUp+YmhFe7A YpyxGYLzoGcg== X-IronPort-AV: E=McAfee;i="6000,8403,9862"; a="242212664" X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208";a="242212664" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 18:41:39 -0800 IronPort-SDR: AREd7oQnznsddHzTa3z54QGeZQx6RInVrOUVE9nAlPLf0TiToBCTCICK14AlmuhoVNUVQvaqh9 TAdjZQmTT4cQ== X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208";a="353280739" Received: from ncorral-mobl2.amr.corp.intel.com (HELO [10.212.67.147]) ([10.212.67.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 18:41:38 -0800 Subject: Re: [PATCH v2 2/2] ASoC: rt715:add Mic Mute LED control support To: "Yuan, Perry" , "Limonciello, Mario" , "oder_chiou@realtek.com" , "perex@perex.cz" , "tiwai@suse.com" Cc: "alsa-devel@alsa-project.org" , "broonie@kernel.org" , "lgirdwood@gmail.com" , "linux-kernel@vger.kernel.org" References: <20201228133831.17464-1-Perry_Yuan@Dell.com> From: Pierre-Louis Bossart Message-ID: Date: Tue, 12 Jan 2021 20:41:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>> +#if IS_ENABLED(CONFIG_DELL_PRIVACY) >>>>> + /* Privacy LED Trigger State Changed by muted/unmute switch */ >>>>> + if (mc->invert) { >>>>> + val0 = ucontrol->value.integer.value[0]; >>>>> + val1 = ucontrol->value.integer.value[1]; >>>>> + if (val0 == 1 && val1 == 1) { >>>>> + rt715->micmute_led = LED_OFF; >>>>> + ledtrig_audio_set(LED_AUDIO_MICMUTE, >>>>> + rt715->micmute_led ? LED_ON : >>>> LED_OFF); >>>>> + } else if (val0 == 0 && val1 == 0) { >>>>> + rt715->micmute_led = LED_ON; >>>>> + ledtrig_audio_set(LED_AUDIO_MICMUTE, >>>>> + rt715->micmute_led ? LED_ON : >>>> LED_OFF); >>>>> + } >>>>> + } >>>>> +#endif >>>> >>>> Should this be activated for specific DMI quirks? This driver is >>>> used in >>> non-Dell >>>> platforms (I am thinking of Intel RVPs or Realtek daughterboards), I >>>> am not sure if a build-time behavior change makes sense. >>>> >>>> Or conversely could we just set the LEDs unconditionally if doing so >>>> is harmless? >>> >>> The current mic mute led setting path is not common used for other >>> vendors, just Dell platform support this mic mute led set operation. >>> >>> Do you think that I need to add one DMI quirk in the next version ? >>> If so, I can add that. >>> >>> >> >> >> In the HDA audio case this is modeled off of, the code runs whether or not a >> vendor has support for a mic mute LED. The calls to ledtrig_audio_set should >> be a no-op. I agree with @Pierre-Louis Bossart in this case, we should just be >> running it whether or not dell-privacy is compiled in. If another vendor >> chooses to add LED support they'll just need to set up their ledtrig supported >> backend and not change codec code. > > Hi @Pierre-Louis Bossart > Seems like that we have two way to go. > * DMI quirks,seems like that it needs to maintain the quirk list when vendors have new system to support. > * We just set the mic mute led state unconditionally . > > Which way would you prefer for next patch review? Maintaining quirks is a hassle, it's much simpler and consistent with HDaudio if the leds are set unconditionally. Thanks!