Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4067649ima; Mon, 4 Feb 2019 09:37:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IZRFWC9oMc0ZD30mD7l8RArAC9B+MT+UmDop+khdpB+H5Q3ckRPiqCn7xo8ZvMrbYlhKgGi X-Received: by 2002:a17:902:2ac3:: with SMTP id j61mr507401plb.185.1549301860976; Mon, 04 Feb 2019 09:37:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549301860; cv=none; d=google.com; s=arc-20160816; b=Mhg0LwIV4kmX9wd1DZslFvrAy7AA4dmDXyoMCWXd4DP/L5vri3mLWbM87CUpn9i4P3 TRuNdje5IgU9AJt4fXl9tKbwdMMHas7ZZN34tGBvxKl8P9v9BiaLjwGnvP2MGc8dqvB9 kJPRHYeUqhGVjy0w32i6tS8gZVx8BUXMokjLxd8hCN2eWqkI8yggFTWiSx2PdqSf7QNG qDKMfyNq/C6eynvO+2jhPLHDmjwvpuDwXVyzMekpavyIHi/Ia++aFuLOfPVqLgwQIWJ/ MdsHmTYsXkXY6gT/BUmj5ymPavVVJKstpEfm48at7K6l8PbQJpNugkLkw1SAt9aSDqKw f1yg== 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; bh=77m/WaAHa+Nze+yFSSYeEwoZFGP0iu4CwSfBgab7aJU=; b=YIbRIrlOB7mjMMJ71amGVkVQlg4Z8gb7+Q+bkkQbjFz1co++8GRtt8Ep5ZnOqA/RyS ThYDVCW6vGgsGITM5H2MXzwE7p6A7SGl8wnf1iPcekw3QHVds7WtcKEUcPYWRfzeX/7g So4HCzwRbpBG7uHc4X5tumf5EP6AC9E5VO74lEzcdNcy8p2TkxfKezYoUA9sudfUaax1 oSMuMr5Pqe1QFSMgr47Oti6reRXBqttHUNzwUE1YE4NpdKn5kr3wFuWZM+cLVKKE7JXd 43klxlGVYg4WMMa0fx4TKnIn2E66ip1zbys6wejTXUflHMsZMOHpk1mQ9cqddMioP6sa P4tw== ARC-Authentication-Results: i=1; mx.google.com; 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=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si508155pfi.228.2019.02.04.09.37.24; Mon, 04 Feb 2019 09:37:40 -0800 (PST) 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; 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=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728026AbfBDRfa (ORCPT + 99 others); Mon, 4 Feb 2019 12:35:30 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:45138 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbfBDRf3 (ORCPT ); Mon, 4 Feb 2019 12:35:29 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x14HYC54005426; Mon, 4 Feb 2019 11:35:25 -0600 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail3.cirrus.com ([87.246.76.56]) by mx0b-001ae601.pphosted.com with ESMTP id 2qd8graet5-1; Mon, 04 Feb 2019 11:35:25 -0600 Received: from EX17.ad.cirrus.com (ex17.ad.cirrus.com [172.20.9.81]) by mail3.cirrus.com (Postfix) with ESMTP id CAC686255C5C; Mon, 4 Feb 2019 11:35:32 -0600 (CST) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Mon, 4 Feb 2019 17:35:24 +0000 Received: from imbe.wolfsonmicro.main (imbe.wolfsonmicro.main [198.61.95.81]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id x14HZNWw029893; Mon, 4 Feb 2019 17:35:23 GMT Date: Mon, 4 Feb 2019 17:35:23 +0000 From: Charles Keepax To: Mark Brown CC: Axel Lin , Liam Girdwood , Subject: Re: [PATCH] regulator: lochnagar: Fix n_voltages setting for VDDCORE Message-ID: <20190204173523.GM3837@imbe.wolfsonmicro.main> References: <20190129030156.2024-1-axel.lin@ingics.com> <20190129095438.GJ3837@imbe.wolfsonmicro.main> <20190129180547.GI10524@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190129180547.GI10524@sirena.org.uk> User-Agent: Mutt/1.5.20 (2009-12-10) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902040136 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2019 at 06:05:47PM +0000, Mark Brown wrote: > On Tue, Jan 29, 2019 at 09:54:38AM +0000, Charles Keepax wrote: > > > Hmm... I think this might need a little more investigation, it > > does indeed fail at present (amazing that it works upto exactly 1.2V > > which is common the usecase) but this feels more like a core > > problem. There are indeed only 57 valid voltage settings as the > > range is 0x8 - 0x41, but it seems that presently the core treats > > this less as n_voltages and more like max_selector. Should we > > perhaps be teaching the core to understand the min_selector > > instead? > > We've not had a need for this before but that seems like a reasonable > addition. Ok been looking at this last couple of days and I am not so sure it was a good idea after all. There are basically two options: 1) Update the usages of selector so it is consistently an index into the available voltages. 2) Update the handling of n_voltages so that it is converted to max_selector when used. Both of these really seem to end up with code that is more complex than the current system. You end up needing to always specify or calculate and store the minimum selector and maybe the maximum one. This needs handling across the various different schemes for specifying the voltage ranges for the regulators. So I am adding my ack to the patch, and think we should really just apply Axel's fix. Acked-by: Charles Keepax One thought that did cross my mind, would we be tempted to rename n_voltages to max_selector? It would be more consistent with the current usage, although its a horrible big change that doesn't really make any functional difference. Thanks, Charles