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 9D6FD3BADBE for ; Fri, 20 Mar 2026 17:23:28 +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=1774027409; cv=none; b=lzu4xShCbcNiGlgrpm1ncQpauzko+9nimNxOoV6tM4vBCZjPxrMGmorlxxhSBXDf+66zOT1k1hFqJvthLg7wX55GThhqQc/J6nNNTjXYuQsFw7wu6ivTlqMv0nL6K6NZ6wsQEyb41SwzorwstRfvpW7aus6aA9v6OjO5XzPGxQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774027409; c=relaxed/simple; bh=OJJyQ7N3WF+j+dEurHCdLzCCk3xicc9di2O5Up0QKJE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iGhA3z+4da8DdLmzti9qEs/xogDBseWp0cMAvSR9KYuduvAupB4emHobFFYioq7B9W5DL5vdL2jXN9JgNbZ5VF2QAaPV0ULA+G6Rvn616F3s9Nc3gMYU1TSCxhbjGh0JWKW9xsFtkL+tZrQHsTOXeVKy9QGaGmSK9qeFIvYgg64= 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=R3ae2ZQa; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bYEn653p; 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="R3ae2ZQa"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bYEn653p" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62KEUeSP3614544 for ; Fri, 20 Mar 2026 17:23:28 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= SfbxDY9Im2+BtL9OZSyqlYbFE771o07gzHc0qIeYYj8=; b=R3ae2ZQam077UttZ x0zRwZTNWjAMA8FgstZbdBkdXRWea+TBW5pCL2WGntLuUy16AW+gGbhRR9cxIo/j FsOHoDoumCvoj01uDo5/MCv9rEyoyM+Puf/9wQnFoNGBxt8kB3T69HQh+KuX8UFN 1ys0pb+a38go2TnOAgHcZ8XDcuZfDrOcJ2S8lT7Pq6fvcEhpFRIY29kNP+O3b17m gr2CTzfF0yCFcUTVoGl5uWAe/KPoeBgvy9LaZ1pWCbSaos6oG1Oqx/iFkP3Pch38 8cycW3/xqGInoL/V9W4bGzMvf3jg5T0IqayrphghBQ39cNtowrCnbrhYl2nqgdUR W7OVig== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d0qg7b088-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 20 Mar 2026 17:23:27 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-50b389f2560so61820921cf.3 for ; Fri, 20 Mar 2026 10:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1774027407; x=1774632207; 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=SfbxDY9Im2+BtL9OZSyqlYbFE771o07gzHc0qIeYYj8=; b=bYEn653pghZh5RsoGTyHdW+nluxCMPOQdzY+67+k3OhxNWo/IlzPCPcDMJ+x+gVRWC eDVlIbGJ3Z9JkgsLnKsDt0o+x1gu/JCxuGZLjzSYLH5NZDJLkK+CYyCiDLQxPdmPloXy 777gVXOAphFiVGorx4ufXzQ/Uk6D5IXlywbPVlHJaVNVmAqnSnmOq74/Iu6sWJOiFppp jtze6H1otDfJ1xp+6Yyx13sld+/dFBvwYGVf7OZOPaccbyHcZgJX+3fYADtGfEBtZAWp ABTJA2aGwH94HZP7cNS2zLOhZQuiFHEHnHw2KKRL2gkmOPqSrnJ/uFCLLTUu5Bwacay7 VUnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774027407; x=1774632207; 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=SfbxDY9Im2+BtL9OZSyqlYbFE771o07gzHc0qIeYYj8=; b=GWRQ7CYpIootbpD4yH4it1v1rJTOXypg8vQf6LTMP7b5qDNk41pCnNx43co28LLMyr CF2C/OAHM6q8Zf/yIAHEIUmZnbRuAaO9cZ5DFX2Vslwmq6JQ/W6bvswXsFaTRZLe3qbx yLoHSy0PMYo/lItbA0kmZWQRMtFwGhGaDQ+6I80GAiKzUK0ZzgpcVLYIMlsYvIDwTRvX XcNOusCNlj1KKzVp7GB4fRrQEDxLqAjaqsFjhhfPP/Vq0Bdoc06Brpo2F/Y4aKrZN3JI 2boxk2HDKsK4WxpizkRFpMriNHvYzzBk/MDXt50fplgJcYY4ulDNzBUQ5ZvCmWhuEkl6 qgPg== X-Forwarded-Encrypted: i=1; AJvYcCWXq+zWd1gBzC8Sh2PtQPp/TXfbgBY7QqeX9GKekt499bAhNMV8s9/G004yZzRLMEuI9XNDDal135Lk9kE=@vger.kernel.org X-Gm-Message-State: AOJu0YzWyS4na8W4BLFq4XMf+D4+3CIaIdjo8f1NZchvVG/GETV20l0X pXcUI1Fq4wHOObqdo25xPJ45lchKjKglsn8L4g1tj4J1plDCpqkaLFbEGRUuwPuNtS5jxeP6Idf uV0YCCmNO4tDinaI56dfyY5cdgR/h5/YjeWqqo7bHbd3AzfWYQ4mpoPj7vQ+WjKNuL8LfujRKaA 0= X-Gm-Gg: ATEYQzz6GrZfJ7CGVJhYyls77nTfYI2tv4t/J1TXs9P4ARadBk91OY/Pi8zqEPna6VH 5UOVGdO8yLBuGRWuyFD5EV1gCuWrAAwqnH2QybS3uTZW6u5WEjAomN1l24zkRtVjS8iBzbrnteQ bWRmIw2XrupTCNx446NvPRJOicwx30WGftIIiK1emUtOyxV13s//V1dQhBUpleIwUFGxZRDBinz MPE1SsSqjA1av+zxrbJYZHMlpOeN5QcJd4zjOHqqH4hNHDdTu1G4/MUGmJoKKBxZBna4PBN99+9 TuTL9xFBNSFYn6WXdRpwLYOqHnCM2ibJWGJO3yWjP0wDuKozGn4G6VnnvVWmnPQu5e68fjgArjZ TwglT1L9LCDKoigu7U70vLXb14aNetPH+Dr/SnCDM2lG3fbpufiTLm7Y+WtkItCvrTCatPL6RET qKHukAPeWY X-Received: by 2002:a05:622a:7593:b0:50b:1932:c9c with SMTP id d75a77b69052e-50b374b1f0dmr45800001cf.40.1774027406879; Fri, 20 Mar 2026 10:23:26 -0700 (PDT) X-Received: by 2002:a05:622a:7593:b0:50b:1932:c9c with SMTP id d75a77b69052e-50b374b1f0dmr45799691cf.40.1774027406461; Fri, 20 Mar 2026 10:23:26 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:ae20:597c:99b8:d161? ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486f8b322d9sm139618585e9.8.2026.03.20.10.23.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Mar 2026 10:23:25 -0700 (PDT) Message-ID: Date: Fri, 20 Mar 2026 18:23:24 +0100 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 2/4] hwmon: Add Qualcomm PMIC BCL hardware monitor driver To: Guenter Roeck , Manaf Meethalavalappu Pallikunhi Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , amit.kucheria@oss.qualcomm.com, Daniel Lezcano , Gaurav Kohli , linux-hwmon@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260206-qcom-bcl-hwmon-v1-0-7b426f0b77a1@oss.qualcomm.com> <20260206-qcom-bcl-hwmon-v1-2-7b426f0b77a1@oss.qualcomm.com> <6f4b27c5-074e-403a-90b8-fe7ef3a993b5@oss.qualcomm.com> <1db8667b-5546-47bb-8ba5-cdb99fd60848@roeck-us.net> Content-Language: en-US From: Daniel Lezcano In-Reply-To: <1db8667b-5546-47bb-8ba5-cdb99fd60848@roeck-us.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: 557ZDH66z0fd5AJtSCQFTk6-ytlOOJlu X-Proofpoint-GUID: 557ZDH66z0fd5AJtSCQFTk6-ytlOOJlu X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzIwMDE0MCBTYWx0ZWRfX+HerBHrXr6uY CXOgR/XbOcrK4mud98jmawIBo96RKXMoTB/EorBQ/KEboXSjFXPmcSKftoErXzjmDR7UvxCBlMA 6WZQa+bWjR7f1oiSVKQH2x6/My7TXycXDwOfcHY2HMBL7d9kGReKAV+nNuywucoUguV9qvWjM9V teQpZUl37X1l79AbL8t//z4mhdpsTeFKK92NhRzV0ik+MF5gqhkx7xN2kFddDDnKYO+JwOPbNKp XrWYB0FtwIg3ZCa9wtpPHfbxeicHV9Y585oEghc6VsOt11PkBW3ZOtIgLAJu8p+eFuxKZhLRVAX Smh83HggRRc526JzbN4wxpizcW/Qmx4sjGNs0qwFSNJ7KB9Xl9H0xPfv+eTSF0T4HwCJSr+NExs uti9ZG+7I62r3fMFKGHSvV2KefiaksqKdFH7IQ9SBxLLh/s5jOQ26adJDNTPLbjuUcirhVQ5TQ1 NWKqk2+JDQC0+xNIcbw== X-Authority-Analysis: v=2.4 cv=fdGgCkQF c=1 sm=1 tr=0 ts=69bd828f cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=N4zZDkH6pAkBRpc-Z9EA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 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-03-20_03,2026-03-20_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603200140 On 3/20/26 17:59, Guenter Roeck wrote: > On 3/20/26 09:08, Daniel Lezcano wrote: >> >> Hi Guenter, >> >> On 3/20/26 16:22, Guenter Roeck wrote: >>> On 3/20/26 07:52, Daniel Lezcano wrote: >> >> [ ... ] >> >>>>> + >>>>> +ADD_BCL_HWMON_ALARM_MAPS(in, min, lcrit); >>>>> +ADD_BCL_HWMON_ALARM_MAPS(curr, max, crit); >>>>> + >>>>> +/* Interrupt names for each alarm level */ >>>>> +static const char * const bcl_int_names[ALARM_MAX] = { >>>>> +    [LVL0] = "bcl-max-min", >>>>> +    [LVL1] = "bcl-critical", >>>>> +}; >>>> >>>> IIUC there are three levels of alarms but the hwmon only has max/min >>>> and critical. Would it make sense to do adaptative min / max ? So when >>> >>> hwmon has lcrit, min, max, and crit alarms for all sensor types, plus >>> an additional _cap_alarm for power attributes and _emergency_alarm >>> for temperature attributes. There is also a generic _alarm attribute >>> for each sensor, which is supposed to be used if the specific alarm >>> type is not known. >>> >>> What exactly are the three levels of alarms ? >> >> Manaf can give more clarifications, but it is like we have yellow, >> orange and red alarms. So there is an additional alarm comparing to >> what is available in hwmon. The proposed driver maps orange and red >> alarms, respectively to bcl-max and bcl-critical. >> >> I'm just asking if it is important to have this 'yellow' alarm ? And >> as there is a missing alarm to describe it in hwmon, how can we use it ? >> > > Is this for high alarms only or also for low alarms ? It is high for over current and low for under voltage. > I would not mind adding _emergency attributes for non-temperature > alarms if needed. We could also add another low alarm if needed, > though I don't have a good idea for a good name for that. May be "warning" ? Alternatively, could it be interesting to have an alarm with a value passed in the event which represent the value in the unit of the monitored attribute ? So there is no need to add more alarm files