Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4457892pxb; Sun, 14 Feb 2021 11:02:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAaO1iyAvJGP+2nucz5G0vz/bjICoIBtW6Z65GaVNRDK9nZCRU6p8VqF16ix874PPX31pU X-Received: by 2002:a05:6402:d0a:: with SMTP id eb10mr12563782edb.249.1613329336236; Sun, 14 Feb 2021 11:02:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613329336; cv=none; d=google.com; s=arc-20160816; b=gG4tCCnVyY2tBetwIYe3lOZWrw3XikOXSvdzMfESO1aWANrHuLT+GFG+ru0COHvyT/ W7/g4oGOD5Bmc0DT+2GSoZJABzgESnY8Xzd3VxFhO2bZ5BNfQOZAG/hemR/9fxItVaFx tO9fap6CiHT2NN2QOtYS05SvaoPVhKCOB3KvCjhlT7b9pmntACiqToXEJuSRaXyu/O40 rqq0YivTIatUdMHtADdmFtx1Gg+zqnKyj8dD1ui2hUIGtTtb+SnfIXh7Lm0h2pNxt9wl t8FljwnQbls3GdUFH+EEMPo6zSLfPQeAHrsDdbH/oZ4MTk1sEsT+nEqdI/8HeEgTJjuD wh7A== 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=cvdjkRHWFkzG1lLfAFQoWXRELwhjh9aZAgl/H1YhF18=; b=JHeHPY96Z7/KfsJjNMWVrIiwyMsj/cfvV6+z7UNz6YZ6g6/RM0FcHPGLGo27UgMfQn RvDWdONq6wZsEU5xR3UA5GlABxF7EB5yD+Ds3jyMlOZQbgHE0Yr3WLfdqsusjcMWiVan 4M8P/N7rCnUlsEBYY7UKJEo0tDvAaorC/TYXfkjrF5yb1NbAEvWl1yJMKA6aIVI3FpiH FE7RP2QLnsjAmKKvldI+T+iRTYs2omfvhHpaOnNwaBRtegDjafUTnIH/qpeIdg9C5a45 G0nZJ1G7FZvedx86FvGHGjA8dY/Jx3lfDjCjG9iOnK+8vWpymst8LXzKGAeQrKoy789z mX/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@perex.cz header.s=default header.b=shMZT7rj; 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 g13si1037469ejb.579.2021.02.14.11.01.51; Sun, 14 Feb 2021 11:02:16 -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; dkim=pass header.i=@perex.cz header.s=default header.b=shMZT7rj; 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 S229793AbhBNTA2 (ORCPT + 99 others); Sun, 14 Feb 2021 14:00:28 -0500 Received: from mail1.perex.cz ([77.48.224.245]:52362 "EHLO mail1.perex.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbhBNTA2 (ORCPT ); Sun, 14 Feb 2021 14:00:28 -0500 X-Greylist: delayed 473 seconds by postgrey-1.27 at vger.kernel.org; Sun, 14 Feb 2021 14:00:27 EST Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id 5E495A0042; Sun, 14 Feb 2021 19:51:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz 5E495A0042 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1613328711; bh=cvdjkRHWFkzG1lLfAFQoWXRELwhjh9aZAgl/H1YhF18=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=shMZT7rji9g0Qza6xyS5aIMcHpz4YS2/4/dcUoAH3CcWxdJkioPpRZ7uUADD1y7XZ Pq1Zbh3YLDrArISiKbUvm5hyoUXCPA4h5NbzKv+U3a9wMFODe5bhs/B5Wn23KaPxY1 qDn4xzoaUGOjpF3t6tQ8njru35ulewub33j2YS8w= 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; Sun, 14 Feb 2021 19:51:39 +0100 (CET) Subject: Re: [PATCH v3 3/3] ASoC: rt715:add micmute led state control supports To: Perry Yuan , Mark Brown , Perry Yuan Cc: oder_chiou@realtek.com, tiwai@suse.com, hdegoede@redhat.com, mgross@linux.intel.com, lgirdwood@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, Mario.Limonciello@dell.com References: <20210112171814.5404-1-Perry_Yuan@Dell.com> <20210112175406.GF4646@sirena.org.uk> <43507ba7-74b8-2d18-57ca-271f89a752de@gmail.com> From: Jaroslav Kysela Message-ID: <4a79cb14-4c71-8bd8-9c8c-ab2421e97e0b@perex.cz> Date: Sun, 14 Feb 2021 19:51:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <43507ba7-74b8-2d18-57ca-271f89a752de@gmail.com> 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 14. 02. 21 v 7:43 Perry Yuan napsal(a): >>> @@ -287,6 +291,18 @@ static int rt715_sdca_put_volsw(struct snd_kcontrol *kcontrol, >>> return err; >>> } >>> >>> +#if IS_ENABLED(CONFIG_DELL_PRIVACY) >>> + /* dell privacy LED trigger state changed by muted/unmute switch */ >>> + if (mc->invert) { >>> + if (ucontrol->value.integer.value[0] || ucontrol->value.integer.value[1]) { >>> + rt715->micmute_led = LED_OFF; >>> + } else { >>> + rt715->micmute_led = LED_ON; >>> + } >>> + ledtrig_audio_set(LED_AUDIO_MICMUTE, rt715->micmute_led); >>> + } >>> +#endif >>> + My question is, how do we know that the rt715 codec has connected internal microphone to this input? I believe that this should be covered in the machine specific code (runtime check), not in the codec code. #if CONFIG is not sufficient here. > I have moved this part code to the local definition of > rt715_set_amp_gain_put and removed from rt715_priv. > new code will be like this in V4. > > @@ -88,6 +89,7 @@ static int rt715_set_amp_gain_put(struct snd_kcontrol > *kcontrol, > RT715_SET_GAIN_MIX_ADC2_L}; > unsigned int addr_h, addr_l, val_h, val_ll, val_lr; > unsigned int read_ll, read_rl, i, j, loop_cnt; > + bool micmute_led; > The whole LED trigger mechanism for the sound is covered in my LED generic code : https://lore.kernel.org/alsa-devel/20210211111400.1131020-1-perex@perex.cz/ Jaroslav -- Jaroslav Kysela Linux Sound Maintainer; ALSA Project; Red Hat, Inc.