From patchwork Mon Mar 18 10:45:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 15399 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 C1A9823E00 for ; Mon, 18 Mar 2013 10:45:48 +0000 (UTC) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by fiordland.canonical.com (Postfix) with ESMTP id 86D8BA1960D for ; Mon, 18 Mar 2013 10:45:48 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id ge1so4526454lbb.15 for ; Mon, 18 Mar 2013 03:45:48 -0700 (PDT) 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:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:x-gm-message-state; bh=BQHd/af0sWCFWBD1XJ0JWb7AqFP71z2HoGgi4sA/gNY=; b=aznrNGT1EJPQuBnJR0O98pHfy/K9DBQYYKLx6HyBoSVO21FKF61xytTSZD48dU9cn0 aglBoyaZFUsCl6WbaLLBbOCqexsb+PIw3+HTlCTZiEs6IC6aFhL5HPlwR+CiVEtrTtxt vn8SfKjISMtFbRrqpgJAOLGhb/tH3u6yHjEXTjV86gj9DPJhUyQJG7+VGIfvN2xbEYnK r2ZvvXOfZpg2x7IAb0Y6WB4MxaIBatuBdWCV5fzlWhfroU9E5yQffMPjj6maD04rx4uX QUMvO+Eeb1LuzuewEqLZncmnlGmh4F6FReLwqO1OPwOgyuHbpgJq2VxHSbyPUgIIHXHT xZZQ== X-Received: by 10.112.9.10 with SMTP id v10mr6339870lba.47.1363603548098; Mon, 18 Mar 2013 03:45:48 -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.112.91.146 with SMTP id ce18csp236603lbb; Mon, 18 Mar 2013 03:45:47 -0700 (PDT) X-Received: by 10.14.210.8 with SMTP id t8mr47813740eeo.35.1363603547172; Mon, 18 Mar 2013 03:45:47 -0700 (PDT) Received: from eu1sys200aog115.obsmtp.com (eu1sys200aog115.obsmtp.com [207.126.144.139]) by mx.google.com with SMTP id n8si27366902eeu.231.2013.03.18.03.45.44 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Mar 2013 03:45:47 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.139 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.139; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.139 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 eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKUUbwWLTt7hGEcflqYDiZOlWgkO96xq8h@postini.com; Mon, 18 Mar 2013 10:45:47 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 C25C9E6; Mon, 18 Mar 2013 10:45:12 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6AF9C45E5; Mon, 18 Mar 2013 10:45:12 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id F360BA8083; Mon, 18 Mar 2013 11:45:07 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 18 Mar 2013 11:45:11 +0100 From: Linus Walleij To: Grant Likely , Cc: Anmar Oueja , Gabriel Fernandez , , Linus Walleij Subject: [PATCH v2] gpio: stmpe: pass DT node to irqdomain Date: Mon, 18 Mar 2013 11:45:05 +0100 Message-ID: <1363603505-2996-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: ALoCoQn27TbuSqbr4bQ5Hpw0mjn1moY0/+xjbmF816LdJjjs4kzZviW/eImNzAejxaQPDs1zlMx9 From: Gabriel Fernandez The irq domain was implemented but the device tree node was not transmitted to irq_domain_add_simple(). Cc: stable@vger.kernel.org Signed-off-by: Gabriel Fernandez Signed-off-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 770476a..3ce5bc3 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -307,11 +307,15 @@ static const struct irq_domain_ops stmpe_gpio_irq_simple_ops = { .xlate = irq_domain_xlate_twocell, }; -static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio) +static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio, + struct device_node *np) { - int base = stmpe_gpio->irq_base; + int base = 0; - stmpe_gpio->domain = irq_domain_add_simple(NULL, + if (!np) + base = stmpe_gpio->irq_base; + + stmpe_gpio->domain = irq_domain_add_simple(np, stmpe_gpio->chip.ngpio, base, &stmpe_gpio_irq_simple_ops, stmpe_gpio); if (!stmpe_gpio->domain) { @@ -346,6 +350,9 @@ static int stmpe_gpio_probe(struct platform_device *pdev) stmpe_gpio->chip = template_chip; stmpe_gpio->chip.ngpio = stmpe->num_gpios; stmpe_gpio->chip.dev = &pdev->dev; +#ifdef CONFIG_OF + stmpe_gpio->chip.of_node = np; +#endif stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1; if (pdata) @@ -366,7 +373,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) goto out_free; if (irq >= 0) { - ret = stmpe_gpio_irq_init(stmpe_gpio); + ret = stmpe_gpio_irq_init(stmpe_gpio, np); if (ret) goto out_disable;