From patchwork Tue Sep 3 06:20:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 19698 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5BB92248D9 for ; Tue, 3 Sep 2013 06:18:36 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id i72sf254279yha.1 for ; Mon, 02 Sep 2013 23:18:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:dlp-filter:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=VsTa9r2OKMXm/KhRlMgdVekNtnb0ot1yfWnbDjoFvFU=; b=l1SvsgDSrl62np9GWDMJMaIGw98FYEIHbyVwC9d3HSUAFWUE8vqNrpbkRXM66dJdQ9 Yr31pA7FGSqpPlnLDPs/lYm+3i7t7l1CegWBGBWVDo1cDD3sLjbfMPZZBgef5DY1BKe1 le+DXRgQaUBdY4OenewFq8lZlP3LulWVNiGtTlKedc+SDit5HrSzozTy8+jzfvplrueD ROeENgYwr9XVMyo2gRAwZy74vhvsCDejW8LfhohMFtwAxDIv68qzKuer3SLQWXLxO5Rl RqNYWGtyIVT3y/yYcXkIxwZJE9vH79Oq//S3K7CZOTYzmQg73kI8kbN0rm0Tu9Xl1SPX x1kA== X-Received: by 10.236.189.167 with SMTP id c27mr10164254yhn.28.1378189115407; Mon, 02 Sep 2013 23:18:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.38.101 with SMTP id f5ls2454222qek.31.gmail; Mon, 02 Sep 2013 23:18:35 -0700 (PDT) X-Received: by 10.58.146.71 with SMTP id ta7mr1159829veb.23.1378189115314; Mon, 02 Sep 2013 23:18:35 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id de6si4050791vcb.109.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Sep 2013 23:18:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id ij15so3743086vcb.30 for ; Mon, 02 Sep 2013 23:18:35 -0700 (PDT) X-Gm-Message-State: ALoCoQnsjCEJfHmi+BLy8clgc3qyyhwpMxNU6huZCI+kDLEMfbv8nMf3vsVYQFyQopw3oOeQYeXd X-Received: by 10.220.1.203 with SMTP id 11mr21454062vcg.15.1378189114964; Mon, 02 Sep 2013 23:18:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp152379vcz; Mon, 2 Sep 2013 23:18:34 -0700 (PDT) X-Received: by 10.68.19.226 with SMTP id i2mr7128871pbe.131.1378189114012; Mon, 02 Sep 2013 23:18:34 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id ut10si13691964pbc.30.1969.12.31.16.00.00; Mon, 02 Sep 2013 23:18:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.24 as permitted sender) client-ip=203.254.224.24; Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MSJ007SYDIWO7Q0@mailout1.samsung.com>; Tue, 03 Sep 2013 15:18:32 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id C8.D7.31253.83F75225; Tue, 03 Sep 2013 15:18:32 +0900 (KST) X-AuditID: cbfee690-b7f3b6d000007a15-09-52257f380e30 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id CB.9A.09055.83F75225; Tue, 03 Sep 2013 15:18:32 +0900 (KST) Received: from localhost.localdomain.com ([107.108.73.95]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MSJ009TBDIQS402@mmp1.samsung.com>; Tue, 03 Sep 2013 15:18:31 +0900 (KST) From: Rajeshwari S Shinde To: u-boot@lists.denx.de Cc: patches@linaro.org, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org, u-boot-review@google.com, hs@denx.de Subject: [PATCH] Exynos5250: I2C: Fix driver as per new I2C multibus/multiadapter support Date: Tue, 03 Sep 2013 11:50:14 +0530 Message-id: <1378189214-22972-1-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.11.7 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRmVeSWpSXmKPExsWyRsSkVteiXjXIoP+TosXD9TdZLHbcuc9s 0XGkhdFiyuEvLBbftmxjtFj+eiO7xdu9newO7B6zGy6yeMybdYLFY8GmUo871/aweZy9s4PR o2/LKsYAtigum5TUnMyy1CJ9uwSujHcrZAseilUsvLSbsYHxjlAXIyeHhICJxJTje9ggbDGJ C/fWg9lCAksZJaZc5oep6di6grGLkQsovohRom3uTyYIp4tJYs/l7+xdjBwcbEBVG08kgDSI CEhI/Oq/CtbALNDEKDHxaR8TSEJYIFrizZM2VhCbRUBVYu/DP2BxXgEPiZXT/0BdoSgxY8kz Rgi7m13i974UiHoBiW+TD7GA7JIQkJXYdI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tKu/DmZOW3+gS 6b1091tUpNI/5e5Me+cdt4Pfuze3LOXr2MOck804Tc1XN2FrobJEyP70TLFjLysUuQ0+rhDa 6mobwv9zQrfW4zP2CkErTEtuPilvdlZiKc5INNRiLipOBABhde3I0wIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rajeshwari.s@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch fixes the S3C24xx I2C driver as per new I2C multibus/multiadapter support for Exynos5250. Change-Id: I95873fef7d312310670e3bb33ad9532c10f60463 Signed-off-by: Rajeshwari S Shinde --- drivers/i2c/s3c24x0_i2c.c | 14 +++++++------- include/configs/exynos5250-dt.h | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c index cd09c78..5fdb85f 100644 --- a/drivers/i2c/s3c24x0_i2c.c +++ b/drivers/i2c/s3c24x0_i2c.c @@ -53,7 +53,7 @@ static unsigned int g_current_bus __attribute__((section(".data"))); #ifdef CONFIG_OF_CONTROL static int i2c_busses __attribute__((section(".data"))); -static struct s3c24x0_i2c_bus i2c_bus[CONFIG_MAX_I2C_NUM] +static struct s3c24x0_i2c_bus i2c_bus_data[CONFIG_SYS_NUM_I2C_BUSES] __attribute__((section(".data"))); #endif @@ -160,7 +160,7 @@ int i2c_set_bus_num(unsigned int bus) { struct s3c24x0_i2c *i2c; - if ((bus < 0) || (bus >= CONFIG_MAX_I2C_NUM)) { + if ((bus < 0) || (bus >= CONFIG_SYS_NUM_I2C_BUSES)) { debug("Bad bus: %d\n", bus); return -1; } @@ -503,12 +503,12 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len) void board_i2c_init(const void *blob) { int i; - int node_list[CONFIG_MAX_I2C_NUM]; + int node_list[CONFIG_SYS_NUM_I2C_BUSES]; int count; count = fdtdec_find_aliases_for_id(blob, "i2c", COMPAT_SAMSUNG_S3C2440_I2C, node_list, - CONFIG_MAX_I2C_NUM); + CONFIG_SYS_NUM_I2C_BUSES); for (i = 0; i < count; i++) { struct s3c24x0_i2c_bus *bus; @@ -516,7 +516,7 @@ void board_i2c_init(const void *blob) if (node <= 0) continue; - bus = &i2c_bus[i]; + bus = &i2c_bus_data[i]; bus->regs = (struct s3c24x0_i2c *) fdtdec_get_addr(blob, node, "reg"); bus->id = pinmux_decode_periph_id(blob, node); @@ -529,7 +529,7 @@ void board_i2c_init(const void *blob) static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx) { if (bus_idx < i2c_busses) - return &i2c_bus[bus_idx]; + return &i2c_bus_data[bus_idx]; debug("Undefined bus: %d\n", bus_idx); return NULL; @@ -540,7 +540,7 @@ int i2c_get_bus_num_fdt(int node) int i; for (i = 0; i < i2c_busses; i++) { - if (node == i2c_bus[i].node) + if (node == i2c_bus_data[i].node) return i; } diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h index 2b93a45..e6a2cd0 100644 --- a/include/configs/exynos5250-dt.h +++ b/include/configs/exynos5250-dt.h @@ -254,8 +254,9 @@ #define CONFIG_SYS_I2C_SPEED 100000 /* 100 Kbps */ #define CONFIG_DRIVER_S3C24X0_I2C #define CONFIG_I2C_MULTI_BUS -#define CONFIG_MAX_I2C_NUM 8 #define CONFIG_SYS_I2C_SLAVE 0x0 +#define CONFIG_SYS_I2C_MAX_HOPS 1 +#define CONFIG_SYS_NUM_I2C_BUSES 8 #define CONFIG_I2C_EDID /* PMIC */