From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 5F07A18DB0D for ; Mon, 17 Nov 2025 02:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763346154; cv=none; b=ieILnU7Pj3c5h3RJs+T/FtiI5QQXieiY/P7GNpzHIF1deppmdQlZzblNMxZnm5Yj5vSgC+XDWZCMRWI+HM8KHA9BL7Fg6up3p5WK7AhowZ2qW88/q4i2enMsU1jaqG97W+CplOO3CCTathlTkVk8eHlPNzTdLIYlqpBHDrQupzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763346154; c=relaxed/simple; bh=e+p48IaoIhLfXRpESvp6/pHVPXSO99iUgRfoHczmL14=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EbgLhFvwgrFQOZx5gyb7zsFFIWnPWwnc5eg3BfyO2E7iQYICZWhlK40PqdTtUj+bnE/4blze3siY0c28wiV440xYmPhTnaaFKpyAIe28kvWTIrdqehwoygFMcARTKcU+mR/xfNRurPQs5GtDi70QX4Dn7moDnxOBwvXVC1H6uRA= 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=i6YZpvcE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FiOFGbja; arc=none smtp.client-ip=205.220.168.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="i6YZpvcE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FiOFGbja" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AGLiBvW1964088 for ; Mon, 17 Nov 2025 02:22:32 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= zYlVhddMHWTqti30RONS2XolCrlKESX7cb8t/mBL6EM=; b=i6YZpvcEazbBUaFJ o9oxWg0gtdveZ+InITy6kEk6LNd8vy3ZYbbs7D4+9PJD90gnYSdgnWIXYwQaLtuF 8AjNQ4aiJFXi0BNbMTdTNq8c7ueltsH5Qle/2uhqvI1jTbWTY88yPKr7Xhd8wzD5 yS8sSyD7wxfUw3S/60m5nHhWc9qiX5pgNpK5T8v2rMY76ZYx0TQ49vFH/4/N7K3v Y80H8coHI0Bt5++kSf3GAk9aK8gR6qUrU4d0+DV6cqLQdmsQOsAaVpI6CuYAMYcz CyzPkEpnWkOIMQAB4+fXBZ0avOQ9EtGFO8R4FainGLtSzcw2iNxLaKL/WhP8owzD Q7Xgkg== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4aejmyu1nm-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 17 Nov 2025 02:22:32 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2956cdcdc17so43262315ad.3 for ; Sun, 16 Nov 2025 18:22:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1763346151; x=1763950951; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zYlVhddMHWTqti30RONS2XolCrlKESX7cb8t/mBL6EM=; b=FiOFGbjaRQ6IzE+rGwivZZD+SUfSl+VM5OqioHIMbhRnCoJjIO7wrjJ1VZ2V8M85aC N0TZ1lWrzwUePs/ikslWLM2cmgayqUwAaEZTSYXi+MoYlaf3N5oPvWSmD8FkaLCvntJv cWeWbPCcsSYB0Sg0hS9VZSWo54EgDMbEke4JrD3ovbWtgtRMIXJuFKXp9lGezlq9dsAX fu8QvILu3C6eEuu7R8urjEUVYo6MPSoQOpQ4zqgmk3v+J198qxquj/rLoGV3Roc+9L66 SrAhsmQCkvRCmRQ1lY3NC+Hnj0AyCTzjxsOJKegwU2cgTFYl1OXh51sxC4UX1wFMN6vY RnHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763346151; x=1763950951; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zYlVhddMHWTqti30RONS2XolCrlKESX7cb8t/mBL6EM=; b=IlpIFvWW8+AdMppHUAiGGPoYu3ACaA1aZe8314BYe40M2FdMlx9E4kCsvTO7VQqvRu YcV6FHUWSOKXnqHSYfz7FsALn7LeLke6ppX5e/nJFvEvXg5v7kSYBHU4S55HgtrW02jR fBUsfRfB9KXViwwYjQTK67mZ0oGYQ3EC+TaGSjsTcqsFiv/a5n4HweguykZg37zTgauC dm99qE1uj9HwkkrjdcSnw2Oovq0+gDEWADpUjm1v9hpvKVj6wq74dWXug2dK34b8etqe JJ0QhuTb6UNrZ6oyZgNMUzq1StZHwU8LtppXslotfapAwSLNa35UiArveBDWml7L/MLp HzXA== X-Forwarded-Encrypted: i=1; AJvYcCVsDA4bm+wk+VwtAJgyMkTU+RTHrswMi83X+ZK07wl7W37D3tc2Av/iY+xdbq626UWwsf+mre9ALrHccbo=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0ZcXFRejjFMrG+AnQgtCE88Yog9e+P5RaShQdDqCASAX+M3qn HrAKSUi0LJIsDf8J9XsNqMZD0rW/GKLo+ZnMQHgWj7KMI4f+reuC9kY0d8u/owObEf1Skh5FPsW 6Ch9TU+2ymt5QQIKUdov8ICfr4sYjVpLOHgrVfhzPXuC8rixNfaNGQ3RqL/EYzok//krlamX/jJ c= X-Gm-Gg: ASbGncvL9WFcLhuFnFQJKUCv+3013LvORkY9XKNl+x1cu2jGuQKVIVLbc36K2LBZ5z+ wk53AqrcCrr0lB6b6Vs+KurpMBHVZTgp95fZ+xohH/NwnWRc1uK5CB1Qj3nZcNgghy35EshZ13L kUw+POgL3ABjNmv7dw0BTaNZkUTxVmuPruz4QP/6SZP57J35VrHd/TSd4FsUa6AXafptLO0iCJs U7qAn+LsJm0WJ6HMEFIbBDAu1L0qsqB963NzCcicDr07b7OnWsmATWVedfFG9wYFgN8dxvvyHPl JWuPyzHWg9wbov3EDJZZ7gNuUhGNoQSvXLXzqyiVMf1BqAGPMoaSa+t5t2oYQXYZf1Sm0Be7GYL +02bxoqJaGRqvHqcD8YTB94Q+W4mGszs3SGulSS2E0g4gN70GvuknRoxYj9UqoPXfQ1w= X-Received: by 2002:a17:902:e947:b0:295:7b8c:6622 with SMTP id d9443c01a7336-2986a6b8751mr131261055ad.11.1763346151455; Sun, 16 Nov 2025 18:22:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3D3b+HBgeuxjjE3vKDtxkEEvpqpfT69zOTS4Ccxq4aUIezvfTp6KMVKhasPkouV5wkn+nGw== X-Received: by 2002:a17:902:e947:b0:295:7b8c:6622 with SMTP id d9443c01a7336-2986a6b8751mr131260715ad.11.1763346150967; Sun, 16 Nov 2025 18:22:30 -0800 (PST) Received: from [10.133.33.96] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2985c2bebe1sm120036205ad.82.2025.11.16.18.22.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Nov 2025 18:22:30 -0800 (PST) Message-ID: Date: Mon, 17 Nov 2025 10:22:23 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] leds: rgb: leds-qcom-lpg: Only enable TRILED when LPG is used by LED To: Bjorn Andersson Cc: kernel@oss.qualcomm.com, Lee Jones , Pavel Machek , Marijn Suijten , Subbaraman Narayanamurthy , Pavel Machek , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org References: <20251114-lpg_triled_fix-v1-1-9b239832c53c@oss.qualcomm.com> <7jf4xvqmlymwkyrdp2ulpazfwmhdmfegzigewc5esk2sj323a5@72skiavskrqt> <7732165a-4147-4917-b76a-1525aae13c25@oss.qualcomm.com> Content-Language: en-US From: Fenglin Wu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE3MDAxNyBTYWx0ZWRfX9u45pCPfidAL qZlQjmzPqcEh2qOZlY2bnnb2oIbghEF2ITxb3uVN1ShP3PqtMEzb6Xf1VgTKyL0IPcpz5KUt4jD F9OePssPzZuwa4aV+DJ7wXjy+vQfg29p7SL1GaHDJWHBgatztUU7W1PjwcCsHYssADvLtJAlW5s dZEWIiwaTcUAzB1ucb7R4wNhbjcRByrlFSpkL+rHx5vI1mtab0mQQtyq8fM0krj14DpT1XUsHyc mQ3Dt2BpIU5p0dGa3RMeYlLwWEnlY36ubK5TZgtFTNzOWWy+l7/nAz1TafG5Diso3UcT0s6XFUO C57LXTlCdHrhLp7NRwwZxW3Tgz2GCUVlSaiT/onBD/MlCgSlnGsprNKkYeFkGsUD7LiNI+O6Yk0 lgnkr/QWl9LwD2J0WygM4xXMLL3R7A== X-Authority-Analysis: v=2.4 cv=BPK+bVQG c=1 sm=1 tr=0 ts=691a86e8 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=sxwf-mhpPifykftr7pEA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: DY7TGpQSogLo5TOLcIsGaZvgMyuh6P_0 X-Proofpoint-GUID: DY7TGpQSogLo5TOLcIsGaZvgMyuh6P_0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-17_01,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 adultscore=0 suspectscore=0 phishscore=0 malwarescore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511170017 On 11/14/2025 10:56 PM, Bjorn Andersson wrote: > On Fri, Nov 14, 2025 at 03:13:18PM +0800, Fenglin Wu wrote: >> On 11/14/2025 12:58 PM, Bjorn Andersson wrote: >>> If chan->in_use, then the channel is exposed as a LED and >>> lpg_pwm_request() should have returned -EBUSY, so we should never reach >>> lpg_pwm_apply()? >> Yes, I agree. >> >> Change is trying to ignore enabling TRILED channel when the LPG channel >> mapping to TRILED is not used for controlling the LED (not defining the LED >> child nodes). >> >> So the fix should be just removing this line instead of adding the if check. >> > Sorry, it's been a while since I looked at this code, but isn't it > possible to configure a channel going through the triled to be exposed > as a PWM channel and if so, don't we need to enable the TRILED driver > for this channel in those cases? Yes, this is possible, and enabling TRILED is not necessary in this case. The signals from the LPG channels mapped to the TRILED channels can also be routed to the PMIC GPIOs by setting the GPIO pinctrl state to the "funcx" function. For example, for LPG channels in PMH0101, based on the PMIC GPIO usage table, these GPIOs can be used to output the PWM signals if they are configured to the "func1" function. GPIO05 -- PWM1 GPIO06 -- PWM2 GPIO11 -- PWM3 GPIO08 -- PWM4 GPIO09 -- PWM4 > >> I will update it in patch v2. >> >>> Why do you check chan->triled_mask? I guess we will still read/write the >>> triled regiter, but don't make any changes if this is 0? >>> >>> Or is this the actual issue that you're fixing, that we read/write the >>> registers when we shouldn't? If so this should be clarified in the >>> commit message. >> Yes, there was a case that a LPG channel mapping to TRILED is repurposed to >> control a fan, and it was seen that the BOB1 (supplies to TRILED) voltage >> bumped to higher voltage when the PWM channel was enabled. >> > Is the signal still routed through the TRILED, or is it muxed to another > driver? No, the signals will not be routed to TRILED but through other PMIC GPIOs. > > Regards, > Bjorn > >>> Regards, >>> Bjorn