Message ID | 20230718092439.2482320-1-quic_fenglinw@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1623763vqt; Tue, 18 Jul 2023 02:53:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlE87aCBXqzZzlvr2arGFoN3+O2Smnh4JhwkMuSqxA3pW/haaXGm8bbkiwq4toXjKzFaVCyk X-Received: by 2002:a05:6a00:190c:b0:682:4c1c:a0f6 with SMTP id y12-20020a056a00190c00b006824c1ca0f6mr20690831pfi.3.1689674027298; Tue, 18 Jul 2023 02:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689674027; cv=none; d=google.com; s=arc-20160816; b=MJjIeWiq20RdbqHJXOxTBKfYXOWza6HhZa26k2Gcf3wxW/Rz9TLAA7hRBaXIPzT7c0 I5ih4PVkJKtBx2Kdo7zV/PiEU380UUbzT9CmGHAgYmG9vw2tVU5zBrMXgwbGnYNRAwvD 0CbpCIrx/ZzF9ZdhJP8EqusxVXVlqmKbpzPS0orpbGNMtRp9TzKiiOLJMzk63e+Ft0FY 7mFGlKItdmrFecBbGybjhAvih6X9mjQRJsZsaX/GnKDUPniAz2ZFDa0JchmrrEJYR4Io T3cA2JpYXsKn2lpxN6LY5afnuBBx2lQeLagRDj2blTwkOn8MuT027wQcztoL+GzeWHj8 gP1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2JI/ceV/+gBheTQl8ppCWHbt7J8E80oqaoct7rSb0T0=; fh=zjDCuupMACeSb7mx+U3frxvtPxdq/kwwykIdT4uIPPI=; b=x6kKWGiY1uvjhVbBtdwYNc0EQHfL2u9RgPEM5fDkeLv0HzIGlOixWDiASliaGrOfIx E/UNudPQA1J9z/wtozoqiVDMtPWbjHqup44YmYYnfvFEBw7Nvytszbp1b6kL5d4RazdT mmZlO4/R5J8M+GIAY6+v5gaPlwCgCK3fyx8sfC61wub8sf+Oi1cle580BOx6SY1h5M1P RaavMKPy8j1/QYGl8YbVkhPn2Z4k8IW5y/AQxv8L08QjW8MTPsidR2cERyXmC2FYEZcH IhYHUTkpxIXiMzGbudW0Wk121GXb9ca9DtUOwb49NxHUVIvWWi9D9SxEXmw/s7tbn1p3 lQ1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=CIpMAmCK; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fd10-20020a056a002e8a00b0067b2f265d2asi1377797pfb.262.2023.07.18.02.53.34; Tue, 18 Jul 2023 02:53:47 -0700 (PDT) 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=CIpMAmCK; 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 S232112AbjGRJZl (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Tue, 18 Jul 2023 05:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbjGRJZf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Jul 2023 05:25:35 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 953A310DF; Tue, 18 Jul 2023 02:25:30 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36I6ki2W011157; Tue, 18 Jul 2023 09:25:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=2JI/ceV/+gBheTQl8ppCWHbt7J8E80oqaoct7rSb0T0=; b=CIpMAmCKOzZ2t930Wl0YI1FPoTn6hN7x3YfCKFzR4ESiJZ2lyMunB5Tj7wktfTL18QN7 7TGqdAI4kgI6jBgN64/HHcM9HGq4eOcSXSyDiGsyANQKn6Gjhg7C22rFoaggpAeOpYIG KKss4iEsvLxevDFi+JtL5EhHUYiGgFi3ExVNImLxHALz42rp4t82kIh/gYbK7gRpqU5U e+ZWJDPArQ1bliTbNbhuwlQvvhqhgVEhsnnWGWUz8tNHS0Qj7MXzABYiln+5p/MJFJsX IgJWnkwXqtThuLrv9ue3SBhHLKdmLbV/BCd05VUKmtWrLcb5lriDpb7BL74opowzdSki MQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rwnrrgb63-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 09:25:02 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36I9P1am025820 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 09:25:01 GMT Received: from fenglinw2-gv.qualcomm.com (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.1118.30; Tue, 18 Jul 2023 02:24:58 -0700 From: Fenglin Wu <quic_fenglinw@quicinc.com> To: <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <lee@kernel.org>, <pavel@ucw.cz>, <krzysztof.kozlowski@linaro.org>, "Fenglin Wu" <quic_fenglinw@quicinc.com>, ChiaEn Wu <chiaen_wu@richtek.com>, Alice Chen <alice_chen@richtek.com>, ChiYuan Huang <cy_huang@richtek.com>, "Dylan Van Assche" <me@dylanvanassche.be>, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, Tom Rix <trix@redhat.com>, <linux-leds@vger.kernel.org> CC: <quic_collinsd@quicinc.com>, <quic_subbaram@quicinc.com> Subject: [PATCH v1] led: flash: various minor fixes for leds-qcom-flash driver Date: Tue, 18 Jul 2023 17:24:28 +0800 Message-ID: <20230718092439.2482320-1-quic_fenglinw@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-GUID: 2E2T8EoQIN0PnmIJGpKIZYC5febABgEr X-Proofpoint-ORIG-GUID: 2E2T8EoQIN0PnmIJGpKIZYC5febABgEr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-17_15,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 phishscore=0 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=772 priorityscore=1501 impostorscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307180085 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771751632890466797 X-GMAIL-MSGID: 1771751632890466797 |
Series |
[v1] led: flash: various minor fixes for leds-qcom-flash driver
|
|
Commit Message
Fenglin Wu
July 18, 2023, 9:24 a.m. UTC
Update the driver to address following minor issues:
- Add a sentence in Kconfig to explain the driver can be compiled
as a module
- strobe off the LED channel before setting flash current to prevent
the flash LED being lit with an incorrect brightness if it was
already active in torch mode
- put the child node if register any flash LED device failed.
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
---
drivers/leds/flash/Kconfig | 2 ++
drivers/leds/flash/leds-qcom-flash.c | 5 +++++
2 files changed, 7 insertions(+)
Comments
On 18/07/2023 11:24, Fenglin Wu wrote: > Update the driver to address following minor issues: > - Add a sentence in Kconfig to explain the driver can be compiled > as a module > - strobe off the LED channel before setting flash current to prevent > the flash LED being lit with an incorrect brightness if it was > already active in torch mode > - put the child node if register any flash LED device failed. Don't mix different fixes and changes in one commit. Also, please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument). I really do not see a point why I am cc-ed here. Best regards, Krzysztof
On 7/18/2023 5:32 PM, Krzysztof Kozlowski wrote: > On 18/07/2023 11:24, Fenglin Wu wrote: >> Update the driver to address following minor issues: >> - Add a sentence in Kconfig to explain the driver can be compiled >> as a module >> - strobe off the LED channel before setting flash current to prevent >> the flash LED being lit with an incorrect brightness if it was >> already active in torch mode >> - put the child node if register any flash LED device failed. > > Don't mix different fixes and changes in one commit. > > Also, please use scripts/get_maintainers.pl to get a list of necessary > people and lists to CC (and consider --no-git-fallback argument). I > really do not see a point why I am cc-ed here. > > Best regards, > Krzysztof I understood that we should separate the changes for different fixes. I am trying to address the review comment from Pavel that was coming late after the original changes were applied: https://lore.kernel.org/linux-arm-msm/20230325170957.GA2904@bug/ (sorry for just got time to work on this), since all of them are small ones and all related with the same driver, so I thought it might be good to put them together and update with a single patch? BTW, you are copied because you also reviewed the original changes. Thanks >
On Tue, 18 Jul 2023, Fenglin Wu wrote: > > > On 7/18/2023 5:32 PM, Krzysztof Kozlowski wrote: > > On 18/07/2023 11:24, Fenglin Wu wrote: > > > Update the driver to address following minor issues: > > > - Add a sentence in Kconfig to explain the driver can be compiled > > > as a module > > > - strobe off the LED channel before setting flash current to prevent > > > the flash LED being lit with an incorrect brightness if it was > > > already active in torch mode > > > - put the child node if register any flash LED device failed. > > > > Don't mix different fixes and changes in one commit. > > > > Also, please use scripts/get_maintainers.pl to get a list of necessary > > people and lists to CC (and consider --no-git-fallback argument). I > > really do not see a point why I am cc-ed here. > > > > Best regards, > > Krzysztof > > I understood that we should separate the changes for different fixes. > > I am trying to address the review comment from Pavel that was coming late > after the original changes were applied: > https://lore.kernel.org/linux-arm-msm/20230325170957.GA2904@bug/ (sorry for > just got time to work on this), since all of them are small ones and all > related with the same driver, so I thought it might be good to put them > together and update with a single patch? Separate patches - one per functional change please.
On 7/19/2023 4:50 PM, Lee Jones wrote: > On Tue, 18 Jul 2023, Fenglin Wu wrote: > >> >> >> On 7/18/2023 5:32 PM, Krzysztof Kozlowski wrote: >>> On 18/07/2023 11:24, Fenglin Wu wrote: >>>> Update the driver to address following minor issues: >>>> - Add a sentence in Kconfig to explain the driver can be compiled >>>> as a module >>>> - strobe off the LED channel before setting flash current to prevent >>>> the flash LED being lit with an incorrect brightness if it was >>>> already active in torch mode >>>> - put the child node if register any flash LED device failed. >>> >>> Don't mix different fixes and changes in one commit. >>> >>> Also, please use scripts/get_maintainers.pl to get a list of necessary >>> people and lists to CC (and consider --no-git-fallback argument). I >>> really do not see a point why I am cc-ed here. >>> >>> Best regards, >>> Krzysztof >> >> I understood that we should separate the changes for different fixes. >> >> I am trying to address the review comment from Pavel that was coming late >> after the original changes were applied: >> https://lore.kernel.org/linux-arm-msm/20230325170957.GA2904@bug/ (sorry for >> just got time to work on this), since all of them are small ones and all >> related with the same driver, so I thought it might be good to put them >> together and update with a single patch? > > Separate patches - one per functional change please. sure. I will separate them and send them out. Thanks >
diff --git a/drivers/leds/flash/Kconfig b/drivers/leds/flash/Kconfig index 4ed2efc65434..4e08dbc05709 100644 --- a/drivers/leds/flash/Kconfig +++ b/drivers/leds/flash/Kconfig @@ -89,6 +89,8 @@ config LEDS_QCOM_FLASH the total LED current will be split symmetrically on each channel and they will be enabled/disabled at the same time. + This driver can be built as a module, it will be called "leds-qcom-flash". + config LEDS_RT4505 tristate "LED support for RT4505 flashlight controller" depends on I2C && OF diff --git a/drivers/leds/flash/leds-qcom-flash.c b/drivers/leds/flash/leds-qcom-flash.c index b089ca1a1901..a73d3ea5c97a 100644 --- a/drivers/leds/flash/leds-qcom-flash.c +++ b/drivers/leds/flash/leds-qcom-flash.c @@ -309,6 +309,10 @@ static int qcom_flash_strobe_set(struct led_classdev_flash *fled_cdev, bool stat struct qcom_flash_led *led = flcdev_to_qcom_fled(fled_cdev); int rc; + rc = set_flash_strobe(led, SW_STROBE, false); + if (rc) + return rc; + rc = set_flash_current(led, led->flash_current_ma, FLASH_MODE); if (rc) return rc; @@ -745,6 +749,7 @@ static int qcom_flash_led_probe(struct platform_device *pdev) return 0; release: + fwnode_handle_put(child); while (flash_data->v4l2_flash[flash_data->leds_count] && flash_data->leds_count) v4l2_flash_release(flash_data->v4l2_flash[flash_data->leds_count--]); return rc;