From patchwork Mon Aug 13 22:34:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 10564917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA9CB1510 for ; Mon, 13 Aug 2018 22:35:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC7B029353 for ; Mon, 13 Aug 2018 22:35:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B046A29370; Mon, 13 Aug 2018 22:35:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FFEB29353 for ; Mon, 13 Aug 2018 22:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732324AbeHNBS6 (ORCPT ); Mon, 13 Aug 2018 21:18:58 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:38391 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730178AbeHNBS5 (ORCPT ); Mon, 13 Aug 2018 21:18:57 -0400 Received: by mail-lj1-f194.google.com with SMTP id p6-v6so13830999ljc.5; Mon, 13 Aug 2018 15:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b2SdvcCWvKUHXYoc18v3gflYdo3rK03xrds2t38Pw+o=; b=I63en7JUaNTgxV8FI2WFzD6wAlVmktuXrNtMgvRQOLakFX+2L/JsMaUQSa3ialIX8i t89YBkKNPnlPeCm+g9b08bYHVqXdurk8llgXfbGti//vodwCm5xp9sBs7iNy03Awxswg K9rM+C13Hi5bQyxMIjDKnNw7hrySQshX9doiA3Ug2fx5APA1JeDKSaKSz17Vr8KKB1pe kHrC1w+C1S+obq2jjmmE9YPwJAG0AuoAl0tSe/7ItMUeyaRTeC2zIvFjtF9PYY+TJJ0L EN0/bdkXbvjV8QTcLOnGJjpqGeM6YBfpDHp6495Dk8jZ6zQFPLUs6/gONG9vUgJNaiKB iJag== 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=b2SdvcCWvKUHXYoc18v3gflYdo3rK03xrds2t38Pw+o=; b=dJbEBJG3lMQq1cp+EniokgS+tlOnKHSOpba/UgW5h4djREb+6RXmrtGGEVsCXHGNqm MRmM0KhCbavoFe6DclV1+ZbRHJvFays3XhdvOzZJzUhW1USfSrvau/iMI1TGi3mPxY1X gwKK34tJLBZp7959Ueh07dgESrIq2bj46yoN1g8NHVgIP6cMOs4VTXfFbo+fNmPNS3lE UzOUENfytLlJf6ERnhmWoGizQTWt9qQd1yB6ZhHoFSjwA5rOwoKPetr9JIEvG3yfcFXe xcHV4MiiYXjfYflFJr+R1EsSsAx3LmoPGUOvil5W4kXxm4moFYLJMM2LcjbCZeFuW2oK 0eag== X-Gm-Message-State: AOUpUlFY65ZmDVm2kEgOek4U4n8NRxHuvHMEHdWzHsAIDF1h62Nk8SfW Jl9IdbBbuAbsefefKAL39FPq1T++2eCcUg== X-Google-Smtp-Source: AA+uWPyp/o2aXnNMyr3Oy9nMJmN23OVRMJ1SZaWObPJc3Qf3fejcc1yO0vjS0rIftTYgjnCq0bG5DQ== X-Received: by 2002:a2e:9599:: with SMTP id w25-v6mr9877719ljh.6.1534199681289; Mon, 13 Aug 2018 15:34:41 -0700 (PDT) Received: from z50.lan (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id f136-v6sm3572702lfe.71.2018.08.13.15.34.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 15:34:40 -0700 (PDT) From: Janusz Krzysztofik To: Boris Brezillon , Miquel Raynal Cc: Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Tony Lindgren , Aaro Koskinen , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-mtd@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik Subject: [PATCH v3 3/7] ARM: OMAP1: ams-delta: Provide GPIO lookup table for NAND data port Date: Tue, 14 Aug 2018 00:34:44 +0200 Message-Id: <20180813223448.21316-4-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180813223448.21316-1-jmkrzyszt@gmail.com> References: <20180806222918.12644-1-jmkrzyszt@gmail.com> <20180813223448.21316-1-jmkrzyszt@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Data port used by Amstrad Delta NAND driver is actually an OMAP MPUIO device, already under control of gpio-omap driver. The NAND driver gets access to the port by ioremapping it and performs read/write operations. That is done without any proteciton from other users legally manipulating the port pins over GPIO API. The plan is to convert the driver to access the port over GPIO consumer API. Before that is implemented, the driver can already obtain exclusive access to the port by requesting an array of its GPIO descriptors. Add respective entries to the NAND GPIO lookup table. Signed-off-by: Janusz Krzysztofik Reviewed-by: Boris Brezillon Reviewed-by: Linus Walleij --- arch/arm/mach-omap1/board-ams-delta.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index eedacdfe9725..16f7bbe47607 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -337,7 +337,8 @@ static struct platform_device ams_delta_nand_device = { .resource = ams_delta_nand_resources, }; -#define OMAP_GPIO_LABEL "gpio-0-15" +#define OMAP_GPIO_LABEL "gpio-0-15" +#define OMAP_MPUIO_LABEL "mpuio" static struct gpiod_lookup_table ams_delta_nand_gpio_table = { .table = { @@ -349,6 +350,14 @@ static struct gpiod_lookup_table ams_delta_nand_gpio_table = { GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWE, "nwe", 0), GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_ALE, "ale", 0), GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_CLE, "cle", 0), + GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 0, "data", 0, 0), + GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 1, "data", 1, 0), + GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 2, "data", 2, 0), + GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 3, "data", 3, 0), + GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 4, "data", 4, 0), + GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 5, "data", 5, 0), + GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 6, "data", 6, 0), + GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 7, "data", 7, 0), { }, }, };