From patchwork Tue Mar 5 13:11:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amar X-Patchwork-Id: 15239 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4C37023E00 for ; Tue, 5 Mar 2013 12:59:23 +0000 (UTC) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by fiordland.canonical.com (Postfix) with ESMTP id E0D65A1945C for ; Tue, 5 Mar 2013 12:59:22 +0000 (UTC) Received: by mail-vb0-f50.google.com with SMTP id ft2so1253777vbb.37 for ; Tue, 05 Mar 2013 04:59:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-auditid:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-brightmail-tracker:x-brightmail-tracker :dlp-filter:x-mtr:x-cfilter-loop:x-gm-message-state; bh=fENbuITL3EHNs6/z9nxUu9n8SxgA2vW+yaW6R9RJeYI=; b=Sp+oMJLy/b+p0NrhMBHPTnMTgjFDV5k3oUqb9ujmaSZ/Zost/pEhTq9ipnXTK/gBH+ uO+Ci7Xauu4hXUTdqyldycLUPFeUrO/z7UCgIQP69zeE6xgBWN2jkmJSw+3ZaPoypMpa tTeROx6rHf0DIDEnoiotZ05lDtq+5zGRsqnAhc4Gx4rC2dwfbRevJgFo1NbEV766igDN 3NtrKQeOmFKxD8UGeJcJLVLCtY0GAPhB+1cLWUzPCxZCmpC86PahhPNBWJYvmcL51qoS tI4T0TSdC8PGluJOnRk068pPpZUbPVb89gmw9571FhZJw0AHlkspyhCZEe/UhxAjUCkO wLqA== X-Received: by 10.52.18.148 with SMTP id w20mr8324959vdd.8.1362488362264; Tue, 05 Mar 2013 04:59:22 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp110068veb; Tue, 5 Mar 2013 04:59:21 -0800 (PST) X-Received: by 10.68.239.3 with SMTP id vo3mr23710957pbc.184.1362488360926; Tue, 05 Mar 2013 04:59:20 -0800 (PST) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id pu7si27064006pbc.22.2013.03.05.04.59.20; Tue, 05 Mar 2013 04:59:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.33 as permitted sender) client-ip=203.254.224.33; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.33 as permitted sender) smtp.mail=amarendra.xt@samsung.com Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJ600BWSUQ8DP70@mailout3.samsung.com>; Tue, 05 Mar 2013 21:58:56 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 2E.BE.17763.01CE5315; Tue, 05 Mar 2013 21:58:56 +0900 (KST) X-AuditID: cbfee690-b7f6b6d000004563-42-5135ec1038b9 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id BE.F1.03880.01CE5315; Tue, 05 Mar 2013 21:58:56 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJ600GDUUCXH840@mmp1.samsung.com>; Tue, 05 Mar 2013 21:58:56 +0900 (KST) From: Amar To: u-boot@lists.denx.de Cc: patches@linaro.org, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org, afleming@gmail.com, jh80.chung@samsung.com Subject: [PATCH V7 10/10] EXYNOS5: I2C: Added FDT and non-FDT support for I2C Date: Tue, 05 Mar 2013 08:11:30 -0500 Message-id: <1362489090-7745-11-git-send-email-amarendra.xt@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1362489090-7745-1-git-send-email-amarendra.xt@samsung.com> References: <1362489090-7745-1-git-send-email-amarendra.xt@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsWyRsSkRlfgjWmgwb8mC4uH62+yWEw5/IXF gcnjzrU9bAGMUVw2Kak5mWWpRfp2CVwZnTN+sBR84qpo6WtibWB8wdHFyMkhIWAi8f95ByOE LSZx4d56ti5GLg4hgaWMEg/vLmeEKeqb+ZgFIrGIUWLX6l5GCKeXSWLq24nsXYwcHGwCqhK/ FtuDNIgISEj86r8KVsMs0MEosWPiZkaQGmEBX4mnj8FqWIDKV585ywQS5hXwkFg6Xw5il5zE hz2P2EFsTqDwos8LmUFsIQF3iUs9i8BukBC4zyYx49Q2Vog5AhLfJh9iAZkjISArsekAM8Qc SYmDK26wTGAUXsDIsIpRNLUguaA4Kb3IRK84Mbe4NC9dLzk/dxMjMBhP/3s2YQfjvQPWhxiT gcZNZJYSTc4HBnNeSbyhsYm5qbGpmZGlpaUpacJK4rzyl2QChQTSE0tSs1NTC1KL4otKc1KL DzEycXBKNTCyq00+Vz2lvLtid4siD0O82RkWx0fLCl5+0MkyWn3erCEtptfo+E1fjpOB7u/s pMLeTPt5uG55dfYO/+D1U33Yv0psSpHjmc9+4c+Fijt7b+w54PGVYWmk/adbfP8yor86VWk8 VlE89+bqsesX9+m0nrl12e73zG3ekzI+992MzvxeZrR4t9Z2JZbijERDLeai4kQAQo9EXFwC AAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsVy+t9jAV2BN6aBBh93a1k8XH+TxWLK4S8s Dkwed67tYQtgjGpgtMlITUxJLVJIzUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLx CdB1y8wBmq2kUJaYUwoUCkgsLlbSt8M0ITTETdcCpjFC1zckCK7HyAANJKxhzOic8YOl4BNX RUtfE2sD4wuOLkZODgkBE4m+mY9ZIGwxiQv31rN1MXJxCAksYpTYtbqXEcLpZZKY+nYiexcj BwebgKrEr8X2IA0iAhISv/qvgtUwC3QwSuyYuJkRpEZYwFfi6WOwGhag8tVnzjKBhHkFPCSW zpeD2CUn8WHPI3YQmxMovOjzQmYQW0jAXeJSzyKWCYy8CxgZVjGKphYkFxQnpeca6RUn5haX 5qXrJefnbmIEh/oz6R2MqxosDjEKcDAq8fAyHDUJFGJNLCuuzD3EKMHBrCTCu/OpaaAQb0pi ZVVqUX58UWlOavEhxmSgoyYyS4km5wPjMK8k3tDYxNzU2NTSxMLEzJI0YSVxXsZTTwKEBNIT S1KzU1MLUotgtjBxcEo1MM7rUDgzqf/Pv8yVJfuOGqyf3qVVf5HXqZ6n7PwvibwF2RobSwR/ Plv399L8yYt2uhtYcoX9muXYKGzK69s5vUjQY/aV5nsVewXnPl64Rbf7sD3XIb6c6rA4+8Nz pq3a+fXI3GO8+sctjmRfmbN+RWhWxas7ybcv21fNeGiurPbOTlUmbp3U3HNKLMUZiYZazEXF iQCkNi4juQIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQkQLO8gmfjAEv5xQqC6ivIJHrlY9HAxQ6ljRbqudsQkwTUy6tMbBLK0zHpGwvqfoOMnrCNY This patch adds FDT and non-FDT support for I2C, and initialise the I2C channels. Signed-off-by: Amar Tested-by: Hung-ying Tyan --- Changes since V4: New patch. Changes since V5: 1)Removed the function call i2c_init() present inside the function board_i2c_init(). Changes since V6: No change. drivers/i2c/s3c24x0_i2c.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c index 769a2ba..5b4c3d2 100644 --- a/drivers/i2c/s3c24x0_i2c.c +++ b/drivers/i2c/s3c24x0_i2c.c @@ -524,11 +524,12 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len) len) != 0); } -#ifdef CONFIG_OF_CONTROL void board_i2c_init(const void *blob) { + int i; +#ifdef CONFIG_OF_CONTROL int node_list[CONFIG_MAX_I2C_NUM]; - int count, i; + int count; count = fdtdec_find_aliases_for_id(blob, "i2c", COMPAT_SAMSUNG_S3C2440_I2C, node_list, @@ -548,8 +549,15 @@ void board_i2c_init(const void *blob) bus->bus_num = i2c_busses++; exynos_pinmux_config(bus->id, 0); } +#else + for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) { + exynos_pinmux_config((PERIPH_ID_I2C0 + i), + PINMUX_FLAG_NONE); + } +#endif } +#ifdef CONFIG_OF_CONTROL static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx) { if (bus_idx < i2c_busses)