summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/include/asm/arch-tegra2/pmu.h8
-rw-r--r--board/nvidia/common/board.c1
-rw-r--r--board/nvidia/common/board.h1
-rw-r--r--board/nvidia/common/emc.c4
-rw-r--r--board/nvidia/common/pmu.c7
-rw-r--r--board/nvidia/common/pmu.h28
6 files changed, 38 insertions, 11 deletions
diff --git a/arch/arm/include/asm/arch-tegra2/pmu.h b/arch/arm/include/asm/arch-tegra2/pmu.h
index 140636edf1..5baab7604a 100644
--- a/arch/arm/include/asm/arch-tegra2/pmu.h
+++ b/arch/arm/include/asm/arch-tegra2/pmu.h
@@ -21,8 +21,8 @@
* MA 02111-1307 USA
*/
-#ifndef _PMU_H_
-#define _PMU_H_
+#ifndef _ARCH_PMU_H_
+#define _ARCH_PMU_H_
#define DVC_I2C_BUS_NUMBER 0
#define PMU_I2C_ADDRESS 0x34
@@ -54,6 +54,4 @@
#define SM1_PWM_BIT 1
#define SM2_PWM_BIT 2
-int tegra2_pmu_is_voltage_nominal(void);
-
-#endif /* PMU_H */
+#endif /* _ARCH_PMU_H_ */
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index bff7da55fd..b3e5590f9c 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -53,6 +53,7 @@
#include <i2c.h>
#endif
#include "board.h"
+#include "pmu.h"
#ifdef CONFIG_TEGRA2_MMC
#include <mmc.h>
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 84a06ee64d..28e66a5b85 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -31,6 +31,5 @@ int tegra2_mmc_init(const void *blob);
void lcd_early_init(const void *blob);
int lcd_pinmux_early_init(const void *blob);
int tegra_get_chip_type(void);
-int pmu_set_nominal(void);
#endif /* BOARD_H */
diff --git a/board/nvidia/common/emc.c b/board/nvidia/common/emc.c
index 54284e3378..53d6711ff4 100644
--- a/board/nvidia/common/emc.c
+++ b/board/nvidia/common/emc.c
@@ -11,9 +11,9 @@
#include <asm/arch/sys_proto.h>
#include <asm/arch-tegra/clk_rst.h>
#include <asm/arch/clock.h>
-#include <asm/arch/pmu.h>
#include <asm/arch/emc.h>
#include "board.h"
+#include "pmu.h"
static const struct tegra_emc_table *tegra_emc_table;
static int tegra_emc_table_size;
@@ -1029,7 +1029,7 @@ int board_emc_init(void)
DECLARE_GLOBAL_DATA_PTR;
/* if voltage has not been set properly, return */
- if (!tegra2_pmu_is_voltage_nominal())
+ if (!pmu_is_voltage_nominal())
return -1;
for (i = 0; i < ARRAY_SIZE(board_table); i++) {
diff --git a/board/nvidia/common/pmu.c b/board/nvidia/common/pmu.c
index a71d436baf..9b25a00925 100644
--- a/board/nvidia/common/pmu.c
+++ b/board/nvidia/common/pmu.c
@@ -31,6 +31,7 @@
#include <asm/arch-tegra/pmc.h>
#include <i2c.h>
#include "board.h"
+#include "pmu.h"
/*
* abs() handles unsigned ints, shorts and chars and returns a signed long.
@@ -176,7 +177,7 @@ static int tegra2_set_voltage(int reg, int data, int control)
return -1;
}
-int tegra2_pmu_is_voltage_nominal(void)
+int pmu_is_voltage_nominal(void)
{
if ((vdd_current[core].data == vdd_current[core].nominal) &&
(vdd_current[cpu].data == vdd_current[cpu].nominal))
@@ -184,7 +185,7 @@ int tegra2_pmu_is_voltage_nominal(void)
return 0;
}
-void calculate_next_voltage(int *data, int nominal, int step)
+static void calculate_next_voltage(int *data, int nominal, int step)
{
if (abs(nominal - *data) > VDD_TRANSITION_STEP)
*data += step;
@@ -327,7 +328,7 @@ int pmu_set_nominal(void)
return -1;
/* if current voltage is already set to nominal, skip */
- if (tegra2_pmu_is_voltage_nominal())
+ if (pmu_is_voltage_nominal())
return 0;
/* adjust vdd_core and/or vdd_cpu */
diff --git a/board/nvidia/common/pmu.h b/board/nvidia/common/pmu.h
new file mode 100644
index 0000000000..73ce3a6d1b
--- /dev/null
+++ b/board/nvidia/common/pmu.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _PMU_H_
+#define _PMU_H_
+
+int pmu_set_nominal(void);
+int pmu_is_voltage_nominal(void);
+
+#endif /* PMU_H */