From patchwork Tue Nov 20 22:27:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 1776471 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 0AD743FCAE for ; Tue, 20 Nov 2012 22:29:50 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TawIe-0005nI-ED; Tue, 20 Nov 2012 22:28:12 +0000 Received: from mail-fa0-f73.google.com ([209.85.161.73]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TawIb-0005k1-Q5 for linux-arm-kernel@lists.infradead.org; Tue, 20 Nov 2012 22:28:10 +0000 Received: by mail-fa0-f73.google.com with SMTP id a10so278485fad.0 for ; Tue, 20 Nov 2012 14:28:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=As4+Z82hUWzDYwGATu1w2geE+2aYRRffeoGaIH838no=; b=Txk1dOvn2rxg1qb17PoqhfBJjEwvohLFlvG+EapZZeAWqAwKWhslTMpzFsbkOCBTyZ MGsyQHH4iVO6NMwOWmx+exQ9E8bcgiazOVfC7j013MqyjhnjF9skBLI/P+VYTlOD0ORQ LulR8rHNjwzWyJzdXAUexTmpk5I1eTYA9/mN3Rlj/+ldDUZluj8IfbXywHUqBDJMIRD0 Lkkcwlga4b5Pq77fpYinx7rAp2O6U7FyhuT+1d+g6ZoEDoaZk9mO+kmlild3J7IyQa4a y+8UJLK8NFFn1tgn/M/uZvWu8fYPTcfY82SS8ARAJ+u9EbYDUvpA4nM/ueVcq3jQ3Tub 0V3g== Received: by 10.14.209.66 with SMTP id r42mr13848462eeo.1.1353450489382; Tue, 20 Nov 2012 14:28:09 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id z47si3661040eel.0.2012.11.20.14.28.09 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 20 Nov 2012 14:28:09 -0800 (PST) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.73.80]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 071A220004E; Tue, 20 Nov 2012 14:28:09 -0800 (PST) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 6A3A580B05; Tue, 20 Nov 2012 14:28:08 -0800 (PST) From: Doug Anderson To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/2] i2c: s3c2410: Get the i2c bus number from alias id Date: Tue, 20 Nov 2012 14:27:04 -0800 Message-Id: <1353450428-2615-2-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1353450428-2615-1-git-send-email-dianders@chromium.org> References: <1353450428-2615-1-git-send-email-dianders@chromium.org> X-Gm-Message-State: ALoCoQkHL9h+jfaVs1YFNZZFw9qzwDtkTzhsxYfN7E4mX0gs25T0bcfbLsT0GqSdwE1UK4L781/i4hTXRq5+XU4nZatGUj3csCJwC151Kw4J7TG7/aS4UsUKHJU2fdLcGWjiluL0fzBRURx1xAWDnSWiPd/HCiMTr0pCnPt0quLqqWpTRsxJPI5DGZjgIxcePsnq2fPW9CeVBm4+fmKkq4xQIM2sgDRTZw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121120_172809_988030_DDED5965 X-CRM114-Status: GOOD ( 14.17 ) X-Spam-Score: -0.3 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.161.73 listed in list.dnswl.org] 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kukjin Kim , Padmavathi Venna , linux-kernel@vger.kernel.org, Doug Anderson , Wolfram Sang , Thomas Abraham , linux-i2c@vger.kernel.org, Ben Dooks , Olof Johansson , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 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 From: Padmavathi Venna Get the i2c bus number that the device is connected to using the alias id. This makes debugging / grokking of kernel messages much easier. [dianders: slight patch cleanup from Padmavathi's original.] Signed-off-by: Padmavathi Venna Signed-off-by: Doug Anderson Acked-by: Kukjin Kim --- drivers/i2c/busses/i2c-s3c2410.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 3e0335f..ca43590 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -899,11 +899,19 @@ static void s3c24xx_i2c_parse_dt(struct device_node *np, struct s3c24xx_i2c *i2c) { struct s3c2410_platform_i2c *pdata = i2c->pdata; + int id; if (!np) return; - pdata->bus_num = -1; /* i2c bus number is dynamically assigned */ + id = of_alias_get_id(np, "i2c"); + if (id < 0) { + dev_warn(i2c->dev, "failed to get alias id:%d\n", id); + pdata->bus_num = -1; + } else { + /* i2c bus number is statically assigned from alias */ + pdata->bus_num = id; + } of_property_read_u32(np, "samsung,i2c-sda-delay", &pdata->sda_delay); of_property_read_u32(np, "samsung,i2c-slave-addr", &pdata->slave_addr); of_property_read_u32(np, "samsung,i2c-max-bus-freq",