OMAP: voltage: move plat/voltage.h to mach-omap2/voltage.h
authorPaul Walmsley <paul@pwsan.com>
Fri, 25 Feb 2011 22:54:33 +0000 (15:54 -0700)
committerPaul Walmsley <paul@pwsan.com>
Tue, 8 Mar 2011 03:05:08 +0000 (20:05 -0700)
At this point in time, there's no reason for this header file to be in
plat-omap/include/plat/voltage.h.  It should not be included by device
drivers, and the code that uses it is currently all under mach-omap2/.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/omap_twl.c
arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/smartreflex.h
arch/arm/mach-omap2/sr_device.c
arch/arm/mach-omap2/voltage.c
arch/arm/mach-omap2/voltage.h [new file with mode: 0644]
arch/arm/plat-omap/include/plat/omap_hwmod.h
arch/arm/plat-omap/include/plat/voltage.h [deleted file]

index 00e1d2b53683373928c6dd33509393ce7e0dcace..ad8c18a45ce15e94ad983fb7eaf982fe037b8659 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/kernel.h>
 #include <linux/i2c/twl.h>
 
-#include <plat/voltage.h>
+#include "voltage.h"
 
 #include "pm.h"
 
index 7bb64d8121a7d2982baef5e94f3b41636b94b0d9..2c3a2531e67888e48cdb77340c1e2ca8d774a55e 100644 (file)
@@ -18,8 +18,8 @@
 #include <plat/omap-pm.h>
 #include <plat/omap_device.h>
 #include <plat/common.h>
-#include <plat/voltage.h>
 
+#include "voltage.h"
 #include "powerdomain.h"
 #include "clockdomain.h"
 #include "pm.h"
index 6568c885f37a1a4c26b9d4d05dafb3768aed1caa..5f35b9e2555603fcbd44f1150439a371c31bbde1 100644 (file)
@@ -21,7 +21,8 @@
 #define __ASM_ARM_OMAP_SMARTREFLEX_H
 
 #include <linux/platform_device.h>
