Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp119970ybl; Tue, 13 Aug 2019 17:10:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuiLCPZ/HjGGKNS4ICsY8WNOf2zCH5gJ6sZ4X+4Y2kf3HUAUJUSYCeKrXeVbLcwcb0dj+I X-Received: by 2002:a17:902:2f43:: with SMTP id s61mr5951486plb.238.1565741427301; Tue, 13 Aug 2019 17:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565741427; cv=none; d=google.com; s=arc-20160816; b=c9n1iXaOyoClz8oMM1zPi4iNCq0ctPHCwpx4ciauzEeWya00v0H0czhWP13AWXnZR4 rv1POnwrKm5pdqkHJ9lQUlCqAPhXitazHp2OanYaXA16nfrBG3jOjkmReiud35LDfE7R FCCP78REi20qo8tdJLBA7U9R1hYCbVGfaHCFwQyIpcS6WH6MwvL7s5i/SrhDaZzKkzKO UyB7souRsMET21witRBJLkKJMLLK62uYYv8kPWCQ9y+VoAp6zSLpcOo+SbLiTokoVYl1 m0JcX06qaavgCipJiOU159jrGBqMo6RnS5VPORSEDM2B7qubj1LgxwRovb7xrFdRNWUu cf2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=o55tj+/aZrNzUgZeZQ5pqQWMkewfSKqJdVDZgTuDGvM=; b=qGxqi9d7ZOjDDVN6o7qK+0TCjwmDswA0MWLL89twmyIeNuBJaoca5q7FXQB6MEyo5G 0jZMfq1Gd6GQ6PihCzjCQ60uUgLrQDIkvvC37O+zCDdfqpcK6/n+K0cr/2GREGuninXj aaa246PDJUK7nTnOA+rAUEoIzRQz86idRd5iGB6O1RkAjgRdXsHuWq0zrieZq8NsiJdd dQafEl0ReSJlyT1fWXSrrxnRdcLFly3KKjOJ918Jp+gggm8ad+u2/NSqJmAV/sVXab9y uXfLUEWq2p1eOQhemIX4cH9fg9UaMl2MQkIIkYqw1alC+b5c0bLQCgjKT4ninYWi2D37 PZqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vgaW+4fG; 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=pass (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 j27si56346273pgj.571.2019.08.13.17.10.10; Tue, 13 Aug 2019 17:10:27 -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=pass header.i=@kernel.org header.s=default header.b=vgaW+4fG; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726770AbfHNAJO (ORCPT + 99 others); Tue, 13 Aug 2019 20:09:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:60678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbfHNAJN (ORCPT ); Tue, 13 Aug 2019 20:09:13 -0400 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8891420844; Wed, 14 Aug 2019 00:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565741352; bh=NGCjQUMppzGC46S5+/+MwbDqpRJ6D0XRhJjiDj5cviU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vgaW+4fGXXlQYWi3ipOqfpuiyxg/c4cx4aTK5d0appRa+6m/AN5HvQkgbNiT1ADtP 3kL/zUdYLztowLI7bmCUX0uqcehExCUJS8JkB4IEHuUKdpN0DA3yFIBjfX9UTkms6B ykPMUYCxU/Ocp/LGrfVvG4Ut0J1y/dl8CLOIlQOQ= Received: by mail-wr1-f43.google.com with SMTP id t16so19262905wra.6; Tue, 13 Aug 2019 17:09:12 -0700 (PDT) X-Gm-Message-State: APjAAAWtXAf8VZ0m/HKZlqlElNo+7QX+k0ly1kgkSL/khswu/41iC1cj OMKtj+aUB8uCKrTFdktoA7KaglBW2hYDXs8JM3A= X-Received: by 2002:adf:f90e:: with SMTP id b14mr489711wrr.124.1565741351010; Tue, 13 Aug 2019 17:09:11 -0700 (PDT) MIME-Version: 1.0 References: <1565686400-5711-1-git-send-email-light.hsieh@mediatek.com> <1565686400-5711-3-git-send-email-light.hsieh@mediatek.com> In-Reply-To: <1565686400-5711-3-git-send-email-light.hsieh@mediatek.com> From: Sean Wang Date: Tue, 13 Aug 2019 17:08:59 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 2/5] pinctrl: mediatek: Supporting driving setting without mapping current to register value To: Light Hsieh Cc: Linus Walleij , "moderated list:ARM/Mediatek SoC support" , "open list:GPIO SUBSYSTEM" , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Light a few nitpicks, but the overall changes look good to me On Tue, Aug 13, 2019 at 1:53 AM Light Hsieh wrote: > > From: Light Hsieh > > Mediatek's smarphone project actual usage does need to know current value > (in mA) in procedure of finding the best driving setting. > The steps in the procedure is like as follow: > > 1. set driving setting field in setting register as 0, measure waveform, > perform test, and etc. > 2. set driving setting field in setting register as 1, measure waveform, > perform test, and etc. > ... > n. set driving setting field in setting register as n-1, measure > waveform, perform test, and etc. > Check the results of steps 1~n and adopt the setting that get best result. > > This procedure does need to know the mapping between current to register > value. > Therefore, setting driving without mapping current is more pratical for > Mediatek's smartphone usage. > > Change-Id: Iacdabf0cada230fc5acad96673810c12a6c4556d remove change-id > --- > drivers/pinctrl/mediatek/pinctrl-mt6765.c | 4 ++-- > drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 21 +++++++++++++++++++++ > drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h | 5 +++++ > drivers/pinctrl/mediatek/pinctrl-paris.c | 1 + > 4 files changed, 29 insertions(+), 2 deletions(-) > > diff --git a/drivers/pinctrl/mediatek/pinctrl-mt6765.c b/drivers/pinctrl/mediatek/pinctrl-mt6765.c > index 32451e8..e024ebc 100644 > --- a/drivers/pinctrl/mediatek/pinctrl-mt6765.c > +++ b/drivers/pinctrl/mediatek/pinctrl-mt6765.c > @@ -1077,8 +1077,8 @@ > .bias_disable_get = mtk_pinconf_bias_disable_get, > .bias_set = mtk_pinconf_bias_set, > .bias_get = mtk_pinconf_bias_get, > - .drive_set = mtk_pinconf_drive_set_rev1, > - .drive_get = mtk_pinconf_drive_get_rev1, > + .drive_set = mtk_pinconf_drive_set_direct_val, > + .drive_get = mtk_pinconf_drive_get_direct_val, I prefer to mtk_pinconf_drive_[get,set]_raw_val that would be better to understand. > .adv_pull_get = mtk_pinconf_adv_pull_get, > .adv_pull_set = mtk_pinconf_adv_pull_set, > }; > diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c > index 4687f63..23a9529 100644 > --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c > +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c > @@ -607,6 +607,27 @@ int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw, > return 0; > } > > +/* Revision direct value */ > +int mtk_pinconf_drive_set_direct_val(struct mtk_pinctrl *hw, > + const struct mtk_pin_desc *desc, u32 arg) > +{ > + int err; > + > + err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg); > + > + return err; > +} > + > +int mtk_pinconf_drive_get_direct_val(struct mtk_pinctrl *hw, > + const struct mtk_pin_desc *desc, int *val) > +{ > + int err; > + > + err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val); > + > + return err; > +} > + > int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw, > const struct mtk_pin_desc *desc, bool pullup, > u32 arg) > diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h > index 1b7da42..b3bada0 100644 > --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h > +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h > @@ -288,6 +288,11 @@ int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw, > int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw, > const struct mtk_pin_desc *desc, int *val); > > +int mtk_pinconf_drive_set_direct_val(struct mtk_pinctrl *hw, > + const struct mtk_pin_desc *desc, u32 arg); > +int mtk_pinconf_drive_get_direct_val(struct mtk_pinctrl *hw, > + const struct mtk_pin_desc *desc, int *val); > + > int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw, > const struct mtk_pin_desc *desc, bool pullup, > u32 arg); > diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c > index 28b4951..71c94b2 100644 > --- a/drivers/pinctrl/mediatek/pinctrl-paris.c > +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c > @@ -964,3 +964,4 @@ static int mtk_paris_pinctrl_resume(struct device *device) > .suspend_noirq = mtk_paris_pinctrl_suspend, > .resume_noirq = mtk_paris_pinctrl_resume, > }; > + remove unnecessary the empty line > -- > 1.8.1.1.dirty >