From: Florian Fainelli <f.fainelli@gmail.com>
To: sean.wang@mediatek.com, john@phrozen.org, davem@davemloft.net
Cc: nbd@openwrt.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next 2/4] net-next: mediatek: add platform data to adapt into various hardware
Date: Tue, 11 Jul 2017 21:19:49 -0700 [thread overview]
Message-ID: <2ab410a6-bf08-79bc-28ca-e05eb8b67cf5@gmail.com> (raw)
In-Reply-To: <401e9fa04ea4759c936fa5af11bb2b5c97ef14f0.1499829241.git.sean.wang@mediatek.com>
On 07/11/2017 08:37 PM, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> This patch is the preparation patch in order to adapt into various
> hardware through adding platform data which holds specific characteristics
> among MediaTek SoCs and introducing the unified clock handler for those
> distinct clock requirements depending on different features such as
> TRGMII and SGMII getting support on the target SoC. And finally, add
> enhancement with given the generic description for Kconfig and remove the
> unnecessary machine type dependency in Makefile.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> if (dev->phydev->link)
> @@ -1837,6 +1838,39 @@ static void ethsys_reset(struct mtk_eth *eth, u32 reset_bits)
> mdelay(10);
> }
>
> +static void mtk_clk_disable(struct mtk_eth *eth)
> +{
> + int clk;
> +
> + for (clk = MTK_CLK_MAX - 1; clk >= 0; clk--) {
> + if (eth->clks[clk])
> + clk_disable_unprepare(eth->clks[clk]);
> + }
The clock framework works just fine with NULL clk references, no need to
check that.
> +}
There are now (or will be soon in clk-next) bulk accessors that you may
consider using for this.
> +
> +static int mtk_clk_enable(struct mtk_eth *eth)
> +{
> + int clk, ret;
> +
> + for (clk = 0; clk < MTK_CLK_MAX ; clk++) {
> + if (eth->clks[clk]) {
> + ret = clk_prepare_enable(eth->clks[clk]);
> + if (ret)
> + goto err_disable_clks;
> + }
> + }
Same here.
--
Florian
next prev parent reply other threads:[~2017-07-12 4:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 3:37 [PATCH net-next 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC sean.wang
2017-07-12 3:37 ` [PATCH net-next 1/4] dt-bindings: net: mediatek: add support for MediaTek MT7623 and " sean.wang
2017-07-12 3:37 ` [PATCH net-next 2/4] net-next: mediatek: add platform data to adapt into various hardware sean.wang
2017-07-12 4:19 ` Florian Fainelli [this message]
2017-07-12 14:50 ` Andrew Lunn
2017-07-15 1:47 ` Sean Wang
2017-07-12 3:37 ` [PATCH net-next 3/4] net-next: mediatek: add support for MediaTek MT7622 SoC sean.wang
2017-07-12 15:00 ` Andrew Lunn
2017-07-12 3:37 ` [PATCH net-next 4/4] MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers sean.wang
2017-07-12 3:53 ` [PATCH net-next 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC David Miller
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=2ab410a6-bf08-79bc-28ca-e05eb8b67cf5@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=john@phrozen.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=nbd@openwrt.org \
--cc=netdev@vger.kernel.org \
--cc=sean.wang@mediatek.com \
/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