From: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: chen.zhong-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
chenglin.xu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v4 4/7] soc: mediatek: pwrap: update pwrap_init without slave programming
Date: Tue, 10 Oct 2017 20:00:41 +0200 [thread overview]
Message-ID: <f3a04159-8491-6ca6-d2ad-7df1dfd64331@gmail.com> (raw)
In-Reply-To: <604078485ca9ab04cea5bc531425d6035b27bc88.1505980364.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
On 09/21/2017 10:26 AM, sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org wrote:
> From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
>
> pwrap initialization is highly associated with the base SoC, so
> update here for allowing pwrap_init without slave program which would be
> used to those PMICs without extra encryption on bus such as MT6380.
>
> Signed-off-by: Chenglin Xu <chenglin.xu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Chen Zhong <chen.zhong-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
> drivers/soc/mediatek/mtk-pmic-wrap.c | 91 +++++++++++++++++++++---------------
> 1 file changed, 54 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> index 27d7ccc..9c6d855 100644
> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> @@ -531,6 +531,7 @@ struct pmic_wrapper_type {
> u32 spi_w;
> u32 wdt_src;
> int has_bridge:1;
> + int slv_program:1;
> int (*init_reg_clock)(struct pmic_wrapper *wrp);
> int (*init_soc_specific)(struct pmic_wrapper *wrp);
> };
> @@ -999,9 +1000,12 @@ static int pwrap_init(struct pmic_wrapper *wrp)
> }
>
> /* Reset SPI slave */
> - ret = pwrap_reset_spislave(wrp);
> - if (ret)
> - return ret;
> +
> + if (wrp->master->slv_program) {
> + ret = pwrap_reset_spislave(wrp);
> + if (ret)
> + return ret;
> + }
>
> pwrap_writel(wrp, 1, PWRAP_WRAP_EN);
>
> @@ -1013,45 +1017,52 @@ static int pwrap_init(struct pmic_wrapper *wrp)
> if (ret)
> return ret;
>
> - /* Setup serial input delay */
> - ret = pwrap_init_sidly(wrp);
> - if (ret)
> - return ret;
> + if (wrp->master->slv_program) {
This if branch is really long and complex enough to put it into function apart.
Thanks,
Matthias
PD please take into account the comments I made on v3 of the series.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-10-10 18:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 8:26 [PATCH v4 0/7] Add PMIC support to MediaTek MT7622 SoC sean.wang-NuS5LvNUpcJWk0Htik3J/w
2017-09-21 8:26 ` [PATCH v4 1/7] dt-bindings: arm: mediatek: add MT7622 string to the PMIC wrapper doc sean.wang
2017-09-21 8:26 ` [PATCH v4 3/7] soc: mediatek: pwrap: add pwrap_write32 for writing in 32-bit mode sean.wang
2017-09-21 8:26 ` [PATCH v4 4/7] soc: mediatek: pwrap: update pwrap_init without slave programming sean.wang
[not found] ` <604078485ca9ab04cea5bc531425d6035b27bc88.1505980364.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-10-10 18:00 ` Matthias Brugger [this message]
2017-10-13 9:41 ` Sean Wang
2017-10-13 14:07 ` Matthias Brugger
[not found] ` <fe0952f1-c018-8492-7336-149f917463e1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-16 6:22 ` Sean Wang
2017-09-21 8:26 ` [PATCH v4 5/7] soc: mediatek: pwrap: add MediaTek MT6380 as one slave of pwrap sean.wang
[not found] ` <cover.1505980364.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-09-21 8:26 ` [PATCH v4 2/7] soc: mediatek: pwrap: add pwrap_read32 for reading in 32-bit mode sean.wang-NuS5LvNUpcJWk0Htik3J/w
2017-09-21 8:26 ` [PATCH v4 6/7] soc: mediatek: pwrap: add support for MT7622 SoC sean.wang-NuS5LvNUpcJWk0Htik3J/w
2017-09-21 8:26 ` [PATCH v4 7/7] soc: mediatek: pwrap: fixup warnings from coding style 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=f3a04159-8491-6ca6-d2ad-7df1dfd64331@gmail.com \
--to=matthias.bgg-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=chen.zhong-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=chenglin.xu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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).