Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp300975rwl; Wed, 4 Jan 2023 19:46:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXtmM+vm0GNobP5M+0VNGW6povftFJnZG9/aHWTymWl1ROq4+gymxxWmJkZb9dqay2j1w3n5 X-Received: by 2002:a05:6402:1654:b0:461:78ef:56f2 with SMTP id s20-20020a056402165400b0046178ef56f2mr43607928edx.34.1672890386786; Wed, 04 Jan 2023 19:46:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672890386; cv=none; d=google.com; s=arc-20160816; b=mjHMizRpJamDaaFXWtv9CwHbRpBpDuMz3W6B09jQh6UI32NJSMWZVFnDGUDW/13QPd 6UymggcVv0WoZOnxvgKeJhDoyllxb2T1iXtuOQEXG8+oVUwkiLHF56ELNtrNQeBi1ntc j/RjNcUeGaOeKTrEZcHjMHpbgCrPqg5HL3V7/BwfcCXn92VTnzRP1WcVsMf8+DOXqnQk V1ETeXaKRfBB9GcKIN8IOdL+vC3QoF0TlSA+wYLZxEWoQOZdilJfgqR/gUKoH+wX8tDB /u42HoJ+c/DcQIeg3pgWF9bz/32q82IvaEPa5ywX2NeZBQU6N8AepapHI4TvQWNB1XfF p+8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=rYZZ7K2evFRILFiOW3T3WVNM4lxUmUKMsxscKwrHJ6I=; b=f3yOT00Z0FcYFschVkZ96z5a10p2zM8zBtAu8l+I4VZ/ygPK6qN4h1QFc+JaI82DCY OI7sQfdwobL6ver8CRzW+x1Vr5s8Rwus4WXOF4exqne6E6w8vnt1M4mFJyPVoNFBn7F/ BLpyRSPb5T69ByNCQwph3Hg8P0ilumpLbBxDP/d5qtJOR7OoGKduduVhSRhndJ+/VUAL +VkC8UO9yNcrg0MTEsCGQAtgKM0899dp/j/YnhhAT6QVRb1rAGeFAj53rQnh7jUTe43X m0jfRMfZC7427xp5UW+e+joPvxWfwbhK3MezuPCXbRaqWDtt63UQNeXu7JJDsQSamaAz 8hGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Udx87EQh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a056402320b00b004882dbd8c9bsi19952344eda.631.2023.01.04.19.46.13; Wed, 04 Jan 2023 19:46:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Udx87EQh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbjAEDaa (ORCPT + 55 others); Wed, 4 Jan 2023 22:30:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230042AbjAEDaY (ORCPT ); Wed, 4 Jan 2023 22:30:24 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FEBB2F793; Wed, 4 Jan 2023 19:30:22 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3053PKXV012892; Thu, 5 Jan 2023 03:30:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=rYZZ7K2evFRILFiOW3T3WVNM4lxUmUKMsxscKwrHJ6I=; b=Udx87EQhHLo0CDo8fSBroF+7fDENtAemn9Kdbmikp5mKhYccZHnQUG1h5W6Js1QnUGW3 Ql7YMsZRuBPlAV19qun2l2IFDFZySyXXtkz/2UgUX/wbM4MKl0x6MNb5VRyn5YiwaIsR kZveF2jhYGDNm5Ou6oQwvNZTzeRNdxzyGraK4widgpnEPop46R92EBhykXWyOg5yofF2 fzvfcumxG/IK3rIROKe8CwsHy5tLy4hAm99VAd4bwTSFJCD5EPiktyW4dNgYAGV3GoHA gU52ETxO+jOxb1/IkQHTPf4Tm9F/vDdoN9A1d3adiPmqJ1ltHj7D2bW4oRroft71nZ0X Lg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mvsvfbamd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Jan 2023 03:30:10 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3053U9dh007600 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 5 Jan 2023 03:30:09 GMT Received: from [10.239.155.106] (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 4 Jan 2023 19:30:06 -0800 Message-ID: Date: Thu, 5 Jan 2023 11:30:04 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED Content-Language: en-US To: Luca Weiss , Pavel Machek CC: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , , , , References: <20221209-fp4-pm6150l-flash-v1-0-531521eb2a72@fairphone.com> <20221209-fp4-pm6150l-flash-v1-3-531521eb2a72@fairphone.com> From: Fenglin Wu In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: QG9Tjmjud-8tTfVegRavIMMjdsTZoQmm X-Proofpoint-GUID: QG9Tjmjud-8tTfVegRavIMMjdsTZoQmm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-04_07,2023-01-04_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 clxscore=1011 mlxlogscore=456 priorityscore=1501 malwarescore=0 adultscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301050027 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/12/12 21:59, Luca Weiss wrote: > On Sat Dec 10, 2022 at 6:16 PM CET, Pavel Machek wrote: >> Hi! >> >>> Configure the pm6150l flash node for the dual flash LEDs found on FP4. >> >>> +&pm6150l_flash { >>> + status = "okay"; >>> + >>> + led-0 { >>> + function = LED_FUNCTION_FLASH; >>> + color = ; >>> + led-sources = <1>; >>> + led-max-microamp = <180000>; >>> + flash-max-microamp = <1000000>; >>> + flash-max-timeout-us = <1280000>; >>> + }; > > Hi Pavel, > >> >> I'm pretty sure the flash is not yellow. > > The marketing term is Dual LED flash or Dual-tone flash, one LED is a > blue-ish white and one is a yellow-ish white, but from what I can tell, > in the original code it's always referred to as white and yellow so I > also followed that here. > > Also the LEDs are right next to each other so in practise for torch just > both go on, and for camera flash I cannot really tell you but I guess > it's doing something there with the camera tuning. > > See also this picture: > https://shop.fairphone.com/media/catalog/product/cache/b752d78484639b19641a8560800d919d/p/_/p_5b_main_camera_back.jpg > Hi Pavel, Luca is right. It is normally called dual CCT (Correlated Color Temperature) flash LED. It has 2 LEDs, one is with higher CCT (~6000K) so it looks like a white LED, another is with lower CCT (~2000K) and it looks like a yellow LED. I am not an expert of this but my understanding is the camera tuning process normally adjusts the brightness of the two LEDs and enables them to get different CCT for different snapshots. I was thinking to use the "white" and "yellow" to name the flash LEDs which should be much better that just using indexes, it implicitly tell that the "white" one is having higher CCT and the "yellow" one is having lower CCT. Fenglin >> >> Plus, how is the node in /sys/class/leds called? Can you make an entry >> in Documentation/leds/well-known-leds.txt and ensure the name stays >> consistent across devices? > > / # ls -al /sys/class/leds/white:flash/ > total 0 > drwxr-xr-x 3 0 0 0 Jan 1 00:00 . > drwxr-xr-x 4 0 0 0 Jan 1 00:00 .. > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 brightness > lrwxrwxrwx 1 0 0 0 Jan 1 00:00 device -> ../../../c440000.spmi:pmic@5:led-controller@d300 > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 flash_brightness > -r--r--r-- 1 0 0 4096 Jan 1 00:00 flash_fault > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 flash_strobe > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 flash_timeout > -r--r--r-- 1 0 0 4096 Jan 1 00:00 max_brightness > -r--r--r-- 1 0 0 4096 Jan 1 00:00 max_flash_brightness > -r--r--r-- 1 0 0 4096 Jan 1 00:00 max_flash_timeout > drwxr-xr-x 2 0 0 0 Jan 1 00:00 power > lrwxrwxrwx 1 0 0 0 Jan 1 00:00 subsystem -> ../../../../../../../../../class/leds > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 uevent > / # ls -al /sys/class/leds/yellow:flash/ > total 0 > drwxr-xr-x 3 0 0 0 Jan 1 00:00 . > drwxr-xr-x 4 0 0 0 Jan 1 00:00 .. > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 brightness > lrwxrwxrwx 1 0 0 0 Jan 1 00:00 device -> ../../../c440000.spmi:pmic@5:led-controller@d300 > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 flash_brightness > -r--r--r-- 1 0 0 4096 Jan 1 00:00 flash_fault > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 flash_strobe > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 flash_timeout > -r--r--r-- 1 0 0 4096 Jan 1 00:00 max_brightness > -r--r--r-- 1 0 0 4096 Jan 1 00:00 max_flash_brightness > -r--r--r-- 1 0 0 4096 Jan 1 00:00 max_flash_timeout > drwxr-xr-x 2 0 0 0 Jan 1 00:00 power > lrwxrwxrwx 1 0 0 0 Jan 1 00:00 subsystem -> ../../../../../../../../../class/leds > -rw-r--r-- 1 0 0 4096 Jan 1 00:00 uevent > > There's also already flash LED on PinePhone and some MSM8916 devices, > but I think they also have white:flash based on the dt. > >> >> Best regards, >> Pavel >> -- >> People of Russia, stop Putin before his war on Ukraine escalates. >