From patchwork Wed May 30 04:47:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 9038 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 7B01E23E58 for ; Wed, 30 May 2012 04:49:01 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 43AE4A185A3 for ; Wed, 30 May 2012 04:49:01 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so3563019yhp.11 for ; Tue, 29 May 2012 21:49:01 -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:in-reply-to:references :x-gm-message-state; bh=v3XPeKZs9HFwTCYPcuQJnz3q2COl5m22OhfckGsGAB8=; b=h/meqUJw5Q7nnanRfPxMiGXKb16EwZDZakOrKm9X/Dbgj39aSzrdjYJWuljzBmjUoX 23Un4wYCw5hsNlbUe1cBpU1L4vDg0Za8nMNhAwPT/XZvk9Hkj8iHGJGYrNjw3TypqynW g5kGgV5Cr+PRAV4NDOVXjtCR09syncy3N/N5KZqU/angShOUCPy7U8ePuHvTGDs2Vt3o pnCrO2VxPuLngZQPbebxjEHdXGQcAXGwNLjPlXiU8OjtM1BtQC8diJEOVNlJW31q9lNI PIKwkvsRwYiTa8Z4C632U2Jbyb5l/CrNnA81jr5yTo+TD/z0rvaOa1qqKU3fxjI/ekA5 tAaA== Received: by 10.50.87.227 with SMTP id bb3mr9338973igb.57.1338353340905; Tue, 29 May 2012 21:49:00 -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.231.24.148 with SMTP id v20csp170295ibb; Tue, 29 May 2012 21:49:00 -0700 (PDT) Received: by 10.68.197.99 with SMTP id it3mr28039328pbc.148.1338353340270; Tue, 29 May 2012 21:49:00 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id ku9si15135999pbc.355.2012.05.29.21.49.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 May 2012 21:49:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-pz0-f50.google.com with SMTP id h15so7270112dan.37 for ; Tue, 29 May 2012 21:49:00 -0700 (PDT) Received: by 10.68.227.69 with SMTP id ry5mr45965092pbc.16.1338353340031; Tue, 29 May 2012 21:49:00 -0700 (PDT) Received: from localhost.localdomain ([118.143.64.134]) by mx.google.com with ESMTPS id kd6sm25122557pbc.24.2012.05.29.21.48.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 May 2012 21:48:59 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, arnd@arndb.de, linus.walleij@stericsson.com, grant.likely@secretlab.ca, cjb@laptop.org, broonie@opensource.wolfsonmicro.com, sameo@linux.intel.com Cc: Lee Jones Subject: [PATCH 20/22] pinctrl-nomadik: Allow Device Tree driver probing Date: Wed, 30 May 2012 12:47:38 +0800 Message-Id: <1338353260-10097-21-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1338353260-10097-1-git-send-email-lee.jones@linaro.org> References: <1338353260-10097-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkA2azul81y03/2Wt070x+pTnMmqgXJB+o7CisnIr4XhexSKkwON7Okny+HJrXhmcw0tbwd The Nomadik GPIO controller now relies on Nomadik pinctrl, however the pinctrl driver is not currently started by any ux500 platform. This is requred or GPIOs do not work at all. Signed-off-by: Lee Jones --- drivers/pinctrl/pinctrl-nomadik.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index b8e01c3..b26395d 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1688,18 +1689,34 @@ static struct pinctrl_desc nmk_pinctrl_desc = { .owner = THIS_MODULE, }; +static const struct of_device_id nmk_pinctrl_match[] = { + { + .compatible = "stericsson,nmk_pinctrl", + .data = (void *)PINCTRL_NMK_DB8500, + }, + {}, +}; + static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) { const struct platform_device_id *platid = platform_get_device_id(pdev); + struct device_node *np = pdev->dev.of_node; struct nmk_pinctrl *npct; + unsigned int version = 0; int i; npct = devm_kzalloc(&pdev->dev, sizeof(*npct), GFP_KERNEL); if (!npct) return -ENOMEM; + if (platid) + version = platid->driver_data; + else if (np) + version = (unsigned int) + of_match_device(nmk_pinctrl_match, &pdev->dev)->data; + /* Poke in other ASIC variants here */ - if (platid->driver_data == PINCTRL_NMK_DB8500) + if (version == PINCTRL_NMK_DB8500) nmk_pinctrl_db8500_init(&npct->soc); /* @@ -1758,6 +1775,7 @@ static struct platform_driver nmk_pinctrl_driver = { .driver = { .owner = THIS_MODULE, .name = "pinctrl-nomadik", + .of_match_table = nmk_pinctrl_match, }, .probe = nmk_pinctrl_probe, .id_table = nmk_pinctrl_id,