From patchwork Mon Jan 21 11:43:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amar X-Patchwork-Id: 14143 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 98D4823E02 for ; Mon, 21 Jan 2013 11:31:15 +0000 (UTC) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by fiordland.canonical.com (Postfix) with ESMTP id 3AFA5A1880D for ; Mon, 21 Jan 2013 11:31:15 +0000 (UTC) Received: by mail-vb0-f43.google.com with SMTP id fs19so5600202vbb.2 for ; Mon, 21 Jan 2013 03:31:14 -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=1h0pDEPMeaOq3QwfMdoyRzFHItl74vKYmUo/CoVdNQA=; b=lwsK+7hTH0XE3ZvksorgHio+2k+x14nC9dY4kEgez0RRfRpdGgtY3vfCBIxynTzDsa +tqfyimiFAJKO7naaaJSq4WZEtJyu4sRsIh/UPRjLEZmMGlr+4xLU7Ade+keKEo+OgrB pkvtqWMRiiOyaLxpt0ntk0hVwvwTPLIzGtgp9QOn2ro8/zvknIFZWvmuShePYMrE+UsN wkP9TM11AARms46Py5D0irt0Jpf52JK/nF8TA0KwXWDzuN/pOEHXP0izIT4QAN+R+iCV RoNvKaYFk7I8AfOW0J54Pso7lwAknfYfzbmMcWOtHrHsYO0MJgJF89Rz4IVsJWYsV2mk ncJw== X-Received: by 10.220.238.139 with SMTP id ks11mr18604076vcb.49.1358767874781; Mon, 21 Jan 2013 03:31:14 -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.145.101 with SMTP id st5csp196567veb; Mon, 21 Jan 2013 03:31:14 -0800 (PST) X-Received: by 10.66.88.133 with SMTP id bg5mr46460979pab.21.1358767873752; Mon, 21 Jan 2013 03:31:13 -0800 (PST) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id y1si13806594pav.74.2013.01.21.03.31.13; Mon, 21 Jan 2013 03:31:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.24 as permitted sender) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.24 as permitted sender) smtp.mail=amarendra.xt@samsung.com Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MGZ00BV33ZTZTO0@mailout1.samsung.com>; Mon, 21 Jan 2013 20:31:12 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id D5.6F.03880.FF62DF05; Mon, 21 Jan 2013 20:31:11 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-ef-50fd26ffbb65 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 35.6F.03880.EF62DF05; Mon, 21 Jan 2013 20:31:11 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MGZ0092C3L1A540@mmp2.samsung.com>; Mon, 21 Jan 2013 20:31:10 +0900 (KST) From: Amar To: u-boot@lists.denx.de, jh80.chung@samsung.com Cc: patches@linaro.org, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org, afleming@gmail.com, hs@denx.de Subject: [PATCH V5 10/10] EXYNOS5: I2C: Added FDT and non-FDT support for I2C Date: Mon, 21 Jan 2013 06:43:58 -0500 Message-id: <1358768638-14187-11-git-send-email-amarendra.xt@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1358768638-14187-1-git-send-email-amarendra.xt@samsung.com> References: <1358768638-14187-1-git-send-email-amarendra.xt@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCLMWRmVeSWpSXmKPExsWyRsSkTve/2t8Ag/WzBS0err/JYjHl8BcW ByaPO9f2sAUwRnHZpKTmZJalFunbJXBlTJr+k7lgMVfFxUN3GBsY13B0MXJySAiYSCz7P48V whaTuHBvPRuILSSwlFFiyVIjmJqNP1sZIeLTGSXuLxaAsHuZJN6er+5i5OBgE1CV+LXYHiQs ImAgMf3JdrCRzAI1EpPn32ICKREW8JW4vyoKJMwCVL2x5RgTiM0r4Clx9cFRdohNchIf9jwC szmB4vv/7mGF2OQhsWvBfyCbC6jmMpvEiXuT2CEGCUh8m3yIBWS+hICsxKYDzBBzJCUOrrjB MoFReAEjwypG0dSC5ILipPRcI73ixNzi0rx0veT83E2MwDA8/e+Z9A7GVQ0WhxgFOBiVeHgT +v4ECLEmlhVX5h5ilOBgVhLh/TkDKMSbklhZlVqUH19UmpNafIgxGWj5RGYp0eR8YIzklcQb GpuYmxqbWhoZmZmakiasJM7LeOpJgJBAemJJanZqakFqEcwWJg5OqQbGHrfuz+ZJXXmmUoKP DNa49At9W/DTOzfz3JzN2lrHA77MSZ5hYScuFPVkloHXwxbr9m/1S29xGZX5i72a4W3Zsi1u +hX5jTu2mR/Il/pqy8/8+3u6/GmXXK30M0byF+al7r50drnWvgsrhENX7GxaJrz6qpTYZOUV nG4qTFO/9p40OmHVy7hDiaU4I9FQi7moOBEAE2lQxocCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsVy+t9jQd3/an8DDFr3sFg8XH+TxWLK4S8s Dkwed67tYQtgjGpgtMlITUxJLVJIzUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLx CdB1y8wBmq2kUJaYUwoUCkgsLlbSt8M0ITTETdcCpjFC1zckCK7HyAANJKxhzJg0/SdzwWKu iouH7jA2MK7h6GLk5JAQMJHY+LOVEcIWk7hwbz0biC0kMJ1R4v5iAQi7l0ni7fnqLkYODjYB VYlfi+1BwiICBhLTn2xnBbGZBWokJs+/xQRSIizgK3F/VRRImAWoemPLMSYQm1fAU+Lqg6Ps EJvkJD7seQRmcwLF9//dwwqxyUNi14L/rBMYeRcwMqxiFE0tSC4oTkrPNdIrTswtLs1L10vO z93ECA7zZ9I7GFc1WBxiFOBgVOLhTej7EyDEmlhWXJl7iFGCg1lJhPfnDKAQb0piZVVqUX58 UWlOavEhxmSgqyYyS4km5wNjMK8k3tDYxNzU2NTSxMLEzJI0YSVxXsZTTwKEBNITS1KzU1ML UotgtjBxcEo1MDbFBeY3fDoTF3Q2ovu//urL539UqTIeXLpR+MF+i20PQqqKb+x5Ys9xrq3y EVtO3eQTkveDy5hEYs+7LN6x8u1joXPreRi9lJNv3C+6EtSRY7k4o0qxLJt3Y9DvTkaxVO1b 2fsjo/r0pUQe50zLvOVfL8ckEPt88iFfHru7iZUsi/es4JaNVmIpzkg01GIuKk4EAC+CVta3 AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQl9CmeZwfP4/T6Xz/K4N16tlyzu0uZ/rNoxnhqoaHPbUJtRnj+P7UpUasb2cmycTeV8C+Mw This patch adds FDT and non-FDT support for I2C, and initialise the I2C channels. Signed-off-by: Amar --- Changes since V4: New patch. drivers/i2c/s3c24x0_i2c.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c index 769a2ba..f2a035c 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,16 @@ 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 + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); } +#ifdef CONFIG_OF_CONTROL static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx) { if (bus_idx < i2c_busses)