From: Dejin Zheng <zhengdejin5@gmail.com>
To: Light Hsieh <light.hsieh@mediatek.com>
Cc: linus.walleij@linaro.org, linux-mediatek@lists.infradead.org,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
sean.wang@kernel.org, kuohong.wang@mediatek.com
Subject: Re: [PATCH v7 2/6] Supporting driving setting without mapping current to register value
Date: Sat, 4 Jan 2020 12:48:01 +0800 [thread overview]
Message-ID: <20200104044801.GA13072@nuc8i5> (raw)
In-Reply-To: <1577799707-11855-2-git-send-email-light.hsieh@mediatek.com>
On Tue, Dec 31, 2019 at 09:41:43PM +0800, Light Hsieh wrote:
> 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:
smartphone ?
>
> 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 practical for
> MediaTek's smartphone usage.
>
> Change-Id: I8bd6a2cecc0af650923704589b5b90097b0ff77e
> ---
> drivers/pinctrl/mediatek/pinctrl-mt6765.c | 4 ++--
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 12 ++++++++++++
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h | 5 +++++
> 3 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mt6765.c b/drivers/pinctrl/mediatek/pinctrl-mt6765.c
> index 32451e8..1212264 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_raw,
> + .drive_get = mtk_pinconf_drive_get_raw,
> .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 d63e05e..2247eae 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> @@ -608,6 +608,18 @@ int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
> return 0;
> }
>
> +int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
> + const struct mtk_pin_desc *desc, u32 arg)
> +{
> + return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg);
> +}
> +
> +int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
> + const struct mtk_pin_desc *desc, int *val)
> +{
> + return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, 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-mtk-common-v2.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
> index 1b7da42..75d0e07 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_raw(struct mtk_pinctrl *hw,
> + const struct mtk_pin_desc *desc, u32 arg);
> +int mtk_pinconf_drive_get_raw(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);
> --
> 1.8.1.1.dirty
next prev parent reply other threads:[~2020-01-04 4:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-31 13:41 [PATCH v7 1/6] Check gpio pin number and use binary search in mtk_hw_pin_field_lookup() Light Hsieh
2019-12-31 13:41 ` [PATCH v7 2/6] Supporting driving setting without mapping current to register value Light Hsieh
2020-01-04 4:48 ` Dejin Zheng [this message]
2020-01-17 8:35 ` Sean Wang
2019-12-31 13:41 ` [PATCH v7 3/6] Refine mtk_pinconf_get() and mtk_pinconf_set() Light Hsieh
2019-12-31 13:41 ` [PATCH v7 4/6] Refine mtk_pinconf_get() Light Hsieh
2019-12-31 13:41 ` [PATCH v7 5/6] Backward compatible to previous Mediatek's bias-pull usage Light Hsieh
2020-01-07 10:40 ` Linus Walleij
2020-01-07 12:16 ` Light Hsieh
2020-01-07 13:26 ` Linus Walleij
2020-01-17 9:18 ` Sean Wang
2019-12-31 13:41 ` [PATCH v7 6/6] Add support for pin configuration dump via debugfs Light Hsieh
2020-01-17 9:05 ` Sean Wang
2020-01-02 9:02 ` [PATCH v7 1/6] Check gpio pin number and use binary search in mtk_hw_pin_field_lookup() Yingjoe Chen
2020-01-17 8:30 ` Sean Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200104044801.GA13072@nuc8i5 \
--to=zhengdejin5@gmail.com \
--cc=kuohong.wang@mediatek.com \
--cc=light.hsieh@mediatek.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=sean.wang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).