Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be080451 authored by Sebastian Hesselbarth's avatar Sebastian Hesselbarth
Browse files

clk: sunxi: declare OF clock provider



Common clock framework allows to register clock providers to get called
on of_clk_init() by using CLK_OF_DECLARE. This converts sunxi clock
providers to make use of it and get rid of the mach specific clk init
call. As sunxi has a bunch of independent clk provider nodes, we hook
current clock init to board compatible to make it called once.

Signed-off-by: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: default avatarMike Turquette <mturquette@linaro.org>
parent 8e7b25f1
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -20,8 +20,6 @@
#include <linux/io.h>
#include <linux/io.h>
#include <linux/reboot.h>
#include <linux/reboot.h>


#include <linux/clk/sunxi.h>

#include <asm/mach/arch.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/map.h>
#include <asm/system_misc.h>
#include <asm/system_misc.h>
@@ -118,7 +116,7 @@ static void sunxi_setup_restart(void)


static void __init sunxi_timer_init(void)
static void __init sunxi_timer_init(void)
{
{
	sunxi_init_clocks();
	of_clk_init(NULL);
	clocksource_of_init();
	clocksource_of_init();
}
}


+6 −5
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@


#include <linux/clk-provider.h>
#include <linux/clk-provider.h>
#include <linux/clkdev.h>
#include <linux/clkdev.h>
#include <linux/clk/sunxi.h>
#include <linux/of.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_address.h>


@@ -617,11 +616,8 @@ static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_mat
	}
	}
}
}


void __init sunxi_init_clocks(void)
static void __init sunxi_init_clocks(struct device_node *np)
{
{
	/* Register all the simple and basic clocks on DT */
	of_clk_init(NULL);

	/* Register factor clocks */
	/* Register factor clocks */
	of_sunxi_table_clock_setup(clk_factors_match, sunxi_factors_clk_setup);
	of_sunxi_table_clock_setup(clk_factors_match, sunxi_factors_clk_setup);


@@ -634,3 +630,8 @@ void __init sunxi_init_clocks(void)
	/* Register gate clocks */
	/* Register gate clocks */
	of_sunxi_table_clock_setup(clk_gates_match, sunxi_gates_clk_setup);
	of_sunxi_table_clock_setup(clk_gates_match, sunxi_gates_clk_setup);
}
}
CLK_OF_DECLARE(sun4i_a10_clk_init, "allwinner,sun4i-a10", sunxi_init_clocks);
CLK_OF_DECLARE(sun5i_a10s_clk_init, "allwinner,sun5i-a10s", sunxi_init_clocks);
CLK_OF_DECLARE(sun5i_a13_clk_init, "allwinner,sun5i-a13", sunxi_init_clocks);
CLK_OF_DECLARE(sun6i_a31_clk_init, "allwinner,sun6i-a31", sunxi_init_clocks);
CLK_OF_DECLARE(sun7i_a20_clk_init, "allwinner,sun7i-a20", sunxi_init_clocks);

include/linux/clk/sunxi.h

deleted100644 → 0
+0 −22
Original line number Original line Diff line number Diff line
/*
 * Copyright 2012 Maxime Ripard
 *
 * Maxime Ripard <maxime.ripard@free-electrons.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __LINUX_CLK_SUNXI_H_
#define __LINUX_CLK_SUNXI_H_

void __init sunxi_init_clocks(void);

#endif