Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[pandora-kernel.git] / arch / arm / mach-omap2 / voltage.h
index a36d2cf..16a1b09 100644 (file)
@@ -33,8 +33,6 @@ struct powerdomain;
 #define OMAP3_VOLTOFFSET       0xff
 #define OMAP3_VOLTSETUP2       0xff
 
-struct omap_vdd_info;
-
 /**
  * struct omap_vfsm_instance - per-voltage manager FSM register/bitfield
  * data
@@ -55,10 +53,15 @@ struct omap_vfsm_instance {
  * @node: list_head linking all voltage domains
  * @pwrdm_list: list_head linking all powerdomains in this voltagedomain
  * @vc: pointer to VC channel associated with this voltagedomain
+ * @vp: pointer to VP associated with this voltagedomain
  * @read: read a VC/VP register
  * @write: write a VC/VP register
  * @read: read-modify-write a VC/VP register
- * @vdd: to be removed
+ * @sys_clk: system clock name/frequency, used for various timing calculations
+ * @scale: function used to scale the voltage of the voltagedomain
+ * @nominal_volt: current nominal voltage for this voltage domain
+ * @volt_data: voltage table having the distinct voltages supported
+ *             by the domain and other associated per voltage data.
  */
 struct voltagedomain {
        char *name;
@@ -67,6 +70,7 @@ struct voltagedomain {
        struct list_head pwrdm_list;
        struct omap_vc_channel *vc;
        const struct omap_vfsm_instance *vfsm;
+       struct omap_vp_instance *vp;
        struct omap_voltdm_pmic *pmic;
 
        /* VC/VP register access functions: SoC specific */
@@ -74,7 +78,16 @@ struct voltagedomain {
        void (*write) (u32 val, u8 offset);
        u32 (*rmw)(u32 mask, u32 bits, u8 offset);
 
-       struct omap_vdd_info *vdd;
+       union {
+               const char *name;
+               u32 rate;
+       } sys_clk;
+
+       int (*scale) (struct voltagedomain *voltdm,
+                     unsigned long target_volt);
+
+       u32 nominal_volt;
+       struct omap_volt_data *volt_data;
 };
 
 /**
@@ -131,59 +144,15 @@ struct omap_voltdm_pmic {
        u8 (*uv_to_vsel) (unsigned long uV);
 };
 
-/**
- * omap_vdd_info - Per Voltage Domain info
- *
- * @volt_data          : voltage table having the distinct voltages supported
- *                       by the domain and other associated per voltage data.
- * @vp_data            : the register values, shifts, masks for various
- *                       vp registers
- * @vp_rt_data          : VP data derived at runtime, not predefined
- * @debug_dir          : debug directory for this voltage domain.
- * @curr_volt          : current voltage for this vdd.
- * @vp_enabled         : flag to keep track of whether vp is enabled or not
- * @volt_scale         : API to scale the voltage of the vdd.
- */
-struct omap_vdd_info {
-       struct omap_volt_data *volt_data;
-       struct omap_vp_instance_data *vp_data;
-       struct omap_vp_runtime_data vp_rt_data;
-       struct dentry *debug_dir;
-       u32 curr_volt;
-       bool vp_enabled;
-
-       int (*volt_scale) (struct voltagedomain *voltdm,
-               unsigned long target_volt);
-};
-
-int omap_voltage_scale_vdd(struct voltagedomain *voltdm,
-               unsigned long target_volt);
-void omap_voltage_reset(struct voltagedomain *voltdm);
 void omap_voltage_get_volttable(struct voltagedomain *voltdm,
                struct omap_volt_data **volt_data);
 struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
                unsigned long volt);
-unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm);
-struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm);
-#ifdef CONFIG_PM
 int omap_voltage_register_pmic(struct voltagedomain *voltdm,
                               struct omap_voltdm_pmic *pmic);
 void omap_change_voltscale_method(struct voltagedomain *voltdm,
                int voltscale_method);
 int omap_voltage_late_init(void);
-#else
-static inline int omap_voltage_register_pmic(struct voltagedomain *voltdm,
-                                            struct omap_voltdm_pmic *pmic)
-{
-       return -EINVAL;
-}
-static inline  void omap_change_voltscale_method(struct voltagedomain *voltdm,
-               int voltscale_method) {}
-static inline int omap_voltage_late_init(void)
-{
-       return -EINVAL;
-}
-#endif
 
 extern void omap2xxx_voltagedomains_init(void);
 extern void omap3xxx_voltagedomains_init(void);
@@ -197,4 +166,7 @@ int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user),
 int voltdm_for_each_pwrdm(struct voltagedomain *voltdm,
                          int (*fn)(struct voltagedomain *voltdm,
                                    struct powerdomain *pwrdm));
+int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt);
+void voltdm_reset(struct voltagedomain *voltdm);
+unsigned long voltdm_get_voltage(struct voltagedomain *voltdm);
 #endif