diff options
author | Ranjith Lohithakshan <ranjithl@ti.com> | 2010-02-24 14:05:54 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-02-24 14:05:54 -0500 |
commit | 419cc97d3678f0fca5e60b3853dd9c1371f67805 (patch) | |
tree | a3997e3f9ad52abf927597f8e241fb6dfb02ab00 /arch/arm/mach-omap2/clock34xx.c | |
parent | cde08f81b1d7952ae00c4be2165da629ef985522 (diff) |
OMAP2/3 clock: Extend find_idlest() to pass back idle state value
Current implementation defines clock idle state indicators based on the
cpu information (cpu_is_omap24xx() or cpu_is_omap34xx()) in a system wide
manner. This patch extends the find_idlest() function in clkops to pass
back the idle state indicator for that clock, thus allowing idle state
indicators to be defined on a per clock basis if required.
This is specifically needed on AM35xx devices as the new IPSS clocks
indicates the idle status (0 is idle, 1 is ready) in a way just
opposite to how its handled in OMAP3 (0 is ready, 1 is idle).
Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
[paul@pwsan.com: updated to apply after commit 98c45457 et seq.]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/clock34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/clock34xx.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index ae9e2c82eb6a..49d93efc1911 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c | |||
@@ -47,6 +47,7 @@ struct clk *sdrc_ick_p, *arm_fck_p; | |||
47 | * @clk: struct clk * being enabled | 47 | * @clk: struct clk * being enabled |
48 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | 48 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into |
49 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | 49 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into |
50 | * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator | ||
50 | * | 51 | * |
51 | * The OMAP3430ES2 SSI target CM_IDLEST bit is at a different shift | 52 | * The OMAP3430ES2 SSI target CM_IDLEST bit is at a different shift |
52 | * from the CM_{I,F}CLKEN bit. Pass back the correct info via | 53 | * from the CM_{I,F}CLKEN bit. Pass back the correct info via |
@@ -54,13 +55,15 @@ struct clk *sdrc_ick_p, *arm_fck_p; | |||
54 | */ | 55 | */ |
55 | static void omap3430es2_clk_ssi_find_idlest(struct clk *clk, | 56 | static void omap3430es2_clk_ssi_find_idlest(struct clk *clk, |
56 | void __iomem **idlest_reg, | 57 | void __iomem **idlest_reg, |
57 | u8 *idlest_bit) | 58 | u8 *idlest_bit, |
59 | u8 *idlest_val) | ||
58 | { | 60 | { |
59 | u32 r; | 61 | u32 r; |
60 | 62 | ||
61 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); | 63 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); |
62 | *idlest_reg = (__force void __iomem *)r; | 64 | *idlest_reg = (__force void __iomem *)r; |
63 | *idlest_bit = OMAP3430ES2_ST_SSI_IDLE_SHIFT; | 65 | *idlest_bit = OMAP3430ES2_ST_SSI_IDLE_SHIFT; |
66 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; | ||
64 | } | 67 | } |
65 | 68 | ||
66 | const struct clkops clkops_omap3430es2_ssi_wait = { | 69 | const struct clkops clkops_omap3430es2_ssi_wait = { |
@@ -75,6 +78,7 @@ const struct clkops clkops_omap3430es2_ssi_wait = { | |||
75 | * @clk: struct clk * being enabled | 78 | * @clk: struct clk * being enabled |
76 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | 79 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into |
77 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | 80 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into |
81 | * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator | ||
78 | * | 82 | * |
79 | * Some OMAP modules on OMAP3 ES2+ chips have both initiator and | 83 | * Some OMAP modules on OMAP3 ES2+ chips have both initiator and |
80 | * target IDLEST bits. For our purposes, we are concerned with the | 84 | * target IDLEST bits. For our purposes, we are concerned with the |
@@ -85,7 +89,8 @@ const struct clkops clkops_omap3430es2_ssi_wait = { | |||
85 | */ | 89 | */ |
86 | static void omap3430es2_clk_dss_usbhost_find_idlest(struct clk *clk, | 90 | static void omap3430es2_clk_dss_usbhost_find_idlest(struct clk *clk, |
87 | void __iomem **idlest_reg, | 91 | void __iomem **idlest_reg, |
88 | u8 *idlest_bit) | 92 | u8 *idlest_bit, |
93 | u8 *idlest_val) | ||
89 | { | 94 | { |
90 | u32 r; | 95 | u32 r; |
91 | 96 | ||
@@ -93,6 +98,7 @@ static void omap3430es2_clk_dss_usbhost_find_idlest(struct clk *clk, | |||
93 | *idlest_reg = (__force void __iomem *)r; | 98 | *idlest_reg = (__force void __iomem *)r; |
94 | /* USBHOST_IDLE has same shift */ | 99 | /* USBHOST_IDLE has same shift */ |
95 | *idlest_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT; | 100 | *idlest_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT; |
101 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; | ||
96 | } | 102 | } |
97 | 103 | ||
98 | const struct clkops clkops_omap3430es2_dss_usbhost_wait = { | 104 | const struct clkops clkops_omap3430es2_dss_usbhost_wait = { |
@@ -107,6 +113,7 @@ const struct clkops clkops_omap3430es2_dss_usbhost_wait = { | |||
107 | * @clk: struct clk * being enabled | 113 | * @clk: struct clk * being enabled |
108 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | 114 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into |
109 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | 115 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into |
116 | * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator | ||
110 | * | 117 | * |
111 | * The OMAP3430ES2 HSOTGUSB target CM_IDLEST bit is at a different | 118 | * The OMAP3430ES2 HSOTGUSB target CM_IDLEST bit is at a different |
112 | * shift from the CM_{I,F}CLKEN bit. Pass back the correct info via | 119 | * shift from the CM_{I,F}CLKEN bit. Pass back the correct info via |
@@ -114,13 +121,15 @@ const struct clkops clkops_omap3430es2_dss_usbhost_wait = { | |||
114 | */ | 121 | */ |
115 | static void omap3430es2_clk_hsotgusb_find_idlest(struct clk *clk, | 122 | static void omap3430es2_clk_hsotgusb_find_idlest(struct clk *clk, |
116 | void __iomem **idlest_reg, | 123 | void __iomem **idlest_reg, |
117 | u8 *idlest_bit) | 124 | u8 *idlest_bit, |
125 | u8 *idlest_val) | ||
118 | { | 126 | { |
119 | u32 r; | 127 | u32 r; |
120 | 128 | ||
121 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); | 129 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); |
122 | *idlest_reg = (__force void __iomem *)r; | 130 | *idlest_reg = (__force void __iomem *)r; |
123 | *idlest_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT; | 131 | *idlest_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT; |
132 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; | ||
124 | } | 133 | } |
125 | 134 | ||
126 | const struct clkops clkops_omap3430es2_hsotgusb_wait = { | 135 | const struct clkops clkops_omap3430es2_hsotgusb_wait = { |