clk: ux500: Add abx500 clock driver
Subsystems (4)
cover clk: ux500: Add abx500 clock driver
From: Ulf Hansson <[email protected]>
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
Signature · 1 line
1.7.10
PATCH 1/2 clk: ux500: Initial support for abx500 clock driver
From: Ulf Hansson <[email protected]>
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.
--- 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
drivers/clk/ux500/Makefile +3 -0
@@ -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
drivers/clk/ux500/abx500-clk.c new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
1.7.10
PATCH 1/2 clk: ux500: Initial support for abx500 clock driver
Quoting Ulf Hansson (2012-11-22 02:35:39)
Quoted 10 lines
From: Ulf Hansson <[email protected]>
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 <[email protected]>
Taken into clk-next.
Thanks,
Mike
Quoted 98 lines
--- 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.cdrivers/clk/ux500/Makefile +3
-0@@ -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.odrivers/clk/ux500/abx500-clk.c new file +73
-0@@ -0,0 +1,73 @@ +/* +* abx500 clock implementation for ux500 platform. +* +* Copyright (C) 2012 ST-Ericsson SA +* Author: Ulf Hansson <[email protected]> +* +* 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 <[email protected]" ); +MODULE_DESCRIPTION ("ABX500 clk driver" ); +MODULE_LICENSE ("GPL v2" );Signature · 1 line
1.7.10
PATCH 2/2 mfd: ab8500-core: Add abx500-clk as an mfd child device
In reply to Ulf HanssonFrom: Ulf Hansson <[email protected]>
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.
--- drivers/mfd/ab8500-core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mfd/ab8500-core.c +4 -0
@@ -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),
Signature · 1 line
1.7.10
PATCH 2/2 mfd: ab8500-core: Add abx500-clk as an mfd child device
Hi Ulf,
Quoted 11 lines · Ulf Hansson
From: Ulf Hansson <[email protected]>
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 <[email protected]>Signed-off-by Ulf Hansson <[email protected]>--- drivers/mfd/ab8500-core.c | 4 ++++ 1 file changed, 4 insertions(+)
Patch applied, thanks.
Cheers,
Samuel.
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/
cover clk: ux500: Add abx500 clock driver
In reply to Ulf HanssonQuoted 11 lines · Ulf Hansson
From: Ulf Hansson <[email protected]>
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.
for all.
I think the best is to have Sam ACK it and take this through Mr. Turquette's tree?
Yours,
Linus Walleij
cover clk: ux500: Add abx500 clock driver
Quoted 15 lines · Linus Walleij
Quoted 11 lines · Ulf Hansson
From: Ulf Hansson <[email protected]>
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.
Quoted 8 lines
Reviewed-by Linus Walleij <[email protected]>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