diff options
author | Doug Anderson <dianders@chromium.org> | 2011-10-20 15:50:03 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2011-10-25 11:46:27 -0700 |
commit | 57fee6619bbf503c170e5ff2a3914a9173e7c01f (patch) | |
tree | 956ab17aa60cce999488af2b67a5213d7645c1d9 /board/nvidia | |
parent | 28f587c69545fee3d7f2c3f2239d1e26bcc91141 (diff) |
pmu: Move pmu.c exported function defs to non-arch pmu.h
Previously the exported function definitions for pmu.c were split
among board.h, emc.c, and the architecture specific pmu.h. Create a
non-architecture-specific pmu.h and put them there.
NOTE: The arch/pmu.h file should probably be removed
eventually in favor of the device tree, since it really
just defines how a particular PMU is used by a particular
family of board.
BUG=chromium-os:21540
TEST=Compiled for seaboard
Change-Id: Ia026e3ff3f1f465be629cc8a348879d2d1564686
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10456
Reviewed-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'board/nvidia')
-rw-r--r-- | board/nvidia/common/board.c | 1 | ||||
-rw-r--r-- | board/nvidia/common/board.h | 1 | ||||
-rw-r--r-- | board/nvidia/common/emc.c | 4 | ||||
-rw-r--r-- | board/nvidia/common/pmu.c | 7 | ||||
-rw-r--r-- | board/nvidia/common/pmu.h | 28 |
5 files changed, 35 insertions, 6 deletions
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c index bff7da55fdf..b3e5590f9ca 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 84a06ee64d4..28e66a5b857 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 54284e3378d..53d6711ff4e 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 a71d436baf4..9b25a00925e 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 00000000000..73ce3a6d1b2 --- /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 */ |