From patchwork Mon Apr 22 09:52:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 16292 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1B5C425DEE for ; Mon, 22 Apr 2013 09:53:08 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id j8sf1014753qah.4 for ; Mon, 22 Apr 2013 02:52:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf: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 :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=7iOkVwiu4BGS9vcSTiyWqqPkIg2Ox5xbwnSs3KDReNA=; b=o3MsGhbQ2r0OeuH6vwvuS93QRl2OFs+oisHjewn2aSY/Y/A8A0cdiU9DkfSP8ydN00 voEDT6Z2QLB/rStnaN4t3QB/rZbjOwgUPvQbJ2tCS9XIwJJabCEBJ8yaDfH6CBEwPHwd LuR3/Is0EMBC2z4jJXWPtWvjQXlbKD8fI3bdmTYzwzOxNzE4qQtKbQapmdF2PXUhVv2a cBSS1AX1SB2dJRxwYZL2rtmnKj2uidGlsQISF853O90vdE6eG21GbOTe4e+3UjcLFPAt c7U9AnYKr8gobxxIYX7jKOC3uGb/cop0nAt+eEWVcHV1o05H6UdutC/SOqSRtqYIHh1P LjjQ== X-Received: by 10.236.174.6 with SMTP id w6mr12747719yhl.25.1366624341981; Mon, 22 Apr 2013 02:52:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.63.33 with SMTP id d1ls3030897qes.88.gmail; Mon, 22 Apr 2013 02:52:21 -0700 (PDT) X-Received: by 10.52.67.166 with SMTP id o6mr15459915vdt.59.1366624341884; Mon, 22 Apr 2013 02:52:21 -0700 (PDT) Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com [2607:f8b0:400c:c02::230]) by mx.google.com with ESMTPS id ir6si1111456vdb.143.2013.04.22.02.52.21 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Apr 2013 02:52:21 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::230; Received: by mail-vb0-f48.google.com with SMTP id p13so5537373vbe.7 for ; Mon, 22 Apr 2013 02:52:21 -0700 (PDT) X-Received: by 10.58.48.166 with SMTP id m6mr5556663ven.59.1366624341778; Mon, 22 Apr 2013 02:52:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp68657veb; Mon, 22 Apr 2013 02:52:21 -0700 (PDT) X-Received: by 10.194.133.198 with SMTP id pe6mr50725296wjb.9.1366624340273; Mon, 22 Apr 2013 02:52:20 -0700 (PDT) Received: from eu1sys200aog119.obsmtp.com (eu1sys200aog119.obsmtp.com [207.126.144.147]) by mx.google.com with SMTP id f3si38557844eev.193.2013.04.22.02.52.12 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Apr 2013 02:52:20 -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; Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKUXUIS8VWy3NrDXzytaoaZUeBRibsEfk/@postini.com; Mon, 22 Apr 2013 09:52:20 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 71FF84D; Mon, 22 Apr 2013 09:51:14 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 85EA23F; Mon, 22 Apr 2013 03:00:41 +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 232B624C07C; Mon, 22 Apr 2013 11:52:04 +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.279.5; Mon, 22 Apr 2013 11:52:09 +0200 From: Linus Walleij To: Cc: Arnd Bergmann , , Linus Walleij Subject: [PATCH 05/23] pinctrl: coh901: add device tree support Date: Mon, 22 Apr 2013 11:52:06 +0200 Message-ID: <1366624326-6259-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: ALoCoQnwY2R9DRX21JfdK3W154xscd3TtwsAdlJoP5LmH+cBY6Qq7fIempLUM1DXDmKoF4ZsoofJ X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Linus Walleij This makes it possible to probe the COH901 pinctrl driver from the device tree, and assigned the device tree node in the gpio_chip so we can look up cross-references from the device tree. Signed-off-by: Linus Walleij --- .../devicetree/bindings/gpio/gpio-stericsson-coh901.txt | 9 +++++++++ drivers/pinctrl/pinctrl-coh901.c | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-stericsson-coh901.txt diff --git a/Documentation/devicetree/bindings/gpio/gpio-stericsson-coh901.txt b/Documentation/devicetree/bindings/gpio/gpio-stericsson-coh901.txt new file mode 100644 index 0000000..355f8ea --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-stericsson-coh901.txt @@ -0,0 +1,9 @@ +ST-Ericsson COH 901 571/3 GPIO controller + +Required properties: +- compatible: Compatible property value should be "stericsson,gpio-coh901" +- reg: Physical base address of the controller and length of memory mapped + region. +- interrupts: the 0...n interrupts assigned to the different GPIO ports/banks. +- interrupt-names: name the interrupts after port/bank, "gpio0", "gpio1" etc. + diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c index 8b7e7bc..bed47ab 100644 --- a/drivers/pinctrl/pinctrl-coh901.c +++ b/drivers/pinctrl/pinctrl-coh901.c @@ -808,6 +808,9 @@ static int __init u300_gpio_probe(struct platform_device *pdev) } dev_dbg(gpio->dev, "initialized %d GPIO ports\n", portno); +#ifdef CONFIG_OF_GPIO + gpio->chip.of_node = pdev->dev.of_node; +#endif err = gpiochip_add(&gpio->chip); if (err) { dev_err(gpio->dev, "unable to add gpiochip: %d\n", err); @@ -861,9 +864,15 @@ static int __exit u300_gpio_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id u300_gpio_match[] = { + { .compatible = "stericsson,gpio-coh901" }, + {}, +}; + static struct platform_driver u300_gpio_driver = { .driver = { .name = "u300-gpio", + .of_match_table = u300_gpio_match, }, .remove = __exit_p(u300_gpio_remove), };