msm: dummy no-op clock support
Subsystems (3)
cover msm: dummy no-op clock support
This patchset adds support for dummy no-op clocks. Some older MSM targets combined the AHB clock (what we call pclk) with the core clk and newer targets split the clocks out. Since we don't want to clutter drivers with ifdefs or add checks for IS_ERR clocks add support for a dummy clock. This simplifies drivers because they can always assume a clock is present and error out if it isn't.
On top of this, add dummy clocks for 8960 to ease driver development.
Stephen Boyd (2):
msm: clock: Support dummy clocks
msm: 8960: Add dummy clocks for 8960
arch/arm/mach-msm/Makefile | 1 + arch/arm/mach-msm/board-msm8960.c | 7 ++ arch/arm/mach-msm/clock-dummy.c | 81 ++++++++++++++++++ arch/arm/mach-msm/clock.h | 11 +++ arch/arm/mach-msm/devices-msm8960.c | 160 +++++++++++++++++++++++++++++++++++ arch/arm/mach-msm/devices.h | 3 + 6 files changed, 263 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-msm/clock-dummy.c
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH 1/2 msm: clock: Support dummy clocks
Implement a dummy clock driver and macro in the spirit of CLK_PCOM(). This is useful on targets where a pclk doesn't exist and we want to keep drivers sane by providing such clocks.
--- arch/arm/mach-msm/Makefile | 1 + arch/arm/mach-msm/clock-dummy.c | 81 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-msm/clock.h | 11 +++++ 3 files changed, 93 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-msm/clock-dummy.c
arch/arm/mach-msm/Makefile +1 -0
@@ -1,5 +1,6 @@ obj-y += io.o idle.o timer.o obj-y += clock.o +obj-y += clock-dummy.o obj-$(CONFIG_DEBUG_FS) += clock-debug.o obj-$(CONFIG_MSM_VIC) += irq-vic.o
arch/arm/mach-msm/clock-dummy.c new file +81 -0
81 lines not on this page · raw message
arch/arm/mach-msm/clock.h +11 -0
@@ -69,4 +69,15 @@ static inline int __init clock_debug_init(void) { return 0; }static inline int __init clock_debug_add (struct clk *clock) {return 0 ; }#endif +extern struct clk_ops clk_ops_dummy; + +#define CLK_DUMMY (clk_name, clk_id, clk_dev) { \ + .con_id = clk_name, \ + .dev_id = clk_dev, \ + .clk = &(struct clk){ \ + .dbg_name = #clk_id, \ + .ops = &clk_ops_dummy, \ + }, \ + } +#endif
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Re: [PATCH 1/2] msm: clock: Support dummy clocks
Quoted 5 lines · Stephen Boyd
Implement a dummy clock driver and macro in the spirit of
CLK_PCOM(). This is useful on targets where a pclk doesn't exist and we want to keep drivers sane by providing such clocks.Change-Id: Iad37f6e5f19052127814934cf7484971fdb4fcda
Please remember to remove any 'Change-Id' lines before posting patches. I'll pull these out of these patches.
David
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH 2/2 msm: 8960: Add dummy clocks for 8960
In reply to Stephen BoydCurrent 8960 devices have all clocks enabled by default. Add dummy clk_lookup mappings for devices so that driver authors can link up their devices to clocks.
--- arch/arm/mach-msm/board-msm8960.c | 7 ++ arch/arm/mach-msm/devices-msm8960.c | 160 +++++++++++++++++++++++++++++++++++ arch/arm/mach-msm/devices.h | 3 + 3 files changed, 170 insertions(+), 0 deletions(-)
arch/arm/mach-msm/board-msm8960.c +7 -0
@@ -35,6 +35,11 @@ static void __init msm8960_map_io(void)msm_map_msm8960_io (); } +static void __init msm8960_init_early (void ) +{ +msm_clock_init (msm_clocks_8960, msm_num_clocks_8960); +} +static void __init msm8960_init_irq (void ) {unsigned int i;
@@ -77,6 +82,7 @@ static void __init msm8960_rumi3_init(void)MACHINE_START (MSM8960_SIM ,"QCT MSM8960 SIMULATOR" ) .map_io = msm8960_map_io, + .init_early = msm8960_init_early, .init_irq = msm8960_init_irq, .timer = &msm_timer, .init_machine = msm8960_sim_init,
@@ -84,6 +90,7 @@ MACHINE_ENDMACHINE_START (MSM8960_RUMI3 ,"QCT MSM8960 RUMI3" ) .map_io = msm8960_map_io, + .init_early = msm8960_init_early, .init_irq = msm8960_init_irq, .timer = &msm_timer, .init_machine = msm8960_rumi3_init,
arch/arm/mach-msm/devices-msm8960.c +160 -0
169 lines not on this page · raw message
arch/arm/mach-msm/devices.h +3 -0
@@ -55,4 +55,7 @@ extern unsigned msm_num_clocks_7x30;extern struct clk_lookup msm_clocks_8x50[];extern unsigned msm_num_clocks_8x50; +extern struct clk_lookup msm_clocks_8960[]; +extern unsigned msm_num_clocks_8960; +#endif
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.