From patchwork Thu Sep 27 13:13:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11760 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 03C5D23EFD for ; Thu, 27 Sep 2012 13:14:28 +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 925C1A1875E for ; Thu, 27 Sep 2012 13:14:27 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so4106129iej.11 for ; Thu, 27 Sep 2012 06:14:27 -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=GreZtHjudZHtkLmaAV964bN6liFiKJaNM7hMBqs5sbU=; b=YFA1AGnqAgYy3WUYQd5DKUW+VW/V+GEtRsflxyntpt/pgoGvVBz6WsQ/QzI6hqlb3h 88p3UwQQk356JokF2rKFtD7KuSPlyMuvNHoM1s4LszEt9ccCBtKFIg6JLYLIurxwjEsX gT9Wpmcdc9cj+HzOkmpx1qFzaC4u0R1Sp+t/0WEBdvccqObXAiV0cKAY8DLXMVnGwf2f 5n9Iki6f17EVJNh3YDnsSafngHWTTAwqr/7q8s8i5t4AmPSgTuWFFfJxwwOD44w9xyjv RIy20+qcZs7RVSSfHgje2PsIorJGX9hsILCI5jyEsNeY+I9G1+/d1Ui5gtFDvpr5lMMQ ETMg== Received: by 10.42.109.194 with SMTP id m2mr2879680icp.48.1348751667346; Thu, 27 Sep 2012 06:14:27 -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.184.232 with SMTP id ex8csp414838igc; Thu, 27 Sep 2012 06:14:26 -0700 (PDT) Received: by 10.14.202.71 with SMTP id c47mr5829565eeo.42.1348751665700; Thu, 27 Sep 2012 06:14:25 -0700 (PDT) Received: from eu1sys200aog107.obsmtp.com (eu1sys200aog107.obsmtp.com [207.126.144.123]) by mx.google.com with SMTP id y1si5161099eep.138.2012.09.27.06.14.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 06:14:25 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.123 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.123; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.123 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-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob107.postini.com ([207.126.147.11]) with SMTP ID DSNKUGRRKNDinC9Grvzeg4W/BE8OZhso7v1r@postini.com; Thu, 27 Sep 2012 13:14:25 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 58C0865; Thu, 27 Sep 2012 13:13:32 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 8619162; Thu, 27 Sep 2012 09:02:55 +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 relay1.stm.gmessaging.net (Postfix) with ESMTPS id C2A2C24C2C0; Thu, 27 Sep 2012 15:13:55 +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; Thu, 27 Sep 2012 15:14:02 +0200 From: Linus Walleij To: , Cc: Stephen Warren , Anmar Oueja , Linus Walleij , Lee Jones , Rob Herring Subject: [PATCH 3/4] pinctrl/nomadik: use simple or linear IRQ domain Date: Thu, 27 Sep 2012 15:13:59 +0200 Message-ID: <1348751639-17457-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: ALoCoQk1jnhhCRYaHWhMzpC8E/b9/r335o+hfOg7QWRovtPJSFVgAzbIGrcJY6HtDGtX4OZb2TPn From: Linus Walleij This alters the Nomadik pinctrl driver to: - Call irqdomain_add_linear() for the DT case so we get all independent from IRQ numbers in this case. - Call irqdomain_add_simple() for the legacy case, which allocates the IRQ descriptors for the Nomadik pin controller dynamically. Cc: Lee Jones Cc: Rob Herring Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-nomadik.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index e031c84..6aab107 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -1286,9 +1286,19 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) platform_set_drvdata(dev, nmk_chip); - nmk_chip->domain = irq_domain_add_legacy(np, NMK_GPIO_PER_CHIP, - NOMADIK_GPIO_TO_IRQ(pdata->first_gpio), - 0, &nmk_gpio_irq_simple_ops, nmk_chip); + if (np) { + /* The DT case will just grab a set of IRQ numbers */ + nmk_chip->domain = irq_domain_add_linear(np, NMK_GPIO_PER_CHIP, + &nmk_gpio_irq_simple_ops, nmk_chip); + } else { + /* Non-DT legacy mode, use hardwired IRQ numbers */ + int irq_start; + + irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio); + nmk_chip->domain = irq_domain_add_simple(NULL, + NMK_GPIO_PER_CHIP, irq_start, + &nmk_gpio_irq_simple_ops, nmk_chip); + } if (!nmk_chip->domain) { dev_err(&dev->dev, "failed to create irqdomain\n"); ret = -ENOSYS;