linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	rahul.tanwar@linux.intel.com
Cc: andriy.shevchenko@intel.com, cheol.yong.kim@intel.com,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	mark.rutland@arm.com, mturquette@baylibre.com,
	qi-ming.wu@intel.com, rahul.tanwar@intel.com, robh+dt@kernel.org,
	robhkernel.org@vger.kernel.org, yixin.zhu@linux.intel.com
Subject: RE: [PATCH v1 1/2] clk: intel: Add CGU clock driver for a new SoC
Date: Tue, 03 Sep 2019 16:54:07 -0700	[thread overview]
Message-ID: <20190903235408.B546D208E3@mail.kernel.org> (raw)
In-Reply-To: <20190902222015.11360-1-martin.blumenstingl@googlemail.com>

Quoting Martin Blumenstingl (2019-09-02 15:20:15)
> +struct intel_clk_gate {
> +       struct clk_hw hw;
> +       struct device *dev;
> +       struct regmap *map;
> +       unsigned int reg;
> +       u8 shift;
> +       unsigned long flags;
> +};
> I know at least two existing regmap clock implementations:
> - drivers/clk/qcom/clk-regmap*
> - drivers/clk/meson/clk-regmap*
> 
> it would be great if we could decide to re-use one of those for the
> "generic" clock types (mux, divider and gate).
> Stephen, do you have any preference here?
> personally I like the meson one, but I'm biased because I've used it
> a lot in the past and I haven't used the qcom one at all.

The topic comes up once in a while. Making a set of regmap clk_ops and
structures might work to consolidate the code across the different
drivers. I can't recall why we didn't combine the two implementations at
that point. I do remember that Mike was opposed to pushing it directly
into the core framework as part of struct clk_hw out of fear of bloating
the clk_hw structure.

I don't particularly like how the meson implementation makes every clk
the same type and has a 'data' member of clk_regmap to differentiate the
types (mux, gate, div, etc.) It avoids nesting structures but otherwise
serves the same purpose as having there be container structures for the
different types that all have a clk_regmap structure inside. qcom
implementation also takes a shortcut and adds enable/disable logic into
the clk_regmap structure. To consolidate the two I imagine we would need
to change both implementations to use a struct like:

	struct clk_regmap {
		struct clk_hw hw;
		struct regmap *map;
	};


  parent reply	other threads:[~2019-09-03 23:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28  7:00 [PATCH v1 0/2] clk: intel: Add a new driver for a new clock controller IP Rahul Tanwar
2019-08-28  7:00 ` [PATCH v1 1/2] clk: intel: Add CGU clock driver for a new SoC Rahul Tanwar
2019-08-28 15:09   ` Andy Shevchenko
2019-09-02  7:43     ` Tanwar, Rahul
2019-09-02 12:20       ` Andy Shevchenko
2019-09-02 12:24         ` Andy Shevchenko
2019-12-06  4:39           ` Tanwar, Rahul
2019-12-07 14:57             ` Andy Shevchenko
2019-12-24  3:04               ` Stephen Boyd
2019-09-02 22:20   ` Martin Blumenstingl
2019-09-03  9:54     ` Tanwar, Rahul
2019-09-03 18:53       ` Martin Blumenstingl
2019-09-04  8:03         ` Tanwar, Rahul
2019-09-05 20:47           ` Martin Blumenstingl
2019-09-09 14:16             ` Kim, Cheol Yong
2019-09-16 18:36               ` Stephen Boyd
2019-09-03 23:54     ` Stephen Boyd [this message]
2019-08-28  7:00 ` [PATCH v1 2/2] dt-bindings: clk: intel: Add bindings document & header file for CGU Rahul Tanwar
2019-12-19 16:33   ` Rob Herring

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=20190903235408.B546D208E3@mail.kernel.org \
    --to=sboyd@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=cheol.yong.kim@intel.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mturquette@baylibre.com \
    --cc=qi-ming.wu@intel.com \
    --cc=rahul.tanwar@intel.com \
    --cc=rahul.tanwar@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=robhkernel.org@vger.kernel.org \
    --cc=yixin.zhu@linux.intel.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).