From: Sunny Luo <sunny.luo@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>,
Neil Armstrong <narmstrong@baylibre.com>,
Mark Brown <broonie@kernel.org>
Cc: Jianxin Pan <jianxin.pan@amlogic.com>,
Kevin Hilman <khilman@baylibre.com>,
Yixun Lan <yixun.lan@amlogic.com>,
linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Carlo Caione <carlo@caione.org>,
linux-amlogic@lists.infradead.org,
Xingyu Chen <xingyu.chen@amlogic.com>
Subject: Re: [PATCH v2 3/3] spi: meson-axg: add a linear clock divider support
Date: Thu, 13 Dec 2018 22:37:07 +0800 [thread overview]
Message-ID: <d9ec856c-d93f-4e4a-c5d4-7b2182f93cf7@amlogic.com> (raw)
In-Reply-To: <e6d5220e45a54d5251bec0f8fd3c147307f8b071.camel@baylibre.com>
Hi Jerome,
On 2018/12/13 17:28, Jerome Brunet wrote:
> On Thu, 2018-12-13 at 09:55 +0100, Neil Armstrong wrote:
>>> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
>>> config SPI_MESON_SPICC
>>> tristate "Amlogic Meson SPICC controller"
>>> - depends on ARCH_MESON || COMPILE_TEST
>>> + depends on OF && COMMON_CLK && (ARCH_MESON || COMPILE_TEST)
>
> The purpose of this patch is clock, right ? Why does it add a dependency on OF
> ?
> I did it by the way. Maybe it's better to add it in patch 1.
>>> +static int meson_spicc_clk_init(struct meson_spicc_device *spicc)
>>> +{
>>> + struct device *dev = &spicc->pdev->dev;
>>> + struct clk_fixed_factor *div0;
>>> + struct clk_divider *div1;
>
> Could you come up with something better than div0 and div1 ? it is confusing,
> especially with the comment above about div3 and 4 ... fixed_factor, div maybe
> ?
> Good, It is really confusing, I will change next patch.
>>> + div1 = &meson_spicc_div1;
>>> + div1->reg = spicc->base + (u64)div1->reg;
>
> So you have static data which you override here. This works only if there is a
> single instance ... and does not really improve readability in your case.
>
> IMO, you'd be better off without the static data above.
This is a terrible bug for more than one instances. I must overwrite it.
>>> + if (!spicc->data->has_enhance_clk_div) {
>
> Do all SoC with 'has_oen' have 'has_enhance_clk_div' too ?
> DO you really need two flags ?
Yes, all Soc with 'has_oen' must have 'has_enhance_clk_div' too.
It is distinct to use two flags here, what do you think of it?
>>> + mux = &meson_spicc_sel;
>>> + snprintf(name, sizeof(name), "%s#_sel", dev_name(dev));
>>> + init.name = name;
>>> + init.ops = &clk_mux_ops;
>>> + init.parent_names = mux_parent_names;
>>> + init.num_parents = 2;
>>> + init.flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT;
>
> Why CLK_SET_RATE_NO_REPARENT ? CCF should pick the parent that give the best
> results, best to let it do its task ...
>
There are two div in AXG, one is the coarse old-div and the other is
enhance-div. From SoCs designer's opinion, the ehance-div aims to take
place of the old-div.
next prev parent reply other threads:[~2018-12-13 14:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-13 8:39 [PATCH v2 0/3] spi: meson-axg: add few enhanced features Sunny Luo
2018-12-13 8:39 ` [PATCH v2 1/3] spi: meson-axg: support MAX 80M clock Sunny Luo
2018-12-13 8:49 ` Neil Armstrong
2018-12-13 11:55 ` Sunny Luo
2018-12-13 8:39 ` [PATCH v2 2/3] spi: meson-axg: enhance output enable feature Sunny Luo
2018-12-13 8:53 ` Neil Armstrong
2018-12-13 13:12 ` Sunny Luo
2018-12-13 9:04 ` Jerome Brunet
2018-12-13 11:53 ` Mark Brown
2018-12-13 12:50 ` Sunny Luo
2018-12-13 13:31 ` Sunny Luo
2018-12-13 8:39 ` [PATCH v2 3/3] spi: meson-axg: add a linear clock divider support Sunny Luo
2018-12-13 8:55 ` Neil Armstrong
2018-12-13 9:28 ` Jerome Brunet
2018-12-13 14:37 ` Sunny Luo [this message]
2018-12-13 15:01 ` Jerome Brunet
2018-12-13 13:25 ` Sunny Luo
2018-12-15 18:31 ` kbuild test robot
[not found] ` <1544690354-16409-1-git-send-email-sunny.luo-LpR1jeaWuhtBDgjK7y7TUQ@public.gmane.org>
2020-02-19 8:17 ` [PATCH v2 0/3] spi: meson-axg: add few enhanced features Neil Armstrong
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=d9ec856c-d93f-4e4a-c5d4-7b2182f93cf7@amlogic.com \
--to=sunny.luo@amlogic.com \
--cc=broonie@kernel.org \
--cc=carlo@caione.org \
--cc=jbrunet@baylibre.com \
--cc=jianxin.pan@amlogic.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=narmstrong@baylibre.com \
--cc=xingyu.chen@amlogic.com \
--cc=yixun.lan@amlogic.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).