Received: by 2002:ab2:7104:0:b0:1f7:f6c3:9cb1 with SMTP id z4csp42985lql; Tue, 7 May 2024 09:16:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+/tOUeNnTBhM69hV23wptumUYhim43fOSuKmxnpSacaI54YYMBHxijHiMYFJd+9nAo7m7YunnWR6/eTbPLfG6XPcv18DdjtE6wShqSA== X-Google-Smtp-Source: AGHT+IHXrTwUGDhwNCIC2j9bV0M67p8GndAP6IJv09Nu0X3vwyxaCHfsETJng3PE7bo/JyP/K4HT X-Received: by 2002:a05:6a20:9712:b0:1a7:2f39:f0cf with SMTP id adf61e73a8af0-1afc8d513cemr179736637.26.1715098609600; Tue, 07 May 2024 09:16:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715098609; cv=pass; d=google.com; s=arc-20160816; b=kKsegHxfsFKihRSBw51CQpkK7maaCtu5zxnSNdjNZMJR6L9uIWEPKMP0Bjho5FQyLD XuTIEURynEZVw8+ExyhZsY2TCsNJ5jcA+gPxWmIPoyRt3SVxAzAGVCviWrU6uPnL+kao KB/TsS2oPVEadFINlmDy63Of9VM8ibx1Q+6tRa7VYGZYpoPdO5DF00Cqi2TYZJno0Ghs 4QEIIbfXGcgzXN4hEBXaU3XBgO6uZ5ZOJJN428mI4gkQxPewgwws58kdVaeJYSdteG2Y VrVd8L6NHsXd8K+pKqQSCbE/26jIuUDFiB23cfGCRiwhuGMfr77TbdB8tMImRUst2jBM hjCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YK2NhrQCwAQ4bjAoS4Tvj+7TK9vqx2EigIT4NalgNhQ=; fh=At6lIJW7ZCUq1yHolNCcONaKRnihWalRu9CwHTuZ4vc=; b=i/DcA5mzJ7007IZFMWzsVXr5TBKDAhzYV/QYLH5dSgO4P6TS132emUbtSs2BSGkUnr gc92ypCukEk1xbV8b6GQ1kEZZZkyWDUgaCeMcn7Tosc/LmVQuM2rCtFebECla05jziEH bE32ddInOykjn42d9S9Ge3Z+NiE3CVcH183m4qMkxGw++N1CM2R0kXgS7s4s1fWwiNPD 0ZarYb/PGKk1uZRlAIUI20s05U0C5h+GfsPr9wkKEiSe6w1+h2hYyZv3Qfcyyaba+3FP IXAGEVNtdM/tPSa9I1wuQbCxvQWEvcL0IbVsgnotkoEacOdr6J94PH+yk6J6rMC/kW52 LLvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AMbZQAM4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171723-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171723-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r22-20020a170902be1600b001eb5323f9dfsi10254366pls.233.2024.05.07.09.16.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:16:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171723-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AMbZQAM4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171723-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171723-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3F32EB21EC0 for ; Tue, 7 May 2024 15:52:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9908F168AFD; Tue, 7 May 2024 15:52:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AMbZQAM4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B3BB615E1E2; Tue, 7 May 2024 15:52:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715097134; cv=none; b=Jfz3NXRtLINOvL0KN5z5JraXiWhRq4xKKbOVYAk0uuvYLlK/Z+wPdLKiAyTdYk+Phyuf0LxlAR08GmD6PvUpPZIinv1uUSOL1LJ0jpFGvOftM/ZWd9VmvdcVtSMTUzRiX0FABRHiRVAYDraCeglyci8g//ie3wIso6ce+9B60W4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715097134; c=relaxed/simple; bh=P2vSRZtRgkdxOqQUeJVty78/jCAKTgcuzaOvxK4M7eY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EM43cGpNQb3HjyN1+2TqszcWcQVN1pKIQfENJqV/347Avnlm1zinPj7iMcehA8PB5akr7+NpHrMfXqLL8QNZcx+dO90rNLOrCSeUxkqGj4nCecPsZMkH2Nv/t6NTMlSb0lBtF8yBEAsKFBd+wdU0UdcTYXmgx0IIfWVXLZoIFu8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AMbZQAM4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45A03C2BBFC; Tue, 7 May 2024 15:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715097134; bh=P2vSRZtRgkdxOqQUeJVty78/jCAKTgcuzaOvxK4M7eY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AMbZQAM4JyVqwNOuBsPbY21+XXdFF5F4D6e9MTQ5hdPTaO2K/2viznyAjPuKKpz1d bIhCJSPJKicfCGWqEmIimQ8yNs2mKbTKRRrIMQXL4qei7CyESWAKNz8xq4Lz5JJo0M nAkRko4hFKqJIxL9x/XpfU4++M7+qBYpo5whDIIQVG+yanbNVGzk2p5r8PM8CCnyIq JIf7/lH0XWXLDS3RblvBugKeDT+o8bJsgs06y6H2K/bGHqfudfneTrD1aLgE1oU6Jw 5KpQyguCsH/xgSyuP/Rr5t0dyPFYtbyxXrzP7wyQgm0s4HlmKJuptqOsvbdi+d0Dr+ 4hov+wWA3y01w== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s4N71-0000000057F-3roK; Tue, 07 May 2024 17:52:16 +0200 Date: Tue, 7 May 2024 17:52:15 +0200 From: Johan Hovold To: Konrad Dybcio Cc: Johan Hovold , Lee Jones , Mark Brown , Linus Walleij , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Das Srinagesh , Satya Priya , Stephen Boyd , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH 12/13] regulator: add pm8008 pmic regulator driver Message-ID: References: <20240506150830.23709-1-johan+linaro@kernel.org> <20240506150830.23709-13-johan+linaro@kernel.org> <6dc632b0-792c-49c8-9f66-43f7a14789cc@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6dc632b0-792c-49c8-9f66-43f7a14789cc@linaro.org> On Tue, May 07, 2024 at 01:48:30PM +0200, Konrad Dybcio wrote: > On 5/6/24 17:08, Johan Hovold wrote: > > From: Satya Priya > > > > Qualcomm Technologies, Inc. PM8008 is an I2C-controlled PMIC containing > > seven LDO regulators. Add a PM8008 regulator driver to support PMIC > > regulator management via the regulator framework. > > > > Note that this driver, originally submitted by Satya Priya [1], has been > > reworked to match the new devicetree binding which no longer describes > > each regulator as a separate device. > > > > This avoids describing internal details like register offsets in the > > devicetree and allows for extending the implementation with features > > like over-current protection without having to update the binding. > > > > Specifically note that the regulator interrupts are shared between all > > regulators. > > > > Note that the secondary regmap is looked up by name and that if the > > driver ever needs to be generalised to support regulators provided by > > the primary regmap (I2C address) such information could be added to a > > driver lookup table matching on the parent compatible. > > > > This also fixes the original implementation, which looked up regulators > > by 'regulator-name' property rather than devicetree node name and which > > prevented the regulators from being named to match board schematics. > > > > [1] https://lore.kernel.org/r/1655200111-18357-8-git-send-email-quic_c_skakit@quicinc.com > > > > Signed-off-by: Satya Priya > > Cc: Stephen Boyd > > [ johan: rework probe to match new binding, amend commit message and > > Kconfig entry] > > Signed-off-by: Johan Hovold > > --- > > I'm a bit lukewarm on calling this qcom-pm8008-regulator.. But then > qcom-i2c-regulator or qpnp-i2c-regulator may bite due to being overly > generic.. Would you know whether this code will also be used for e.g. > PM8010? Yes, for any sufficiently similar PMICs, including SPMI ones. So 'qpnp-regulator' would be a generic name, but only Qualcomm knows what PMICs they have and how they are related -- the rest of us is left doing tedious code forensics to try to make some sense of this. So just like for compatible strings, letting the first supported PMIC name the driver makes sense as we don't know when we'll want to add a second one for another set of devices (and we don't want to call that one 'qpnp-regulator-2'). On the other hand, these names are now mostly internal and can more easily be renamed later. Johan