From patchwork Wed Sep 20 13:39:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 9961487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2946E60208 for ; Wed, 20 Sep 2017 13:55:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18FA928F0A for ; Wed, 20 Sep 2017 13:55:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D988290A9; Wed, 20 Sep 2017 13:55:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 37EEF28F0A for ; Wed, 20 Sep 2017 13:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=nUSTKFXN6i1HUWZI7Uhk/iGBCtkxqvMKjFouXUOOKkw=; b=OwuRdJ5wEO68SJHMW8QlocxPJx vqCJ/A4iY5jdrsFIfDWYMeCWI4J6IQz6NV9T/ARK/qepeLm6l9KWAnJDycQMiWTgvNG/ZiR4uQ/4I W6ZW4/bMapBTGHGvhcuOD+/qGRDIsRyPYutwbcaYP+HJsBz4YPAzJ8Dn+rBGPPFxTu5JdATOneyEt O7DEAYxW22aiSYXZOdAn9aPGK4p9YZaxZ4YdRkK0Xf7hmbLzQF6iar4fYjdt22nJa0IjxKFBpVm4i 6vi9BJ7uYYcHNZxU1j9QsRzeB7ioer63JZRDwbrfHwSsm2mWlaOoB4LJeQJKCyuJQilr9bqsKZmmn jjD/XuJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dufT4-0001Hj-RW; Wed, 20 Sep 2017 13:55:10 +0000 Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dufES-0008AN-U7 for linux-arm-kernel@lists.infradead.org; Wed, 20 Sep 2017 13:40:33 +0000 Received: by mail-wr0-x22d.google.com with SMTP id z39so2191431wrb.8 for ; Wed, 20 Sep 2017 06:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q6SPt7E8EFFA37vG/DeJoLrRPd9ktmwC85Tt2b0FGio=; b=KX1uLyqK5z1299W5cpLRnEtRtObkXi46YACkkJmZckGYTMuaPQJktiaGNTiX4VEJiw AzNsMW97QYkeNgqdkUXIa0YkOwCsMVDdd9RPVn848mLpfPyL263NqZ4ifbglpxMhjJuH 0hC1wb+3UQDNPcLV5RmYKhdarj/V2R18A7WRo6uZtsqfv7Z6zJTTqIkzIdzBTBynnNUs kY7OGJGEkWm9i4I4k/4OgL5445Nb/LvBqPekkeJFRaIMGMEnr7tONQBR2C+/wln3S0PW EoE8QbMJZF0IbqP5uYzFDOcUWAWpfMZccsy+Z0xlCJYAOMmxP97wX8VOBmW4+hFqvSAf lHNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q6SPt7E8EFFA37vG/DeJoLrRPd9ktmwC85Tt2b0FGio=; b=kun/oVN8PoxSXejFH6BCdBXdpNT0FG0ALEJtHmpiKAlzSsk5dxcYlAdbXVW7SuKz3x Zo4tfymum0+GH0mapBkOwgbF7+t6JQKRz/QB+GtjFu9CRbX0sqj1cIJh9jdZ+M2c7bs/ FypoGDcdhVAnuJO2Witce5OqFNApyKehccsJNEQUFkNzgXr09l4iMaEPjkoBW/nGvYSw E3rVe/8ZlvYPVLMLfTTAD1T0ImL8cNY2ehxEqncqac+l0pzKAzCTNZwz4XtOMLGfekDQ 1eLXSxDfVhmr/StmudvQzMfukypDgwEP/+pGLUhWVCySTS5AQajtlhr5HzW1xGsx8DHA 4RBQ== X-Gm-Message-State: AHPjjUgQmo9gPUXFQ2IyHpvK0oxCspqh3K8yidICuiBsgqOx3FW0uLOn OJJVs2OQZOIfmG79W7COQp4ZGA== X-Google-Smtp-Source: AOwi7QBPazFvKRdeiaClkL1mGUXbq0fJAo9um9S9eabqMcIH/o8YGXPMG63SvQ3h53+GDppznZS5fw== X-Received: by 10.223.150.27 with SMTP id b27mr4616963wra.100.1505914783169; Wed, 20 Sep 2017 06:39:43 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a39sm1938888wrc.48.2017.09.20.06.39.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Sep 2017 06:39:42 -0700 (PDT) From: Jerome Brunet To: Linus Walleij , Kevin Hilman , Carlo Caione Subject: [PATCH 6/8] pinctrl: meson: get rid of pin_base Date: Wed, 20 Sep 2017 15:39:25 +0200 Message-Id: <20170920133927.17390-7-jbrunet@baylibre.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170920133927.17390-1-jbrunet@baylibre.com> References: <20170920133927.17390-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170920_064005_417538_E2BE1F11 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Martin Blumenstingl , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP pin_base was used with the manually set pin offset in meson pinctrl. This is no longer the case, pin_base is 0 on every meson pinctrl controllers and should go away. Tested-by: Martin Blumenstingl Signed-off-by: Jerome Brunet --- drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 2 -- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 2 -- drivers/pinctrl/meson/pinctrl-meson.c | 30 +++++++++++++----------------- drivers/pinctrl/meson/pinctrl-meson8.c | 2 -- drivers/pinctrl/meson/pinctrl-meson8b.c | 2 -- 5 files changed, 13 insertions(+), 25 deletions(-) diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c index 6d52842d3ee5..8e0d6e4a31b4 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c @@ -820,7 +820,6 @@ static struct meson_bank meson_gxbb_aobus_banks[] = { struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = { .name = "periphs-banks", - .pin_base = 0, .pins = meson_gxbb_periphs_pins, .groups = meson_gxbb_periphs_groups, .funcs = meson_gxbb_periphs_functions, @@ -833,7 +832,6 @@ struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = { struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = { .name = "aobus-banks", - .pin_base = 0, .pins = meson_gxbb_aobus_pins, .groups = meson_gxbb_aobus_groups, .funcs = meson_gxbb_aobus_functions, diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c index 32e35ba9c04e..0d90ddab6ddd 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c @@ -807,7 +807,6 @@ static struct meson_bank meson_gxl_aobus_banks[] = { struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = { .name = "periphs-banks", - .pin_base = 0, .pins = meson_gxl_periphs_pins, .groups = meson_gxl_periphs_groups, .funcs = meson_gxl_periphs_functions, @@ -820,7 +819,6 @@ struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = { struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = { .name = "aobus-banks", - .pin_base = 0, .pins = meson_gxl_aobus_pins, .groups = meson_gxl_aobus_groups, .funcs = meson_gxl_aobus_functions, diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index 247208150b19..c9cd54de0449 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -413,16 +413,15 @@ static const struct pinconf_ops meson_pinconf_ops = { static int meson_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) { struct meson_pinctrl *pc = gpiochip_get_data(chip); - unsigned int reg, bit, pin; + unsigned int reg, bit; struct meson_bank *bank; int ret; - pin = pc->data->pin_base + gpio; - ret = meson_get_bank(pc, pin, &bank); + ret = meson_get_bank(pc, gpio, &bank); if (ret) return ret; - meson_calc_reg_and_bit(bank, pin, REG_DIR, ®, &bit); + meson_calc_reg_and_bit(bank, gpio, REG_DIR, ®, &bit); return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), BIT(bit)); } @@ -431,21 +430,20 @@ static int meson_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int value) { struct meson_pinctrl *pc = gpiochip_get_data(chip); - unsigned int reg, bit, pin; + unsigned int reg, bit; struct meson_bank *bank; int ret; - pin = pc->data->pin_base + gpio; - ret = meson_get_bank(pc, pin, &bank); + ret = meson_get_bank(pc, gpio, &bank); if (ret) return ret; - meson_calc_reg_and_bit(bank, pin, REG_DIR, ®, &bit); + meson_calc_reg_and_bit(bank, gpio, REG_DIR, ®, &bit); ret = regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 0); if (ret) return ret; - meson_calc_reg_and_bit(bank, pin, REG_OUT, ®, &bit); + meson_calc_reg_and_bit(bank, gpio, REG_OUT, ®, &bit); return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), value ? BIT(bit) : 0); } @@ -453,16 +451,15 @@ static int meson_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, static void meson_gpio_set(struct gpio_chip *chip, unsigned gpio, int value) { struct meson_pinctrl *pc = gpiochip_get_data(chip); - unsigned int reg, bit, pin; + unsigned int reg, bit; struct meson_bank *bank; int ret; - pin = pc->data->pin_base + gpio; - ret = meson_get_bank(pc, pin, &bank); + ret = meson_get_bank(pc, gpio, &bank); if (ret) return; - meson_calc_reg_and_bit(bank, pin, REG_OUT, ®, &bit); + meson_calc_reg_and_bit(bank, gpio, REG_OUT, ®, &bit); regmap_update_bits(pc->reg_gpio, reg, BIT(bit), value ? BIT(bit) : 0); } @@ -470,16 +467,15 @@ static void meson_gpio_set(struct gpio_chip *chip, unsigned gpio, int value) static int meson_gpio_get(struct gpio_chip *chip, unsigned gpio) { struct meson_pinctrl *pc = gpiochip_get_data(chip); - unsigned int reg, bit, val, pin; + unsigned int reg, bit, val; struct meson_bank *bank; int ret; - pin = pc->data->pin_base + gpio; - ret = meson_get_bank(pc, pin, &bank); + ret = meson_get_bank(pc, gpio, &bank); if (ret) return ret; - meson_calc_reg_and_bit(bank, pin, REG_IN, ®, &bit); + meson_calc_reg_and_bit(bank, gpio, REG_IN, ®, &bit); regmap_read(pc->reg_gpio, reg, &val); return !!(val & BIT(bit)); diff --git a/drivers/pinctrl/meson/pinctrl-meson8.c b/drivers/pinctrl/meson/pinctrl-meson8.c index 7344f8577467..fbf8ecd1c2b6 100644 --- a/drivers/pinctrl/meson/pinctrl-meson8.c +++ b/drivers/pinctrl/meson/pinctrl-meson8.c @@ -1046,7 +1046,6 @@ static struct meson_bank meson8_aobus_banks[] = { struct meson_pinctrl_data meson8_cbus_pinctrl_data = { .name = "cbus-banks", - .pin_base = 0, .pins = meson8_cbus_pins, .groups = meson8_cbus_groups, .funcs = meson8_cbus_functions, @@ -1059,7 +1058,6 @@ struct meson_pinctrl_data meson8_cbus_pinctrl_data = { struct meson_pinctrl_data meson8_aobus_pinctrl_data = { .name = "ao-bank", - .pin_base = 0, .pins = meson8_aobus_pins, .groups = meson8_aobus_groups, .funcs = meson8_aobus_functions, diff --git a/drivers/pinctrl/meson/pinctrl-meson8b.c b/drivers/pinctrl/meson/pinctrl-meson8b.c index c3c247bfbc60..7af296db48c8 100644 --- a/drivers/pinctrl/meson/pinctrl-meson8b.c +++ b/drivers/pinctrl/meson/pinctrl-meson8b.c @@ -906,7 +906,6 @@ static struct meson_bank meson8b_aobus_banks[] = { struct meson_pinctrl_data meson8b_cbus_pinctrl_data = { .name = "cbus-banks", - .pin_base = 0, .pins = meson8b_cbus_pins, .groups = meson8b_cbus_groups, .funcs = meson8b_cbus_functions, @@ -919,7 +918,6 @@ struct meson_pinctrl_data meson8b_cbus_pinctrl_data = { struct meson_pinctrl_data meson8b_aobus_pinctrl_data = { .name = "aobus-banks", - .pin_base = 0, .pins = meson8b_aobus_pins, .groups = meson8b_aobus_groups, .funcs = meson8b_aobus_functions,