From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE4C7402449 for ; Wed, 1 Apr 2026 13:36:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775050566; cv=none; b=Xhi/BloewIgbYTrelysMrmPC2GZ6+KGfefMJAwLG7Nn3NGTn9WcOuE5XZ9HHBf2SOTd3bkXRQkFeqDwcj1Pm2DqlOVYTfvEEJwNa9qXP/0M+vLNGIvpDEjXe+OBw6yq/hprymmzBP70fhrs40s0hJ7v7R1/MUGwbVRXMFZCxWVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775050566; c=relaxed/simple; bh=ti4R8oexXn+OJA745yjlFiW13FWx9mVLKg0pKebToC0=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=A2p7iVL6QDgjEXUc8mUBIQ4jWGI35tQqy4rK1Fwmft71fUCWf9viqX6OtOkHagkPVsB0ivIt6qAB3TIqamv1dw2xWA0ZUxhjaslLRB5OIAUZ00MGpuiv65qNxwBw18aresG8EHSMG6IUeh5RE7ERQYrZwZ0XIAz2wAFtz+nNEls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=OKdevTQy; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BjrsA7ac; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="OKdevTQy"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BjrsA7ac" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 631CwbLN719339 for ; Wed, 1 Apr 2026 13:36:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 65IFvKQl1RiHWZxxj4dKFyqz3g4kOpQxBtNIz2Ud1s0=; b=OKdevTQyxjHUoLSz rE/9RuX/Cv0NcBt3sXkwE7nXLFmo3HmG9RvoMVAQq4A+fRaMXHtNBp7oEqf1Gja3 DKTzwypJipNZrjNY1lS+SbDPZ5cGcJUWPn0SWpLzVgVY5WKc215U92XmFAbYj4UZ KjMh1szzdFCsUz8CMLSDptruI61wD1LknkAgluoPhJXCiygYIDYuxooJJvQ5xmmx zOYr4z4/LjKmDwF6fjSKe9ED+DqoKhbsaH3q250MyeDHfMBpqG4ni1gApmr76fbq IvelJ4Q8RPZg0FKjD3w3aSauS1pUdUoVAj4C1OxD5S3cJI/O89x0sT6Oc4UnKmT2 E9dmZQ== Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d8kcsva5h-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 01 Apr 2026 13:36:04 +0000 (GMT) Received: by mail-vk1-f199.google.com with SMTP id 71dfb90a1353d-5662a21d35bso18050404e0c.2 for ; Wed, 01 Apr 2026 06:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1775050564; x=1775655364; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=65IFvKQl1RiHWZxxj4dKFyqz3g4kOpQxBtNIz2Ud1s0=; b=BjrsA7acXpNWtbnp8t4Q9tDBvSvnG1j4B+tXANm1BKtsbyRbRHga3UubHaFwCwQzcw RsL1xESRa+xEcJEJ2FC5CovfD0/0bE5d22/l2FyRE7uW47LQfiJ4CU3BJ72f0yKWQjR6 VyLhAOPUsTaMzKx8BgFwQG4tfsgsj5ZXddJFXSFg5mGrdOdRqj01kYWrkvKwj2MxspCA N1jcfP5/xNRn2aX3vzlwi24S/D3hej2aRKtbOReXscx3gim2v50KqKRST+3p7xMuDwo5 n07UgDVdj3zLcXhL4BZve75ZpyHC4nH/cyhG5wgBkHFp0FEzSW1CsUSbwKa2s2y73+wz tF1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775050564; x=1775655364; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=65IFvKQl1RiHWZxxj4dKFyqz3g4kOpQxBtNIz2Ud1s0=; b=Mi3q90F/uF2fpeyeBKU0kKayK0G3mjkgkariXcsLDa+DMR/aP0MgRjkZRmhdpoVTrb P7qrSqAvv9PFm4WJF4oDjxgcIYZUPjkgFOaqyyfRzJu9jWjC8IT3XfEdFllSWmralxh9 LnQyvFWaEjKnQEiSp6RGG2y82qLr8XbpvHWP1Ls+3A5pVSc8csMttO+GSbgsfVEQySHN 9xRsQkq09bTqEOixL/5FVGBsJD/9ugqgS2pPNV3MpCiIXtKcVsgxX0+AXOYdYSD/9Iwb AZCr79gDYhbkqqyYfWVlg9kYkDJLprG26OaiEjzsGxKtJgm8gCfSK4PjmC153wjAEd7i deRA== X-Forwarded-Encrypted: i=1; AJvYcCUu0t1W9AxOyy1cL8fQ8jKhzkrsOlUiKFyUClpatir1pezMeNjEuDYAOFMK+jdr0kPoNWsc6Wek81+9q3M=@vger.kernel.org X-Gm-Message-State: AOJu0YxAcVPuR2prhiz/fXioC4Ey+PVwVfW/lPN2vm8iNc/bLaFJ4+S+ HLIQR+UW1QSsuOWKe5OKhbiCmcT2UhupftJJhhUOz41C+wQnXxkmWDqZCX7lpAwIMab3U/fh2VD /SMqygNSQ5b8FqDDLPIyf1Im7kQPOi6BUgXfpc7JxcFGkJY2w5S9NXqcr/gC81ocerQk= X-Gm-Gg: ATEYQzycU3DhMQ0IsNgm+nfZNehoXiS0oGsawYaLp7+9mEHx6Vd90rTeP/w0dhRqUUG PTwtYpX1Lxo1QEqxSKZifRVpujZ5QKROlfxJVXhy56spxaT1mKM7Ql3/lZKLEdSYgQAtSKQn180 mn+hVUcJiIvax7Gb5Ap8cuR9uZtZwy77AqPfIMYGv/ZomFoiWCvcXujrH6LlaMVtY/9++1dBeDy n3SoKhncHEcnrtboV0mWY44gr43JK/JWsBBjQcmpR0CRqtLtzUstfY1bXNDPBU+M3tSvXB6G6AM m6cW16NBhEiKdEiXncqJPx4yGDxkYNuUXDmi5GxpgZ6rlHzoyBewZuKlXu0lTW+NJPWt0bU2dWZ 3aBFV/4vh31DYSq6g4+SvEdihR+iIOJuZAvmdIwL/FTDxOWlX6HlCP2wnBHsNIj3HgeryDBu9Q2 LCmfERNPgjhyfQ1L5vaIAKJYaBlvmiuds7YNHRXNJIL32wc+q9v9Gak+AoiHUFxGDWe4wvPmj6C E7JQlowA0aavlnK X-Received: by 2002:a05:6102:5494:b0:605:6615:d9dd with SMTP id ada2fe7eead31-60567d42645mr1456975137.3.1775050563918; Wed, 01 Apr 2026 06:36:03 -0700 (PDT) X-Received: by 2002:a05:6102:5494:b0:605:6615:d9dd with SMTP id ada2fe7eead31-60567d42645mr1456958137.3.1775050563411; Wed, 01 Apr 2026 06:36:03 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9b7ae24d6bsm510260966b.6.2026.04.01.06.36.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Apr 2026 06:36:02 -0700 (PDT) Message-ID: <7dbd37c3-4a5e-4577-bff6-ed0826b489ac@oss.qualcomm.com> Date: Wed, 1 Apr 2026 15:36:01 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Hans de Goede Subject: Re: [PATCH v6 4/4] platform/x86: int3472: Add support for GPIO type 0x02 (IR flood LED) To: Andy Shevchenko Cc: Marco Nenciarini , Daniel Scally , Sakari Ailus , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260331075204.1567624-1-mnencia@kcore.it> <20260331075204.1567624-5-mnencia@kcore.it> Content-Language: en-US, nl In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDAxMDEyNiBTYWx0ZWRfX9w2F1Xht7Bme hXxXJyPaGiHwZz0KP6wdf7ecPOZx08AiOxslJvWToRYJkUGk6ds5Sfg+WrqYBvOCNyiZTg5cEJ6 woxqdDJnJ4Oiz29tBh9rVifVKvEj8Arftde3gREpguom8/Md/28biIfoy0T/MuTfCZPtLgUKgxA GMm5Kx5JC3BXZLnEs9YoPts0sxUxR9RbneosUF85UaWukyUwWL5OVKypAG5g0K85lqtjzx3xRux lpD559O8eVVETysZLFdFi1aydUfT3GuzTJPOVAIdjR5amX6SScV702xpBooW54mLQGl9b30JSw+ DuIbIF2VkroNePyp7GGuGu3TbTa09k4nqwhXYxyh+/6xEZCYGvRYCmLxImb3SqG0slL3d1+cX+A O0+z48Vfz0EHVH4b6g+emZAvoxkUcT7ifFaZXOVa0kJnO+iDel5voJH8XsOmIgjCCWiSoqXsys5 jDYDojNpCOaY0t4n1ig== X-Authority-Analysis: v=2.4 cv=KNlXzVFo c=1 sm=1 tr=0 ts=69cd1f44 cx=c_pps a=+D9SDfe9YZWTjADjLiQY5g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=PhDHjK9OYLvGxpwDl6MA:9 a=QEXdDO2ut3YA:10 a=vmgOmaN-Xu0dpDh8OwbV:22 X-Proofpoint-ORIG-GUID: WxTdsrLVkfbJyPqlx2Hz6QL_1n6fdhZz X-Proofpoint-GUID: WxTdsrLVkfbJyPqlx2Hz6QL_1n6fdhZz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-01_04,2026-04-01_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 clxscore=1015 phishscore=0 bulkscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2604010126 Hi, On 31-Mar-26 12:55, Andy Shevchenko wrote: > On Tue, Mar 31, 2026 at 12:36:28PM +0200, Hans de Goede wrote: >> On 31-Mar-26 09:52, Marco Nenciarini wrote: >>> Add support for GPIO type 0x02, which controls an IR flood LED used >>> for face authentication on some laptops (e.g. Dell Pro Max 16 Premium). >>> >>> Without this patch, the kernel logs "GPIO type 0x02 unknown; the sensor >>> may not work" and IR sensors paired with a flood LED cannot function. >>> >>> The flood LED is registered through the LED subsystem like the existing >>> privacy LED. Unlike the privacy LED, it does not have a lookup entry >>> since there is no consumer driver expecting it via led_get(). >>> >>> To support multiple LEDs per INT3472 device, convert the single led >>> struct member to an array with a counter. > > ... > >>> + ret = skl_int3472_register_led(int3472, gpio, "privacy", true); >>> + if (ret) >>> + err_msg = "Failed to register LED\n"; >>> + > >>> + ret = skl_int3472_register_led(int3472, gpio, "ir_flood", false); >> >> and then here instead of having 2 almost identical cases just pass con_id >> note please already use con_id here in patch 3/4 to avoid churn. >> >> After changing that in 3/4 you only need to add a single: >> >> + case INT3472_GPIO_TYPE_STROBE: >> >> here to make it also handle the strobe/ir_flood case. > > We would also need to recognize need for a lookup. Either keeping > a boolean that needs to be initialised into something like > `type != INT3472_GPIO_TYPE_STROBE` or turning back to switch-case > for that in the callee: > > switch (type) { > case _PRIVACY: > lookup = ... > led_add_lookup(...); > break; > case _STROBE: // no lookup for now > default: > break; > } > > given the nice and neat caller side I would move to switch-case. Why would we want to not register the lookup for the ir_flood case too ? Elsewhere in the thread we're discussing actually controlling this LED from the v4l2-core which will require the lookup. And if that does not materialize the lookup still does no harm. Regards, Hans