From patchwork Mon Aug 6 22:29:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 10558079 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 E240014E5 for ; Mon, 6 Aug 2018 22:40:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9F3329A7B for ; Mon, 6 Aug 2018 22:40:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A90029A91; Mon, 6 Aug 2018 22:40:26 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 47EB729A7B for ; Mon, 6 Aug 2018 22:40:26 +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=QbshNLRA//S+gmTPx23f7WawJPwQ7UIDi8ENxBle94U=; b=eBsIYOYcu/L1w5ksq2dgJXXXgE ZEGXU08Gh+boNAFXFdAN/xUwGmEv3afGxoBhlZ7fBN6dIADl05mIoUyc30Ozxg5mYCYFqHfWV//fe E9XQNfqIp8m2UqkdmUgeI2pksloJDMugyHPylR+hGQQxsmHMprA67fXe4G8LMF7naZuI/rxBnd6ew xGqR0yfJ1nOOLPMSiQBdqM/+lDSonZ4FZNS3eCBthDYmFItpamXAEsCPiZeacJNWwfg1fv1qhP4Y0 VnUECWOS666gRbfVNMudkkqZ1kl32Vm/jsCBGeA3jXwsHzSo81rHbHTOydukWvn5ettj1FQTAaA2Y 9HAcNj6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmoAp-00017i-0i; Mon, 06 Aug 2018 22:40:23 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmo0Y-0005Qq-9C; Mon, 06 Aug 2018 22:29:55 +0000 Received: by mail-lf1-x144.google.com with SMTP id u202-v6so10191460lff.9; Mon, 06 Aug 2018 15:29:33 -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=qE651b7//Tbsbpcejonm6kJTFp1EXDTRFlY4lg7NZoU=; b=UzmOCFOqDbEGpqK5M4xDrxNAXdA3kP3pyZWsy3bzWt+QEaIOW0BJvYmUtU0eHMSfWa t5oVqRitJyP6DHIEZXrdHyovb1X2Z36+gu4NJLjnfQES3lDRH7S2v9e3yapUI7mhjh83 kn+SzD0tfX6JQV5IqXDNdFLEdYJPNEbuVpUZJV9TQSKe+hJ1bPnYIoOieYMLOVLTQzO7 SPikvaqzL/0F0YuqFhAOJeSD562MHRn2wn0OMrX6KZWDezmsDRvMLqGvOEHHqLslcPc4 nST822MJLIEu+ih9X92tJjWoNSpMGhYy1tVBsJtaY3+Y1cVLKcMuhduwqC/YOBJs3xxx wp1w== 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=qE651b7//Tbsbpcejonm6kJTFp1EXDTRFlY4lg7NZoU=; b=PtDsJ8eBtTNZRkQMvPeAZMTmiDAKz5Ved0sxj9L0a3Enhp0PqQklG92VEjUKIi63oz zIM/FEBYpIp8g78zjFNJ+vcqg2SkCbB7aE/V1szVqFZz0rKtOlF2I13FE2vDEceZ8nn/ Qenxw8r0JRlfJ/FCb4j/NUgAORRkebWT/MCMPKsYZD/hvVsBbh8K8Khwei6H4JVNilhr lzF/0cBgZz43sobaTPw622ECByrTxmXOqtjvFoABRsgmesM9Wt3VPPTwV2+r+O2cRgJ8 01B1ZRuvYFP1QMLKx6V1hlt5pXwUupbvGsJfNYPRUWh9AHz9t7KCoQ0QP1fvzx+/obLZ I1zg== X-Gm-Message-State: AOUpUlEwB7fOukjyuyunQfO+PMdrArPUp3eDJ3r9GWVQTYfT5EvT5QAn aqbaODyXAzqTRgk3deuKTpo= X-Google-Smtp-Source: AAOMgpfPA1GoyiViwrZ+zcc9ED1kWg0CchOueaRUSh+QIUJrLIOeXMRKB062ROUOwBPzBoziWlnPxg== X-Received: by 2002:a19:4e06:: with SMTP id c6-v6mr11876651lfb.30.1533594571832; Mon, 06 Aug 2018 15:29:31 -0700 (PDT) Received: from z50.lan (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id o4-v6sm2438561ljc.67.2018.08.06.15.29.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 15:29:31 -0700 (PDT) From: Janusz Krzysztofik To: Boris Brezillon , Linus Walleij Subject: [RFC PATCH v2 03/12] ARM: OMAP1: ams-delta: Provide GPIO lookup table for NAND data port Date: Tue, 7 Aug 2018 00:29:09 +0200 Message-Id: <20180806222918.12644-4-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180806222918.12644-1-jmkrzyszt@gmail.com> References: <20180718235710.18242-1-jmkrzyszt@gmail.com> <20180806222918.12644-1-jmkrzyszt@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180806_152946_702378_C4B0C6E6 X-CRM114-Status: GOOD ( 14.28 ) 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: linux-omap@vger.kernel.org, Jonathan Corbet , Tony Lindgren , Richard Weinberger , linux-gpio@vger.kernel.org, Aaro Koskinen , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Vasut , Janusz Krzysztofik , linux-mtd@lists.infradead.org, Miquel Raynal , Brian Norris , David Woodhouse , linux-arm-kernel@lists.infradead.org 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 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), { }, }, };