From patchwork Wed Oct 10 12:38:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12106 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 7BC3724188 for ; Wed, 10 Oct 2012 12:38:35 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 310D8A19090 for ; Wed, 10 Oct 2012 12:38:35 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so720652iej.11 for ; Wed, 10 Oct 2012 05:38:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=hD+b0u22yO2xEjEBl61j3GEJC6bS1wVN1Vp5iVFOC44=; b=DhIuPkqsFqiTWMg0KIXd/Tt2Yh/A2JRoBCKmTQAnBSjnkaXu6hY8j2pxkMvG77ndvd VCAgvUfJM5pzmNxrsBUYPv0AsSoPr1LkZ1xQ5qH+xdyAhKw9QCMnYIWXiUY4tJqGjvYY i798Mha1tUtb2DM+JjvlGtXtVWsYoTzN9Zy0Nydj3/KIMx0AvcJEgW8hGQTHt3O4VRT3 XNeOu/uCcJgqG5tZFMm8n9NHJKIR6QQypEmq1WReT0+zMHA+XHi5SumPpS6KhlH018GJ x1Vn7ZmkYDwINozYKtYD2GEXOyXAThbvaw0oteWX0NSLHYgT6RfO7FPLf0qJ/IelSKoQ US+Q== Received: by 10.50.159.194 with SMTP id xe2mr4959677igb.62.1349872714944; Wed, 10 Oct 2012 05:38:34 -0700 (PDT) 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.50.67.148 with SMTP id n20csp216678igt; Wed, 10 Oct 2012 05:38:33 -0700 (PDT) Received: by 10.14.173.67 with SMTP id u43mr7097063eel.27.1349872713252; Wed, 10 Oct 2012 05:38:33 -0700 (PDT) Received: from eu1sys200aog119.obsmtp.com (eu1sys200aog119.obsmtp.com [207.126.144.147]) by mx.google.com with SMTP id a8si721454eep.113.2012.10.10.05.38.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Oct 2012 05:38:33 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.147; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKUHVsQ6DWs7SOWt75kPjtC49jJ2ZCWVx1@postini.com; Wed, 10 Oct 2012 12:38:33 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CBDB710E; Wed, 10 Oct 2012 12:38:21 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8A1872AAE; Wed, 10 Oct 2012 12:38:21 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id E96B2A8098; Wed, 10 Oct 2012 14:38:15 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 10 Oct 2012 14:38:21 +0200 From: Linus Walleij To: , Cc: Stephen Warren , Anmar Oueja , Patrice Chotard , Linus Walleij Subject: [PATCH 3/5] pinctrl/nomadik: allow to support several ranges per GPIO bank Date: Wed, 10 Oct 2012 14:38:18 +0200 Message-ID: <1349872698-31245-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQn3pHs66mUYYaxI1pxSUIs7fMT5P+N61siOtRybnYYsXaSumQbBmOWReF5lLF3MdOJz+kmo From: Patrice Chotard With DB8500 the number of GPIO chips = number GPIO bank = number of GPIO ranges. With DB8540, a new GPIO range configuration is used, some GPIO banks can have several GPIO ranges. For example, DB8540 GPIO bank0 (GPIO0 to GPIO32) have 2 GPIO ranges: - GPIO0 to GPIO17 : routed - GPIO18 to GPIO21 : hole - GPIO22 to GPIO28 : routed - GPIO29 to GPIO32 : hole Previously, during nmk_pinctrl_probe(), all GPIO ranges were parsed, as GPIO ranges are larger than the number of GPIO chips, a warning occurs. This commit allows each bank to have several GPIO ranges. Signed-off-by: Patrice Chotard Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-nomadik.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 334cd2f..e4d3778 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -1837,11 +1837,11 @@ static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) * need this to proceed. */ for (i = 0; i < npct->soc->gpio_num_ranges; i++) { - if (!nmk_gpio_chips[i]) { + if (!nmk_gpio_chips[npct->soc->gpio_ranges[i].id]) { dev_warn(&pdev->dev, "GPIO chip %d not registered yet\n", i); return -EPROBE_DEFER; } - npct->soc->gpio_ranges[i].gc = &nmk_gpio_chips[i]->chip; + npct->soc->gpio_ranges[i].gc = &nmk_gpio_chips[npct->soc->gpio_ranges[i].id]->chip; } nmk_pinctrl_desc.pins = npct->soc->pins;