Received: by 10.192.165.148 with SMTP id m20csp539298imm; Wed, 25 Apr 2018 03:57:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/nQoI0iqF0cT3sp3T+YsBT1LsNfzv8tu672MDrhjAOgc5iIAVR8ORlEWvvUtSZwtShALcX X-Received: by 2002:a17:902:42a5:: with SMTP id h34-v6mr28634035pld.65.1524653830381; Wed, 25 Apr 2018 03:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524653830; cv=none; d=google.com; s=arc-20160816; b=SLqgSxDo0R4PavuBTexyzbKvFirSz5fxevHZEJ/ezAa/z9AEgxSKZ7Uu7PHkKA/qTS b8DU/nlQgGAfQLcHK22YHzLNYUojpe8cjPgkNqMVE0ibCelIIGrGcMD4QNELVB8NqAuz Oa4NVOMB8tuQb5Di2+cKE8k+DO282i8jD6GKgdvCwzO2P/OMlvOqng2/L/jSDSNIHnC0 KHH8TPZV030Odse4ku8gWbsQMX/inEYupyxC1eh0G1QAITGkDXbWqzZQbiMYBBgYXZRJ VbVnWFwKn/u992n9KiMGKktT2ADjAb5BB/dL1xcqjl7wLfCGUUHA5W9RaUFxol8ZENqr Jvtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to:date :arc-authentication-results; bh=RMh1oqASPbNUS1MeOLnB4CoTSaMAER09AVll+ven7e8=; b=u4+XikVaDkiRXvFnlHQ/8czgtFFLmg9WLWNh0AE41Qnmfy/KPcu1wzfYDl/qBOT9CG ncI0FSmvBa4PAKdlCKB11gStjfg14e/JOPzEgAbuOWlIc+q4LBVSS+k3I0fsdU/7NTyp HVNgSj93a2G4yG186choQ2AJHZDIo/qMDTIjhj5QFFkCRFFRschNeyofrCCXVyfCR/6W 5vxxcbNgygLyqhonb5WENEfk62z7sUgE3vXtV1hYWN1QjgHTgfg6zCJ9zh8Q1Ce8DUqs S3wFPt+BANrrNYRRJ0cLqkZOUBhTjpFRWr6c1yq6m1/QnQ4zZWOJ9H5PW/cUe/uhgNbd N23g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 131si15129224pfa.246.2018.04.25.03.56.56; Wed, 25 Apr 2018 03:57:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754262AbeDYKz5 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 25 Apr 2018 06:55:57 -0400 Received: from hermes.aosc.io ([199.195.250.187]:33621 "EHLO hermes.aosc.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752520AbeDYKzy (ORCPT ); Wed, 25 Apr 2018 06:55:54 -0400 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id 15E134E756; Wed, 25 Apr 2018 10:55:47 +0000 (UTC) Date: Wed, 25 Apr 2018 18:55:10 +0800 In-Reply-To: <20180425105309.GC24769@sirena.org.uk> References: <20180423144657.63264-1-icenowy@aosc.io> <20180423144657.63264-3-icenowy@aosc.io> <20180424170733.GD22073@sirena.org.uk> <20180425105309.GC24769@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH v3 2/3] regulator: add support for SY8106A regulator To: Mark Brown CC: linux-arm-kernel@lists.infradead.org, Ondrej Jirman , devicetree@vger.kernel.org, Maxime Ripard , linux-sunxi@googlegroups.com, Liam Girdwood , linux-kernel@vger.kernel.org, Chen-Yu Tsai , Rob Herring From: Icenowy Zheng Message-ID: <15C93A9B-6EEB-49EB-A942-35F761E86569@aosc.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 于 2018年4月25日 GMT+08:00 下午6:53:09, Mark Brown 写到: >On Wed, Apr 25, 2018 at 07:41:35AM +0800, Icenowy Zheng wrote: >> 于 2018年4月25日 GMT+08:00 上午1:07:33, Mark Brown 写到: >> >On Mon, Apr 23, 2018 at 10:46:56PM +0800, Icenowy Zheng wrote: > >> >> --- /dev/null >> >> +++ b/drivers/regulator/sy8106a-regulator.c >> >> @@ -0,0 +1,176 @@ >> >> +// SPDX-License-Identifier: GPL-2.0+ >> >> +/* >> >> + * sy8106a-regulator.c - Regulator device driver for SY8106A > >> >Just make the entire thing a C++ comment so it looks consistent and >> >joined up. > >> SPDX identifier is special -- it should be in a seperated >> comment block. > >No, it just needs to be a C++ comment on the first line to ease machine >parsing. The rest of the file doesn't matter for that. Okay. Thus I will use a seperate /* */ block for it in the next revision, to follow the rule. > >> >> + if (reg & SY8106A_GO_BIT) >> >> + return reg & rdev->desc->vsel_mask; >> >> + else >> >> + return (chip->fixed_voltage - rdev->desc->min_uV) / >> >> + rdev->desc->uV_step; > >> >You could use the standard get_voltage_sel() if you provide a >mapping >> >operation that set everything with _GO_BIT set to return the fixed >> >voltage. Though looking at this it seems that the fixed voltage >will >> >always be one that could be set via the register anyway so I'm >> >wondering >> >if the easiest thing here isn't to just have the driver turn off >> >_GO_BIT > >> Do you mean "turn on" here? > >Yes. Okay. I will do it in this way and drop custom get/set_voltage_sel.