Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp735871lqt; Thu, 6 Jun 2024 17:58:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWB54eMR2avuPWf4TDjntEzjWq+FVKenqJPX+i1Fghc7dG2smW2QPcwi4AzEHph+t6jiWzuWoCiQx57DspC9I+zXZeuLLtSG+8o27W+Hw== X-Google-Smtp-Source: AGHT+IFh4JCul0caWd6hJLeZx/JT9iC8yrTGlRjNu58fHrzZAWgvOOzNpdE9ANG1UQM9igZkI2Zy X-Received: by 2002:a17:906:f582:b0:a68:6032:463c with SMTP id a640c23a62f3a-a6cd65668b5mr102366566b.18.1717721903004; Thu, 06 Jun 2024 17:58:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717721902; cv=pass; d=google.com; s=arc-20160816; b=Zz9NegcOV0iUAdI3tvIChhCwT5IgTGojFDCcoVKImZlj0CiXL2lnGrHHnpDxwcCiQU uH8jWylyfXGjC+/D/nh2C+ZVzVYLcUowJ9a3bnxdfDMSzAuOIQQ2WIwFh9TuETu3H88I vN8gRTlSGCEDkEbkLi+bEr2ZX7SSoqtCRSImMeE3jzctdojU/jFozukTnUmJBxyxyqu0 OlVOtjIS3BxE0YTrsFnL8q0rU+D88im2hGiHxCKxisxfMx0kL+q8NOGpabKGRv3Ws6Wa p3++lKJJOijmLh9HCz+ShCXQFax50wmtWCPwmVmUh55PQIj8GiJLhn3QLZlp3+FLWAqI SRUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=GR6l+MtUgvHhjzAP/hYqmbmV38riRQ6sN23ytTC2cvw=; fh=PDl46UexhUSw50kCp0Ii+T/+1MJdfQCpI0GuIS9yiEU=; b=GtPUtWHE/JoNBUkwLqnONJICcanaAl57TH9PsWxDWSgyZrfsbgAfpthuKeUppvePmY ffCpHOcEWDUQ+/zYgdtGG4nVdSXDadvmYUkw26fs3GOPk+dhWJqAnjYCtgRXz96dNS3E 7y+m7une4iagSeXAcGivvHWjgFT21Ya9eclCPT0MWBijGk8s5TFxZfvKfQ2nr88Xpf2I 4N52s/qZIml7nNY2s9HT4NVVcH9V0Y6WjJKIs7rk02vs3toH/XQIaPhHJXLrRvuNME0n T3c8wlxn3M37Fe7z9OsWVRtYtgIv2t0xRj0Zq403NRVs72pgYLPrZx9lQcKWMZFeQX46 F4Kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fMf4ErAw; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-205206-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205206-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c8070818esi129817966b.552.2024.06.06.17.58.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 17:58:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205206-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fMf4ErAw; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-205206-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205206-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B3D031F23132 for ; Fri, 7 Jun 2024 00:58:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01A81DDC3; Fri, 7 Jun 2024 00:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="fMf4ErAw" 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 92E88D2FF; Fri, 7 Jun 2024 00:53:39 +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=1717721621; cv=none; b=E+5GDsQI5/9/96YKzfr0rGomNyLhe5/J1TxqvKmCzV2nfmPObgftuQJqfYza/H4F4yIhOGTdxF91aKIs0VevotYlj44Il2K5Ip+DoP4hsv3Wb2LYUpmbLrVlZ3OYrvTU0pQabdOdON+We0z33bcygaQWzZdHFrGtnEl8/4GtnNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717721621; c=relaxed/simple; bh=whxTm1m9+FDgqmbBh3+6J3Hp3yp5syfTVkjTM/AiZtY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=StX9MIIeTq5iugdPykMkQcFOKKheIxF0zxe3Dc4v24a6Tq8dg1kIh3bj8smGdXLzuYkL+bJPOeDNKUFGrl/POZ5PKY/Tri1kfGTiFipFcLr+ORnNDcOrZVMgQWHJhA91EPL/V1YifGwU15MJT/y4GMXwVDYI7LHXk8ctsuxp1Uw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=fMf4ErAw; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 456McuDV010965; Fri, 7 Jun 2024 00:53:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=GR6l+MtUgvHhjzAP/hYqmb mV38riRQ6sN23ytTC2cvw=; b=fMf4ErAw1m+aqyEzIROSYWNdhRqwq7NvEuY5Bq qFGtnzrtmULZbhmRyxAsfN6ErZN9IiRdzGiY/T+wO1GppFzOcQRCeYACwgPxXuZe N7cPFeTOG2bzsxcrs78iTYirgP1jFFM2OVWSutyJjTzUpRZxdZdk69txvBC9ugKK LnlsXwZX3ExEBSCm9vnas+Tl2yuIEAsK1SVm1LG9cplwSUAWTjNgASfmDAb+1dMf PlqpI3QgPxgel8S6zgnZaOk2BQUPdrDQ6HRg3SB8XQvNN3zqp2heakkC8wnXn5ko 8aacGdGGbxiKWfH/Fb4qjH9cEqgIm4YYFGIcy8zpVDsjf/Jw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yjhw0w8qs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Jun 2024 00:53:27 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4570rQq4025333 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 7 Jun 2024 00:53:26 GMT Received: from hu-amelende-lv.qualcomm.com (10.49.16.6) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 6 Jun 2024 17:53:25 -0700 From: Anjelique Melendez To: , , , , CC: , , , , , , , , Subject: [PATCH 1/2] leds: rgb: leds-qcom-lpg: Add PPG check for setting/clearing PBS triggers Date: Thu, 6 Jun 2024 17:52:50 -0700 Message-ID: <20240607005250.4047135-1-quic_amelende@quicinc.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: igZFFnN0w5yzpdAvyttdv1JaqUUEIdv_ X-Proofpoint-GUID: igZFFnN0w5yzpdAvyttdv1JaqUUEIdv_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-06_20,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 phishscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=776 lowpriorityscore=0 suspectscore=0 malwarescore=0 spamscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406070005 Currently, all LED LPG devices will call lpg_{set,clear}_pbs_trigger() when setting brightness regardless of if they support PPG and have PBS triggers. Check if device supports PPG before setting/clearing PBS triggers. Fixes: 6ab1f766a80a ("leds: rgb: leds-qcom-lpg: Add support for PPG through single SDAM") Fixes: 5e9ff626861a ("leds: rgb: leds-qcom-lpg: Include support for PPG with dedicated LUT SDAM") Signed-off-by: Anjelique Melendez --- drivers/leds/rgb/leds-qcom-lpg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c index 9467c796bd04..e74b2ceed1c2 100644 --- a/drivers/leds/rgb/leds-qcom-lpg.c +++ b/drivers/leds/rgb/leds-qcom-lpg.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2017-2022 Linaro Ltd * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. - * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved. */ #include #include @@ -254,6 +254,9 @@ static int lpg_clear_pbs_trigger(struct lpg *lpg, unsigned int lut_mask) u8 val = 0; int rc; + if (!lpg->lpg_chan_sdam) + return 0; + lpg->pbs_en_bitmap &= (~lut_mask); if (!lpg->pbs_en_bitmap) { rc = nvmem_device_write(lpg->lpg_chan_sdam, SDAM_REG_PBS_SEQ_EN, 1, &val); @@ -276,6 +279,9 @@ static int lpg_set_pbs_trigger(struct lpg *lpg, unsigned int lut_mask) u8 val = PBS_SW_TRIG_BIT; int rc; + if (!lpg->lpg_chan_sdam) + return 0; + if (!lpg->pbs_en_bitmap) { rc = nvmem_device_write(lpg->lpg_chan_sdam, SDAM_REG_PBS_SEQ_EN, 1, &val); if (rc < 0) -- 2.34.1