From patchwork Fri Feb 15 06:34:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amar X-Patchwork-Id: 14824 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 79EE023FC2 for ; Fri, 15 Feb 2013 06:14:17 +0000 (UTC) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by fiordland.canonical.com (Postfix) with ESMTP id 71CEFA183CF for ; Fri, 15 Feb 2013 06:14:16 +0000 (UTC) Received: by mail-vb0-f49.google.com with SMTP id s24so1979332vbi.22 for ; Thu, 14 Feb 2013 22:14:16 -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=ytby5xCK0NCX48txVSPk2z5HDmuCAoC1CcMfouUtXg0=; b=TlE0Ok6gJ3yVSKvN0Ed/FLxl55Oi4wk4GdaM8XWj5DYP69k6VY1Xt0a5+FDf32WPud qVXc5zLCVSxzhVHfNHW8la+FiXX753buvEW1s4wJSVSElxU9vOastzxAoR9dbI+q7jyP a1TYbOHeffDfYTTSWHCNSN9ifkvSLj47QtMdTtg2W6zBcclfhFcqVNjeTYPeildgTDAr DEa9nTy7CtFLIMCdFSkUAalMGcYdN71z4MehOSTEI33qlGR7qctXKo0tIkhlrt7bCVG9 d4fijfFvlJUmFRLoZenqCI1np2Cw68PeJ+1WcQknTZffAWT2LD5qJgZhOVnWNowxpUXT U+7Q== X-Received: by 10.52.98.5 with SMTP id ee5mr1444717vdb.102.1360908855975; Thu, 14 Feb 2013 22:14:15 -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.221.4.5 with SMTP id oa5csp305016vcb; Thu, 14 Feb 2013 22:14:15 -0800 (PST) X-Received: by 10.68.129.163 with SMTP id nx3mr3538379pbb.13.1360908855052; Thu, 14 Feb 2013 22:14:15 -0800 (PST) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id ol9si3674409pbb.257.2013.02.14.22.14.14; Thu, 14 Feb 2013 22:14:15 -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 epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MI800J4GZZ1VHN0@mailout1.samsung.com>; Fri, 15 Feb 2013 15:14:13 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 1F.BB.16905.532DD115; Fri, 15 Feb 2013 15:14:13 +0900 (KST) X-AuditID: cbfee68d-b7f4f6d000004209-a3-511dd235f420 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 06.9A.03918.532DD115; Fri, 15 Feb 2013 15:14:13 +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 <0MI8005Z0ZYZ7R20@mmp2.samsung.com>; Fri, 15 Feb 2013 15:14:13 +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 V6 10/10] EXYNOS5: I2C: Added FDT and non-FDT support for I2C Date: Fri, 15 Feb 2013 01:34:51 -0500 Message-id: <1360910091-6285-11-git-send-email-amarendra.xt@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1360910091-6285-1-git-send-email-amarendra.xt@samsung.com> References: <1360910091-6285-1-git-send-email-amarendra.xt@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsWyRsSkWtf0kmygQd8hM4uH62+yWEw5/IXF gcnjzrU9bAGMUVw2Kak5mWWpRfp2CVwZs2/sYSy4wFWxdfFFpgbGCxxdjJwcEgImEp/3n2KE sMUkLtxbz9bFyMUhJLCUUeJwUyM7TFF3YxMzRGI6o8T6ua+gqnqZJOa9bgVyODjYBFQlfi22 B2kQEZCQ+NV/lRGkhlmgg1Fix8TNYCuEBXwlVv78xAxiswDVN7+8CdbLK+AhcWN1KcQyOYkP ex6BLeYECp+b/BqsXEjAXWLnpw6wmRICt9kkXn67zQoxR0Di2+RDLCBzJARkJTYdYIaYIylx cMUNlgmMwgsYGVYxiqYWJBcUJ6UXGeoVJ+YWl+al6yXn525iBIbj6X/Pencw3j5gfYgxGWjc RGYp0eR8YDjnlcQbGpuYmxqbmhlZWlqakiasJM4rd0kmUEggPbEkNTs1tSC1KL6oNCe1+BAj EwenVAOju8uH5fOFr5/dJvGkY/uORd3bf+YzBkkfnPlZyG3xxf15m/02npNbPfvz+4pD/137 1jFttn8TrrL625vS3DNPXzOUXg9+ezXkSe7rTRIHVjuvnLbIR/uB/c7y7h8fDoUl7633Pn73 akPNR3GblA8zfnpz+M78ZrBhz6uD2S4erh1nT8p41vdWT1JiKc5INNRiLipOBADNgIGXXQIA AA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRmVeSWpSXmKPExsVy+t9jQV3TS7KBBpc+aFk8XH+TxWLK4S8s Dkwed67tYQtgjGpgtMlITUxJLVJIzUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLx CdB1y8wBmq2kUJaYUwoUCkgsLlbSt8M0ITTETdcCpjFC1zckCK7HyAANJKxhzJh9Yw9jwQWu iq2LLzI1MF7g6GLk5JAQMJHobmxihrDFJC7cW8/WxcjFISQwnVFi/dxXUE4vk8S8161ADgcH m4CqxK/F9iANIgISEr/6rzKC1DALdDBK7Ji4mREkISzgK7Hy5yewqSxA9c0vb4L18gp4SNxY XQqxTE7iw55H7CA2J1D43OTXYOVCAu4SOz91ME5g5F3AyLCKUTS1ILmgOCk911CvODG3uDQv XS85P3cTIzjYn0ntYFzZYHGIUYCDUYmHV0BCNlCINbGsuDL3EKMEB7OSCO+aEKAQb0piZVVq UX58UWlOavEhxmSgoyYyS4km5wMjMa8k3tDYxNzU2NTSxMLEzJI0YSVxXsZTTwKEBNITS1Kz U1MLUotgtjBxcEo1MMbNaZ3yKdFw43mdpEcrLY5qbzn9LzggtdZGZvcRvu8rwyurlMyMdT7f 9m5ZZqL2vODmhHCfTT+/Ptgul68VtkTAcl3ztYfCS0wUfNMuVZ54MDNl73+2E/2fzRct/vJf esntGT3Raz9qGXfLu0vt8f7xVnya5ymrp0GLYlU4uJqFed6ozlnYwK7EUpyRaKjFXFScCABR 4I2BugIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQmANHxEX8k8DYbpfKNqhpMcZSDul+qBbnrLrgJArWHYybgAz51PSHGte4n959NthGmEaa3a This patch adds FDT and non-FDT support for I2C, and initialise the I2C channels. Signed-off-by: Amar Acked-by: Simon Glass --- Changes since V4: New patch. Changes since V5: 1)Removed the function call i2c_init() present inside the function board_i2c_init(). 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)