From patchwork Sun May 17 15:57:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlo Caione X-Patchwork-Id: 6424311 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 876019F318 for ; Sun, 17 May 2015 16:01:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B59482041D for ; Sun, 17 May 2015 16:01:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E5F05203F1 for ; Sun, 17 May 2015 16:01:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yu0xH-0000ew-B0; Sun, 17 May 2015 15:58:19 +0000 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yu0xD-0000c3-Hu for linux-arm-kernel@lists.infradead.org; Sun, 17 May 2015 15:58:16 +0000 Received: by wicmx19 with SMTP id mx19so71969098wic.0 for ; Sun, 17 May 2015 08:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=GBbckb0SiZ+ucufIxhg5cDh+cIftaFgGrIZ+gK0IaTc=; b=ZYfEvuA5c17MsBF0hFzf3NkEz06m8XfoKmRrbn4Qd0sKUyvRZqQxlxU1a+5jWAZp9E EpcQdwEAD0Bv73F8Kmp0keDSyPh2ruhFv0OFM6gZ0C8Yj+N2Tasit4pLOP8o4fpr76K5 tDy7ReS+IXRL6s/Hq/VFaRfFnxTzY+j80wF9gLiZx3g6J9I7+NagL9nQ+KrARpMcUnwa S3rndWrhKZTaleQJuhDLl7mS3oorKXMJr6ZLSXhknvilvZ/qmu7JpkxwnIzys/OgqM1A Fu2ASJ8kd0SjpNLXNJQH8PNboadQItAKfFLCjBIMagkhUj00VPgqZN3sQcw5XXwU5bgq RTZA== X-Received: by 10.194.236.66 with SMTP id us2mr37195358wjc.54.1431878270562; Sun, 17 May 2015 08:57:50 -0700 (PDT) Received: from localhost.localdomain (2-238-57-164.ip242.fastwebnet.it. [2.238.57.164]) by mx.google.com with ESMTPSA id m2sm8166577wiy.7.2015.05.17.08.57.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 May 2015 08:57:49 -0700 (PDT) From: Carlo Caione To: linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, b.galvani@gmail.com, drake@endlessm.com, jstpierre@mecheye.net, jerry.cao@amlogic.com, victor.wan@amlogic.com Subject: [PATCH] pinctrl: Fix gpio/pin mapping for Meson8b Date: Sun, 17 May 2015 17:57:38 +0200 Message-Id: <1431878258-10229-1-git-send-email-carlo@caione.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150517_085815_757208_098D827A X-CRM114-Status: GOOD ( 10.36 ) X-Spam-Score: -0.7 (/) Cc: Carlo Caione X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Carlo Caione The num_pins field in the struct meson_domain_data must include also the missing pins in the Meson8b SoC, otherwise the GPIO <-> pin mapping is broken on this platform. Avoid also the dinamic allocation for GPIOs. Signed-off-by: Carlo Caione --- drivers/pinctrl/meson/pinctrl-meson.c | 2 +- drivers/pinctrl/meson/pinctrl-meson8b.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index edcd140..a70a5fe 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -569,7 +569,7 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc) domain->chip.direction_output = meson_gpio_direction_output; domain->chip.get = meson_gpio_get; domain->chip.set = meson_gpio_set; - domain->chip.base = -1; + domain->chip.base = domain->data->pin_base; domain->chip.ngpio = domain->data->num_pins; domain->chip.can_sleep = false; domain->chip.of_node = domain->of_node; diff --git a/drivers/pinctrl/meson/pinctrl-meson8b.c b/drivers/pinctrl/meson/pinctrl-meson8b.c index 2f7ea62..9677807 100644 --- a/drivers/pinctrl/meson/pinctrl-meson8b.c +++ b/drivers/pinctrl/meson/pinctrl-meson8b.c @@ -876,13 +876,13 @@ static struct meson_domain_data meson8b_domain_data[] = { .banks = meson8b_banks, .num_banks = ARRAY_SIZE(meson8b_banks), .pin_base = 0, - .num_pins = 83, + .num_pins = 130, }, { .name = "ao-bank", .banks = meson8b_ao_banks, .num_banks = ARRAY_SIZE(meson8b_ao_banks), - .pin_base = 83, + .pin_base = 130, .num_pins = 16, }, };