From patchwork Fri Feb 23 13:11:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 205370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp573270dyb; Fri, 23 Feb 2024 05:11:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUKCfhuZkAs5HG1z7uFuA6gHNbPARVtub4aFbnYjYDeUOgil90enjCM2/9BE/zf0ECgOnmuWO6DXAN+cakRW9DGPPV+qg== X-Google-Smtp-Source: AGHT+IGsLmroLuvDOv2VBZa2y9DJUnd7bl7mTF4zdEpfZXcpXrcMyYRZY/W13WdB5rkhjENiUx7f X-Received: by 2002:a17:902:c213:b0:1dc:5cf7:ab7f with SMTP id 19-20020a170902c21300b001dc5cf7ab7fmr1386117pll.64.1708693915523; Fri, 23 Feb 2024 05:11:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708693915; cv=pass; d=google.com; s=arc-20160816; b=F8FYkrY/5Vd2EpzlQCVCs2MRRK6233CA6Q37Bg+VoJ3S98kYqmItlH78izXj9I3Oyr 6nX/+Cm+plQ5Gp0eObLkWfvq9S4gnQnqEMkxp6GifcUAPmt1EKs/izUq1aWsVB4L9806 i1es0B3crjnZcgJOv7uPI9BtvluzFiWp7zRbdJUf1sZqrvAiHEc0pcEhWRNbMwYAo223 yF2VuO/2zSZq56n4Keyry+qn/B6j1pMBqq1ptzg9rtcUL48PtgBmzWStBfoF6ty8+Y0B nKB35CbWFQlemJ2tSs/HPQthMncr32iqksd7yZGc4pmzXPs+HtiuM/po+79YUftS9L2b T85g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from; bh=gzJ5+xvaN/hg/ycejUEXeugsA44h0L1EdN02+hdjvK8=; fh=NhZ9u6hk/GWOhXXFpZaLopJNCy8ghkuBBEm9RDxDwfE=; b=De1R1Ru15hWNkGqt/dV7TcLGEo78sZKTA1uqo5gEKVwzYefakXKf90E6DPrnYLE0u+ SQfcrDilcbG4hhn9CWsYB29Ayu7InOBJeIqS9jjxiOAfedzWQfseAj/OApJNtLEFwwKi Dg47523A1x8I3+hQeD6ueRh3dHpERmkS/aMNEHRF139qzU/YPoGgpj7Q76e7FtJwI4Ud 3DDWh9iTy3ImJE/GC1qjQenXvxeGxdkwZNRkpgt9hI487Z2+QAoxndh0qTzHhkVm/ZWY FTgqmVBSBaxe4BRvrPhADwjAAAskBd+M7Qj2Aj71BpcvCSgdzYaGLovieiFQMgucxD9+ Iw0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=0leil.net); spf=pass (google.com: domain of linux-kernel+bounces-78352-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78352-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j14-20020a170903024e00b001db9c2b41a5si12387958plh.373.2024.02.23.05.11.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:11:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78352-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=0leil.net); spf=pass (google.com: domain of linux-kernel+bounces-78352-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78352-ouuuleilei=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 106382838EC for ; Fri, 23 Feb 2024 13:11:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC5847EEEF; Fri, 23 Feb 2024 13:11:42 +0000 (UTC) Received: from smtp-bc0e.mail.infomaniak.ch (smtp-bc0e.mail.infomaniak.ch [45.157.188.14]) (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 9C5B65DF00 for ; Fri, 23 Feb 2024 13:11:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.157.188.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693901; cv=none; b=L6wpV3D6mC/l7duemZ4lBIWYruV0IB4437wO2vMBGh2RT4d9I327f/NkQtPnPEj21HfBHnpnS3KLr0kvSftNa/ok9cu+oZ+IojPXQ+4TmUbY6zNsC2sd0oQTTlgW/X7JviYqLVAPm+59+/Ok0W0q9Qj104NhTkVQY8O2D5t/IcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693901; c=relaxed/simple; bh=0EmZbA6Z/VNF5c7++YIeS8HzXck5oR/WMMWqA0pYtD0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qOCWM4Za/TNl2nck9LW2ri7Qyr8HQNAvPseeVLzHrOmLqZSd4MjbNb1Jlmtlaunw0BkepO/6/TCP9lXJRB9PQ4HgktiKWlvyoYWVMhinO9oOdcENyxwqrR1svPJXlD9nZMGBd1n2O4G+Rof9O1DZkcvUWg4eb2FFB0sIjbDWrHE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=0leil.net; spf=pass smtp.mailfrom=0leil.net; arc=none smtp.client-ip=45.157.188.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=0leil.net Received: from smtp-4-0001.mail.infomaniak.ch (unknown [10.7.10.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Th9Q03TwQzMs1Yf; Fri, 23 Feb 2024 14:11:36 +0100 (CET) Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4Th9Q005gGzbZW; Fri, 23 Feb 2024 14:11:35 +0100 (CET) From: Quentin Schulz Date: Fri, 23 Feb 2024 14:11:23 +0100 Subject: [PATCH 2/2] regulator: rk808: fix LDO range on RK806 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240223-rk806-regulator-ranges-v1-2-3904ab70d250@theobroma-systems.com> References: <20240223-rk806-regulator-ranges-v1-0-3904ab70d250@theobroma-systems.com> In-Reply-To: <20240223-rk806-regulator-ranges-v1-0-3904ab70d250@theobroma-systems.com> To: Liam Girdwood , Mark Brown , Matti Vaittinen , shengfei Xu , Sebastian Reichel Cc: linux-kernel@vger.kernel.org, Quentin Schulz , Quentin Schulz X-Mailer: b4 0.13.0 X-Infomaniak-Routing: alpha X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791695431178577548 X-GMAIL-MSGID: 1791695431178577548 From: Quentin Schulz The linear ranges aren't really matching what they should be. Indeed, the range is inclusive of the min value, so it makes sense the previous range does NOT include the max step value representing the min value of the range in question. Since 3.4V is represented by the decimal value 232, the previous range max step value should be 231 and not 232. No expected change in behavior since 3.4V was mapped with step 232 from the first range but is now mapped with step 232 from the second range. While at it, remove the incorrect comment from the second range. Fixes: f991a220a447 ("regulator: rk808: add rk806 support") Cc: Quentin Schulz Signed-off-by: Quentin Schulz --- drivers/regulator/rk808-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index bfab5468cc54..d89ae7f16d7a 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -1023,8 +1023,8 @@ static const struct linear_range rk806_buck_voltage_ranges[] = { }; static const struct linear_range rk806_ldo_voltage_ranges[] = { - REGULATOR_LINEAR_RANGE(500000, 0, 232, 12500), /* 500mV ~ 3400mV */ - REGULATOR_LINEAR_RANGE(3400000, 233, 255, 0), /* 500mV ~ 3400mV */ + REGULATOR_LINEAR_RANGE(500000, 0, 231, 12500), /* 500mV ~ 3400mV */ + REGULATOR_LINEAR_RANGE(3400000, 232, 255, 0), }; static const struct regulator_desc rk806_reg[] = {