Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp214628lqg; Wed, 10 Apr 2024 23:41:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBCWAsszVNvQxM+2nFDFXLvcR5dlpY9msvE2wkV3VJ/uO7kmBIdD+gP7lFlAyzCtNRj4dDwNIDoTbSUW0cSWZPobFTgqxikGL9gWsrow== X-Google-Smtp-Source: AGHT+IH9LLN7pvG+YFMQ1jSP5A4og28VMINDgEBU8ZlKHyJIqBdXgVGvMD8Uy9aYOXYJMP93eoPY X-Received: by 2002:a05:6808:1386:b0:3c5:ed3e:dace with SMTP id c6-20020a056808138600b003c5ed3edacemr5724635oiw.4.1712817705066; Wed, 10 Apr 2024 23:41:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712817705; cv=pass; d=google.com; s=arc-20160816; b=otmq4IRrP3+Cp7ds2I9+GyRFBCS8OYCD9CN8/ALIQT+Wcl12sZPB0jfd5B35bUTYDV spOfTnizGe9oacHsLt7cuSzevA2CKxlV9n8FKiyjuNpN1ewdTs94aKK4u+35MsHcrSsp G54YzeIXnOwADNnLMLKzSTIf6XMUURHCbJdP3ajAZBZ7+pXTjXbfRre9PjCattzm0QEF LwHVFPhV0GwNgABiSJlxIT02zxcyFelq9IDUJat8P+8gcaXJljdlj9Qmm3nGA2bIhYGr Mr9SmIqoRUiBtLS9lkjj5RkKRYk6anT8T8E0rlKEr66YPZG6c8E7oh3NBiN4HrXec4HS J/LA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=mcdDJkJCVkNz828CwmAMGvCGhf1VhflNoT6vWunNHR0=; fh=UOzgVK00BB12Ht/CRe6RbfOm3hQx1vZu/Hp5umAB8vQ=; b=fF5cmvEqXcCKjfsHgeYXEox0LUJMtkL7G5ByJ0CU9Myz1YPdiSiTpXDtxw5fhTbS2G ryBthMoZemydpef4sxfs0mA2hGj8pvUouv6CRJa2I4N/KcuDxy//R8u2VpfufZ3XRUk3 gKntgz3jRQZG9y/feajO4T9tbxfLVsBYhkoufg7Gl8WBj3mIWAC4atNRPfq0dOXh79OQ wFWu9/mqD7jPb+prfCJl2IMOw2BuUFu+PM3rYH/0pE0zFqD3/naD++DYg8JoncX6aAdp Excvz7+/0+Rh64Z1CzCRxiyTd5gE++jkqg15qxL7z2v/q884T3G9E7egMdRLNjWzjPeE uFDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jSC3lve+; 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-139866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139866-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v5-20020a05620a0a8500b0078ec28d9ea2si585122qkg.150.2024.04.10.23.41.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 23:41:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jSC3lve+; 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-139866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139866-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C55041C21A41 for ; Thu, 11 Apr 2024 06:41:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D730F13D888; Thu, 11 Apr 2024 06:41:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="jSC3lve+" 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 5AEDE4F5FE; Thu, 11 Apr 2024 06:41:33 +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=1712817695; cv=none; b=Ax6JoPhrtf3RFh7Xr2MNPWNIqzkqNQTGgmm0y9RpAYWtwtRS8y7CZ+uN3Uu8sipeaNmGcV5dMKjikGDFUeDHv46Y9I4lFpky8Km1eZ4GqlmFSe4U+R86h7joBdi9ZX+LElfgistp9uOasU9fNJbTDB8AdGi80RZtExt7JvhCLmQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712817695; c=relaxed/simple; bh=i4ItlNX7TbuFsOHfmGQsx52q+0Kg3uL7qQOODxT6NHk=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=pWJLOuIzzWucnf0YVcHBDlF5o9p7vDuiuteeWG0n4X8Rzq8meJqfcoY+6x6rO3J3EoYih454E1PRzJlmYDHKbioS8ulDLeudFg+JRcrcmL8KG4ThPnGNPi47ar+WVh3Qwd6Csyp2+5pxwlTcKze/8pGRYrlF7+elWjT+StPzBMY= 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=jSC3lve+; 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 (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43B5Da1p028318; Thu, 11 Apr 2024 06:41:22 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=mcdDJkJCVkNz828CwmAMGvCGhf1VhflNoT6vWunNHR0=; b=jS C3lve+KDWKnr4lvhpAPj1NgN9omwb3q9sACmtTAtNI7hGT/Ah6qoe9MLTulgMJBa f0o36RhyqaNfgWV9GfUaRxjcmASLMDD2e12zimXSNeZErY5vePU/7kTFs8yYK01y mO4L5xvp5KApKUAKt/avOFmOzEEgo+GnUFeQNea9em3TOc9S3WPVAr2uncf3Ge0Q vkqUQDb1lvNwXt2YVFlru3viUjaF3WDIW+MIu5JzfSJTRM+r2Fu7QsHJkVotjAmM 0oCY2pjh2b3GYFdtIK3QL71BkXQPdjYEgl/HYFIKjj6nmdNYtsQLj2GBf8+3HJwf JBEGd7K46AycI8x85RRg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xe5ehs963-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Apr 2024 06:41:22 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43B6fLjm019752 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Apr 2024 06:41:21 GMT Received: from [10.253.12.44] (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.1544.4; Wed, 10 Apr 2024 23:41:15 -0700 Message-ID: <89bc03c9-9545-4886-aec7-91c9926257b3@quicinc.com> Date: Thu, 11 Apr 2024 14:41:13 +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 v8 3/3] input: pm8xxx-vibrator: add new SPMI vibrator support Content-Language: en-US To: Konrad Dybcio , , Andy Gross , Bjorn Andersson , Dmitry Torokhov , Rob Herring , "Krzysztof Kozlowski" , Dmitry Baryshkov CC: , , , References: <20240401-pm8xxx-vibrator-new-design-v8-0-6f2b8b03b4c7@quicinc.com> <20240401-pm8xxx-vibrator-new-design-v8-3-6f2b8b03b4c7@quicinc.com> <3f8c970c-6a0d-4fc3-a2d3-e0797e7055cf@linaro.org> From: Fenglin Wu In-Reply-To: <3f8c970c-6a0d-4fc3-a2d3-e0797e7055cf@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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: 8mxOIQfrsnj8gQvUfMzniYvrdn-kuydZ X-Proofpoint-ORIG-GUID: 8mxOIQfrsnj8gQvUfMzniYvrdn-kuydZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-11_02,2024-04-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 priorityscore=1501 adultscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404110046 Hi Konrad, On 4/11/2024 2:10 AM, Konrad Dybcio wrote: > > >> -#define VIB_MAX_LEVEL_mV    (3100) >> -#define VIB_MIN_LEVEL_mV    (1200) >> -#define VIB_MAX_LEVELS        (VIB_MAX_LEVEL_mV - VIB_MIN_LEVEL_mV) >> +#define VIB_MAX_LEVEL_mV(vib)    (vib->drv2_addr ? (3544) : (3100)) > > You shouldn't need the additional inside parentheses > > Also, is this really a good discriminator for the voltage ranges? Do *all* > PMIC vibrators with a drv2_addr operate within this range? If not, consider > a struct field here > Currently, yes, all PMIC vibrators with a drv2_addr (PMI632, PM7250B, PM7325B, PM7550BA) operate within the same range because they are the same type. > >> +#define VIB_MIN_LEVEL_mV(vib)    (vib->drv2_addr ? (1504) : (1200)) >> +#define VIB_MAX_LEVELS(vib)    (VIB_MAX_LEVEL_mV(vib) - >> VIB_MIN_LEVEL_mV(vib)) > > If the ranges are supposed to be inclusive, this is off-by-one. But looking > at the driver, it seems like MIN_LEVEL may be "off"? I'm not sure though. > > Either way, this would be a separate fix. > [...] The voltage range [1504, 3544] for the new SPMI vibrator is inclusive. I checked the voltage range [1200 3100] for PM8916 SPMI vibrator is also inclusive. I couldn't find any document to confirm if the SSBI vibrator but I assume it is the same as PM8916. I will make change before the series to address it. Thanks for reviewing the changes! Fenglin