Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1253609

Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support

From Hans de Goede <hdegoede@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support
Date 2015-10-22 11:10 +0200
Message-ID <qmk2J-69B-19@gated-at.bofh.it> (permalink)
References <qm4hk-8eF-5@gated-at.bofh.it> <qm75w-3ST-17@gated-at.bofh.it> <qmiX0-4m5-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On 22-10-15 09:58, Jean-Francois Moine wrote:
> On Wed, 21 Oct 2015 21:18:45 +0200
> Hans de Goede <hdegoede@redhat.com> wrote:
>
>> Great to see that you've started working on this again. Last weekend I
>> ended up working on this too together with Reinder E.N. de Haan <reinder@mveas.com>
>> (added to the Cc).
>>
>> We took a slightly different approach for the gates clocks, see:
>>
>> https://github.com/jwrdegoede/linux-sunxi/commits/sunxi-wip
>>
>> And specifically:
>>
>> https://github.com/jwrdegoede/linux-sunxi/commit/80a1afe319d5d1a0c426d42e75d37f0c64e8ea0b
>>
>> Combined with:
>>
>> https://github.com/jwrdegoede/linux-sunxi/commit/d508da5feb5048f6674d6b24b58ac9058fb9d877
>>
>> This deals with the per gate parents the same way the rockchip
>> clock code does, and it seems to be quite a bit less code then your solution.
>
> Here is a simpler patch:
>
> diff --git a/drivers/clk/sunxi/clk-simple-gates.c b/drivers/clk/sunxi/clk-simple-gates.c
> index 6ce9118..8fecaeab 100644
> --- a/drivers/clk/sunxi/clk-simple-gates.c
> +++ b/drivers/clk/sunxi/clk-simple-gates.c
> @@ -35,6 +35,7 @@ static void __init sunxi_simple_gates_setup(struct device_node *node,
>   	void __iomem *reg;
>   	const __be32 *p;
>   	int number, i = 0, j;
> +	bool parent_per_gate;
>   	u8 clk_bit;
>   	u32 index;
>
> @@ -43,6 +44,7 @@ static void __init sunxi_simple_gates_setup(struct device_node *node,
>   		return;
>
>   	clk_parent = of_clk_get_parent_name(node, 0);
> +	parent_per_gate = of_clk_get_parent_count(node) != 1;
>
>   	clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);
>   	if (!clk_data)
> @@ -58,6 +60,8 @@ static void __init sunxi_simple_gates_setup(struct device_node *node,
>   	of_property_for_each_u32(node, "clock-indices", prop, p, index) {
>   		of_property_read_string_index(node, "clock-output-names",
>   					      i, &clk_name);
> +		if (parent_per_gate)
> +			clk_parent = of_clk_get_parent_name(node, i);
>
>   		clk_reg = reg + 4 * (index / 32);
>   		clk_bit = index % 32;
>
>

Yes good one, doing things that way indeed is better.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support Jens Kuske <jenskuske@gmail.com> - 2015-10-21 18:20 +0200
  [PATCH 2/6] clk: sunxi: Add H3 clocks support Jens Kuske <jenskuske@gmail.com> - 2015-10-21 18:20 +0200
    Re: [linux-sunxi] [PATCH 2/6] clk: sunxi: Add H3 clocks support Julian Calaby <julian.calaby@gmail.com> - 2015-10-22 02:20 +0200
      Re: [linux-sunxi] [PATCH 2/6] clk: sunxi: Add H3 clocks support Jens Kuske <jenskuske@gmail.com> - 2015-10-22 09:50 +0200
  Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support Hans de Goede <hdegoede@redhat.com> - 2015-10-21 21:20 +0200
    Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support Jens Kuske <jenskuske@gmail.com> - 2015-10-22 09:50 +0200
      Re: [linux-sunxi] Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3  support Hans de Goede <hdegoede@redhat.com> - 2015-10-22 10:50 +0200
        Re: [linux-sunxi] Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support Peter Korsgaard <peter@korsgaard.com> - 2015-10-27 20:30 +0100
    Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support Jean-Francois Moine <moinejf@free.fr> - 2015-10-22 10:00 +0200
      Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support Hans de Goede <hdegoede@redhat.com> - 2015-10-22 11:10 +0200
  Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support Hans de Goede <hdegoede@redhat.com> - 2015-10-21 21:30 +0200

csiph-web