devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Liao <jamesjj.liao@mediatek.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	Mike Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	devicetree@vger.kernel.org, Sascha Hauer <kernel@pengutronix.de>,
	srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org,
	Daniel Kurtz <djkurtz@chromium.org>,
	linux-mediatek@lists.infradead.org,
	Shunli Wang <shunli.wang@mediatek.com>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/6] clk: mediatek: Add MT2701 clock support
Date: Tue, 5 Jan 2016 17:59:00 +0800	[thread overview]
Message-ID: <1451987940.19662.0.camel@mtksdaap41> (raw)
In-Reply-To: <1451986201.3391.3.camel@pengutronix.de>

Hi Philipp,

On Tue, 2016-01-05 at 10:30 +0100, Philipp Zabel wrote:
> Hi James,
> 
> Am Dienstag, den 05.01.2016, 14:30 +0800 schrieb James Liao:
> > From: Shunli Wang <shunli.wang@mediatek.com>
> > 
> > Add MT2701 clock support, include topckgen, apmixedsys,
> > infracfg, pericfg and subsystem clocks.
> > 
> > Signed-off-by: Shunli Wang <shunli.wang@mediatek.com>
> > Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
> > ---
> >  drivers/clk/mediatek/Kconfig      |    8 +
> >  drivers/clk/mediatek/Makefile     |    1 +
> >  drivers/clk/mediatek/clk-gate.c   |   56 ++
> >  drivers/clk/mediatek/clk-gate.h   |    2 +
> >  drivers/clk/mediatek/clk-mt2701.c | 1210 +++++++++++++++++++++++++++++++++++++
> >  drivers/clk/mediatek/clk-mtk.c    |   25 +
> >  drivers/clk/mediatek/clk-mtk.h    |   35 +-
> >  7 files changed, 1334 insertions(+), 3 deletions(-)
> >  create mode 100644 drivers/clk/mediatek/clk-mt2701.c
> > 
> > diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
> > index dc224e6..6c7cdc0 100644
> > --- a/drivers/clk/mediatek/Kconfig
> > +++ b/drivers/clk/mediatek/Kconfig
> > @@ -6,6 +6,14 @@ config COMMON_CLK_MEDIATEK
> >  	---help---
> >  	  Mediatek SoCs' clock support.
> >  
> > +config COMMON_CLK_MT2701
> > +	bool "Clock driver for Mediatek MT2701 and MT7623"
> > +	depends on COMMON_CLK
> > +	select COMMON_CLK_MEDIATEK
> > +	default ARCH_MEDIATEK
> > +	---help---
> > +	  This driver supports Mediatek MT2701 and MT7623 clocks.
> > +
> >  config COMMON_CLK_MT8135
> >  	bool "Clock driver for Mediatek MT8135"
> >  	depends on COMMON_CLK
> > diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile
> > index 32e7222..5b2b91b 100644
> > --- a/drivers/clk/mediatek/Makefile
> > +++ b/drivers/clk/mediatek/Makefile
> > @@ -1,4 +1,5 @@
> >  obj-$(CONFIG_COMMON_CLK_MEDIATEK) += clk-mtk.o clk-pll.o clk-gate.o clk-apmixed.o
> >  obj-$(CONFIG_RESET_CONTROLLER) += reset.o
> > +obj-$(CONFIG_COMMON_CLK_MT2701) += clk-mt2701.o
> >  obj-$(CONFIG_COMMON_CLK_MT8135) += clk-mt8135.o
> >  obj-$(CONFIG_COMMON_CLK_MT8173) += clk-mt8173.o
> > diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gate.c
> > index 576bdb7..38badb4 100644
> > --- a/drivers/clk/mediatek/clk-gate.c
> > +++ b/drivers/clk/mediatek/clk-gate.c
> > @@ -61,6 +61,26 @@ static void mtk_cg_clr_bit(struct clk_hw *hw)
> >  	regmap_write(cg->regmap, cg->clr_ofs, BIT(cg->bit));
> >  }
> >  
> > +static void mtk_cg_set_bit_no_setclr(struct clk_hw *hw)
> > +{
> > +	struct mtk_clk_gate *cg = to_clk_gate(hw);
> > +	u32 val;
> > +
> > +	regmap_read(cg->regmap, cg->sta_ofs, &val);
> > +	val |= BIT(cg->bit);
> > +	regmap_write(cg->regmap, cg->sta_ofs, val);
> 
> You can use regmap_update_bits here:
> 
> 	u32 bit = BIT(cg->bit);
> 	regmap_update_bits(cg->regmap, cg->sta_ofs, bit, bit);
> 
> > +}
> > +
> > +static void mtk_cg_clr_bit_no_setclr(struct clk_hw *hw)
> > +{
> > +	struct mtk_clk_gate *cg = to_clk_gate(hw);
> > +	u32 val;
> > +
> > +	regmap_read(cg->regmap, cg->sta_ofs, &val);
> > +	val &= ~(BIT(cg->bit));
> > +	regmap_write(cg->regmap, cg->sta_ofs, val);
> 
> and here:
> 
> 	u32 bit = BIT(cg->bit);
> 	regmap_update_bits(cg->regmap, cg->sta_ofs, bit, 0);

OK. I'll change it in next patch. Thanks.


Best regards,

James



  reply	other threads:[~2016-01-05  9:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05  6:30 [PATCH v2 0/6] Add clock support for Mediatek MT2701 James Liao
     [not found] ` <1451975422-31174-1-git-send-email-jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2016-01-05  6:30   ` [PATCH v2 1/6] clk: mediatek: Refine the makefile to support multiple clock drivers James Liao
2016-01-05  6:30   ` [PATCH v2 3/6] clk: mediatek: Add dt-bindings for MT2701 clocks James Liao
2016-01-05  6:30   ` [PATCH v2 4/6] clk: mediatek: Add MT2701 clock support James Liao
     [not found]     ` <1451975422-31174-5-git-send-email-jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2016-01-05  9:30       ` Philipp Zabel
2016-01-05  9:59         ` James Liao [this message]
2016-01-05  6:30   ` [PATCH v2 5/6] reset: mediatek: mt2701 reset controller dt-binding file James Liao
     [not found]     ` <1451975422-31174-6-git-send-email-jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2016-01-05  9:31       ` Philipp Zabel
2016-01-05 10:00         ` James Liao
2016-01-05  6:30 ` [PATCH v2 2/6] dt-bindings: ARM: Mediatek: Document bindings for MT2701 James Liao
2016-01-06 15:08   ` Rob Herring
2016-01-13  3:39     ` James Liao
2016-01-05  6:30 ` [PATCH v2 6/6] reset: mediatek: mt2701 reset driver James Liao
2016-01-05  9:31   ` Philipp Zabel

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=1451987940.19662.0.camel@mtksdaap41 \
    --to=jamesjj.liao@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=sboyd@codeaurora.org \
    --cc=shunli.wang@mediatek.com \
    --cc=srv_heupstream@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;
as well as URLs for NNTP newsgroup(s).