From patchwork Thu Jun 16 09:09:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: MyungJoo Ham X-Patchwork-Id: 886522 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5G99o0R006653 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 16 Jun 2011 09:10:11 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QX8a3-0003Zl-HB; Thu, 16 Jun 2011 09:09:39 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QX8a3-00049h-6l; Thu, 16 Jun 2011 09:09:39 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QX8Zz-00049B-P8 for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2011 09:09:36 +0000 Received: from epcpsbgm2.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LMV00GZTLF7FY60@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2011 18:09:33 +0900 (KST) X-AuditID: cbfee61b-b7c62ae0000056ed-b8-4df9c84c474b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id B8.6A.22253.C48C9FD4; Thu, 16 Jun 2011 18:09:32 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LMV00DQDLFWI9@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2011 18:09:32 +0900 (KST) Received: from localhost.localdomain ([165.213.219.116]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Thu, 16 Jun 2011 18:09:19 +0900 Date: Thu, 16 Jun 2011 18:09:32 +0900 From: MyungJoo Ham Subject: [PATCH 2/2] Exynos4 NURI: add MAX17042 fuel gauge In-reply-to: <1308215372-17420-1-git-send-email-myungjoo.ham@samsung.com> To: linux-arm-kernel@lists.infradead.org Message-id: <1308215372-17420-2-git-send-email-myungjoo.ham@samsung.com> X-Mailer: git-send-email 1.7.4.1 References: <1308215372-17420-1-git-send-email-myungjoo.ham@samsung.com> X-OriginalArrivalTime: 16 Jun 2011 09:09:19.0997 (UTC) FILETIME=[1377AAD0:01CC2C05] X-Brightmail-Tracker: AAAAAA== X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110616_050936_096182_6ADA3418 X-CRM114-Status: GOOD ( 16.61 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [203.254.224.34 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain Cc: Kukjin Kim , Russell King , linux-kernel@vger.kernel.org, dg77.kim@samsung.com, kyungmin.park@samsung.com, myungjoo.ham@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 16 Jun 2011 09:10:11 +0000 (UTC) Signed-off-by: MyungJoo Ham Signed-off-by: Kyungmin Park --- arch/arm/mach-exynos4/mach-nuri.c | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c index c8c2431..b8c0c5d 100644 --- a/arch/arm/mach-exynos4/mach-nuri.c +++ b/arch/arm/mach-exynos4/mach-nuri.c @@ -13,8 +13,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -983,6 +985,7 @@ static struct max8997_platform_data nuri_max8997_pdata = { }; #define NURI_PMIC_GPIO EXYNOS4_GPX0(7) +#define NURI_FUELGAUGE_GPIO EXYNOS4_GPX2(3) static void __init nuri_pmic_init(void) { int gpio; @@ -992,6 +995,11 @@ static void __init nuri_pmic_init(void) gpio_request(gpio, "AP_PMIC_IRQ"); s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); + + gpio = NURI_FUELGAUGE_GPIO; + gpio_request(gpio, "FUEL_ALERT"); + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); + s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } /* GPIO I2C 5 (PMIC) */ @@ -1003,6 +1011,30 @@ static struct i2c_board_info i2c5_devs[] __initdata = { }, }; +static struct max17042_platform_data nuri_battery_platform_data = { + .enable_current_sense = false, +}; + +/* GPIO I2C 9 (Fuel Gauge) */ +static struct i2c_gpio_platform_data i2c9_gpio_data = { + .sda_pin = EXYNOS4_GPY4(0), /* XM0ADDR_8 */ + .scl_pin = EXYNOS4_GPY4(1), /* XM0ADDR_9 */ +}; +static struct platform_device i2c9_gpio = { + .name = "i2c-gpio", + .id = 9, + .dev = { + .platform_data = &i2c9_gpio_data, + }, +}; +enum { I2C9_MAX17042}; +static struct i2c_board_info i2c9_devs[] __initdata = { + [I2C9_MAX17042] = { + I2C_BOARD_INFO("max17042", 0x36), + .platform_data = &nuri_battery_platform_data, + }, +}; + /* USB EHCI */ static struct s5p_ehci_platdata nuri_ehci_pdata; @@ -1024,6 +1056,7 @@ static struct platform_device *nuri_devices[] __initdata = { &s5p_device_ehci, &s3c_device_i2c3, &s3c_device_i2c5, + &i2c9_gpio, /* NURI Devices */ &nuri_gpio_keys, @@ -1050,6 +1083,8 @@ static void __init nuri_machine_init(void) s3c_i2c5_set_platdata(NULL); i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(NURI_PMIC_GPIO); i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); + i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(NURI_FUELGAUGE_GPIO); + i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); nuri_ehci_init(); clk_xusbxti.rate = 24000000;