Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1982825yba; Sat, 27 Apr 2019 11:22:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOn7xbdGZH52eSChW6O7L664SUAgAMpO0BbvG8OvvrqIUoudOsnwsGBiHYDtDymkeVoxCu X-Received: by 2002:a65:6289:: with SMTP id f9mr3722804pgv.380.1556389354726; Sat, 27 Apr 2019 11:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556389354; cv=none; d=google.com; s=arc-20160816; b=ZYm8OKod1ZHzgJ7j7hwp14vXemhQBjrczBO1+y3SuxYy4BvSiglwvyEV/zkwHqLeDP GgXaQf8FzexRaBmRBDdLmCXIiyOiUtTegWgdL44+Z1PRbsp+hgSbBjij04Vodr+edNgN OQtO3vk22vx3w1LJXDpiZ4FuSV/TLBzTtQV/prjtJy7WlPEXxfF6t2x8YS8wTY82apfl +XKuMFT8Fyv4ocRX4m4DbKlgSizdBFAK+sQAQCcaStPOvuZFpJEcLmu7MWQcaesIGXVW XUZsYUBk0/LviXRtSVoPe4cQZ5pI9U3qbPfltS3HFhKdps99GYtkIyYI6odyoCeLg5hC UuVQ== 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=p01vbJpyOWJAdEXdJU0OCfw6W6SYYsQSTTr9W3aE80M=; b=VNmccFZ+1BIvubq8avwcxR9UwfVoZao261WebKi6G2G29tslZR6wZux93xoJ8nIBhm Lna/PizDXUOxRQZGsrv9NEht2gGg3VRZT0ni2yNNKhk1oDeYUhhD2VK++qyZ8MnZNFic F3PuTd3kTVtjKoKhmnQSFhPjXqB+Fhc8g9E0CwKaQAxZ1/MSfblC+AXNElYgIR/605y9 muFxmaCDYt/IrT+RHyv/y6BZHnR0/QlXYOKlIaP7DNvwycXJfvXcYJxKH31vt9C7FtP+ pDWBHM/e0ER6gUtDqBxwtV5YO6OZeKCv5hrqscdQFASIB9G90lEj0Zm3/+YlPlRYZnh3 vAPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=oJ1uFElZ; 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 b15si17785569pgl.2.2019.04.27.11.22.19; Sat, 27 Apr 2019 11:22:34 -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=oJ1uFElZ; 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 S1726324AbfD0SV2 (ORCPT + 99 others); Sat, 27 Apr 2019 14:21:28 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:34232 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbfD0SV2 (ORCPT ); Sat, 27 Apr 2019 14:21:28 -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=p01vbJpyOWJAdEXdJU0OCfw6W6SYYsQSTTr9W3aE80M=; b=oJ1uFElZv1svSo9snDycG0e8y X48y5Srs/Ekw8ZvHe6Od0d3EayaPfXx2H79dKk9/lxbXPDG1wUIDDzU+rWqiyA+ExIDZSzmVRqvLb 8MGoXm/TgudGdCH7HjrW0xDCfvA5HEc3F4yFVR5AXbzxsQDSWOsafg76J0wJBGqUEV0MU=; Received: from [211.55.52.15] (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 1hKRwq-00053h-RE; Sat, 27 Apr 2019 18:21:17 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 54AE1441D3B; Sat, 27 Apr 2019 19:21:13 +0100 (BST) Date: Sun, 28 Apr 2019 03:21:13 +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: <20190427182113.GL14916@sirena.org.uk> References: <1548675904-18324-1-git-send-email-jorge.ramirez-ortiz@linaro.org> <1548675904-18324-3-git-send-email-jorge.ramirez-ortiz@linaro.org> <20190204090301.GC23441@sirena.org.uk> <95276ca0-6896-a595-867a-184a518fa31f@linaro.org> <20190425183736.GF23183@sirena.org.uk> <022b3c6a-e356-3c5a-3c46-c6edcf4f8cd5@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sCNd3Ivk/oijKKf1" Content-Disposition: inline In-Reply-To: <022b3c6a-e356-3c5a-3c46-c6edcf4f8cd5@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 --sCNd3Ivk/oijKKf1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 25, 2019 at 09:44:00PM +0200, Jorge Ramirez wrote: > the way I see it, if I follow your suggestion and since we are not > allowed to extend spmi_regulator_find_range(), the only options are: > 1) duplicate verbatim this whole function > (spmi_regulator_select_voltage_same_range) with a minor change (this > amount of code duplication in the kernel seems rather unnecessary to me) > 2) modify the struct spmi_regulator definition with a new operation that > calls a different implementation of find range (seems a massive overkill) Since the point of this change is AFAICT that this regulator only has a single linear range it seems like it should just be able to use the existing generic functions shouldn't it? It just needs it's own set/get_voltage_sel() operations. As far as I can see the main thing the driver is doing with the custom stuff is handling the fact that there's multiple ranges but that's not an issue for this regulator. It's possible I'm missing something there but that was the main thing (and we do have some generic support for multiple linear ranges in the helper code already, can't remember why this driver isn't using that - the ranges overlap IIRC?). TBH looking at the uses of find_range() I'm not sure they're 100% sensible as they are - the existing _time_sel() is assuming we only need to work out the ramp time between voltages in the same range which is going to have trouble. --sCNd3Ivk/oijKKf1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlzEnZYACgkQJNaLcl1U h9Be2wf/Ts0rAq3XrujapmG1sE36u6DgwDxHfPpMSejg40goWEljc2BT0WnUwqiC NRj8O2f8zXZJ6jEofNYk6dOO17ej93naTtIO34nDIU7KSB0q0DhyApUTMwGiFuC9 b5Aoa1EvRAaqQ/Pr9n8XUHnDxgCJsMzDxz9w6dXlT0fgDnvoFnQAL1OYaHZjwb72 Sgp/3sJSpniaTGO+F3QaSV/lmGJ/7bMRvvNSQZOpwYc10YRmuFOGcGw2WZp71G4q XUlyxvscZ77dvHs3p/p87mwuzJID6ZTxnIFcH3ScemFJE6DDSN4aRb1gfVZtrOIS qdrDP4sKHBDd+xxxcUqJVBtZaWHK/Q== =RPrf -----END PGP SIGNATURE----- --sCNd3Ivk/oijKKf1--