From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 15/20] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU
Date: Wed, 26 Feb 2014 14:24:01 +0100 [thread overview]
Message-ID: <1792922.9Bi30kDKcG@avalon> (raw)
In-Reply-To: <1393400016-23433-16-git-send-email-horms+renesas@verge.net.au>
Hi Simon,
Thank you for the patch.
On Wednesday 26 February 2014 16:33:31 Simon Horman wrote:
> Now that the common clock framework is supported, the clock lookup
> entries in clock-r8a7779.c are not registered anymore. Devices must
> instead reference their clocks in the device tree. However, SCIF and CMT
> devices are still instantiated through platform code, and thus need a
> clock lookup entry.
>
> Retrieve the SCIF and CMT clock entries by name and register clkdevs for
> the corresponding devices. This will be removed when the SCIF and CMT
> devices will be instantiated from the device tree.
>
> Based on work for the Koelsch board by Laurent Pinchart.
>
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>
> ---
> v3
> * Initialise TMU clocks instead of CMT clocks
> - It is TMU that Marzen uses as a clocksource
> * Refactor clock initialisation hack as per more recent mainline
> code for Koelsch
> * Use IS_ERR to check the return value of clk_get()
> ---
> arch/arm/mach-shmobile/board-marzen-reference.c | 31 +++++++++++++++++++++-
> 1 file changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c
> b/arch/arm/mach-shmobile/board-marzen-reference.c index e261431..a5974d2
> 100644
> --- a/arch/arm/mach-shmobile/board-marzen-reference.c
> +++ b/arch/arm/mach-shmobile/board-marzen-reference.c
> @@ -19,7 +19,9 @@
> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
> USA */
>
> +#include <linux/clk.h>
> #include <linux/clk/shmobile.h>
> +#include <linux/clkdev.h>
> #include <linux/clocksource.h>
> #include <linux/of_platform.h>
> #include <mach/r8a7779.h>
> @@ -38,7 +40,34 @@ static void __init marzen_init_timer(void)
>
> static void __init marzen_init(void)
> {
> -#ifndef CONFIG_COMMON_CLK
> +#ifdef CONFIG_COMMON_CLK
> + static const struct clk_name {
> + const char *clk;
> + const char *con_id;
> + const char *dev_id;
> + } clk_names[] = {
> + { "scif0", NULL, "sh-sci.0" },
> + { "scif1", NULL, "sh-sci.1" },
> + { "scif2", NULL, "sh-sci.2" },
> + { "scif3", NULL, "sh-sci.3" },
> + { "scif4", NULL, "sh-sci.4" },
> + { "scif5", NULL, "sh-sci.5" },
Any chance to switch the board the DT-based SCIF instead ? ;-)
> + { "tmu00", NULL, "sh_tmu.0" },
> + { "tmu01", NULL, "sh_tmu.1" },
> + { "tmu02", NULL, "sh_tmu.2" },
Those clocks should be tmu0, tmu1 and tmu2.
> + };
> + struct clk *clk;
> + unsigned int i;
> +
> + for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
> + clk = clk_get(NULL, clk_names[i].clk);
> + if (!IS_ERR(clk)) {
> + clk_register_clkdev(clk, clk_names[i].con_id,
> + clk_names[i].dev_id);
> + clk_put(clk);
> + }
> + }
> +#else
> r8a7779_clock_init();
> #endif
> r8a7779_add_standard_devices_dt();
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2014-02-26 13:24 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 7:33 [PATCH v3 00/20] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
2014-02-26 7:33 ` [PATCH v3 01/20] clk: shmobile: r8a7779: Add clocks support Simon Horman
2014-02-26 8:05 ` Geert Uytterhoeven
2014-02-26 8:59 ` Simon Horman
2014-02-26 9:06 ` Geert Uytterhoeven
2014-02-28 1:35 ` Simon Horman
2014-02-26 12:53 ` Laurent Pinchart
2014-02-26 13:02 ` Laurent Pinchart
2014-03-12 7:55 ` Simon Horman
2014-03-12 10:12 ` Laurent Pinchart
2014-03-13 2:22 ` Simon Horman
2014-03-13 9:07 ` Laurent Pinchart
2014-03-14 0:38 ` Simon Horman
2014-03-01 13:50 ` Wolfram Sang
2014-03-01 17:33 ` Geert Uytterhoeven
2014-03-02 11:35 ` Laurent Pinchart
2014-03-02 11:51 ` Geert Uytterhoeven
2014-03-02 11:59 ` Wolfram Sang
2014-02-26 7:33 ` [PATCH v3 02/20] clk: shmobile: r8a7779: Add MSTP clock support Simon Horman
2014-02-26 12:53 ` Laurent Pinchart
2014-02-26 7:33 ` [PATCH v3 03/20] ARM: shmobile: r8a7779: Add clock index macros for DT sources Simon Horman
2014-02-26 12:56 ` Laurent Pinchart
2014-02-26 7:33 ` [PATCH v3 04/20] ARM: shmobile: r8a7779: Add clocks Simon Horman
2014-02-26 8:13 ` Geert Uytterhoeven
2014-02-26 8:55 ` Simon Horman
2014-02-26 13:15 ` Laurent Pinchart
2014-03-12 8:40 ` Simon Horman
2014-02-26 14:45 ` Laurent Pinchart
2014-03-12 8:43 ` Simon Horman
2014-03-01 14:29 ` Wolfram Sang
2014-02-26 7:33 ` [PATCH v3 05/20] ARM: shmobile: Sync Marzen DTS with Marzen reference DTS Simon Horman
2014-02-26 13:17 ` Laurent Pinchart
2014-02-26 7:33 ` [PATCH v3 06/20] ARM: shmobile: marzen: Specify external clock frequency in DT Simon Horman
2014-02-26 13:19 ` Laurent Pinchart
2014-02-26 7:33 ` [PATCH v3 07/20] ARM: shmobile: marzen: Reference clocks Simon Horman
2014-02-26 13:20 ` Laurent Pinchart
2014-02-26 15:23 ` Sergei Shtylyov
2014-03-13 0:09 ` Simon Horman
2014-02-26 7:33 ` [PATCH v3 08/20] ARM: shmobile: r8a7779: " Simon Horman
2014-02-26 13:21 ` Laurent Pinchart
2014-02-26 7:33 ` [PATCH v3 09/20] ARM: shmobile: r8a7779: Add helper to read mode pins Simon Horman
2014-02-26 7:33 ` [PATCH v3 10/20] ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c Simon Horman
2014-02-26 7:33 ` [PATCH v3 11/20] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code Simon Horman
2014-02-26 7:33 ` [PATCH v3 12/20] ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h Simon Horman
2014-02-26 7:33 ` [PATCH v3 13/20] ARM: shmobile: r8a7779: Initial multiplatform support Simon Horman
2014-02-26 7:33 ` [PATCH v3 14/20] ARM: shmobile: marzen-reference: Initialize CPG device Simon Horman
2014-02-26 13:22 ` Laurent Pinchart
2014-02-26 7:33 ` [PATCH v3 15/20] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU Simon Horman
2014-02-26 8:29 ` Geert Uytterhoeven
2014-02-26 8:56 ` Simon Horman
2014-02-26 13:24 ` Laurent Pinchart [this message]
2014-03-13 0:03 ` Simon Horman
2014-02-26 7:33 ` [PATCH v3 16/20] ARM: shmobile: marzen: Add to shmobile defconfig Simon Horman
2014-02-26 7:33 ` [PATCH v3 17/20] ARM: shmobile: Remove non-multiplatform Marzen reference support Simon Horman
2014-02-26 7:33 ` [PATCH v3 18/20] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB Simon Horman
2014-02-26 7:33 ` [PATCH v3 19/20] ARM: shmobile: Remove Marzen reference DTS Simon Horman
2014-02-26 7:33 ` [PATCH v3 20/20] ARM: shmobile: marzen-reference: Remove legacy clock support Simon Horman
2014-02-26 8:33 ` Geert Uytterhoeven
2014-02-26 8:57 ` Simon Horman
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=1792922.9Bi30kDKcG@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).