* [PATCH 0/2] clk: ux500: Add abx500 clock driver
@ 2012-11-22 10:35 Ulf Hansson
2012-11-22 10:35 ` [PATCH 1/2] clk: ux500: Initial support for " Ulf Hansson
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ulf Hansson @ 2012-11-22 10:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Ulf Hansson <ulf.hansson@linaro.org>
The abx500 clocks will not be initialized from the normal clk init call.
Instead the abx500 clocks relies on the abx500-core and therfore it also
make sense to let it be a child device to it.
Right now, I am not sure of which tree to go through when merging this, but
until that is settled I hope to collect ACKs.
Upcoming series will add the abx500 clock implementations and definitions.
Ulf Hansson (2):
clk: ux500: Initial support for abx500 clock driver
mfd: ab8500-core: Add abx500-clk as an mfd child device
drivers/clk/ux500/Makefile | 3 ++
drivers/clk/ux500/abx500-clk.c | 73 ++++++++++++++++++++++++++++++++++++++++
drivers/mfd/ab8500-core.c | 4 +++
3 files changed, 80 insertions(+)
create mode 100644 drivers/clk/ux500/abx500-clk.c
--
1.7.10
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] clk: ux500: Initial support for abx500 clock driver
2012-11-22 10:35 [PATCH 0/2] clk: ux500: Add abx500 clock driver Ulf Hansson
@ 2012-11-22 10:35 ` Ulf Hansson
2012-11-26 17:06 ` Mike Turquette
2012-11-22 10:35 ` [PATCH 2/2] mfd: ab8500-core: Add abx500-clk as an mfd child device Ulf Hansson
2012-11-22 13:25 ` [PATCH 0/2] clk: ux500: Add abx500 clock driver Linus Walleij
2 siblings, 1 reply; 7+ messages in thread
From: Ulf Hansson @ 2012-11-22 10:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Ulf Hansson <ulf.hansson@linaro.org>
The abx500 clock driver is a platform driver which will be initialized
during arch init. The platform device shall be added from the ab-core
driver as a mfd child device to maintain correct boot sequence.
Depending on what ab version we use, different clock definitions will
be added.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/clk/ux500/Makefile | 3 ++
drivers/clk/ux500/abx500-clk.c | 73 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 76 insertions(+)
create mode 100644 drivers/clk/ux500/abx500-clk.c
diff --git a/drivers/clk/ux500/Makefile b/drivers/clk/ux500/Makefile
index 858fbfe..bcc0c11 100644
--- a/drivers/clk/ux500/Makefile
+++ b/drivers/clk/ux500/Makefile
@@ -10,3 +10,6 @@ obj-y += clk-prcmu.o
obj-y += u8500_clk.o
obj-y += u9540_clk.o
obj-y += u8540_clk.o
+
+# ABX500 clock driver
+obj-y += abx500-clk.o
diff --git a/drivers/clk/ux500/abx500-clk.c b/drivers/clk/ux500/abx500-clk.c
new file mode 100644
index 0000000..e27c523
--- /dev/null
+++ b/drivers/clk/ux500/abx500-clk.c
@@ -0,0 +1,73 @@
+/*
+ * abx500 clock implementation for ux500 platform.
+ *
+ * Copyright (C) 2012 ST-Ericsson SA
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/mfd/abx500/ab8500.h>
+
+/* TODO: Add clock implementations here */
+
+
+/* Clock definitions for ab8500 */
+static int ab8500_reg_clks(struct device *dev)
+{
+ return 0;
+}
+
+/* Clock definitions for ab8540 */
+static int ab8540_reg_clks(struct device *dev)
+{
+ return 0;
+}
+
+/* Clock definitions for ab9540 */
+static int ab9540_reg_clks(struct device *dev)
+{
+ return 0;
+}
+
+static int __devinit abx500_clk_probe(struct platform_device *pdev)
+{
+ struct ab8500 *parent = dev_get_drvdata(pdev->dev.parent);
+ int ret;
+
+ if (is_ab8500(parent) || is_ab8505(parent)) {
+ ret = ab8500_reg_clks(&pdev->dev);
+ } else if (is_ab8540(parent)) {
+ ret = ab8540_reg_clks(&pdev->dev);
+ } else if (is_ab9540(parent)) {
+ ret = ab9540_reg_clks(&pdev->dev);
+ } else {
+ dev_err(&pdev->dev, "non supported plf id\n");
+ return -ENODEV;
+ }
+
+ return ret;
+}
+
+static struct platform_driver abx500_clk_driver = {
+ .driver = {
+ .name = "abx500-clk",
+ .owner = THIS_MODULE,
+ },
+ .probe = abx500_clk_probe,
+};
+
+static int __init abx500_clk_init(void)
+{
+ return platform_driver_register(&abx500_clk_driver);
+}
+
+arch_initcall(abx500_clk_init);
+
+MODULE_AUTHOR("Ulf Hansson <ulf.hansson@linaro.org");
+MODULE_DESCRIPTION("ABX500 clk driver");
+MODULE_LICENSE("GPL v2");
--
1.7.10
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] mfd: ab8500-core: Add abx500-clk as an mfd child device
2012-11-22 10:35 [PATCH 0/2] clk: ux500: Add abx500 clock driver Ulf Hansson
2012-11-22 10:35 ` [PATCH 1/2] clk: ux500: Initial support for " Ulf Hansson
@ 2012-11-22 10:35 ` Ulf Hansson
2012-11-23 11:18 ` Samuel Ortiz
2012-11-22 13:25 ` [PATCH 0/2] clk: ux500: Add abx500 clock driver Linus Walleij
2 siblings, 1 reply; 7+ messages in thread
From: Ulf Hansson @ 2012-11-22 10:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Ulf Hansson <ulf.hansson@linaro.org>
Hierarchically, the abx500-clk shall be considered as a child of the
ab8500 core. The abx500-clk is intiated at arch init and thus the clks
will be available when clients needs them.
Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/mfd/ab8500-core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 1667c77..b8fe5f6f 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -984,6 +984,10 @@ static struct mfd_cell __devinitdata abx500_common_devs[] = {
.of_compatible = "stericsson,ab8500-regulator",
},
{
+ .name = "abx500-clk",
+ .of_compatible = "stericsson,abx500-clk",
+ },
+ {
.name = "ab8500-gpadc",
.of_compatible = "stericsson,ab8500-gpadc",
.num_resources = ARRAY_SIZE(ab8500_gpadc_resources),
--
1.7.10
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 0/2] clk: ux500: Add abx500 clock driver
2012-11-22 10:35 [PATCH 0/2] clk: ux500: Add abx500 clock driver Ulf Hansson
2012-11-22 10:35 ` [PATCH 1/2] clk: ux500: Initial support for " Ulf Hansson
2012-11-22 10:35 ` [PATCH 2/2] mfd: ab8500-core: Add abx500-clk as an mfd child device Ulf Hansson
@ 2012-11-22 13:25 ` Linus Walleij
2012-11-23 15:43 ` Ulf Hansson
2 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2012-11-22 13:25 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Nov 22, 2012 at 11:35 AM, Ulf Hansson
<ulf.hansson@stericsson.com> wrote:
> From: Ulf Hansson <ulf.hansson@linaro.org>
>
> The abx500 clocks will not be initialized from the normal clk init call.
>
> Instead the abx500 clocks relies on the abx500-core and therfore it also
> make sense to let it be a child device to it.
>
> Right now, I am not sure of which tree to go through when merging this, but
> until that is settled I hope to collect ACKs.
>
> Upcoming series will add the abx500 clock implementations and definitions.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
for all.
I think the best is to have Sam ACK it and take this through
Mr. Turquette's tree?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] mfd: ab8500-core: Add abx500-clk as an mfd child device
2012-11-22 10:35 ` [PATCH 2/2] mfd: ab8500-core: Add abx500-clk as an mfd child device Ulf Hansson
@ 2012-11-23 11:18 ` Samuel Ortiz
0 siblings, 0 replies; 7+ messages in thread
From: Samuel Ortiz @ 2012-11-23 11:18 UTC (permalink / raw)
To: linux-arm-kernel
Hi Ulf,
On Thu, Nov 22, 2012 at 11:35:40AM +0100, Ulf Hansson wrote:
> From: Ulf Hansson <ulf.hansson@linaro.org>
>
> Hierarchically, the abx500-clk shall be considered as a child of the
> ab8500 core. The abx500-clk is intiated at arch init and thus the clks
> will be available when clients needs them.
>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
> drivers/mfd/ab8500-core.c | 4 ++++
> 1 file changed, 4 insertions(+)
Patch applied, thanks.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/2] clk: ux500: Add abx500 clock driver
2012-11-22 13:25 ` [PATCH 0/2] clk: ux500: Add abx500 clock driver Linus Walleij
@ 2012-11-23 15:43 ` Ulf Hansson
0 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2012-11-23 15:43 UTC (permalink / raw)
To: linux-arm-kernel
On 22 November 2012 14:25, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Thu, Nov 22, 2012 at 11:35 AM, Ulf Hansson
> <ulf.hansson@stericsson.com> wrote:
>
>> From: Ulf Hansson <ulf.hansson@linaro.org>
>>
>> The abx500 clocks will not be initialized from the normal clk init call.
>>
>> Instead the abx500 clocks relies on the abx500-core and therfore it also
>> make sense to let it be a child device to it.
>>
>> Right now, I am not sure of which tree to go through when merging this, but
>> until that is settled I hope to collect ACKs.
>>
>> Upcoming series will add the abx500 clock implementations and definitions.
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> for all.
>
> I think the best is to have Sam ACK it and take this through
> Mr. Turquette's tree?
>
> Yours,
> Linus Walleij
Samuel already applied the mfd patch.
So let's take these patches as standalone patches. Mike can take the
clk patch through his tree, that should not be any problem I think.
Kind regards
Ulf Hansson
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] clk: ux500: Initial support for abx500 clock driver
2012-11-22 10:35 ` [PATCH 1/2] clk: ux500: Initial support for " Ulf Hansson
@ 2012-11-26 17:06 ` Mike Turquette
0 siblings, 0 replies; 7+ messages in thread
From: Mike Turquette @ 2012-11-26 17:06 UTC (permalink / raw)
To: linux-arm-kernel
Quoting Ulf Hansson (2012-11-22 02:35:39)
> From: Ulf Hansson <ulf.hansson@linaro.org>
>
> The abx500 clock driver is a platform driver which will be initialized
> during arch init. The platform device shall be added from the ab-core
> driver as a mfd child device to maintain correct boot sequence.
>
> Depending on what ab version we use, different clock definitions will
> be added.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Taken into clk-next.
Thanks,
Mike
> ---
> drivers/clk/ux500/Makefile | 3 ++
> drivers/clk/ux500/abx500-clk.c | 73 ++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 76 insertions(+)
> create mode 100644 drivers/clk/ux500/abx500-clk.c
>
> diff --git a/drivers/clk/ux500/Makefile b/drivers/clk/ux500/Makefile
> index 858fbfe..bcc0c11 100644
> --- a/drivers/clk/ux500/Makefile
> +++ b/drivers/clk/ux500/Makefile
> @@ -10,3 +10,6 @@ obj-y += clk-prcmu.o
> obj-y += u8500_clk.o
> obj-y += u9540_clk.o
> obj-y += u8540_clk.o
> +
> +# ABX500 clock driver
> +obj-y += abx500-clk.o
> diff --git a/drivers/clk/ux500/abx500-clk.c b/drivers/clk/ux500/abx500-clk.c
> new file mode 100644
> index 0000000..e27c523
> --- /dev/null
> +++ b/drivers/clk/ux500/abx500-clk.c
> @@ -0,0 +1,73 @@
> +/*
> + * abx500 clock implementation for ux500 platform.
> + *
> + * Copyright (C) 2012 ST-Ericsson SA
> + * Author: Ulf Hansson <ulf.hansson@linaro.org>
> + *
> + * License terms: GNU General Public License (GPL) version 2
> + */
> +
> +#include <linux/err.h>
> +#include <linux/module.h>
> +#include <linux/device.h>
> +#include <linux/platform_device.h>
> +#include <linux/mfd/abx500/ab8500.h>
> +
> +/* TODO: Add clock implementations here */
> +
> +
> +/* Clock definitions for ab8500 */
> +static int ab8500_reg_clks(struct device *dev)
> +{
> + return 0;
> +}
> +
> +/* Clock definitions for ab8540 */
> +static int ab8540_reg_clks(struct device *dev)
> +{
> + return 0;
> +}
> +
> +/* Clock definitions for ab9540 */
> +static int ab9540_reg_clks(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static int __devinit abx500_clk_probe(struct platform_device *pdev)
> +{
> + struct ab8500 *parent = dev_get_drvdata(pdev->dev.parent);
> + int ret;
> +
> + if (is_ab8500(parent) || is_ab8505(parent)) {
> + ret = ab8500_reg_clks(&pdev->dev);
> + } else if (is_ab8540(parent)) {
> + ret = ab8540_reg_clks(&pdev->dev);
> + } else if (is_ab9540(parent)) {
> + ret = ab9540_reg_clks(&pdev->dev);
> + } else {
> + dev_err(&pdev->dev, "non supported plf id\n");
> + return -ENODEV;
> + }
> +
> + return ret;
> +}
> +
> +static struct platform_driver abx500_clk_driver = {
> + .driver = {
> + .name = "abx500-clk",
> + .owner = THIS_MODULE,
> + },
> + .probe = abx500_clk_probe,
> +};
> +
> +static int __init abx500_clk_init(void)
> +{
> + return platform_driver_register(&abx500_clk_driver);
> +}
> +
> +arch_initcall(abx500_clk_init);
> +
> +MODULE_AUTHOR("Ulf Hansson <ulf.hansson@linaro.org");
> +MODULE_DESCRIPTION("ABX500 clk driver");
> +MODULE_LICENSE("GPL v2");
> --
> 1.7.10
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-11-26 17:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-22 10:35 [PATCH 0/2] clk: ux500: Add abx500 clock driver Ulf Hansson
2012-11-22 10:35 ` [PATCH 1/2] clk: ux500: Initial support for " Ulf Hansson
2012-11-26 17:06 ` Mike Turquette
2012-11-22 10:35 ` [PATCH 2/2] mfd: ab8500-core: Add abx500-clk as an mfd child device Ulf Hansson
2012-11-23 11:18 ` Samuel Ortiz
2012-11-22 13:25 ` [PATCH 0/2] clk: ux500: Add abx500 clock driver Linus Walleij
2012-11-23 15:43 ` Ulf Hansson
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).