Commit 842ec22852cf843558828e6f7a6da2bf72f341a5

Authored by Kevin Hilman
1 parent 58aaa599a9

OMAP3+ VP: replace transaction done check/clear with VP ops

Replace the VP tranxdone check/clear with helper functions from the
PRM layer.

In the process, remove prm_irqst_* voltage structure fields for IRQ
status checking which are no longer needed.

Since these reads/writes of the IRQ status bits were the only PRM
accesses that were not to VC/VP registers, this allows the rest of the
register accesses in the VC/VP code to use VC/VP specific register
access functions (done in the following patch.)

Signed-off-by: Kevin Hilman <khilman@ti.com>

Showing 4 changed files with 5 additions and 24 deletions Side-by-side Diff

arch/arm/mach-omap2/voltage.h
... ... @@ -133,7 +133,6 @@
133 133 * @vfsm : voltage manager FSM data
134 134 * @debug_dir : debug directory for this voltage domain.
135 135 * @curr_volt : current voltage for this vdd.
136   - * @prm_irqst_mod : PRM module id used for PRM IRQ status register access
137 136 * @vp_enabled : flag to keep track of whether vp is enabled or not
138 137 * @volt_scale : API to scale the voltage of the vdd.
139 138 */
... ... @@ -147,8 +146,6 @@
147 146 u32 curr_volt;
148 147 bool vp_enabled;
149 148  
150   - s16 prm_irqst_mod;
151   - u8 prm_irqst_reg;
152 149 u32 (*read_reg) (u16 mod, u8 offset);
153 150 void (*write_reg) (u32 val, u16 mod, u8 offset);
154 151 int (*volt_scale) (struct voltagedomain *voltdm,
arch/arm/mach-omap2/voltagedomains3xxx_data.c
... ... @@ -38,8 +38,6 @@
38 38 };
39 39  
40 40 static struct omap_vdd_info omap3_vdd1_info = {
41   - .prm_irqst_mod = OCP_MOD,
42   - .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
43 41 .vp_data = &omap3_vp1_data,
44 42 .vfsm = &omap3_vdd1_vfsm_data,
45 43 };
... ... @@ -51,8 +49,6 @@
51 49 };
52 50  
53 51 static struct omap_vdd_info omap3_vdd2_info = {
54   - .prm_irqst_mod = OCP_MOD,
55   - .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
56 52 .vp_data = &omap3_vp2_data,
57 53 .vfsm = &omap3_vdd2_vfsm_data,
58 54 };
arch/arm/mach-omap2/voltagedomains44xx_data.c
... ... @@ -37,8 +37,6 @@
37 37 };
38 38  
39 39 static struct omap_vdd_info omap4_vdd_mpu_info = {
40   - .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
41   - .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET,
42 40 .vp_data = &omap4_vp_mpu_data,
43 41 .vfsm = &omap4_vdd_mpu_vfsm_data,
44 42 };
... ... @@ -48,8 +46,6 @@
48 46 };
49 47  
50 48 static struct omap_vdd_info omap4_vdd_iva_info = {
51   - .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
52   - .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
53 49 .vp_data = &omap4_vp_iva_data,
54 50 .vfsm = &omap4_vdd_iva_vfsm_data,
55 51 };
... ... @@ -59,8 +55,6 @@
59 55 };
60 56  
61 57 static struct omap_vdd_info omap4_vdd_core_info = {
62   - .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
63   - .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
64 58 .vp_data = &omap4_vp_core_data,
65 59 .vfsm = &omap4_vdd_core_vfsm_data,
66 60 };
arch/arm/mach-omap2/vp.c
... ... @@ -111,10 +111,8 @@
111 111 * is <3us
112 112 */
113 113 while (timeout++ < VP_TRANXDONE_TIMEOUT) {
114   - vdd->write_reg(vp->prm_irqst_data->tranxdone_status,
115   - vdd->prm_irqst_mod, vdd->prm_irqst_reg);
116   - if (!(vdd->read_reg(vdd->prm_irqst_mod, vdd->prm_irqst_reg) &
117   - vp->prm_irqst_data->tranxdone_status))
  114 + vp->vp_common->ops->clear_txdone(vp->id);
  115 + if (!vp->vp_common->ops->check_txdone(vp->id))
118 116 break;
119 117 udelay(1);
120 118 }
... ... @@ -146,9 +144,7 @@
146 144 * Depends on SMPSWAITTIMEMIN/MAX and voltage change
147 145 */
148 146 timeout = 0;
149   - omap_test_timeout((vdd->read_reg(vdd->prm_irqst_mod,
150   - vdd->prm_irqst_reg) &
151   - vp->prm_irqst_data->tranxdone_status),
  147 + omap_test_timeout(vp->vp_common->ops->check_txdone(vp->id),
152 148 VP_TRANXDONE_TIMEOUT, timeout);
153 149 if (timeout >= VP_TRANXDONE_TIMEOUT)
154 150 pr_err("%s: vdd_%s TRANXDONE timeout exceeded."
... ... @@ -163,10 +159,8 @@
163 159 */
164 160 timeout = 0;
165 161 while (timeout++ < VP_TRANXDONE_TIMEOUT) {
166   - vdd->write_reg(vp->prm_irqst_data->tranxdone_status,
167   - vdd->prm_irqst_mod, vdd->prm_irqst_reg);
168   - if (!(vdd->read_reg(vdd->prm_irqst_mod, vdd->prm_irqst_reg) &
169   - vp->prm_irqst_data->tranxdone_status))
  162 + vp->vp_common->ops->clear_txdone(vp->id);
  163 + if (!vp->vp_common->ops->check_txdone(vp->id))
170 164 break;
171 165 udelay(1);
172 166 }