aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos4
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2011-07-20 11:31:27 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-07-20 12:46:40 -0400
commita140b92ef398153c85ee1c697db0a1be210e9677 (patch)
tree58876069ab52f57c68d44b629c61a7f1b91c0e4e /arch/arm/mach-exynos4
parent29dee863d5626a35354bb23d652011e457c935a4 (diff)
ARM: EXYNOS4: configure MAX17042 fuel gauge on NURI
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos4')
-rw-r--r--arch/arm/mach-exynos4/mach-nuri.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c
index 53a667dee647..43ab82cf6165 100644
--- a/arch/arm/mach-exynos4/mach-nuri.c
+++ b/arch/arm/mach-exynos4/mach-nuri.c
@@ -13,8 +13,10 @@
13#include <linux/input.h> 13#include <linux/input.h>
14#include <linux/i2c.h> 14#include <linux/i2c.h>
15#include <linux/i2c/atmel_mxt_ts.h> 15#include <linux/i2c/atmel_mxt_ts.h>
16#include <linux/i2c-gpio.h>
16#include <linux/gpio_keys.h> 17#include <linux/gpio_keys.h>
17#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/power/max17042_battery.h>
18#include <linux/regulator/machine.h> 20#include <linux/regulator/machine.h>
19#include <linux/regulator/fixed.h> 21#include <linux/regulator/fixed.h>
20#include <linux/mfd/max8997.h> 22#include <linux/mfd/max8997.h>
@@ -955,6 +957,29 @@ static struct i2c_board_info i2c5_devs[] __initdata = {
955 }, 957 },
956}; 958};
957 959
960static struct max17042_platform_data nuri_battery_platform_data = {
961};
962
963/* GPIO I2C 9 (Fuel Gauge) */
964static struct i2c_gpio_platform_data i2c9_gpio_data = {
965 .sda_pin = EXYNOS4_GPY4(0), /* XM0ADDR_8 */
966 .scl_pin = EXYNOS4_GPY4(1), /* XM0ADDR_9 */
967};
968static struct platform_device i2c9_gpio = {
969 .name = "i2c-gpio",
970 .id = 9,
971 .dev = {
972 .platform_data = &i2c9_gpio_data,
973 },
974};
975enum { I2C9_MAX17042};
976static struct i2c_board_info i2c9_devs[] __initdata = {
977 [I2C9_MAX17042] = {
978 I2C_BOARD_INFO("max17042", 0x36),
979 .platform_data = &nuri_battery_platform_data,
980 },
981};
982
958static void __init nuri_power_init(void) 983static void __init nuri_power_init(void)
959{ 984{
960 int gpio; 985 int gpio;
@@ -967,6 +992,11 @@ static void __init nuri_power_init(void)
967 gpio_request(gpio, "AP_PMIC_IRQ"); 992 gpio_request(gpio, "AP_PMIC_IRQ");
968 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); 993 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
969 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 994 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
995
996 gpio = EXYNOS4_GPX2(3);
997 gpio_request(gpio, "FUEL_ALERT");
998 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
999 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
970} 1000}
971 1001
972/* USB EHCI */ 1002/* USB EHCI */
@@ -990,6 +1020,7 @@ static struct platform_device *nuri_devices[] __initdata = {
990 &s3c_device_timer[0], 1020 &s3c_device_timer[0],
991 &s5p_device_ehci, 1021 &s5p_device_ehci,
992 &s3c_device_i2c3, 1022 &s3c_device_i2c3,
1023 &i2c9_gpio,
993 1024
994 /* NURI Devices */ 1025 /* NURI Devices */
995 &nuri_gpio_keys, 1026 &nuri_gpio_keys,
@@ -1016,6 +1047,8 @@ static void __init nuri_machine_init(void)
1016 s3c_i2c5_set_platdata(NULL); 1047 s3c_i2c5_set_platdata(NULL);
1017 i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(7)); 1048 i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(7));
1018 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); 1049 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
1050 i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3));
1051 i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs));
1019 1052
1020 nuri_ehci_init(); 1053 nuri_ehci_init();
1021 clk_xusbxti.rate = 24000000; 1054 clk_xusbxti.rate = 24000000;