Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1203988
| From | James Liao <jamesjj.liao@mediatek.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v7 4/9] clk: mediatek: Add fixed clocks support for Mediatek SoC. |
| Date | 2015-08-10 12:00 +0200 |
| Message-ID | <pVS2b-2wD-113@gated-at.bofh.it> (permalink) |
| References | <pVS26-2wD-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This patch adds fixed clocks support by using CCF fixed-rate
clock implementation.
Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
---
drivers/clk/mediatek/clk-mtk.c | 23 +++++++++++++++++++++++
drivers/clk/mediatek/clk-mtk.h | 17 +++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
index 268b6ff..cf08db6 100644
--- a/drivers/clk/mediatek/clk-mtk.c
+++ b/drivers/clk/mediatek/clk-mtk.c
@@ -49,6 +49,29 @@ err_out:
return NULL;
}
+void __init mtk_clk_register_fixed_clks(const struct mtk_fixed_clk *clks,
+ int num, struct clk_onecell_data *clk_data)
+{
+ int i;
+ struct clk *clk;
+
+ for (i = 0; i < num; i++) {
+ const struct mtk_fixed_clk *rc = &clks[i];
+
+ clk = clk_register_fixed_rate(NULL, rc->name, rc->parent,
+ rc->parent ? 0 : CLK_IS_ROOT, rc->rate);
+
+ if (IS_ERR(clk)) {
+ pr_err("Failed to register clk %s: %ld\n",
+ rc->name, PTR_ERR(clk));
+ continue;
+ }
+
+ if (clk_data)
+ clk_data->clks[rc->id] = clk;
+ }
+}
+
void __init mtk_clk_register_factors(const struct mtk_fixed_factor *clks,
int num, struct clk_onecell_data *clk_data)
{
diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h
index 740fe5e..32d4f55 100644
--- a/drivers/clk/mediatek/clk-mtk.h
+++ b/drivers/clk/mediatek/clk-mtk.h
@@ -25,6 +25,23 @@
#define MHZ (1000 * 1000)
+struct mtk_fixed_clk {
+ int id;
+ const char *name;
+ const char *parent;
+ unsigned long rate;
+};
+
+#define FIXED_CLK(_id, _name, _parent, _rate) { \
+ .id = _id, \
+ .name = _name, \
+ .parent = _parent, \
+ .rate = _rate, \
+ }
+
+void mtk_clk_register_fixed_clks(const struct mtk_fixed_clk *clks,
+ int num, struct clk_onecell_data *clk_data);
+
struct mtk_fixed_factor {
int id;
const char *name;
--
1.8.1.1.dirty
--
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 | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v7 0/9] Fixes and new clocks support for Mediatek MT8173 James Liao <jamesjj.liao@mediatek.com> - 2015-08-10 12:00 +0200
[PATCH v7 6/9] dt-bindings: ARM: Mediatek: Document devicetree bindings for clock controllers James Liao <jamesjj.liao@mediatek.com> - 2015-08-10 12:00 +0200
[PATCH v7 3/9] clk: mediatek: Add __initdata and __init for data and functions James Liao <jamesjj.liao@mediatek.com> - 2015-08-10 12:00 +0200
[PATCH v7 8/9] clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS James Liao <jamesjj.liao@mediatek.com> - 2015-08-10 12:00 +0200
[PATCH v7 4/9] clk: mediatek: Add fixed clocks support for Mediatek SoC. James Liao <jamesjj.liao@mediatek.com> - 2015-08-10 12:00 +0200
[PATCH v7 1/9] clk: mediatek: Removed unused dpi_ck clock from MT8173 James Liao <jamesjj.liao@mediatek.com> - 2015-08-10 12:20 +0200
Re: [PATCH v7 0/9] Fixes and new clocks support for Mediatek MT8173 Daniel Kurtz <djkurtz@chromium.org> - 2015-08-11 06:50 +0200
Re: [PATCH v7 0/9] Fixes and new clocks support for Mediatek MT8173 Daniel Kurtz <djkurtz@chromium.org> - 2015-08-14 06:10 +0200
Re: [PATCH v7 0/9] Fixes and new clocks support for Mediatek MT8173 Sascha Hauer <s.hauer@pengutronix.de> - 2015-08-19 17:00 +0200
csiph-web