diff options
author | Olof Johansson <olof@lixom.net> | 2012-09-16 21:31:37 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-09-16 21:31:37 -0400 |
commit | 2e6185f1fea6cf88e9ce25cde1d6291ddfb3d4f0 (patch) | |
tree | c45ae7bace055c258fba5c4c6c0340b1e3f17f05 /arch/arm/kernel | |
parent | 7405a749ae14f846cc2892c36d1a9343b0264b7c (diff) | |
parent | fd301cc4e5ba839050be135a178031bcd0d363a5 (diff) |
Merge tag 'tegra-for-3.7-drivers-i2c' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/drivers
From Stephen Warren:
ARM: tegra: i2c driver enhancements mostly related to clocking
This branch contains a number of fixes and cleanups to the Tegra I2C
driver related to clocks. These are based on the common clock conversion
in order to avoid duplicating the clock driver changes before and after
the conversion. Finally, a bug-fix related to I2C_M_NOSTART is included.
This branch is based on previous pull request tegra-for-3.7-common-clk.
* tag 'tegra-for-3.7-drivers-i2c' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra:
i2c: tegra: dynamically control fast clk
i2c: tegra: I2_M_NOSTART functionality not supported in Tegra20
ARM: tegra: clock: remove unused clock entry for i2c
ARM: tegra: clock: add connection name in i2c clock entry
i2c: tegra: pass proper name for getting clock
ARM: tegra: clock: add i2c fast clock entry in clock table
ARM: Tegra: Add smp_twd clock for Tegra20
ARM: tegra: cpu-tegra: explicitly manage re-parenting
ARM: tegra: fix overflow in tegra20_pll_clk_round_rate()
ARM: tegra: Fix data type for io address
ARM: tegra: remove tegra_timer from tegra_list_clks
ARM: tegra30: clocks: fix the wrong tegra_audio_sync_clk_ops name
ARM: tegra: clocks: separate tegra_clk_32k_ops from Tegra20 and Tegra30
ARM: tegra: Remove duplicate code
ARM: tegra: Port tegra to generic clock framework
ARM: tegra: Add clk_tegra structure and helper functions
ARM: tegra: Rename tegra20 clock file
ARM: tegra20: Separate out clk ops and clk data
ARM: tegra30: Separate out clk ops and clk data
ARM: tegra: fix U16 divider range check
...
+ sync to v3.6-rc4
Resolved remove/modify conflict in arch/arm/mach-sa1100/leds-hackkit.c
caused by the sync with v3.6-rc4.
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/sched_clock.c | 24 | ||||
-rw-r--r-- | arch/arm/kernel/topology.c | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c index 27d186abbc06..f4515393248d 100644 --- a/arch/arm/kernel/sched_clock.c +++ b/arch/arm/kernel/sched_clock.c | |||
@@ -21,6 +21,8 @@ struct clock_data { | |||
21 | u32 epoch_cyc_copy; | 21 | u32 epoch_cyc_copy; |
22 | u32 mult; | 22 | u32 mult; |
23 | u32 shift; | 23 | u32 shift; |
24 | bool suspended; | ||
25 | bool needs_suspend; | ||
24 | }; | 26 | }; |
25 | 27 | ||
26 | static void sched_clock_poll(unsigned long wrap_ticks); | 28 | static void sched_clock_poll(unsigned long wrap_ticks); |
@@ -49,6 +51,9 @@ static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask) | |||
49 | u64 epoch_ns; | 51 | u64 epoch_ns; |
50 | u32 epoch_cyc; | 52 | u32 epoch_cyc; |
51 | 53 | ||
54 | if (cd.suspended) | ||
55 | return cd.epoch_ns; | ||
56 | |||
52 | /* | 57 | /* |
53 | * Load the epoch_cyc and epoch_ns atomically. We do this by | 58 | * Load the epoch_cyc and epoch_ns atomically. We do this by |
54 | * ensuring that we always write epoch_cyc, epoch_ns and | 59 | * ensuring that we always write epoch_cyc, epoch_ns and |
@@ -98,6 +103,13 @@ static void sched_clock_poll(unsigned long wrap_ticks) | |||
98 | update_sched_clock(); | 103 | update_sched_clock(); |
99 | } | 104 | } |
100 | 105 | ||
106 | void __init setup_sched_clock_needs_suspend(u32 (*read)(void), int bits, | ||
107 | unsigned long rate) | ||
108 | { | ||
109 | setup_sched_clock(read, bits, rate); | ||
110 | cd.needs_suspend = true; | ||
111 | } | ||
112 | |||
101 | void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) | 113 | void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) |
102 | { | 114 | { |
103 | unsigned long r, w; | 115 | unsigned long r, w; |
@@ -169,11 +181,23 @@ void __init sched_clock_postinit(void) | |||
169 | static int sched_clock_suspend(void) | 181 | static int sched_clock_suspend(void) |
170 | { | 182 | { |
171 | sched_clock_poll(sched_clock_timer.data); | 183 | sched_clock_poll(sched_clock_timer.data); |
184 | if (cd.needs_suspend) | ||
185 | cd.suspended = true; | ||
172 | return 0; | 186 | return 0; |
173 | } | 187 | } |
174 | 188 | ||
189 | static void sched_clock_resume(void) | ||
190 | { | ||
191 | if (cd.needs_suspend) { | ||
192 | cd.epoch_cyc = read_sched_clock(); | ||
193 | cd.epoch_cyc_copy = cd.epoch_cyc; | ||
194 | cd.suspended = false; | ||
195 | } | ||
196 | } | ||
197 | |||
175 | static struct syscore_ops sched_clock_ops = { | 198 | static struct syscore_ops sched_clock_ops = { |
176 | .suspend = sched_clock_suspend, | 199 | .suspend = sched_clock_suspend, |
200 | .resume = sched_clock_resume, | ||
177 | }; | 201 | }; |
178 | 202 | ||
179 | static int __init sched_clock_syscore_init(void) | 203 | static int __init sched_clock_syscore_init(void) |
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 198b08456e90..26c12c6440fc 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c | |||
@@ -321,7 +321,7 @@ void store_cpu_topology(unsigned int cpuid) | |||
321 | * init_cpu_topology is called at boot when only one cpu is running | 321 | * init_cpu_topology is called at boot when only one cpu is running |
322 | * which prevent simultaneous write access to cpu_topology array | 322 | * which prevent simultaneous write access to cpu_topology array |
323 | */ | 323 | */ |
324 | void init_cpu_topology(void) | 324 | void __init init_cpu_topology(void) |
325 | { | 325 | { |
326 | unsigned int cpu; | 326 | unsigned int cpu; |
327 | 327 | ||