···11+/*22+ * Hisilicon HiP04 clock driver33+ *44+ * Copyright (c) 2013-2014 Hisilicon Limited.55+ * Copyright (c) 2013-2014 Linaro Limited.66+ *77+ * Author: Haojian Zhuang <haojian.zhuang@linaro.org>88+ *99+ * This program is free software; you can redistribute it and/or modify1010+ * it under the terms of the GNU General Public License as published by1111+ * the Free Software Foundation; either version 2 of the License, or1212+ * (at your option) any later version.1313+ *1414+ * This program is distributed in the hope that it will be useful,1515+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1616+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1717+ * GNU General Public License for more details.1818+ *1919+ * You should have received a copy of the GNU General Public License along2020+ * with this program; if not, write to the Free Software Foundation, Inc.,2121+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.2222+ *2323+ */2424+2525+#include <linux/kernel.h>2626+#include <linux/clk-provider.h>2727+#include <linux/clkdev.h>2828+#include <linux/io.h>2929+#include <linux/of.h>3030+#include <linux/of_address.h>3131+#include <linux/of_device.h>3232+#include <linux/slab.h>3333+#include <linux/clk.h>3434+3535+#include <dt-bindings/clock/hip04-clock.h>3636+3737+#include "clk.h"3838+3939+/* fixed rate clocks */4040+static struct hisi_fixed_rate_clock hip04_fixed_rate_clks[] __initdata = {4141+ { HIP04_OSC50M, "osc50m", NULL, CLK_IS_ROOT, 50000000, },4242+ { HIP04_CLK_50M, "clk50m", NULL, CLK_IS_ROOT, 50000000, },4343+ { HIP04_CLK_168M, "clk168m", NULL, CLK_IS_ROOT, 168750000, },4444+};4545+4646+static void __init hip04_clk_init(struct device_node *np)4747+{4848+ hisi_clk_init(np, HIP04_NR_CLKS);4949+5050+ hisi_clk_register_fixed_rate(hip04_fixed_rate_clks,5151+ ARRAY_SIZE(hip04_fixed_rate_clks),5252+ NULL);5353+}5454+CLK_OF_DECLARE(hip04_clk, "hisilicon,hip04-clock", hip04_clk_init);
+35
include/dt-bindings/clock/hip04-clock.h
···11+/*22+ * Copyright (c) 2013-2014 Hisilicon Limited.33+ * Copyright (c) 2013-2014 Linaro Limited.44+ *55+ * Author: Haojian Zhuang <haojian.zhuang@linaro.org>66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License as published by99+ * the Free Software Foundation; either version 2 of the License, or1010+ * (at your option) any later version.1111+ *1212+ * This program is distributed in the hope that it will be useful,1313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1414+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515+ * GNU General Public License for more details.1616+ *1717+ * You should have received a copy of the GNU General Public License along1818+ * with this program; if not, write to the Free Software Foundation, Inc.,1919+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.2020+ *2121+ */2222+2323+#ifndef __DTS_HIP04_CLOCK_H2424+#define __DTS_HIP04_CLOCK_H2525+2626+#define HIP04_NONE_CLOCK 02727+2828+/* fixed rate & fixed factor clocks */2929+#define HIP04_OSC50M 13030+#define HIP04_CLK_50M 23131+#define HIP04_CLK_168M 33232+3333+#define HIP04_NR_CLKS 643434+3535+#endif /* __DTS_HIP04_CLOCK_H */