-#include <plat/voltage.h>
+
+#include "voltage.h"
 
 /*
  * Different Smartreflex IPs version. The v1 is the 65nm version used in
index a636604961bca48efae90dd97f5b7c800af53f42..10d3c5ee80187f42560eb07d9a5f5d2ecab4c6c9 100644 (file)
@@ -23,9 +23,9 @@
 #include <linux/io.h>
 
 #include <plat/omap_device.h>
-#include <plat/voltage.h>
 
 #include "smartreflex.h"
+#include "voltage.h"
 #include "control.h"
 #include "pm.h"
 
index 12be525b8df46c73db8ac30099928d50c48bca5b..3c9bcdce612b5f72f7a525284d952031428d9889 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/slab.h>
 
 #include <plat/common.h>
-#include <plat/voltage.h>
 
 #include "prm-regbits-34xx.h"
 #include "prm-regbits-44xx.h"
@@ -35,6 +34,8 @@
 #include "prminst44xx.h"
 #include "control.h"
 
+#include "voltage.h"
+
 #define VP_IDLE_TIMEOUT                200
 #define VP_TRANXDONE_TIMEOUT   300
 #define VOLTAGE_DIR_SIZE       16
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
new file mode 100644 (file)
index 0000000..5bd204e
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * OMAP Voltage Management Routines
+ *
+ * Author: Thara Gopinath      <thara@ti.com>
+ *
+ * Copyright (C) 2009 Texas Instruments, Inc.
+ * Thara Gopinath <thara@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
+#define __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
+
+#include <linux/err.h>
+
+#define VOLTSCALE_VPFORCEUPDATE                1
+#define VOLTSCALE_VCBYPASS             2
+
+/*
+ * OMAP3 GENERIC setup times. Revisit to see if these needs to be
+ * passed from board or PMIC file
+ */
+#define OMAP3_CLKSETUP         0xff
+#define OMAP3_VOLTOFFSET       0xff
+#define OMAP3_VOLTSETUP2       0xff
+
+/* Voltage value defines */
+#define OMAP3430_VDD_MPU_OPP1_UV               975000
+#define OMAP3430_VDD_MPU_OPP2_UV               1075000
+#define OMAP3430_VDD_MPU_OPP3_UV               1200000
+#define OMAP3430_VDD_MPU_OPP4_UV               1270000
+#define OMAP3430_VDD_MPU_OPP5_UV               1350000
+
+#define OMAP3430_VDD_CORE_OPP1_UV              975000
+#define OMAP3430_VDD_CORE_OPP2_UV              1050000
+#define OMAP3430_VDD_CORE_OPP3_UV              1150000
+
+#define OMAP3630_VDD_MPU_OPP50_UV              1012500
+#define OMAP3630_VDD_MPU_OPP100_UV             1200000
+#define OMAP3630_VDD_MPU_OPP120_UV             1325000
+#define OMAP3630_VDD_MPU_OPP1G_UV              1375000
+
+#define OMAP3630_VDD_CORE_OPP50_UV             1000000
+#define OMAP3630_VDD_CORE_OPP100_UV            1200000
+
+#define OMAP4430_VDD_MPU_OPP50_UV              930000
+#define OMAP4430_VDD_MPU_OPP100_UV             1100000
+#define OMAP4430_VDD_MPU_OPPTURBO_UV           1260000
+#define OMAP4430_VDD_MPU_OPPNITRO_UV           1350000
+
+#define OMAP4430_VDD_IVA_OPP50_UV              930000
+#define OMAP4430_VDD_IVA_OPP100_UV             1100000
+#define OMAP4430_VDD_IVA_OPPTURBO_UV           1260000
+
+#define OMAP4430_VDD_CORE_OPP50_UV             930000
+#define OMAP4430_VDD_CORE_OPP100_UV            1100000
+
+/**
+ * struct voltagedomain - omap voltage domain global structure.
+ * @name:      Name of the voltage domain which can be used as a unique
+ *             identifier.
+ */
+struct voltagedomain {
+       char *name;
+};
+
+/**
+ * struct omap_volt_data - Omap voltage specific data.
+ * @voltage_nominal:   The possible voltage value in uV
+ * @sr_efuse_offs:     The offset of the efuse register(from system
+ *                     control module base address) from where to read
+ *                     the n-target value for the smartreflex module.
+ * @sr_errminlimit:    Error min limit value for smartreflex. This value
+ *                     differs at differnet opp and thus is linked
+ *                     with voltage.
+ * @vp_errorgain:      Error gain value for the voltage processor. This
+ *                     field also differs according to the voltage/opp.
+ */
+struct omap_volt_data {
+       u32     volt_nominal;
+       u32     sr_efuse_offs;
+       u8      sr_errminlimit;
+       u8      vp_errgain;
+};
+
+/**
+ * struct omap_volt_pmic_info - PMIC specific data required by voltage driver.
+ * @slew_rate: PMIC slew rate (in uv/us)
+ * @step_size: PMIC voltage step size (in uv)
+ * @vsel_to_uv:        PMIC API to convert vsel value to actual voltage in uV.
+ * @uv_to_vsel:        PMIC API to convert voltage in uV to vsel value.
+ */
+struct omap_volt_pmic_info {
+       int slew_rate;
+       int step_size;
+       u32 on_volt;
+       u32 onlp_volt;
+       u32 ret_volt;
+       u32 off_volt;
+       u16 volt_setup_time;
+       u8 vp_erroroffset;
+       u8 vp_vstepmin;
+       u8 vp_vstepmax;
+       u8 vp_vddmin;
+       u8 vp_vddmax;
+       u8 vp_timeout_us;
+       u8 i2c_slave_addr;
+       u8 pmic_reg;
+       unsigned long (*vsel_to_uv) (const u8 vsel);
+       u8 (*uv_to_vsel) (unsigned long uV);
+};
+
+unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm);
+void omap_vp_enable(struct voltagedomain *voltdm);
+void omap_vp_disable(struct voltagedomain *voltdm);
+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_volt_pmic_info *pmic_info);
+void omap_change_voltscale_method(struct voltagedomain *voltdm,
+               int voltscale_method);
+/* API to get the voltagedomain pointer */
+struct voltagedomain *omap_voltage_domain_lookup(char *name);
+
+int omap_voltage_late_init(void);
+#else
+static inline int omap_voltage_register_pmic(struct voltagedomain *voltdm,
+               struct omap_volt_pmic_info *pmic_info)
+{
+       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;
+}
+static inline struct voltagedomain *omap_voltage_domain_lookup(char *name)
+{
+       return ERR_PTR(-EINVAL);
+}
+#endif
+
+#endif
index fedd82971c9e2f12e261356864074e7138342a10..82d79f011dcc638c0fb5f223ffc3bf5f3582d3b2 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/ioport.h>
 #include <linux/spinlock.h>
 #include <plat/cpu.h>
-#include <plat/voltage.h>
 
 struct omap_device;
 
