diff options
author | venu byravarasu <vbyravarasu@nvidia.com> | 2011-06-13 12:23:48 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:45:57 -0800 |
commit | eaa3095b783204d80e8353be2bed7033d3a59d10 (patch) | |
tree | b980f1b23294127d3117b73bef8fdf72e071e7d0 /arch/arm/mach-tegra/board-cardhu-powermon.c | |
parent | 254fd2edaf3a7a627274d105f5644df24feedebd (diff) |
arm: tegra: cardhu: Board changes for powermon
Board details needed by INA219 power monitor device
to measure current, voltage and power on Cardhu are
being filled.
bug 808311
Change-Id: Idbee6034312f5bd888b1ed87ef98f531c45938a0
Reviewed-on: http://git-master/r/34299
Reviewed-by: Niket Sirsi <nsirsi@nvidia.com>
Tested-by: Niket Sirsi <nsirsi@nvidia.com>
Rebase-Id: Rcb4e4b1f79367f297801e5ceb3d124f5e31f01f8
Diffstat (limited to 'arch/arm/mach-tegra/board-cardhu-powermon.c')
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-powermon.c | 184 |
1 files changed, 184 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-powermon.c b/arch/arm/mach-tegra/board-cardhu-powermon.c new file mode 100644 index 000000000000..8d3424631cb9 --- /dev/null +++ b/arch/arm/mach-tegra/board-cardhu-powermon.c @@ -0,0 +1,184 @@ +/* + * arch/arm/mach-tegra/board-cardhu-powermon.c + * + * Copyright (c) 2011, NVIDIA, All Rights Reserved. + * + * 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 3 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, see <http://www.gnu.org/licenses/>. + * + */ + +#include <linux/i2c.h> +#include <linux/ina219.h> +#include "board-cardhu.h" + +static struct ina219_platform_data power_mon_info[] = { + { + .calibration_data = 0xa000, + .power_lsb = 2, + .rail_name = "ac_bat_rail", + .divisor = 20, + }, + { + .calibration_data = 0xa000, + .power_lsb = 2, + .rail_name = "ddr_rail", + .divisor = 20, + }, + { + .calibration_data = 0x6aaa, + .power_lsb = 1, + .rail_name = "backlight_rail", + .divisor = 20, + }, + { + .calibration_data = 0xa000, + .power_lsb = 1, + .rail_name = "cpu_rail", + .divisor = 20, + }, + { + .calibration_data = 0x6aaa, + .power_lsb = 1, + .rail_name = "core_rail", + .divisor = 20, + }, + { + .calibration_data = 0xa000, + .power_lsb = 1, + .rail_name = "display_rail", + .divisor = 20, + }, + { + .calibration_data = 0x6aaa, + .power_lsb = 1, + .rail_name = "tegra_3v3_rail", + .divisor = 20, + }, + { + .calibration_data = 0xa000, + .power_lsb = 1, + .rail_name = "other_pmu_rail", + .divisor = 20, + }, + { + .calibration_data = 0x4000, + .power_lsb = 1, + .rail_name = "tegra_1v8_rail", + .divisor = 20, + }, + { + .calibration_data = 0xa000, + .power_lsb = 1, + .rail_name = "other_1v8_rail", + .divisor = 20, + }, + /* All unused INA219 devices use below data*/ + { + .calibration_data = 0x4000, + .power_lsb = 1, + .rail_name = "unused_rail", + .divisor = 20, + }, +}; + +static struct i2c_board_info cardhu_i2c0_ina219_board_info[] = { + { + I2C_BOARD_INFO("ina219", 0x40), + .platform_data = &power_mon_info[0], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x41), + .platform_data = &power_mon_info[1], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x42), + .platform_data = &power_mon_info[2], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x43), + .platform_data = &power_mon_info[3], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x44), + .platform_data = &power_mon_info[4], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x45), + .platform_data = &power_mon_info[5], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x46), + .platform_data = &power_mon_info[6], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x47), + .platform_data = &power_mon_info[7], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x48), + .platform_data = &power_mon_info[8], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x49), + .platform_data = &power_mon_info[9], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x4A), + .platform_data = &power_mon_info[10], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x4B), + .platform_data = &power_mon_info[10], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x4C), + .platform_data = &power_mon_info[10], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x4D), + .platform_data = &power_mon_info[10], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x4E), + .platform_data = &power_mon_info[10], + .irq = -1, + }, + { + I2C_BOARD_INFO("ina219", 0x4F), + .platform_data = &power_mon_info[10], + .irq = -1, + }, +}; + +int __init cardhu_pmon_init(void) +{ + i2c_register_board_info(0, cardhu_i2c0_ina219_board_info, + ARRAY_SIZE(cardhu_i2c0_ina219_board_info)); + return 0; +} + |