diff options
author | Jin Qian <jqian@nvidia.com> | 2012-02-02 18:25:15 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 13:19:50 -0700 |
commit | cec6dff695711d43edfae17419171c15428fedb3 (patch) | |
tree | fd5fd61a7edb179dcf149a617db9abc9576efca8 /arch/arm/mach-tegra/board-bonaire-power.c | |
parent | a03d0c545e9d55a329511baf69efb56ce0b6abfb (diff) |
ARM: tegra: bonaire: add board files
and the include for host1x init (invoked from board file)
Change-Id: I5a7cb2e074f6c7395aec5ede1db31b2bdeae5cb0
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Mark Stadler <mastadler@nvidia.com>
Signed-off-by: Jin Qian <jqian@nvidia.com>
Reviewed-on: http://git-master/r/82938
Signed-off-by: Mark Stadler <mastadler@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-bonaire-power.c')
-rw-r--r-- | arch/arm/mach-tegra/board-bonaire-power.c | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-bonaire-power.c b/arch/arm/mach-tegra/board-bonaire-power.c new file mode 100644 index 000000000000..c2808a18b3b2 --- /dev/null +++ b/arch/arm/mach-tegra/board-bonaire-power.c @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2011 NVIDIA, Inc. + * + * 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. + * + * 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 + */ +#include <linux/i2c.h> +#include <linux/pda_power.h> +#include <linux/platform_device.h> +#include <linux/resource.h> +#include <linux/io.h> +#include <mach/iomap.h> +#include <mach/irqs.h> +#include <mach/gpio-tegra.h> + +#include "pm.h" +#include "board.h" + +static int ac_online(void) +{ + return 1; +} + +static struct resource bonaire_pda_resources[] = { + [0] = { + .name = "ac", + }, +}; + +static struct pda_power_pdata bonaire_pda_data = { + .is_ac_online = ac_online, +}; + +static struct platform_device bonaire_pda_power_device = { + .name = "pda-power", + .id = -1, + .resource = bonaire_pda_resources, + .num_resources = ARRAY_SIZE(bonaire_pda_resources), + .dev = { + .platform_data = &bonaire_pda_data, + }, +}; + +static struct tegra_suspend_platform_data bonaire_suspend_data = { + .cpu_timer = 2000, + .cpu_off_timer = 0, + .suspend_mode = TEGRA_SUSPEND_NONE, + .core_timer = 0x7e7e, + .core_off_timer = 0, + .corereq_high = false, + .sysclkreq_high = true, +}; + +int __init bonaire_regulator_init(void) +{ + platform_device_register(&bonaire_pda_power_device); + return 0; +} + +int __init bonaire_suspend_init(void) +{ + tegra_init_suspend(&bonaire_suspend_data); + return 0; +} + +#ifdef CONFIG_TEGRA_SIMULATION_PLATFORM + +#define COSIM_SHUTDOWN_REG 0x538f0ffc + +static void bonaire_power_off(void) +{ + pr_err("Bonaire: Powering off the device\n"); + writel(1, IO_ADDRESS(COSIM_SHUTDOWN_REG)); + while (1) + ; +} + +int __init bonaire_power_off_init(void) +{ + pm_power_off = bonaire_power_off; + return 0; +} +#endif |