diff --git a/arch/arm/plat-omap/include/plat/voltage.h b/arch/arm/plat-omap/include/plat/voltage.h
deleted file mode 100644 (file)
index 5bd204e..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * OMAP Voltage Management Routines
- *
- * Author: Thara Gopinath      <thara@ti.com>
- *
- * Copyright (C) 2009 Texas Instruments, Inc.
- * Thara Gopinath <thara@ti.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
-#define __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
-
-#include <linux/err.h>
-
-#define VOLTSCALE_VPFORCEUPDATE                1
-#define VOLTSCALE_VCBYPASS             2
-
-/*
- * OMAP3 GENERIC setup times. Revisit to see if these needs to be
- * passed from board or PMIC file
- */
-#define OMAP3_CLKSETUP         0xff
-#define OMAP3_VOLTOFFSET       0xff
-#define OMAP3_VOLTSETUP2       0xff
-
-/* Voltage value defines */
-#define OMAP3430_VDD_MPU_OPP1_UV               975000
-#define OMAP3430_VDD_MPU_OPP2_UV               1075000
-#define OMAP3430_VDD_MPU_OPP3_UV               1200000
-#define OMAP3430_VDD_MPU_OPP4_UV               1270000
-#define OMAP3430_VDD_MPU_OPP5_UV               1350000
-
-#define OMAP3430_VDD_CORE_OPP1_UV              975000
-#define OMAP3430_VDD_CORE_OPP2_UV              1050000
-#define OMAP3430_VDD_CORE_OPP3_UV              1150000
-
-#define OMAP3630_VDD_MPU_OPP50_UV              1012500
-#define OMAP3630_VDD_MPU_OPP100_UV             1200000
-#define OMAP3630_VDD_MPU_OPP120_UV             1325000
-#define OMAP3630_VDD_MPU_OPP1G_UV              1375000
-
-#define OMAP3630_VDD_CORE_OPP50_UV             1000000
-#define OMAP3630_VDD_CORE_OPP100_UV            1200000
-
-#define OMAP4430_VDD_MPU_OPP50_UV              930000
-#define OMAP4430_VDD_MPU_OPP100_UV             1100000
-#define OMAP4430_VDD_MPU_OPPTURBO_UV           1260000
-#define OMAP4430_VDD_MPU_OPPNITRO_UV           1350000
-
-#define OMAP4430_VDD_IVA_OPP50_UV              930000
-#define OMAP4430_VDD_IVA_OPP100_UV             1100000
-#define OMAP4430_VDD_IVA_OPPTURBO_UV           1260000
-
-#define OMAP4430_VDD_CORE_OPP50_UV             930000
-#define OMAP4430_VDD_CORE_OPP100_UV            1100000
-
-/**
- * struct voltagedomain - omap voltage domain global structure.
- * @name:      Name of the voltage domain which can be used as a unique
- *             identifier.
- */
-struct voltagedomain {
-       char *name;
-};
-
-/**
- * struct omap_volt_data - Omap voltage specific data.
- * @voltage_nominal:   The possible voltage value in uV
- * @sr_efuse_offs:     The offset of the efuse register(from system
- *                     control module base address) from where to read
- *                     the n-target value for the smartreflex module.
- * @sr_errminlimit:    Error min limit value for smartreflex. This value
- *                     differs at differnet opp and thus is linked
- *                     with voltage.
- * @vp_errorgain:      Error gain value for the voltage processor. This
- *                     field also differs according to the voltage/opp.
- */
-struct omap_volt_data {
-       u32     volt_nominal;
-       u32     sr_efuse_offs;
-       u8      sr_errminlimit;
-       u8      vp_errgain;
-};
-
-/**
- * struct omap_volt_pmic_info - PMIC specific data required by voltage driver.
- * @slew_rate: PMIC slew rate (in uv/us)
- * @step_size: PMIC voltage step size (in uv)
- * @vsel_to_uv:        PMIC API to convert vsel value to actual voltage in uV.
- * @uv_to_vsel:        PMIC API to convert voltage in uV to vsel value.
- */
-struct omap_volt_pmic_info {
-       int slew_rate;
-       int step_size;
-       u32 on_volt;
-       u32 onlp_volt;
-       u32 ret_volt;
-       u32 off_volt;
-       u16 volt_setup_time;
-       u8 vp_erroroffset;
-       u8 vp_vstepmin;
-       u8 vp_vstepmax;
-       u8 vp_vddmin;
-       u8 vp_vddmax;
-       u8 vp_timeout_us;
-       u8 i2c_slave_addr;
-       u8 pmic_reg;
-       unsigned long (*vsel_to_uv) (const u8 vsel);
-       u8 (*uv_to_vsel) (unsigned long uV);
-};
-
-unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm);
-void omap_vp_enable(struct voltagedomain *voltdm);
-void omap_vp_disable(struct voltagedomain *voltdm);
-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_volt_pmic_info *pmic_info);
-void omap_change_voltscale_method(struct voltagedomain *voltdm,
-               int voltscale_method);
-/* API to get the voltagedomain pointer */
-struct voltagedomain *omap_voltage_domain_lookup(char *name);
-
-int omap_voltage_late_init(void);
-#else
-static inline int omap_voltage_register_pmic(struct voltagedomain *voltdm,
-               struct omap_volt_pmic_info *pmic_info)
-{
-       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;
-}
-static inline struct voltagedomain *omap_voltage_domain_lookup(char *name)
-{
-       return ERR_PTR(-EINVAL);
-}
-#endif
-
-#endif