]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0115-OMAP3-VP-replace-transaction-done-check-clear-with-V.patch
de2fbad155ee9c979ebd449f2a2899d3e133c553
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-3.0 / pm-wip / voltdm / 0115-OMAP3-VP-replace-transaction-done-check-clear-with-V.patch
1 From 8277e114af7921a1a84e63a4b41f1641582b826b Mon Sep 17 00:00:00 2001
2 From: Kevin Hilman <khilman@ti.com>
3 Date: Mon, 28 Mar 2011 11:57:18 -0700
4 Subject: [PATCH 115/149] OMAP3+ VP: replace transaction done check/clear with VP ops
6 Replace the VP tranxdone check/clear with helper functions from the
7 PRM layer.
9 In the process, remove prm_irqst_* voltage structure fields for IRQ
10 status checking which are no longer needed.
12 Since these reads/writes of the IRQ status bits were the only PRM
13 accesses that were not to VC/VP registers, this allows the rest of the
14 register accesses in the VC/VP code to use VC/VP specific register
15 access functions (done in the following patch.)
17 Signed-off-by: Kevin Hilman <khilman@ti.com>
18 ---
19  arch/arm/mach-omap2/voltage.h                 |    3 ---
20  arch/arm/mach-omap2/voltagedomains3xxx_data.c |    4 ----
21  arch/arm/mach-omap2/voltagedomains44xx_data.c |    6 ------
22  arch/arm/mach-omap2/vp.c                      |   16 +++++-----------
23  4 files changed, 5 insertions(+), 24 deletions(-)
25 diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
26 index 641597c..363eee4 100644
27 --- a/arch/arm/mach-omap2/voltage.h
28 +++ b/arch/arm/mach-omap2/voltage.h
29 @@ -131,7 +131,6 @@ struct omap_volt_pmic_info {
30   * @vfsm                : voltage manager FSM data
31   * @debug_dir          : debug directory for this voltage domain.
32   * @curr_volt          : current voltage for this vdd.
33 - * @prm_irqst_mod       : PRM module id used for PRM IRQ status register access
34   * @vp_enabled         : flag to keep track of whether vp is enabled or not
35   * @volt_scale         : API to scale the voltage of the vdd.
36   */
37 @@ -145,8 +144,6 @@ struct omap_vdd_info {
38         u32 curr_volt;
39         bool vp_enabled;
40  
41 -       s16 prm_irqst_mod;
42 -       u8 prm_irqst_reg;
43         u32 (*read_reg) (u16 mod, u8 offset);
44         void (*write_reg) (u32 val, u16 mod, u8 offset);
45         int (*volt_scale) (struct voltagedomain *voltdm,
46 diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
47 index 7cb27ec..ad8f05b 100644
48 --- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
49 +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
50 @@ -38,8 +38,6 @@ static const struct omap_vfsm_instance_data omap3_vdd1_vfsm_data = {
51  };
52  
53  static struct omap_vdd_info omap3_vdd1_info = {
54 -       .prm_irqst_mod = OCP_MOD,
55 -       .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
56         .vp_data = &omap3_vp1_data,
57         .vfsm = &omap3_vdd1_vfsm_data,
58  };
59 @@ -51,8 +49,6 @@ static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = {
60  };
61  
62  static struct omap_vdd_info omap3_vdd2_info = {
63 -       .prm_irqst_mod = OCP_MOD,
64 -       .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
65         .vp_data = &omap3_vp2_data,
66         .vfsm = &omap3_vdd2_vfsm_data,
67  };
68 diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c
69 index a05d90a..43e1d38 100644
70 --- a/arch/arm/mach-omap2/voltagedomains44xx_data.c
71 +++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c
72 @@ -37,8 +37,6 @@ static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = {
73  };
74  
75  static struct omap_vdd_info omap4_vdd_mpu_info = {
76 -       .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
77 -       .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET,
78         .vp_data = &omap4_vp_mpu_data,
79         .vfsm = &omap4_vdd_mpu_vfsm_data,
80  };
81 @@ -48,8 +46,6 @@ static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = {
82  };
83  
84  static struct omap_vdd_info omap4_vdd_iva_info = {
85 -       .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
86 -       .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
87         .vp_data = &omap4_vp_iva_data,
88         .vfsm = &omap4_vdd_iva_vfsm_data,
89  };
90 @@ -59,8 +55,6 @@ static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = {
91  };
92  
93  static struct omap_vdd_info omap4_vdd_core_info = {
94 -       .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
95 -       .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
96         .vp_data = &omap4_vp_core_data,
97         .vfsm = &omap4_vdd_core_vfsm_data,
98  };
99 diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
100 index f3503de..113c839 100644
101 --- a/arch/arm/mach-omap2/vp.c
102 +++ b/arch/arm/mach-omap2/vp.c
103 @@ -111,10 +111,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
104          * is <3us
105          */
106         while (timeout++ < VP_TRANXDONE_TIMEOUT) {
107 -               vdd->write_reg(vp->prm_irqst_data->tranxdone_status,
108 -                              vdd->prm_irqst_mod, vdd->prm_irqst_reg);
109 -               if (!(vdd->read_reg(vdd->prm_irqst_mod, vdd->prm_irqst_reg) &
110 -                     vp->prm_irqst_data->tranxdone_status))
111 +               vp->vp_common->ops->clear_txdone(vp->id);
112 +               if (!vp->vp_common->ops->check_txdone(vp->id))
113                         break;
114                 udelay(1);
115         }
116 @@ -146,9 +144,7 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
117          * Depends on SMPSWAITTIMEMIN/MAX and voltage change
118          */
119         timeout = 0;
120 -       omap_test_timeout((vdd->read_reg(vdd->prm_irqst_mod,
121 -                                        vdd->prm_irqst_reg) &
122 -                          vp->prm_irqst_data->tranxdone_status),
123 +       omap_test_timeout(vp->vp_common->ops->check_txdone(vp->id),
124                           VP_TRANXDONE_TIMEOUT, timeout);
125         if (timeout >= VP_TRANXDONE_TIMEOUT)
126                 pr_err("%s: vdd_%s TRANXDONE timeout exceeded."
127 @@ -163,10 +159,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
128          */
129         timeout = 0;
130         while (timeout++ < VP_TRANXDONE_TIMEOUT) {
131 -               vdd->write_reg(vp->prm_irqst_data->tranxdone_status,
132 -                              vdd->prm_irqst_mod, vdd->prm_irqst_reg);
133 -               if (!(vdd->read_reg(vdd->prm_irqst_mod, vdd->prm_irqst_reg) &
134 -                     vp->prm_irqst_data->tranxdone_status))
135 +               vp->vp_common->ops->clear_txdone(vp->id);
136 +               if (!vp->vp_common->ops->check_txdone(vp->id))
137                         break;
138                 udelay(1);
139         }
140 -- 
141 1.6.6.1