Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp228411pxf; Thu, 25 Mar 2021 02:40:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY8Ati6ebmAD37knyO6n3FY2/b7Wh+IIejDtMH5O+J4kbii3WHHew/eEpU2Q2LhmUVjNd4 X-Received: by 2002:a17:906:14d4:: with SMTP id y20mr8399287ejc.190.1616665219917; Thu, 25 Mar 2021 02:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616665219; cv=none; d=google.com; s=arc-20160816; b=PtY+3PMONOtPYISIQLIfI6o8HHyfr6VkCkA3skvZaF2ANU/Qv+xhYuDbW8Ze/Leuvv Vn74T1Vz/vbbuTPzGJNnpHJEuVEMa2zR69L3rbBRSvbMRZHmAE3nepE3mtzLsKeJGj01 mnzEUB3XWjqgm5c5Q4G9m9w7ZCmFAbAZVMQQo0nzlhh9CBCZHnDYK6+FFSL0/pGoesiu NHsm3kYa+LSYC84m7T0WE58uZxYw7elLoaM1l0JF4YwRtL0D8qjs59JdyO7FKy6f0POG Bf3oijZhlWor0WG0Oi23JEqOnYO3I8btkzKQhTOi8vXBqZCK679hPHC6ixgvn+IDEGk1 nsAw== 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:dkim-signature:dkim-filter; bh=m40vUxZYaBCFgv5JXNt+otVXhF33b32KBeePsOXeylE=; b=pqMPaRRxPwts3Ezfxo//0x4OQGyEL2ATXwFWuVLUYkvsomphPi9DDDDQgKt7ydyToy B4YqjdOdsT8p0y2s7d+kufV2iWyuq8RXefdKvJJA1faVRiFxxQIjzq7HQQKmSgxdAHYZ S7Q4Xcq0wGT6xfy8cGt8u0FIW78xoRh5VR4fGQgwQb1B8IB4yAS5HAQY9Osg2X55HrVn x18ddk0npTMRrcmQTKBMHYRpEaOoBbuM+jsIGU9fAdqLBKPLkcLvI50nt4MRD7BoFsGU G6cA9wxzv+cPZlVsbS4CYttArFm49bjzSzEZRzSoHRYVDrk0jwGV0DU55+vm6XwKRP0D FtrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@perex.cz header.s=default header.b=COtQgjIf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=perex.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lj27si3745013ejb.513.2021.03.25.02.39.56; Thu, 25 Mar 2021 02:40:19 -0700 (PDT) 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; dkim=pass header.i=@perex.cz header.s=default header.b=COtQgjIf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=perex.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230041AbhCYJim (ORCPT + 99 others); Thu, 25 Mar 2021 05:38:42 -0400 Received: from mail1.perex.cz ([77.48.224.245]:49996 "EHLO mail1.perex.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230051AbhCYJiN (ORCPT ); Thu, 25 Mar 2021 05:38:13 -0400 Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id E5C64A0042; Thu, 25 Mar 2021 10:38:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz E5C64A0042 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1616665085; bh=m40vUxZYaBCFgv5JXNt+otVXhF33b32KBeePsOXeylE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=COtQgjIf7SS1U+9r6pyVoZgOEQL5VrPbPU+Zey6x7BDrCppwysRmKEzFt8ID44Adi M4+g6/8BU6wmB/hQbkC6xGXiVbQFNtdgzSBPVyBlhEvHJAUpqVYdKchaXEAT31rwoX ei5aRoS8LcZUzo8QVn+nzwhcJWCXg5zP/hmvTyM8= Received: from p1gen2.localdomain (unknown [192.168.100.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Thu, 25 Mar 2021 10:37:52 +0100 (CET) Subject: Re: [PATCH v4 2/2] ASoC: rt715:add micmute led state control supports To: "Yuan, Perry" , Mark Brown , "pierre-louis.bossart@linux.intel.com" , "Limonciello, Mario" , "hdegoede@redhat.com" Cc: "pobrn@protonmail.com" , "oder_chiou@realtek.com" , "tiwai@suse.com" , "mgross@linux.intel.com" , "lgirdwood@gmail.com" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "platform-driver-x86@vger.kernel.org" References: <20210301093834.19524-1-Perry_Yuan@Dell.com> <20210308172409.GF4656@sirena.org.uk> <604693cc-08c7-2b5f-632a-58ed537c54a0@perex.cz> From: Jaroslav Kysela Message-ID: <8719e146-3606-aec7-5ba1-fceba383be51@perex.cz> Date: Thu, 25 Mar 2021 10:37:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne 25. 03. 21 v 9:19 Yuan, Perry napsal(a): > Hi Jaroslav: > >> -----Original Message----- >> From: Jaroslav Kysela >> Sent: Monday, March 22, 2021 10:38 PM >> To: Yuan, Perry; Mark Brown; pierre-louis.bossart@linux.intel.com; >> Limonciello, Mario; hdegoede@redhat.com >> Cc: pobrn@protonmail.com; oder_chiou@realtek.com; tiwai@suse.com; >> mgross@linux.intel.com; lgirdwood@gmail.com; alsa-devel@alsa- >> project.org; linux-kernel@vger.kernel.org; platform-driver- >> x86@vger.kernel.org >> Subject: Re: [PATCH v4 2/2] ASoC: rt715:add micmute led state control >> supports >> >> >> [EXTERNAL EMAIL] >> >> Dne 22. 03. 21 v 10:25 Yuan, Perry napsal(a): >>> Hi Mark: >>> >>>> -----Original Message----- >>>> From: Mark Brown >>>> Sent: Tuesday, March 9, 2021 1:24 AM >>>> To: Yuan, Perry >>>> Cc: pobrn@protonmail.com; pierre-louis.bossart@linux.intel.com; >>>> oder_chiou@realtek.com; perex@perex.cz; tiwai@suse.com; >>>> hdegoede@redhat.com; mgross@linux.intel.com; Limonciello, Mario; >>>> lgirdwood@gmail.com; alsa-devel@alsa-project.org; linux- >>>> kernel@vger.kernel.org; platform-driver-x86@vger.kernel.org >>>> Subject: Re: [PATCH v4 2/2] ASoC: rt715:add micmute led state control >>>> supports >>>> >>>> On Mon, Mar 01, 2021 at 05:38:34PM +0800, Perry Yuan wrote: >>>> >>>>> + /* Micmute LED state changed by muted/unmute switch */ >>>>> + if (mc->invert) { >>>>> + if (ucontrol->value.integer.value[0] || ucontrol- >>>>> value.integer.value[1]) { >>>>> + micmute_led = LED_OFF; >>>>> + } else { >>>>> + micmute_led = LED_ON; >>>>> + } >>>>> + ledtrig_audio_set(LED_AUDIO_MICMUTE, micmute_led); >>>>> + } >>>> >>>> These conditionals on inversion seem weird and counterintuitive. If >>>> we're going with this approach it would probably be clearer to define >>>> a custom operation for the affected controls that wraps the standard >>>> one and adds the LED setting rather than keying off invert like this. >>> >>> Currently the sof soundwire driver has no generic led control yet. >>> This patch can handle the led control needs for MIC mute LED, definitely >> the patch is a short term solution. >>> There is a feature request discussion when we started to implement this >> solution. >>> https://github.com/thesofproject/linux/issues/2496#issuecomment- >> 713892 >>> 620 >>> >>> The workable way for now is that we put the LED mute control to the >> codec driver. >>> When there is new and full sound LED solution implemented, this part >> will be also optimized. >>> The Hardware privacy feature needs this patch to handle the Mic mute >> led state change. >>> Before that full solution ready in kernel, could we take this as short term >> solution? >> >> Perry, it's about the machine detection. Your code is too much generic even >> for the top-level LED trigger implementation. We need an extra check, if the >> proper LED's are really controlled on the specific hardware. Other hardware >> may use RT715 for a different purpose. Use DMI / ACPI checks to detect this >> hardware and don't misuse the inversion flag to enable this code. >> >> Jaroslav >> >> -- >> Jaroslav Kysela >> Linux Sound Maintainer; ALSA Project; Red Hat, Inc. > > In the V2 patch, I have added the machine detection, but some guys thought that I should remove the detection for it is harmless to other system > So I remove it in the following patches. > > Is it Ok for you if I add below detection of Dell system which enable the privacy feature ? > > Then the mute led control will be called normally and Mic mute will be successfully configured. > There is no any impaction to other systems. > > > +#if IS_ENABLED(CONFIG_DELL_PRIVACY) > ..... > +#endif I think that you misunderstood the request. It's about the runtime detection not about the compile time detection. An example for DMI check is in sound/soc/intel/boards/sof_sdw.c / sof_sdw_quirk_table . Jaroslav -- Jaroslav Kysela Linux Sound Maintainer; ALSA Project; Red Hat, Inc.