linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Jerome Brunet <jbrunet@baylibre.com>, khilman@baylibre.com
Cc: martin.blumenstingl@googlemail.com, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC/RFT v3 04/14] clk: meson: eeclk: add setup callback
Date: Fri, 26 Jul 2019 16:50:41 +0200	[thread overview]
Message-ID: <55ce9b5e-de2f-9da3-8eec-13b5ead23e6c@baylibre.com> (raw)
In-Reply-To: <1jh8836w49.fsf@starbuckisacylon.baylibre.com>

On 03/07/2019 16:17, Jerome Brunet wrote:
> On Mon 01 Jul 2019 at 11:12, Neil Armstrong <narmstrong@baylibre.com> wrote:
> 
>> Add a setup() callback in the eeclk structure, to call an optional
>> call() function at end of eeclk probe to setup clocks.
>>
>> It's used for the G12A clock controller to setup the CPU clock
>> notifiers.
> 
> I'd prefer if you implement the probe function in the related controller
> have this probe function call meson_eeclkc_probe() for the common part
> 
> In your case, I suppose it means implementing the g12a controller probe
> to deal with the notifiers

Sure, but with this eeclk setup callback I can provide a different setup() callback
for g12a and g12b (and later sm1), without this means adding a top data struct
containing a setup() callback pointer and the soc meson_eeclkc_data struct to be able
to call a setup() for each family like done actually, but this will broke eeclk since
the match_data data won't be a meson_eeclkc_data() struct anymore.

If you still prefer this, I can rework it like that.

I'm rebasing all the stuff on v5.3-rc1 and plan to repost an updated version
shortly, solving this would be easier.

Neil

> 
>>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>> ---
>>  drivers/clk/meson/meson-eeclk.c | 6 ++++++
>>  drivers/clk/meson/meson-eeclk.h | 1 +
>>  2 files changed, 7 insertions(+)
>>
>> diff --git a/drivers/clk/meson/meson-eeclk.c b/drivers/clk/meson/meson-eeclk.c
>> index 6ba2094be257..81fd2abcd173 100644
>> --- a/drivers/clk/meson/meson-eeclk.c
>> +++ b/drivers/clk/meson/meson-eeclk.c
>> @@ -61,6 +61,12 @@ int meson_eeclkc_probe(struct platform_device *pdev)
>>  		}
>>  	}
>>  
>> +	if (data->setup) {
>> +		ret = data->setup(pdev);
>> +		if (ret)
>> +			return ret;
>> +	}
>> +
>>  	return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
>>  					   data->hw_onecell_data);
>>  }
>> diff --git a/drivers/clk/meson/meson-eeclk.h b/drivers/clk/meson/meson-eeclk.h
>> index 9ab5d6fa7ccb..7fdf424f71a6 100644
>> --- a/drivers/clk/meson/meson-eeclk.h
>> +++ b/drivers/clk/meson/meson-eeclk.h
>> @@ -20,6 +20,7 @@ struct meson_eeclkc_data {
>>  	const struct reg_sequence	*init_regs;
>>  	unsigned int			init_count;
>>  	struct clk_hw_onecell_data	*hw_onecell_data;
>> +	int				(*setup)(struct platform_device *pdev);
>>  };
>>  
>>  int meson_eeclkc_probe(struct platform_device *pdev);
>> -- 
>> 2.21.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2019-07-26 14:51 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01  9:12 [RFC/RFT v3 00/14] arm64: g12a: add support for DVFS Neil Armstrong
2019-07-01  9:12 ` [RFC/RFT v3 01/14] pinctrl: meson-g12a: add pwm_a on GPIOE_2 pinmux Neil Armstrong
2019-07-02 22:56   ` Martin Blumenstingl
2019-07-01  9:12 ` [RFC/RFT v3 02/14] clk: core: introduce clk_hw_set_parent() Neil Armstrong
2019-07-02 23:05   ` Martin Blumenstingl
2019-07-01  9:12 ` [RFC/RFT v3 03/14] clk: meson: regmap: export regmap_div ops functions Neil Armstrong
2019-07-01  9:12 ` [RFC/RFT v3 04/14] clk: meson: eeclk: add setup callback Neil Armstrong
2019-07-02 23:16   ` Martin Blumenstingl
2019-07-03 11:45     ` Neil Armstrong
2019-07-03 12:40       ` Jerome Brunet
2019-07-03 12:57         ` Martin Blumenstingl
2019-07-03 14:17   ` Jerome Brunet
2019-07-26 14:50     ` Neil Armstrong [this message]
2019-07-29  7:42       ` Jerome Brunet
2019-07-01  9:12 ` [RFC/RFT v3 05/14] soc: amlogic: meson-clk-measure: protect measure with a mutex Neil Armstrong
2019-07-02 23:01   ` Martin Blumenstingl
2019-07-01  9:12 ` [RFC/RFT v3 06/14] soc: amlogic: meson-clk-measure: add G12B second cluster cpu clk Neil Armstrong
2019-07-02 22:58   ` Martin Blumenstingl
2019-07-01  9:12 ` [RFC/RFT v3 07/14] clk: meson: g12a: add notifiers to handle cpu clock change Neil Armstrong
2019-07-02 23:28   ` Martin Blumenstingl
2019-07-03 11:50     ` Neil Armstrong
2019-08-08  4:43     ` Stephen Boyd
2019-07-01  9:12 ` [RFC/RFT v3 08/14] clk: meson: g12a: expose CPUB clock ID for G12B Neil Armstrong
2019-07-02 23:03   ` Martin Blumenstingl
2019-07-01  9:12 ` [RFC/RFT v3 09/14] arm64: dts: move common G12A & G12B modes to meson-g12-common.dtsi Neil Armstrong
2019-07-02 23:54   ` Martin Blumenstingl
2019-07-03 11:51     ` Neil Armstrong
2019-07-03 12:48       ` Jerome Brunet
2019-07-01  9:12 ` [RFC/RFT v3 10/14] arm64: dts: meson-g12-common: add pwm_a on GPIOE_2 pinmux Neil Armstrong
2019-07-02 23:11   ` Martin Blumenstingl
2019-07-01  9:12 ` [RFC/RFT v3 11/14] arm64: dts: meson-g12a: add cpus OPP table Neil Armstrong
2019-07-02 23:47   ` Martin Blumenstingl
2019-07-03 11:53     ` Neil Armstrong
2019-07-03 12:12       ` Martin Blumenstingl
2019-07-01  9:12 ` [RFC/RFT v3 12/14] arm64: dts: meson-g12a: enable DVFS on G12A boards Neil Armstrong
2019-07-02 23:43   ` Martin Blumenstingl
2019-07-01  9:12 ` [RFC/RFT v3 13/14] arm64: dts: meson-g12b: add cpus OPP tables Neil Armstrong
2019-07-01  9:12 ` [RFC/RFT v3 14/14] arm64: dts: meson-g12b-odroid-n2: enable DVFS Neil Armstrong
2019-07-02 23:45   ` Martin Blumenstingl
2019-07-03 11:54     ` 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=55ce9b5e-de2f-9da3-8eec-13b5ead23e6c@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.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).