Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2172192yba; Mon, 6 May 2019 00:38:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXNCHyk4hTUOqEPH/+ec9i3mY8r/CugmH/j0lkH4zQ0qQfcBMXpg3Yn3be1nnXPkR7lCRq X-Received: by 2002:a62:86ce:: with SMTP id x197mr5909259pfd.218.1557128332696; Mon, 06 May 2019 00:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557128332; cv=none; d=google.com; s=arc-20160816; b=Kb2GpvcCJFr2jWhhPUK/ZCjLd0Zt5slisFarF4iIusE9GyX8xfVXuPy3GCbBd74u1g nAk2x61vU1TN749bETblus1dQ3aevI5DZEoW0yliQbigEFVUcw6jNunCou2hV+6A+Ajs iSKn/1oEaOTCSq4p7dURVcrTQ02l9cS0cFEtAzBu7h028gCDsVX9o0jFzVENSYoslyfy GW6f2ghwyrJYN36NqScIEy3o1WnOKmvIGvXODrXgfEdojtbMUTf8PrmZRCM3zwJ4l5rn kbyXg+e+LLvZvwVDXKWcAPVY8P9K6Qas2j4JUGfYF1F0UGF8oZUT0YxCX/z3oZcULc97 khNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=q/JBvH8ocBJRDInrHMuqhLFgpwZ/1CDyM2bB8iVm+1Q=; b=kcrvZZAPvxNB0brUP9lhEsvKBGHUGBSHX/GiGSOdJWTNDJ0oNVK8IOYJD5NX+TktZG VCwfApfcymMHBZQu/A2wYor028MqY1V3Js4PfYDQPXqikBABmHz+EWppn3VONVQdjy0c gorUcxbEj/OJJ5YTRIuj82IV/luzl0gfvY0r///v1UuAcCSJdHzZYCCAgimrguUzSSBM Rw/h9qF4kHQgw52pK6DWJJnICMqDNn5jMTCD5vvqxfJ3EkDefLxHfvQJ+gWHlTxcwIb0 QLyzsWYqdPnjqcohoHjpiDjmVKjQS/oxSgjnsOI0y/ZTPJoHWO9q3GByZ3LTZ53bOcvM HU1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=q3BZziWW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si15055407pld.78.2019.05.06.00.38.36; Mon, 06 May 2019 00:38:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=q3BZziWW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726348AbfEFHhp (ORCPT + 99 others); Mon, 6 May 2019 03:37:45 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:38904 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfEFHho (ORCPT ); Mon, 6 May 2019 03:37:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=q/JBvH8ocBJRDInrHMuqhLFgpwZ/1CDyM2bB8iVm+1Q=; b=q3BZziWWw5XKK40iJ4F4q0pNq dfknWEHZk0VDTavM7TFIgK8W83a1x2Jhf/nad0JPZHvS2CrDs1F/LC1i1ooIUM5Ot2pyhCIR+u+iS /BAVmbNBb5ZCqqOeD4URO3C0CtFyV12sT/c8PNyDDimdJepfmASvb/MM3dLJMH/eQPrPE=; Received: from kd111239184067.au-net.ne.jp ([111.239.184.67] helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hNYBs-0000s6-Az; Mon, 06 May 2019 07:37:36 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id CB81D440034; Mon, 6 May 2019 05:38:09 +0100 (BST) Date: Mon, 6 May 2019 13:38:09 +0900 From: Mark Brown To: Jorge Ramirez Cc: lgirdwood@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, bjorn.andersson@linaro.org, vinod.koul@linaro.org, niklas.cassel@linaro.org, khasim.mohammed@linaro.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 2/3] drivers: regulator: qcom: add PMS405 SPMI regulator Message-ID: <20190506043809.GL14916@sirena.org.uk> References: <20190502023316.GS14916@sirena.org.uk> <20190503062626.GE14916@sirena.org.uk> <229823c4-f5d4-4821-ded1-cc046dd0bd20@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Ahst0DKxuyFxAqHk" Content-Disposition: inline In-Reply-To: <229823c4-f5d4-4821-ded1-cc046dd0bd20@linaro.org> X-Cookie: -- I have seen the FUN -- User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Ahst0DKxuyFxAqHk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, May 03, 2019 at 10:29:42AM +0200, Jorge Ramirez wrote: > On 5/3/19 08:26, Mark Brown wrote: > > On Thu, May 02, 2019 at 01:30:48PM +0200, Jorge Ramirez wrote: > > It seems a bit of a jump to add a new driver - it's just another > > descriptor and ops structure isn't it? Though as ever with the Qualcomm > > stuff this driver is pretty baroque which doesn't entirely help though I > > think it's just another regulator type which there's already some > > handling for. > So how do we move this forward? > To sum up his regulator needs to be able to bypass accesses to > SPMI_COMMON_REG_VOLTAGE_RANGE and provide the range in some other way > hence the change below > I can't find a simpler solution than this since the function does now > what is supposed to do for all the regulator types supported in the driver The assumption that you need to have this regulator use functions that use and provide ranges is the very thing I'm trying to get you to change. It looks like these regulators just need their own set_voltage_sel() and get_voltage_sel() then they can use the standard linear range mapping functions (and pobably the set_voltage_time_sel() needs fixing anyway for all the other regulators). There's already some conditional code in the probe function for handling different operations for the over current protection and SAW stuff, this looks like it should fit in reasonably well. Usually this would be even easier as probe functions are just data driven but for some reason more than usual of this driver's data initializaiton is done dynamically. --Ahst0DKxuyFxAqHk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlzPujEACgkQJNaLcl1U h9AkRwf9GK2o9cZ1OLFJrB/8tsboZ5JASZWrWkJyQhXcVyS0lEb46C0dmGfdx0QC K7zSOESXrHeOCwevpiCnlpBRtc8pP4raU2rWA4VgE7c7zASR2CITmJOpBDyAkZ6z lLSC2Tj++glpX0avpR3ySlj0jPOSi2J5Ya3J8Waa3FQZmACUOuSBWRwidw27JZqE 2ya2yxvRLHvqy8CFqTXPgW2tOnI++sKwNsbJj7dKSjCHPT4NjALwGHGevcSlxYvn z21RkjOTzCm2jtUPphaEbecZW1MJzcjX+lJD7Io0e3tVveT5RUhX2Vd0IbPzyXGp s5taJbNKU1udzdqgETiAHg711RKazw== =ojFG -----END PGP SIGNATURE----- --Ahst0DKxuyFxAqHk--