Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2417758lqo; Mon, 20 May 2024 05:31:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFOYnz0tsBvnD7I3A36YBMXH21HW1Are3uZDyJawvt3cZxxqQcgLikiVe/IdBJEeTEdCln85ARjkEUQ1dS6AaWoy8a0derd3yqZnycRw== X-Google-Smtp-Source: AGHT+IF8VhTK6tlNSaA/W/uvEUWD88w7sk4x3OdAH8A2aWgeVYldJDf86DNVEYsuVvOMmD42sVpH X-Received: by 2002:a17:906:3591:b0:a61:c462:c612 with SMTP id a640c23a62f3a-a61c462c652mr96696366b.53.1716208314143; Mon, 20 May 2024 05:31:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716208314; cv=pass; d=google.com; s=arc-20160816; b=XVz1ZN3pbNohBPEh9BUgfreEcy/fbnpfYrkI5PCZdkclsTPqSQIQhLsLiwjQedK5dN 1ql+B7Y9FLl0yL9Zchoeq3hJ1XhdheiMXAZirhBCVs54EkrUOQFkpdcMPSB3PEwZ5ZTD 4AS3xg/B0MlAF+UXMXoy3HzIVG3locaDSWe0Bj3vLR/lMiICsDgKFVZfr/ypLBBeJ++Q 1WBFY3RFOVqthJybrzB/o190yiHuQFVt5E0w05p1YIzHsuKD44cMSIjyNmsIJ90+JWiV IlpKP2P9tR1p2v4FqnWWfhS/WL+IlylKDAS6JwjeOxpxq6VjTLcx13ALI2ou3E3TVAuN nK6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=xTV37OvPNxm097mdCjRk9kivbaQmKYdeu/uwsv44aes=; fh=Ru8UrGDc8fhIX5IsWGYMwQhemfn3scHtrgBNg1OCUEQ=; b=eLUDTwluxCXIKA5BsoMvn0e9KNN2lEOEL+dbLySO+O8iRx7srCPeIKvDaBye+ftb9q huEzWQMooyK04K9CdTcNsd+DYCSRZtwx2FnPewAwCgDGDwJXIjEsZWXKyMhfSXYEItOh m0KkmCBi4fvxFnRcVxXzg8HgtzwXme4Av5Ehc3dNzdVwTKFvpCmZTOTvIsfZcsHGE+Zu ln9+tIyITu0jIOc9Da/c0EEHQdTF2dmizO0mkjhChg/S2gg498SJ7jUZYQwUn76RN1lF G64xTQSNeMut3m9K483HLHebTGKzzTZFCwFNdVj9PWyLi+oTqYLD+vgtGClM46w2KJYx aAng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fB+27dHY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-183733-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be6884si1334736766b.758.2024.05.20.05.31.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 05:31:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183733-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fB+27dHY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-183733-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 B0B431F2314A for ; Mon, 20 May 2024 12:31:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26AE36214E; Mon, 20 May 2024 12:31:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fB+27dHY" Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F267612EB for ; Mon, 20 May 2024 12:31:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716208275; cv=none; b=O1wbsnOcJNiPVlWWQZXFw7nAzwnDiHrJPo3CgfX1zqXiKwY3oeG8NFwcJ2fS8+uCtLARJODc6Xq+iFyQeS1NpgYDyS3ljoz43+GviHacrbKl9psPGOC2ZI7FbgSjYCXbJQj6jZ9+bCkJL36S2bqSEBHY5Hlg2TwF+NNz5SkEIvk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716208275; c=relaxed/simple; bh=EShonQY2zDsALv6YQhO9ib6qoCyG9n3IUJVvv5yoQjo=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=a5TYn4xz93h0CrX25xm7V8NVZGDBslU8UxERR8pS7IeSs5SJJ8bt+NoIGb3eBK4pQtDB/gXT/5enpL8I1CFiIOExXp1ZOsXoqleNwa/tbDtRfw+X0HsufRPjwg80i/ifMySgxD1sQ6wmcc7ehgziGS2Jsxqk89NUn6T4kn3OOP8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fB+27dHY; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-51f174e316eso3198590e87.0 for ; Mon, 20 May 2024 05:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716208272; x=1716813072; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=xTV37OvPNxm097mdCjRk9kivbaQmKYdeu/uwsv44aes=; b=fB+27dHYixS2VsxVZmTA1ck9m/jLuvtQcsbKVX+arbcR9adJApp+7e7pWhTjvi0Y8j WGCcFv/WpugicSlvrhPXj3pmCOnvFXcVXuYh1qme2lilNcCk1jUirARNC5S2fm3gZKya /ACIk9ErlDaZkjicYZine80ot5oYyft/dunoUwhr44OghX+EJvbaTDmTDi26dxd9prQU XBlaoor7COK5d3Ebd3XcI3CAdpQ6ipy6RgA+QsPCuHIuApdDJscE389rAJYz5xOPCfnF OXvbCU0wmdXkNRpVDL4xkoyuPAIs2CAjSmdQqXtW0Pmew9QAPLHERi/sVMDBiocgDC7Y zc+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716208272; x=1716813072; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xTV37OvPNxm097mdCjRk9kivbaQmKYdeu/uwsv44aes=; b=APZmAhHbIDGAmq6tsQEEK/CqtvA7CaRWZv10nMBzckuaGqXYHfeX54df1YyyTGYH1b 39OraIDyA0g/PyS3ySLgKPncSrfbmtVSGS+MeQ0T0oGFqQk84MtQ1IhjSl+wT8cGLVRL i15sZNt5yy4u1H9TJo1EAovY+r1LPnTyD3RKxSztib5K3IOOMS83PQhBIdkGz+Yvc4VZ BfYAe14Ksg66SzdcECfsqlDWOudh99snTC6wllj80b8V/BQ9EF8OOJ/yl4eEnZinW1J4 Y6aYeRdO53R7EEZC5SdWAXT45LwTHN0ATQX7ysm39NvfnvV80JL2nqtfbXSKVCraIK2P rhFA== X-Forwarded-Encrypted: i=1; AJvYcCXMLKbDp89M9pD9sbRGfbnNCdWXZJr69lkG78fMPtjYXLWXUi5U+EYiUFUh74tbXO/A82+U0STTy6G1Rpw8Cm4vef50dcFJb4GAMFAQ X-Gm-Message-State: AOJu0Yx2ck3wuXaB68mdwM7Ctzfr2IyLtYYe/dDJ1n/1ogyOV1YuoqXd QQn1yP1py3JXqzlbXZ3B5o7Wj0DyF2A8IjlCswKN/6/HCjDOSUs9 X-Received: by 2002:a05:6512:3c9f:b0:51d:ab55:f2db with SMTP id 2adb3069b0e04-5220fa717f5mr23174649e87.10.1716208271434; Mon, 20 May 2024 05:31:11 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5238a14d64bsm2074664e87.258.2024.05.20.05.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 05:31:10 -0700 (PDT) Date: Mon, 20 May 2024 15:31:02 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Liam Girdwood , Mark Brown , =?iso-8859-1?Q?M=E5rten?= Lindahl , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] regulator: fix pickable ranges vsel caching Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MQgaS3VPhLaQvzhS" Content-Disposition: inline --MQgaS3VPhLaQvzhS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable This series addresses a potential problem where the voltage selector for pickable-ranges is used in same fashion as a 'apply-bit'. Eg, when a regulator voltage is changed so that also the range changes, the effect of the range and voltage selector change is not taken into account until the voltage selector is written to hardware. In such case caching the voltage-selector value will cause the voltage range change to not change the actual output voltage. Patch 1 addresses this issue by adding a flag to regulator desc to advertise this behaviour and by always writing the VSEL register value to hardware if range was changed. Patch 2 sets that flag to Texsas instrument's tps6287x driver because, according to the data-sheet, the TI's PMICs VSEL register must be always written after the range has been changed. Please note that this has not been tested in TI's hardware but the concept is only quickly verified on ROHM's BD71851. All testing is appreciated. Revision history: - v2: - Change series name to reflect content that is still not merged. - Drop already applied patches. - Add patch fixing TI's tps2687x. - Don't bypass cache for pickable-ranges users who don't have. the 'VSEL as apply' behaviour. - Bypass cache only if range was changed. - v1: https://lore.kernel.org/all/cover.1715848512.git.mazziesaccount@gmail.com/ series is base on regulator/for-next --- Matti Vaittinen (2): regulator: pickable ranges: don't always cache vsel regulator: tps6287x: Force writing VSEL bit drivers/regulator/helpers.c | 43 ++++++++++++++++++-------- drivers/regulator/tps6287x-regulator.c | 1 + include/linux/regulator/driver.h | 3 ++ 3 files changed, 34 insertions(+), 13 deletions(-) --=20 2.45.1 --=20 Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =3D]=20 --MQgaS3VPhLaQvzhS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmZLQn0ACgkQeFA3/03a ocVXxAf/eNpKlT3d/ANnNoL1BEmddIi/7e8g3WJrS5H1/1Z5BC+cqZVXPfugKgXy YZeJo7Pb8+hBafaQSVsZdzHWBgEu//SGabvPUbfhYP6JzlcX9UNSkrNG/EKYX3CZ GGoUnsxwh0n3lGOf6lc5cwk4ZybqwYHji4BBNVmmGmsgzcjVrX58712XbXdVthNy w1K9MTJ4elPrgaBrf1cJAbJg+7u7FA9zBxWm8f0SH90Jx65fix63zAvi3chfcqvE F6QVAGJ2LDWljB4ggXkHsUgt/c2sV7yh5zFdGKlW+6WJu5UC6rf/kV46wL6ORFuS LWbVDp2LlyVEVeBAG6QswHuaTsPxEA== =3tAL -----END PGP SIGNATURE----- --MQgaS3VPhLaQvzhS--