From 716ca530e1c4515d8683c9d5be3d56b301758b66 Mon Sep 17 00:00:00 2001 From: James <> Date: Wed, 4 Nov 2015 11:49:21 +0000 Subject: trunk-47381 --- .../patches-4.1/162-clk-sunxi-codec-clock.patch | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 target/linux/sunxi/patches-4.1/162-clk-sunxi-codec-clock.patch (limited to 'target/linux/sunxi/patches-4.1/162-clk-sunxi-codec-clock.patch') diff --git a/target/linux/sunxi/patches-4.1/162-clk-sunxi-codec-clock.patch b/target/linux/sunxi/patches-4.1/162-clk-sunxi-codec-clock.patch new file mode 100644 index 0000000..c19d7a6 --- /dev/null +++ b/target/linux/sunxi/patches-4.1/162-clk-sunxi-codec-clock.patch @@ -0,0 +1,73 @@ +From 9b95732096c11d84bd0082aed0d575d8c09e3ab6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Emilio=20L=C3=B3pez?= +Date: Fri, 18 Jul 2014 15:49:37 -0300 +Subject: [PATCH] clk: sunxi: codec clock support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The codec clock on sun4i, sun5i and sun7i is a simple gate with PLL2 as +parent. + +Signed-off-by: Emilio López +Signed-off-by: Hans de Goede +--- + drivers/clk/sunxi/Makefile | 1 + + drivers/clk/sunxi/clk-a10-codec.c | 41 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 42 insertions(+) + create mode 100644 drivers/clk/sunxi/clk-a10-codec.c + +--- a/drivers/clk/sunxi/Makefile ++++ b/drivers/clk/sunxi/Makefile +@@ -3,6 +3,7 @@ + # + + obj-y += clk-sunxi.o clk-factors.o ++obj-y += clk-a10-codec.o + obj-y += clk-a10-hosc.o + obj-y += clk-a10-pll2.o + obj-y += clk-a20-gmac.o +--- /dev/null ++++ b/drivers/clk/sunxi/clk-a10-codec.c +@@ -0,0 +1,41 @@ ++/* ++ * Copyright 2013 Emilio López ++ * ++ * Emilio López ++ * ++ * 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. ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#define SUN4I_CODEC_GATE 31 ++ ++static void __init sun4i_codec_clk_setup(struct device_node *node) ++{ ++ struct clk *clk; ++ const char *clk_name = node->name, *parent_name; ++ void __iomem *reg; ++ ++ of_property_read_string(node, "clock-output-names", &clk_name); ++ parent_name = of_clk_get_parent_name(node, 0); ++ reg = of_iomap(node, 0); ++ ++ clk = clk_register_gate(NULL, clk_name, parent_name, ++ CLK_SET_RATE_PARENT, reg, ++ SUN4I_CODEC_GATE, 0, NULL); ++ ++ if (!IS_ERR(clk)) ++ of_clk_add_provider(node, of_clk_src_simple_get, clk); ++} ++CLK_OF_DECLARE(sun4i_codec, "allwinner,sun4i-a10-codec-clk", sun4i_codec_clk_setup); -- cgit v1.2.3