From patchwork Wed Feb 12 00:39:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377287 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9E2F17F0 for ; Wed, 12 Feb 2020 00:40:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EA4E20848 for ; Wed, 12 Feb 2020 00:40:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nCZjHoAT"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PJMbw2yP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EA4E20848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=Ttv1sG0pnAdEK7BONJ8oVcexPZklTLQXvVyed4HuPao=; b=nCZjHoAT7VwI8b AXxHAzizp4adTpGyTo0nNqcWrft5jp3Y6joTI51a8YlQxV1yzLNwY1MjRopo2tEdTYj7jKledFWIu 8SUpYIJDxqUoANXghUqRbqgjmdTaodb7yaKhaFJAK5ReH0jzyebIFPNB49ou+xNRkE1V4tk2Igrc3 F/dVPM70nJ8L5zpTczr8Hho9UtYRYc1+24PB3v1UCAWm/72mVHrt8evZyQhWZMaoAi8jRfdlcPHp8 LkP7+djuSoY0onjGdsJHEY1WY8bH8yRK48plG0wvdYiFHXlEwleakU2KJtPgc4wSOpJ9kcDIrM27e 5szOJC8XcSpYyKOVS6/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4h-0008Db-5w; Wed, 12 Feb 2020 00:40:19 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4d-0008BX-65; Wed, 12 Feb 2020 00:40:16 +0000 Received: by mail-lj1-x243.google.com with SMTP id a13so246497ljm.10; Tue, 11 Feb 2020 16:40:14 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=gTk0y+Tu/ho+sT5UGEydRAB4Ni1w6qYJfckfOq/GHOY=; b=PJMbw2yP5vepLZAHEHLf5YyuNbxRFBJ+Egu8gubKnwV1+VNtB+MuREb7ARBAFx6Frp HUAMMDoidNWpA4m0S2u23Kt/9EuZewUVDme2/WregRLAMoinIx8uwRgoGN7+KdZ6F8vI CNdsbtwlOFIUUdD40lCreH2f1rZ21xLnB4KhWs86tlIvlZqlz0+QKIgbZ82B4iz0E6kU lb9xM/rHOv5ISDn+w6tZeHZyTe6FvrMkvl2+VneTH/7F93LTMqt/hfYwJLGvZ73lhhdQ Eh/SqZxp2Bfwi143TMuXlnuzLR+o1OlDR+tuSLdA3yi+9t8IOuTer4sTxSl8keMsw1L8 RSAQ== 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:mime-version:content-transfer-encoding; bh=gTk0y+Tu/ho+sT5UGEydRAB4Ni1w6qYJfckfOq/GHOY=; b=gpscpCFiJI0WyoB+WDXT5Z3sQJ+iy2oocGkhXXum2RqNbZ01EuXo3XnSwohYmsfGju gcVZ6zZpAucDyQwHjnzONjEl5rc3zDIHZ2XrsYpxFtOulvsc3RZOWmFfQc09xpEJ+OJ9 B7oSR5Y29ZJFLdui8Dt/Fo0By8gf2olDAILuiaaKDSgNdrfGUubEWoBUbM+Jz+6RHdHd gJI2Sz08jAQFr4A52kTwZ1K2UCZwIHjU0ZrmfRxAdzmoohoG5sqpeGMaG/w8IJ9zp2xw AZSf62jz2UEj0Gb5wKrBSAVNvDY1u7vOYZHwkVqK+HX0JRxJa8OXLREdAJGu4WaF6ByP 7wgQ== X-Gm-Message-State: APjAAAWeowKvvc2CbdmvZm0fnC1xsKV3P/ue6QN2YNTKNh5BSnGQe7HK O748RiLs18fkHXEMDNdDtNU= X-Google-Smtp-Source: APXvYqxOlD/PlMVdsxwg/tO3eQ2ldw5JbL3TvOKRqRg5kuCKvfoFE1wmf6aj9BVWpeyX9mnmVZ1tfQ== X-Received: by 2002:a2e:880a:: with SMTP id x10mr6200191ljh.211.1581468013645; Tue, 11 Feb 2020 16:40:13 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:13 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 01/14 v2] mtd: rawnand: ams-delta: Write protect device during probe Date: Wed, 12 Feb 2020 01:39:16 +0100 Message-Id: <20200212003929.6682-2-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164015_260974_7F1D54BA X-CRM114-Status: GOOD ( 13.05 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:243 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Initialise NWP GPIO pin as asserted to protect the device from hazard during setup of other GPIO pins. Signed-off-by: Janusz Krzysztofik --- v2: release write protection before calling nand_scan() drivers/mtd/nand/raw/ams-delta.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 8312182088c1..2501cfe00f43 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -251,8 +251,8 @@ static int ams_delta_init(struct platform_device *pdev) platform_set_drvdata(pdev, priv); - /* Set chip enabled, but */ - priv->gpiod_nwp = devm_gpiod_get(&pdev->dev, "nwp", GPIOD_OUT_HIGH); + /* Set chip enabled but write protected */ + priv->gpiod_nwp = devm_gpiod_get(&pdev->dev, "nwp", GPIOD_OUT_LOW); if (IS_ERR(priv->gpiod_nwp)) { err = PTR_ERR(priv->gpiod_nwp); dev_err(&pdev->dev, "NWP GPIO request failed (%d)\n", err); @@ -309,6 +309,17 @@ static int ams_delta_init(struct platform_device *pdev) nand_controller_init(&priv->base); this->controller = &priv->base; + /* + * FIXME: We should release write protection only after nand_scan() to + * be on the safe side but we can't do that until we have a generic way + * to assert/deassert WP from the core. Even if the core shouldn't + * write things in the nand_scan() path, it should have control on this + * pin just in case we ever need to disable write protection during + * chip detection/initialization. + */ + /* Release write protection */ + gpiod_set_value(priv->gpiod_nwp, 1); + /* Scan to find existence of the device */ err = nand_scan(this, 1); if (err) @@ -336,6 +347,9 @@ static int ams_delta_cleanup(struct platform_device *pdev) struct ams_delta_nand *priv = platform_get_drvdata(pdev); struct mtd_info *mtd = nand_to_mtd(&priv->nand_chip); + /* Apply write protection */ + gpiod_set_value(priv->gpiod_nwp, 0); + /* Unregister device */ nand_release(mtd_to_nand(mtd)); From patchwork Wed Feb 12 00:39:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377301 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9DFA139A for ; Wed, 12 Feb 2020 00:41:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7F2F20848 for ; Wed, 12 Feb 2020 00:41:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rbhPHvED"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="u4VSpkKl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7F2F20848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=xPgo42YrrYnjz3M67IiN6V5CD9P0REKQFIT3JQteHoI=; b=rbhPHvEDSkGflm soTrH0Os/ARR4YHqEEZGY3z3bFGuY56D9bHp6IfXg5xj0oM5HJ9+LBvbOBYixY3oaZDu/3O9AyJYf Z+xFQ6XLSenokc886x4cjhwtWSJ9A3qg1QZ0KUo8rCUaInFh2FrN0CAsT/9Zh7+GmHeHbQ+xd94rE Du/Epz32NQYAhZE/wh3ktT0wnMbBQhgrCEy5yOJGlnFwvS0Y/LEV6IC3FZPwXYHtWJ1oMaAOjBkYf nJcLLypY1bultrDguFzxqDDb8fum4xRqdKGQNf990xs5+E9ovo2++VWy3HORzOXNHpHWOIrlYCV3L m05XnI27zYO9AVVUIU8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g5g-0000hm-4o; Wed, 12 Feb 2020 00:41:20 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4e-0008CL-6i; Wed, 12 Feb 2020 00:40:18 +0000 Received: by mail-lj1-x244.google.com with SMTP id h23so252133ljc.8; Tue, 11 Feb 2020 16:40:16 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=1E6U1KXN6Rcnkdcrq0BPPezEV5qfb7m21AOfkLuyxDo=; b=u4VSpkKl40Av+vWVlGDk5M6EJHsC+aP6g1qHFL7Ssr3u+n0QsQjq1srx8PfseuEuIj Ps0xrsUWPLUwRPLl9sbUKec3gOfLRj848+Kp8NQAscYPDxKm+yPp+AaOIDeMJ6M6KGz3 zVZePI+foU/oUER8HIWYYVGp1Ij5wMqSRgPnYDe3IeZHLgHY0PaOsnBSigpaNP6e+hAR eTPapSzPtbdjcbCTyh/dUo780PEYHLZ28QWfRaVbRLTNaa3VL8aq6JeoVOT9e8j6bWKh mKcKG3P147Is2mRggjc9SiReKD13Rr1ypGWAYR70PV0UvJ8PZ/VIuiWfB/3YvW6NZLWk O9+w== 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:mime-version:content-transfer-encoding; bh=1E6U1KXN6Rcnkdcrq0BPPezEV5qfb7m21AOfkLuyxDo=; b=sgQnNmhHksUzG04G4k5tGQlmol6KGjJ6ogHeH6mc7S9SIpZohJ3J57/G8teBKcXDQJ hXhLcNKNI/1aknK5N1+3ae0Vf1J7Xogx2ilYadGeF9VVDur4qgMRCzPTLwQjCMaK9jhS 48sKGcUCFbMg0thVhTT4FdXqwjIxaLtunAPtj0klFAjpRgQbXbDIVs/y4BCq6tojbYir CIdk1gBJD61Xdp/N7gJX0mSAy/z4Q81rH7IAYCEg3ajW7a/wM0yd7SZMOSacwK7ptkT/ aYXjFI/XnhPxajO4ah3YR0AjRS0MsfWcRkddW78j0rgq7BmcjahDwzcrn7ivo8m4crHB GHtg== X-Gm-Message-State: APjAAAUZIuSS7sDaqB4pOLB+dlGDCsWXXzgCqX/IDoq+NU/QihiooxZh 99ceFWvpqTJfkomjwNw86EY= X-Google-Smtp-Source: APXvYqyZTguDgRqpwWaZ+6ZgVuWMJkwrup7xgzKvxWnDPUtwVrP2Se7fBz1FzXWoTaCjDRUXa4UV+g== X-Received: by 2002:a05:651c:2046:: with SMTP id t6mr6132637ljo.180.1581468014885; Tue, 11 Feb 2020 16:40:14 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:14 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 02/14] mtd: rawnand: ams-delta: Use struct gpio_nand_platdata Date: Wed, 12 Feb 2020 01:39:17 +0100 Message-Id: <20200212003929.6682-3-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164016_926045_A35276C8 X-CRM114-Status: GOOD ( 12.94 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:244 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In order to be able to move the hardcoded Amstrad Delta partition info from the driver code to the board file, reuse gpio_nand_platdata structure owned by "gpio-nand" driver and try to obtain information on device partitions from device platform data. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 2501cfe00f43..fbab7cc14607 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -220,12 +221,20 @@ static const struct nand_controller_ops ams_delta_ops = { */ static int ams_delta_init(struct platform_device *pdev) { + struct gpio_nand_platdata *pdata = dev_get_platdata(&pdev->dev); + const struct mtd_partition *partitions = partition_info; + int num_partitions = ARRAY_SIZE(partition_info); struct ams_delta_nand *priv; struct nand_chip *this; struct mtd_info *mtd; struct gpio_descs *data_gpiods; int err = 0; + if (pdata) { + partitions = pdata->parts; + num_partitions = pdata->num_parts; + } + /* Allocate memory for MTD device structure and private data */ priv = devm_kzalloc(&pdev->dev, sizeof(struct ams_delta_nand), GFP_KERNEL); @@ -326,8 +335,7 @@ static int ams_delta_init(struct platform_device *pdev) return err; /* Register the partitions */ - err = mtd_device_register(mtd, partition_info, - ARRAY_SIZE(partition_info)); + err = mtd_device_register(mtd, partitions, num_partitions); if (err) goto err_nand_cleanup; From patchwork Wed Feb 12 00:39:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377303 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74B1B139A for ; Wed, 12 Feb 2020 00:42:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 524A720848 for ; Wed, 12 Feb 2020 00:42:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UfBo3lO+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XlSNMXMo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 524A720848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=QeNrQ2cAJKIMIAYu+UQZ6UXeRpp+2UPeV4tAZ5XndSM=; b=UfBo3lO+sx3c/k OEhIu4LJITsBZ4mqqug3GlG83WUDMGUpsHg3aNl1HLQEHpt2iNKBgkldr7rHI9AHCkF6v1yl7k6yO qcvenADpSvwxkEYyEjVQ8tqklAQZ73hRdoiz+6JV+YYQKkgwwnOH8i7kywmRk2vxIlqVN39fWKPGL E9H52hjnz4/HMVmVDQ8A6wHvreCmaFYWE4HQmbDBhNo4Bur3xJ7TIed3vNgFJKx0NIkBlVJBDQLLA 5eTv/V+sFnL5GSMbNZtEJaayBhbeT3rL7EGesF+mOPXCCoPpe/JvADPD+uW8HaQv3AGvurGsrgnWV 5WNPgdqij3DBMbaBZsrg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g6H-0001Fi-MW; Wed, 12 Feb 2020 00:41:57 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4f-0008Cb-Kn; Wed, 12 Feb 2020 00:40:19 +0000 Received: by mail-lj1-x244.google.com with SMTP id w1so267896ljh.5; Tue, 11 Feb 2020 16:40:17 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=jY/whPnhAuxzTC/NjaKtmOflD4QjDSvq1sNUEMZh1qc=; b=XlSNMXMomGlL98MVH2Y38zJT3ch0ovUnYddswlRj7u5ofxM1PB+ri+IOw8xvPX4+cW zpqqrQCEBXvephKadYoAWUNAB0t79nwBfEr/CM7bkwJcIrj6/EM+t5DLuJu1P2URhzNl IpWbcXL/MfGXqrXPUalE/E1qu8Vbirx3jkfZxzj/DWddR1CI/BoH9S7h5TCWPL4i1SRP Qew5KonrCxJbbetz5dLhj/79jC8qxtYICANMMs5VLxPHZCKINfLQaq21y/Nu2HIFfPD7 3qIl93NiAVU1oqeHJdRRXSLtdQeCeTxCKVb2wgaS9ey5OXNYq1o5Ss+G+6did3W0pMIv eRRg== 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:mime-version:content-transfer-encoding; bh=jY/whPnhAuxzTC/NjaKtmOflD4QjDSvq1sNUEMZh1qc=; b=p01f9S8/yk+szMLjffgbCpC3j5H5hugsehmfktxaSd+zWTm1ICBIMKWN7l2RqNOPRb LchWcDgSIMr6xLY+TTpG0jAzC7JX1xniiOPKvAtjVmJykhqTJQo2xfVtrr6P0D1ZuEM3 tXGTMN0u6vzNmC+c3BgwKBUSUjZPGPfm4WGmoRzk+DNYsTUCQmsbLncIt9ezfGO4PeNk PpJzNU4IZuheFX+vgsaHg4bUoviJKxTVHg1k5K6n3LQJD6RG5PAQRMmzELsvtINzSFvg KrOTZaaZ2wrK6VJs8GaN+HxF8sR7+hDi2mRtWm+2GkYK85U0HnKVve3AYbgQilSFiDwD 3gCw== X-Gm-Message-State: APjAAAVRCdwakSKIZKXk//28reeiomUkBYuBlcGn7iraiRYrHtzcU8Rt CICFEweNFYPuZbxrHIetkHP0ujVT X-Google-Smtp-Source: APXvYqxe6yfLSQK+5DB76pAsO2JVz92J7q3+56L6/lV9a5KfPuaDfJSuV5dzIjVYQ/fXZ7JXD9vMcg== X-Received: by 2002:a05:651c:321:: with SMTP id b1mr5965696ljp.62.1581468016319; Tue, 11 Feb 2020 16:40:16 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:15 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 03/14] ARM: OMAP1: ams-delta: Provide board specific partition info Date: Wed, 12 Feb 2020 01:39:18 +0100 Message-Id: <20200212003929.6682-4-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164017_699036_A2BF1590 X-CRM114-Status: GOOD ( 11.64 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:244 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Now as the Amstrad Delta NAND driver supports fetching information on MTD partitions from device platform data, add partition info to the NAND device configuration. Signed-off-by: Janusz Krzysztofik Acked-by: Tony Lindgren --- arch/arm/mach-omap1/board-ams-delta.c | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index a2aa7a12b374..f4d2ef97099e 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include #include @@ -294,9 +296,42 @@ struct modem_private_data { static struct modem_private_data modem_priv; +/* + * Define partitions for flash device + */ + +static struct mtd_partition partition_info[] = { + { .name = "Kernel", + .offset = 0, + .size = 3 * SZ_1M + SZ_512K }, + { .name = "u-boot", + .offset = 3 * SZ_1M + SZ_512K, + .size = SZ_256K }, + { .name = "u-boot params", + .offset = 3 * SZ_1M + SZ_512K + SZ_256K, + .size = SZ_256K }, + { .name = "Amstrad LDR", + .offset = 4 * SZ_1M, + .size = SZ_256K }, + { .name = "File system", + .offset = 4 * SZ_1M + 1 * SZ_256K, + .size = 27 * SZ_1M }, + { .name = "PBL reserved", + .offset = 32 * SZ_1M - 3 * SZ_256K, + .size = 3 * SZ_256K }, +}; + +static struct gpio_nand_platdata nand_platdata = { + .parts = partition_info, + .num_parts = ARRAY_SIZE(partition_info), +}; + static struct platform_device ams_delta_nand_device = { .name = "ams-delta-nand", .id = -1, + .dev = { + .platform_data = &nand_platdata, + }, }; #define OMAP_GPIO_LABEL "gpio-0-15" From patchwork Wed Feb 12 00:39:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377305 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D7B71580 for ; Wed, 12 Feb 2020 00:42:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B5E520848 for ; Wed, 12 Feb 2020 00:42:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qxVgZ4em"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TWER0fxR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B5E520848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=4DR01ra/uWwn3dsqPLPp7sNaBYoSmFHYxVnui2vYOJ4=; b=qxVgZ4emsdP21n 6/XVTbvKOYl+Fbdrhg6/gqc5970LrRAFjerfmWJTf8tXLSoG2zGdb87tNrhnyDk1xge58JGzrtloW ce0kLum4EtiA2wI9L94gBAX3T94r35gxBYZPNIaJO9LJqZ405BCpdihfnpmsSkHXaTKkt0gkt7bTL +MTV2oknbjNiGC4s1L/4MtcTFVXyeEi21tsq6BfJTdpvdqwVje6LlybraOTwSUXaXUajn354oNGnX vXa9g5nHVieZoSTcEA9TCqsGj6xqCIai2CPWb2VBo06uZ+VbzheamYM9u5n3Bmf2VPMMba6ldbsb/ wvTcaKO4mZ3HPDQ1GVeQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g6l-0001is-Ng; Wed, 12 Feb 2020 00:42:27 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4g-0008DT-Vo; Wed, 12 Feb 2020 00:40:20 +0000 Received: by mail-lj1-x243.google.com with SMTP id r19so278441ljg.3; Tue, 11 Feb 2020 16:40:18 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=LKDP1hyiuSxJLJzh6PxtETHxlHhTQ3RNvBVBm9ROckc=; b=TWER0fxRPSTs5r+v24XbrG3jeVC7fikohs6urpewgZ329P+lFVUPmGspl4I5MUzM76 XyA9DhMCVkyg6gxFfiOuRN8tviL6kEP9U4TpAoAZ79CQOuDU4tyOYwkPMHjhh7GAgkHy xS2AH5iaJxI+IR0DStViI6ZqLf6n7fwHMes7KfTavO20xrces1xeWPi1ajjwNUdREz8/ PcqJevItqEi8/PB+RPGD2Qf6sQOwATSUy8J+hcoy/OyVF5bgZef6ZTQ6egA0T8Avn4/u 27aArAd4t87sKe+Dd6a2ApCQNEV2agN2JeOk+TXpdTsu8g75dHO82T+suDHD8lgTH1tA I68A== 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:mime-version:content-transfer-encoding; bh=LKDP1hyiuSxJLJzh6PxtETHxlHhTQ3RNvBVBm9ROckc=; b=s9r2jfMihvurihhJmnkEu9DCObFsj9EksWOwMn5D0X3XK127Xar69h6hfbcHvMNx2r tp8rYaJzqMQ4Mdt99aeUkK6STP7uvDLIzhfKDeOlK3RloE0XnU8sZisBWPFaU/W8Lz0A EQn9Y/RoUY7ulmEUMoMl3PnKfML8ynfPCUUh8JGBPrHc16uJFBlzwUflePC3cybT3w32 yqr2QWkapNXDAu1uTAAa/W0yuqYtTA8ACNL7iXvJdLxFZPm82pc7lXJzJq9lsJGGFeoh V35JLTit3rjTBQJIRmq0xroBobMwIa0lx+urUJyrgNeskqA8OQ1gk6bsZl9q2fQmgGBB uekQ== X-Gm-Message-State: APjAAAXQwpPnpLAW6lfntDmQzULWZOSrIGNyAocCCwp5+cgseLq8OFHe t9TOODSs3m7QGOU4pm88ieY= X-Google-Smtp-Source: APXvYqzpKF76+7JafsOPb+hJUBKmkk6qQI4meZuR66EOWTQPQWrs9dxfJECmmgTjt7dnRy0P3ahykw== X-Received: by 2002:a2e:97cc:: with SMTP id m12mr5871701ljj.241.1581468017616; Tue, 11 Feb 2020 16:40:17 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:17 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 04/14 v4] mtd: rawnand: ams-delta: Drop board specific partition info Date: Wed, 12 Feb 2020 01:39:19 +0100 Message-Id: <20200212003929.6682-5-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164019_059341_C496CFFA X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:243 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Now as we support fetching partition info from device platform data and the Amstrad Delta board file provides that info, drop it from the driver code. v2: rebase on top of gpio_nand_platdata extension Signed-off-by: Janusz Krzysztofik --- Changelog: v4: rebase on top of gpio_nand_platdata driver/board extensions, - drop no longer required command line parser related bits, - adjust commit description, - move OF fix to a separate patch. v3: add information on the requirement for passing partition info via kernel command line to the board Kconfig entry help text. v2: fix a typo poitned out by Aaro - thanks!, - fix device_node not passed to OF parser via mtd_info, - commit message reworded and reformatted a bit for better readability. drivers/mtd/nand/raw/ams-delta.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index fbab7cc14607..25f121adea6f 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -42,31 +42,6 @@ struct ams_delta_nand { bool data_in; }; -/* - * Define partitions for flash devices - */ - -static const struct mtd_partition partition_info[] = { - { .name = "Kernel", - .offset = 0, - .size = 3 * SZ_1M + SZ_512K }, - { .name = "u-boot", - .offset = 3 * SZ_1M + SZ_512K, - .size = SZ_256K }, - { .name = "u-boot params", - .offset = 3 * SZ_1M + SZ_512K + SZ_256K, - .size = SZ_256K }, - { .name = "Amstrad LDR", - .offset = 4 * SZ_1M, - .size = SZ_256K }, - { .name = "File system", - .offset = 4 * SZ_1M + 1 * SZ_256K, - .size = 27 * SZ_1M }, - { .name = "PBL reserved", - .offset = 32 * SZ_1M - 3 * SZ_256K, - .size = 3 * SZ_256K }, -}; - static void ams_delta_write_commit(struct ams_delta_nand *priv) { gpiod_set_value(priv->gpiod_nwe, 0); @@ -222,8 +197,8 @@ static const struct nand_controller_ops ams_delta_ops = { static int ams_delta_init(struct platform_device *pdev) { struct gpio_nand_platdata *pdata = dev_get_platdata(&pdev->dev); - const struct mtd_partition *partitions = partition_info; - int num_partitions = ARRAY_SIZE(partition_info); + const struct mtd_partition *partitions = NULL; + int num_partitions = 0; struct ams_delta_nand *priv; struct nand_chip *this; struct mtd_info *mtd; From patchwork Wed Feb 12 00:39:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377313 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E180A1580 for ; Wed, 12 Feb 2020 00:42:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE18820873 for ; Wed, 12 Feb 2020 00:42:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cjtsVmmk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SHcDvUlK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE18820873 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=l/IZ+SANlmX/SxiRxiMDJ9mXZ3+LEq+VoHaJZS9JzWg=; b=cjtsVmmk1DoA69 GTP9E6D45uNqrj4s//qb9D4uUTfHJbv7WJVlFnlcXzEzD7Sj0d2V8Pb72y+VGj55hTU2K8nEszsu9 s4CY9i1Svpq/wOa77AVdBp7kXP1FGyleM4Ah/Mv32ffFtiKu0SD4t6ov9cth8n9iMdmJV4Iwey+fu fTP4Y70ntcdop7s0b+MzR/+VjGcmlAIuZ/4WbxRAlyzirgPWqhIq9103Ck9oH+r/zTp45m4ZHnDlX Do5ngM8Qog+s8b9oukVtmkXndan1O+WmoIB68DR3myrBgTAanWlVqx+m8FdpAdIemGB26NjvRJxVv WwtniMKEswcIIPJbm3Cg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g72-0001xj-W0; Wed, 12 Feb 2020 00:42:45 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4i-0008EC-8f; Wed, 12 Feb 2020 00:40:21 +0000 Received: by mail-lj1-x244.google.com with SMTP id e18so234127ljn.12; Tue, 11 Feb 2020 16:40:20 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=ttJW9peokq5rUpFOQPvSx+wLa406veCgVEoVyR6YAV8=; b=SHcDvUlKTDjrSUyYrLPEjMYJTvRDrw/kwd1X2ZFXrBSCah3TbdHcdOnpB/sdh+Cjbf Z3+loashg/BSX7zm1xHB0W+YgWvQ3iA8VQTogN73YaMluPA97Gg7d6wYVOck+f+5YRxH 01YZjhYwC49vPTcoHoTD8EYcXq/wj63Cb5C+5Xt+tlu/gSN+Y85OCic5r1bRg51TsnW3 05BudZ7Mt9kohFXmGNF74A3ZGE+mh3Mj3lT3rGJVhIbUdLGjVlDON2Hfgnls//ISsp8B 3TAh/IExYhEiGEwLHODItVelxBWh230DfJp9RNLFRZsWMqdnoFX+L3KJ3Ag8VTHxzlpM 4x+Q== 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:mime-version:content-transfer-encoding; bh=ttJW9peokq5rUpFOQPvSx+wLa406veCgVEoVyR6YAV8=; b=uoL/60DcFN/X8vFeYshXUYyOHpgPjdNjl+TwBjY47WvQy9ERRquJ2PDtzq+/qU+G2n jUleiSkri6enQaXHu5XSJ6z+POzdmXtXR3IdjYvsOmxotnVd8YgW/7TPgDPs1golnO8C bxdZ/qvBjc+6m/KMLPLD6XhyOl5w/qKwyME8S0YI7z0khzStYz9hwt2OdbkWKi7yDlBG i9Sf8QbD0p3GWNOpUqnxwK29ttrh55unwXgn4GKVwbLHiMHm9GzcliT4nAWSV09IQyKM 4LL3oWKu4UKjkLPIjDi/ksfmQ/rHFHR7IdIZzetCKaCgKqothFOS6ic90kWYJlE5bi0o NXJQ== X-Gm-Message-State: APjAAAWDQAw5gwCa/zUFdPPDC72Fwyv1u0xxNIHV3B26dd8DrN1eWUS5 Deo2BeCFNi3LF0ipC2YT2Mg= X-Google-Smtp-Source: APXvYqwnNi3Y4kZzLlTAlPxy+jEgL87XZNvOHJv/JSD1vBuRqr4PxxEZvgCLUMMsg5LNGxXQvOlRpg== X-Received: by 2002:a2e:b4ef:: with SMTP id s15mr6242730ljm.20.1581468018867; Tue, 11 Feb 2020 16:40:18 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:18 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 05/14] mtd: rawnand: ams-delta: Enable OF partition info support Date: Wed, 12 Feb 2020 01:39:20 +0100 Message-Id: <20200212003929.6682-6-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164020_334858_FA1C6629 X-CRM114-Status: UNSURE ( 8.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:244 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Provide MTD layer with device OF node info required by OF partition parser. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 25f121adea6f..fb96f6a3b0b3 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -222,6 +222,7 @@ static int ams_delta_init(struct platform_device *pdev) mtd->dev.parent = &pdev->dev; nand_set_controller_data(this, priv); + nand_set_flash_node(this, pdev->dev.of_node); priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN); if (IS_ERR(priv->gpiod_rdy)) { From patchwork Wed Feb 12 00:39:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377317 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25B52139A for ; Wed, 12 Feb 2020 00:43:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2E8A20848 for ; Wed, 12 Feb 2020 00:43:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="f9glVEsb"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q5Sp8zgS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2E8A20848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=poiESoOU0KZmT8wdf3Z3DQQNxPHEM78NhjqBZUzbDUs=; b=f9glVEsb6cbWfE r26fG38YMLGyfEK1/il7DTVh2VHCMTiWvkx+oWkX+WVlJ6GQIu5iXi3aJ6mkNad246hGCyRVofOf1 7LOgv8Laowyf1ZHJ4O8C8ERmdB3scjlKLMlUIis+9FJaFpJnxJLQrpKIA/wfQFVGewX4m0enhCj8r vfKtv32RHFKi1AbKQ9NsZB0jTOEZSTeCpOgI401MFgHe8zdDwNRVoHta8B+22M74SxolHb8LPtJtI K72QrfrZcR4hyqNPt1H54IDUUi56ycLmmFTHaG9bDdLyMYio0GtJzG/qHjZLOVOcL5C9+JDehZ+JF fwZdv1ezNX+NsDvTcY1g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g7L-0002IW-EY; Wed, 12 Feb 2020 00:43:03 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4k-0008Fb-1x; Wed, 12 Feb 2020 00:40:23 +0000 Received: by mail-lf1-x143.google.com with SMTP id z18so289573lfe.2; Tue, 11 Feb 2020 16:40:21 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=rcbXhKxbLXfiAbDzRSziEIn2ltFWOw8uQS3zIVYn+gg=; b=Q5Sp8zgS0ILV/I/WeleMtccq3UCbAnE537Le10n/7S71lcR/QnIXWrrz/FhpSuiDpe TyPGuMA4oBihm/7pjxNXPlwtK+y54OsOaDxOP5lBDX4BVVp/wx7q2V7fICW0cIYM9WgN Cl7REP3zzC9ukuTA4cXHD+qzOhsr5eMr3X2VUpjvYuBjZi9WVH3RnRA7R/X50C2eEF4g 1/y7nw8uDN26gwQ/a9I8fjMym4EYDBjzEsXozT6SASYY6fYbrbOQ8FeJevr+yJ0B8Gzk OopPjxQSSW+BPfugOOXK+0Tj6rWU93XFFLrj7beOTvxv/i5Wf1CfwlubNDx7QJsic1de dXag== 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:mime-version:content-transfer-encoding; bh=rcbXhKxbLXfiAbDzRSziEIn2ltFWOw8uQS3zIVYn+gg=; b=QjGc0qImyiC+Ct94bOKqUEWOW6FIw7LrAXC3pmoLTSYzVzMJakaSlu1LYntGe3zOEr Nz9rJVPKQYZNvyOvYuDYmVeI/nvpkOuL0WfvUnOQD8kIEXPuEvftlPx8pa1hculWQ26U iVdGQiDP2WNq9/G+8mqrqLViggILSlZITxus5SZ377dJxPA4t0FcC+XRS6LAvrzP5NZY J0CyrqYEOuQk4xMaSoW5MLqIlitT4g9WTThM/MD96UFrROUG2+suGICx9wRQv7/JDSMB ODfVb/Bpnc6fuUBe37H2jRAEvxhqLorNuHAk0KJjhbaMbLsYm+FdWq6RidQ9OpObyroO CASQ== X-Gm-Message-State: APjAAAWY11JcX3Lfn6BzPwvZ8niB79e36nGW910lg7FkAkNQ3piRuct+ 7bUkTCgrG/q7lH/P6ms3Uqo= X-Google-Smtp-Source: APXvYqwodYVhDD1l/Apthg8LfXfLDg0cdZ2iqObzjbj+/p0QSGtj25rfHAqLSEKqv2DwJdUxnOeDww== X-Received: by 2002:ac2:44d5:: with SMTP id d21mr5090125lfm.188.1581468020153; Tue, 11 Feb 2020 16:40:20 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:19 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 06/14] mtd: rawnand: ams-delta: Push inversion handling to gpiolib Date: Wed, 12 Feb 2020 01:39:21 +0100 Message-Id: <20200212003929.6682-7-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164022_118621_49B95B46 X-CRM114-Status: GOOD ( 12.57 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:143 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Let platforms take care of declaring correct GPIO pin polarity so we can just ask a GPIO line to be asserted or deasserted and gpiolib deals with the rest depending on how the platform is configured. Inspired by similar changes to regulator drivers by Linus Walleij , thanks! Signed-off-by: Janusz Krzysztofik Acked-by: Tony Lindgren --- arch/arm/mach-omap1/board-ams-delta.c | 12 ++++++++---- drivers/mtd/nand/raw/ams-delta.c | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index f4d2ef97099e..8d32894ecd2e 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -341,10 +341,14 @@ static struct gpiod_lookup_table ams_delta_nand_gpio_table = { .table = { GPIO_LOOKUP(OMAP_GPIO_LABEL, AMS_DELTA_GPIO_PIN_NAND_RB, "rdy", 0), - GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NCE, "nce", 0), - GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NRE, "nre", 0), - GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWP, "nwp", 0), - GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWE, "nwe", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NCE, "nce", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NRE, "nre", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWP, "nwp", + GPIO_ACTIVE_LOW), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWE, "nwe", + GPIO_ACTIVE_LOW), 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), diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index fb96f6a3b0b3..c7aeb940accd 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -44,9 +44,9 @@ struct ams_delta_nand { static void ams_delta_write_commit(struct ams_delta_nand *priv) { - gpiod_set_value(priv->gpiod_nwe, 0); - ndelay(40); gpiod_set_value(priv->gpiod_nwe, 1); + ndelay(40); + gpiod_set_value(priv->gpiod_nwe, 0); } static void ams_delta_io_write(struct ams_delta_nand *priv, u8 byte) @@ -81,13 +81,13 @@ static u8 ams_delta_io_read(struct ams_delta_nand *priv) struct gpio_descs *data_gpiods = priv->data_gpiods; DECLARE_BITMAP(values, BITS_PER_TYPE(res)) = { 0, }; - gpiod_set_value(priv->gpiod_nre, 0); + gpiod_set_value(priv->gpiod_nre, 1); ndelay(40); gpiod_get_raw_array_value(data_gpiods->ndescs, data_gpiods->desc, data_gpiods->info, values); - gpiod_set_value(priv->gpiod_nre, 1); + gpiod_set_value(priv->gpiod_nre, 0); res = values[0]; return res; @@ -129,7 +129,7 @@ static void ams_delta_read_buf(struct ams_delta_nand *priv, u8 *buf, int len) static void ams_delta_ctrl_cs(struct ams_delta_nand *priv, bool assert) { - gpiod_set_value(priv->gpiod_nce, assert ? 0 : 1); + gpiod_set_value(priv->gpiod_nce, assert); } static int ams_delta_exec_op(struct nand_chip *this, @@ -237,28 +237,28 @@ static int ams_delta_init(struct platform_device *pdev) platform_set_drvdata(pdev, priv); /* Set chip enabled but write protected */ - priv->gpiod_nwp = devm_gpiod_get(&pdev->dev, "nwp", GPIOD_OUT_LOW); + priv->gpiod_nwp = devm_gpiod_get(&pdev->dev, "nwp", GPIOD_OUT_HIGH); if (IS_ERR(priv->gpiod_nwp)) { err = PTR_ERR(priv->gpiod_nwp); dev_err(&pdev->dev, "NWP GPIO request failed (%d)\n", err); return err; } - priv->gpiod_nce = devm_gpiod_get(&pdev->dev, "nce", GPIOD_OUT_HIGH); + priv->gpiod_nce = devm_gpiod_get(&pdev->dev, "nce", GPIOD_OUT_LOW); if (IS_ERR(priv->gpiod_nce)) { err = PTR_ERR(priv->gpiod_nce); dev_err(&pdev->dev, "NCE GPIO request failed (%d)\n", err); return err; } - priv->gpiod_nre = devm_gpiod_get(&pdev->dev, "nre", GPIOD_OUT_HIGH); + priv->gpiod_nre = devm_gpiod_get(&pdev->dev, "nre", GPIOD_OUT_LOW); if (IS_ERR(priv->gpiod_nre)) { err = PTR_ERR(priv->gpiod_nre); dev_err(&pdev->dev, "NRE GPIO request failed (%d)\n", err); return err; } - priv->gpiod_nwe = devm_gpiod_get(&pdev->dev, "nwe", GPIOD_OUT_HIGH); + priv->gpiod_nwe = devm_gpiod_get(&pdev->dev, "nwe", GPIOD_OUT_LOW); if (IS_ERR(priv->gpiod_nwe)) { err = PTR_ERR(priv->gpiod_nwe); dev_err(&pdev->dev, "NWE GPIO request failed (%d)\n", err); @@ -303,7 +303,7 @@ static int ams_delta_init(struct platform_device *pdev) * chip detection/initialization. */ /* Release write protection */ - gpiod_set_value(priv->gpiod_nwp, 1); + gpiod_set_value(priv->gpiod_nwp, 0); /* Scan to find existence of the device */ err = nand_scan(this, 1); @@ -332,7 +332,7 @@ static int ams_delta_cleanup(struct platform_device *pdev) struct mtd_info *mtd = nand_to_mtd(&priv->nand_chip); /* Apply write protection */ - gpiod_set_value(priv->gpiod_nwp, 0); + gpiod_set_value(priv->gpiod_nwp, 1); /* Unregister device */ nand_release(mtd_to_nand(mtd)); From patchwork Wed Feb 12 00:39:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377321 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B2D91580 for ; Wed, 12 Feb 2020 00:43:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 495E020848 for ; Wed, 12 Feb 2020 00:43:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Pj0WL7mx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y9c3B+ET" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 495E020848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=YjKZ+/al9vwUxcxsFsdJuDidx6eSkdo24lBUUrJhx+g=; b=Pj0WL7mxqIfRYW RGHLcBDoMHjCc0JdYReMuBgX/KFFqdlySVUft95eEaRWZNoi0kYy5l+m848Xtqi1iJk7h3e3M0uKe dxkhLUlnhzAC6Fn8RbkpkfmY/j5Mnl+FsrUTM5BkdpazbrRqhoYeLfuRXBRA3pu8NwAEn93HcfwYX FN/HJBWH9J12PGupGZvEnjCjFTnQYekfrZxg0CHPTx9nEzrm2B2kgfjGe6mxS+JQ2F1TLyMJIWpaa TkI3cTx19KWYz+Drxo646C/tcepTnSx/fvSSNG9VYq81TENgR0cxyF3t6hI8L0GYgXfK9FNt0xf/k MCsbWHUVRBa9C73YI1pQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g80-0002y6-H7; Wed, 12 Feb 2020 00:43:44 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4l-0008H5-PH; Wed, 12 Feb 2020 00:40:25 +0000 Received: by mail-lf1-x144.google.com with SMTP id m30so263193lfp.8; Tue, 11 Feb 2020 16:40:23 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=WQvwUELB2lAk2lsQtZP8H2VNrhUPibDwY83BwnWamDU=; b=Y9c3B+ETlvveEsikvMHolWK2+/qerHygPjGpuDcQ/n0hRzfAyVEFoaL/+IMhgVyjVI HSM4dTDofvtZXO9YIsDpZjF5KiyGe/KSYLfyj/lrgFAqTg+F+HhTNFs2NrR75kkH+5i2 64dyCzKM3mBF6vbMbd2Vncx7klqcoJPcacr4uH8igr4vZLxjQlrtlVoNOeg7u+NIlwtk pVq8ewORb7HXwzgmwlT40EqF0U7gCwYoQsjFgOLjzKfycJ0sHNsYcAemdsvUoHssc/hV PR7JNdgu6aRoPkTz5Y2KhggOiVi0wF4+40UKwSDIohurcU6VjH58IHlssvFEcDYXkx3H wxpw== 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:mime-version:content-transfer-encoding; bh=WQvwUELB2lAk2lsQtZP8H2VNrhUPibDwY83BwnWamDU=; b=scJRIJGuiynqDVoYBQgPpmiw4ZJiV0b7Bc0dc5wyawMgHicJ4dxXvPGvI4cyNeOYkU HfP1unOQ7DKayIohsYuBJbfeb7jT+KzJ6eud2vwgxtmtQMhHqxVJFgP6IQQDlyUJdDSN W2VETO0P9eWEcL5YkV69bgQMZyBNNIHbHJ1CCAx9wkbQCbt1X7lcHlSOBsg1S6ZI37Sv HzmloAvcxgtbyXvqRpusfekx49Omj4DbKTzTVcaQYU2fIjgG5u6dwRDQhfmKAjAbf6Ss IKVD1zxJi1ASJVkzCsUX1ZkYELkfPpGf1F7r+lkADP8ElHbXwSntjNyKCoEgnDumyzeu w8xA== X-Gm-Message-State: APjAAAUiAyfr1ZFw5whUbjEYFOBa5iHIH7LrhCnc9lBErkWUZ285fx21 diPUXtvIxoDoWFZtXnG0LU4= X-Google-Smtp-Source: APXvYqzrumwlcv4WELKNafS26Pu7ImSy3VMG/Df7kdpl+EF/FXmNAxgvCTLUbWPORF6yRPXkGWwhbw== X-Received: by 2002:ac2:43a7:: with SMTP id t7mr5135029lfl.125.1581468021768; Tue, 11 Feb 2020 16:40:21 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:21 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 07/14] mtd: rawnand: ams-delta: Don't hardcode read/write pulse widths Date: Wed, 12 Feb 2020 01:39:22 +0100 Message-Id: <20200212003929.6682-8-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164023_859474_49BA2820 X-CRM114-Status: GOOD ( 11.28 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:144 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Instead of forcing Amstrad Delta specific read/write pulse widths, use variables initialised from respective fields of chip SDR timings. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index c7aeb940accd..11689218d23a 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -40,12 +40,14 @@ struct ams_delta_nand { struct gpio_desc *gpiod_cle; struct gpio_descs *data_gpiods; bool data_in; + unsigned int tRP; + unsigned int tWP; }; static void ams_delta_write_commit(struct ams_delta_nand *priv) { gpiod_set_value(priv->gpiod_nwe, 1); - ndelay(40); + ndelay(priv->tWP); gpiod_set_value(priv->gpiod_nwe, 0); } @@ -82,7 +84,7 @@ static u8 ams_delta_io_read(struct ams_delta_nand *priv) DECLARE_BITMAP(values, BITS_PER_TYPE(res)) = { 0, }; gpiod_set_value(priv->gpiod_nre, 1); - ndelay(40); + ndelay(priv->tRP); gpiod_get_raw_array_value(data_gpiods->ndescs, data_gpiods->desc, data_gpiods->info, values); @@ -187,8 +189,31 @@ static int ams_delta_exec_op(struct nand_chip *this, return ret; } +static int ams_delta_setup_data_interface(struct nand_chip *this, int csline, + const struct nand_data_interface *cf) +{ + struct ams_delta_nand *priv = nand_get_controller_data(this); + const struct nand_sdr_timings *sdr = nand_get_sdr_timings(cf); + struct device *dev = &nand_to_mtd(this)->dev; + + if (IS_ERR(sdr)) + return PTR_ERR(sdr); + + if (csline == NAND_DATA_IFACE_CHECK_ONLY) + return 0; + + priv->tRP = DIV_ROUND_UP(sdr->tRP_min, 1000); + dev_dbg(dev, "using %u ns read pulse width\n", priv->tRP); + + priv->tWP = DIV_ROUND_UP(sdr->tWP_min, 1000); + dev_dbg(dev, "using %u ns write pulse width\n", priv->tWP); + + return 0; +} + static const struct nand_controller_ops ams_delta_ops = { .exec_op = ams_delta_exec_op, + .setup_data_interface = ams_delta_setup_data_interface, }; /* From patchwork Wed Feb 12 00:39:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C3311580 for ; Wed, 12 Feb 2020 00:43:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EEA1F2086A for ; Wed, 12 Feb 2020 00:43:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cDNy1ROB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="djVfoEvV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EEA1F2086A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=YMvQ+sORc7UdUYoDeHHK4NCBrBkzVQDTqDk4pzPSSaQ=; b=cDNy1ROBGuXI4z jtOsinHXhfIfAzrnCyno0eJ/ozMzcD6e6xtCO5jixnjtRUGuveij4H1ley9/6MQ5ZamPT9IiUw58v VY3tNjaDxIL8tcmTEry+j6L3em4kX69GXrILSTQANDxbfJeC6BrOI6b/1iwbH8yYSnkLpK/X0LZ2/ DNVNGYUogQZil4FML7KYGkSWZXz0o7e+E++6KCxbQ77Rh+j37x82sk6diV1L0HF4iLwcSgMYBvonA /HTBwKDtffGrRPYbJl17KxpASWyMx+6nr98ud+0qELwV1bwGUxcQ4+TyQQ7oToRtTtLkmZ+suKJWG eqQf/1SURpRHA9z15Gtw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g7n-0002k6-Vs; Wed, 12 Feb 2020 00:43:31 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4m-0008Ht-KO; Wed, 12 Feb 2020 00:40:26 +0000 Received: by mail-lj1-x244.google.com with SMTP id e18so234236ljn.12; Tue, 11 Feb 2020 16:40:24 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=caDIr3rP6oosu1+kaTV/U9Y5uOqTsEJ+evHiz9URQq4=; b=djVfoEvVfIrazuwClaIyoiPfUM8to2+bMx3D9Wv4DKZg4M3KNwM5B7lVFVi/ThZjuN D/IOBS50MpHYmJZjx/r7OSCQXr+nqh5t1B3y37b8YsbDSSJF8A9rDU5d/WrrgLcwJwdt rWCZkN2cP8KFl+zCY9Dv7sPv+L0id5nyDY/85pQKC4wwZZ/5gFWBmHZQAFEhFYmu8wpi Jtl+3z6aCj5u9e5sAJuAonl4JDHDlgevY7zh6mi0cu884C5Y7c7Ru1Aj8ctqPWwUdtHe ikstkQoiBMtzpL2T9jIZM75yaRcjhW5PnoJSYbEsJ8sdxcCk1jCCfszElMW+knCwvaWn wB1Q== 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:mime-version:content-transfer-encoding; bh=caDIr3rP6oosu1+kaTV/U9Y5uOqTsEJ+evHiz9URQq4=; b=kEEjZuXXNPkjtqthITMUzkIUjAfgQK/ahWNQjnsNVdcoCHyT0aU1cqsPIbEFy4WmT8 8ilYV3m8rvI3aNvAK3QMDEP5/Nvbyp/WuKvb5QUMU/r6BS1kFzrj2Luvha0PaVmB+WTQ i1sv02A2n592bIpfMrsZrdxbG7BdYsRsx5DoNXar/efGsXFxFQoLDRQ+yx+Fp2VZ2xfp GNLJXvsQf+aov8s2Dy0bCJVJi7beBHfi6I/8oJMNzE60oQo02Dvi+DcXnYmU+dUkQ7I1 4RKKQY14ew9VPw5B7Zakhm8iNg/0FaT1yFo6FOAqqNJT+Xd4k1jCgVQmnz3zu6RqqgtX y8AA== X-Gm-Message-State: APjAAAWJ7MU3S5zWWzy66CGDnJAe9bZeaTi2mG5B/vcPLuWVnHMKCT97 VUqba0lDfF2iVwvShN8L05I= X-Google-Smtp-Source: APXvYqy6JFvRC9NklpSqlYRY6lVX8UkHC9NOlwj40Nhm8KFKwboQJSVotTIA/W7iSbWh/4xCAN+43g== X-Received: by 2002:a2e:9596:: with SMTP id w22mr5753039ljh.21.1581468022989; Tue, 11 Feb 2020 16:40:22 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:22 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 08/14] mtd: rawnand: ams-delta: Make read pulses optional Date: Wed, 12 Feb 2020 01:39:23 +0100 Message-Id: <20200212003929.6682-9-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164024_729534_C756790E X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:244 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Allow platforms to omit NRE pin from device configuration by requesting that pin as optional. In that case, also don't apply read pulse width from chip SDR timings. There should be no need for further code adjustments as gpiolib can handle NULL GPIO descriptor pointers. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 11689218d23a..c481d73e3dcb 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -202,8 +202,10 @@ static int ams_delta_setup_data_interface(struct nand_chip *this, int csline, if (csline == NAND_DATA_IFACE_CHECK_ONLY) return 0; - priv->tRP = DIV_ROUND_UP(sdr->tRP_min, 1000); - dev_dbg(dev, "using %u ns read pulse width\n", priv->tRP); + if (priv->gpiod_nre) { + priv->tRP = DIV_ROUND_UP(sdr->tRP_min, 1000); + dev_dbg(dev, "using %u ns read pulse width\n", priv->tRP); + } priv->tWP = DIV_ROUND_UP(sdr->tWP_min, 1000); dev_dbg(dev, "using %u ns write pulse width\n", priv->tWP); @@ -276,7 +278,8 @@ static int ams_delta_init(struct platform_device *pdev) return err; } - priv->gpiod_nre = devm_gpiod_get(&pdev->dev, "nre", GPIOD_OUT_LOW); + priv->gpiod_nre = devm_gpiod_get_optional(&pdev->dev, "nre", + GPIOD_OUT_LOW); if (IS_ERR(priv->gpiod_nre)) { err = PTR_ERR(priv->gpiod_nre); dev_err(&pdev->dev, "NRE GPIO request failed (%d)\n", err); From patchwork Wed Feb 12 00:39:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377327 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48339139A for ; Wed, 12 Feb 2020 00:45:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2632C20848 for ; Wed, 12 Feb 2020 00:45:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pSwmqjvw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XRUOYw1F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2632C20848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=z32+aVdxh4GmGVY/ouU9jLNbjAu5RLpBjBBbfyPOpEg=; b=pSwmqjvwXk7+L9 YAMcEVjJ60LiXgNWvn+4nZHTTeZYzp7UKnpJgwhqIcgY1ar7wFxzW/xPtg0Ky1ACkOQ7NbM4A3Yez 3wtkki28J2qi+4/ur6RFzk6N2pTBVe+87qAHlWbvZyP6Z5jcwxc5XBlxLxqlBa3DHEIB9McgAi+iw gFq7dOhv96ibkrusYide7dZuDiUV8+4kpsbYR+c69hLW3wuDSMDj6TPu4UrLvNdR8FZy0aW1q3ZkX 6gPPUH2bB5Ae/R/+tgfqSetBlKeq8/cLQpaeo8+neNbJq58QxvDAwGGpeKKAcfox2+b0d/4asaH0t +6bWCfJxC2or2qHDLtvg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g9u-0005p5-Qc; Wed, 12 Feb 2020 00:45:42 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4r-0008Jt-VK; Wed, 12 Feb 2020 00:40:33 +0000 Received: by mail-lj1-x241.google.com with SMTP id n18so256671ljo.7; Tue, 11 Feb 2020 16:40:26 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=FJYKPthvZIFedIlxbcTRXaWUixnzV1+Q9RiZEPYQb/8=; b=XRUOYw1FAkTzb6oW3oIsS8OrrN+JDesE+lr0Eg5RKKCAGYyMWyjwLUo6beSeizUGhq RgMChJuxxMdMfwy1UX/UAcxmGlSym9l2K/JYczKwDWXjgaogauFOflQwjP50YXIlTZiU DGMYFyU/qb0xujibkcIeA8KYFLwPt+VWN6Linlz47TdJyttGzGCM4BOVECZKTJ+CMfq+ /tlh+vLf+ycG/NXi3N+RgYjSn7A/7iUsj9CjpcboM+B6OvgvJCuXjwk6Fpzu2QVyTMLD s1pInl6rcIeUO+t+aqUYwJ5g2apQ2wlLtneq1wUdwlH7CIlILApyrZMC+5NKd9QKyApy TlMQ== 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:mime-version:content-transfer-encoding; bh=FJYKPthvZIFedIlxbcTRXaWUixnzV1+Q9RiZEPYQb/8=; b=pyYvFStZ8aHsY6mQzJe/EZXiW7gtGVK645nuwPOs2DDlIrsdIDvpRqJFwe902AKUPv DLH/GDksr9wI1AL8ngcSY2MSUcY5m9P1EgZf+xQqLANVL0SPCoK4apshguZdNQkPivTd qOByQSnTZVAbmDeC0BWxrQde+5Vss9f2tcefOC382qAI1pFmH/O3JJgVW7ksrC1mOLSg bbOnQ1NEP/PaY8bnyLw/eHN0NGnK3j7ns2Aw3InKEjbj7v4qi5fnrAgvxJs+PItBRuk3 kERhd6beK2NCkI55xuNnaPfYVbSty6ASowqcj9W8CdhhtEw2zy39DLTKcp/0bfEY37SX 5nkw== X-Gm-Message-State: APjAAAXFVgFHHT7o5cyRpfbErwSVthHIvMcqSp8zgNUFwRMY8LzYU/G/ mb4NTfb/O+pJ8JZ7z0um+yA= X-Google-Smtp-Source: APXvYqw8vOkP/end+TVMFx46dyQcENtXIweuu3keRWt1h/CrKYtPMYiEk3ELj0Qt93lVXrk/HH4MXg== X-Received: by 2002:a2e:b4e7:: with SMTP id s7mr6220313ljm.58.1581468024270; Tue, 11 Feb 2020 16:40:24 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:23 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 09/14] mtd: rawnand: ams-delta: Handle more GPIO pins as optional Date: Wed, 12 Feb 2020 01:39:24 +0100 Message-Id: <20200212003929.6682-10-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164030_096392_7A240E34 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In order to make the driver more useful on platforms other than Amstrad Delta, allow GPIO descriptor pointers of possibly non-critical NWP and NCE pins to be initialised as NULL. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index c481d73e3dcb..0c88e94e9b71 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -264,14 +264,16 @@ static int ams_delta_init(struct platform_device *pdev) platform_set_drvdata(pdev, priv); /* Set chip enabled but write protected */ - priv->gpiod_nwp = devm_gpiod_get(&pdev->dev, "nwp", GPIOD_OUT_HIGH); + priv->gpiod_nwp = devm_gpiod_get_optional(&pdev->dev, "nwp", + GPIOD_OUT_HIGH); if (IS_ERR(priv->gpiod_nwp)) { err = PTR_ERR(priv->gpiod_nwp); dev_err(&pdev->dev, "NWP GPIO request failed (%d)\n", err); return err; } - priv->gpiod_nce = devm_gpiod_get(&pdev->dev, "nce", GPIOD_OUT_LOW); + priv->gpiod_nce = devm_gpiod_get_optional(&pdev->dev, "nce", + GPIOD_OUT_LOW); if (IS_ERR(priv->gpiod_nce)) { err = PTR_ERR(priv->gpiod_nce); dev_err(&pdev->dev, "NCE GPIO request failed (%d)\n", err); From patchwork Wed Feb 12 00:39:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377325 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49C24139A for ; Wed, 12 Feb 2020 00:45:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27D8B20848 for ; Wed, 12 Feb 2020 00:45:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZeA9UPxb"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aUPEiqJk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27D8B20848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=dzN2FltOEQzl1gELDrGAx0RE+2iPiOcqQnBWlZ6/3Rw=; b=ZeA9UPxbnsm8kD oYtPTdaYdm8MCIS0hEcNZIfg4j7bqCe5qLcyX653y1rUpuFycpFGob1Zk3t8Oz8sapMw1mbjUYHxf zhl+lWn6TnYVUnzBX5p2lvXLVMCENBCGQxymDjC/taWIysHCqMZm/lXirqKZfCW7thdj0MED9RKVx V7ACmjz4gqOwiYRbglNKIIUa6qsOHVv+c82mfGL/VFZTCV/hw5iHwUtGLwNyiqbYqAn6RgEeOJX32 7p9j3rWheQ62B9O3/BLCrPnzQoiVA+nS87MZ0XJ31zP5Pz780x1b7FRLwpzUTR8DUKN9PJ7pIfidr 5VnnnyYJ3o06Et4eYwfg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g9l-0005eE-Cu; Wed, 12 Feb 2020 00:45:33 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4r-0008KR-CT; Wed, 12 Feb 2020 00:40:31 +0000 Received: by mail-lf1-x141.google.com with SMTP id m30so263267lfp.8; Tue, 11 Feb 2020 16:40:27 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=brE3/g7u0N/gg2OgUxbSqylt9cNqdnoOIHKUd4Jqf/I=; b=aUPEiqJkISxLDvjpf3W2bPilp4oLV1bN0j7U/z/pSsTs8ADP3MhrmBZ9ZqhBLdktug oc5O/08eOSIqGfnJLCqBzkPj9k7pHITjd0WveqVhUx92RP4fP36iTF7SewsKAZbHo8eg 1Rmq6GSA9P1kfN5jQ6VTjSIvgnfmVNOkM6BI0VqJn+I3sOqIMloRVorlSjOMxQpfibfF pzbuBM5fKGQsdrOlovubVn/nLSzXkpZ1oFL9BGEaLM2SY3BWJH3wpzH4GnVE7snPOkED R8WiRvn5ll2wkCPeGklOt+tv1I948ov7R1zvoia5vIftzHh25c57BrVVieqHhNwsHh77 DYUA== 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:mime-version:content-transfer-encoding; bh=brE3/g7u0N/gg2OgUxbSqylt9cNqdnoOIHKUd4Jqf/I=; b=SH6lmYNVSxRj+QkahHXiC3VsGEOU34/XuANJ1p9dGILYcf7Vvtw0C2fMZw5JYRncGB EIQfQo4hsLzWisw7r323YE9d/L64BWapkZ+13Vk0FgInmnt1t9tkbA7nFOffmhAtqZlL xBLIlUFZtddMHdc/+rfwUISA1QScoSapaGbMP8ROQ53LVWblgmpMmuBRSKe7wd6IBrkK T5MZFAegc5P9wee/93Dp9ihLy0r7dpH4m53dpnnxX3loFBDA9fXLPjEWZX9BFHianpW4 gwWbxAqN/eDp0dIqpZFwDo3+wkfE0BmeUomWVSam5+LMQ5UC6RSFBWykoGSFpdxhnvWH 1seQ== X-Gm-Message-State: APjAAAXZlYcjxujA32N7egJRaW079UTlUJuJmoAe3PrWKbSyJHT0Yc0A afW1fbOdlx7oswvH5Vp0Z9Y= X-Google-Smtp-Source: APXvYqywmdJL4ETEOowYVGw711/cu1ENWKG7wwEqkKKOXa2c0GrDEFSOpOtQ6O6KBhMLMU76YfQIFQ== X-Received: by 2002:a19:740a:: with SMTP id v10mr5014210lfe.65.1581468025589; Tue, 11 Feb 2020 16:40:25 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:25 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 10/14] mtd: rawnand: ams-delta: Add module device tables Date: Wed, 12 Feb 2020 01:39:25 +0100 Message-Id: <20200212003929.6682-11-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164029_447685_C5CDAACA X-CRM114-Status: GOOD ( 10.01 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:141 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation for merging the driver with "gpio-nand", introduce module device tables where new device models can be accommodated as soon as respective support is added. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 0c88e94e9b71..9857ce25debf 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -370,11 +370,29 @@ static int ams_delta_cleanup(struct platform_device *pdev) return 0; } +static const struct of_device_id gpio_nand_of_id_table[] = { + { + /* sentinel */ + }, +}; +MODULE_DEVICE_TABLE(of, gpio_nand_of_id_table); + +static const struct platform_device_id gpio_nand_plat_id_table[] = { + { + .name = "ams-delta-nand", + }, { + /* sentinel */ + }, +}; +MODULE_DEVICE_TABLE(of, gpio_nand_plat_id_table); + static struct platform_driver ams_delta_nand_driver = { .probe = ams_delta_init, .remove = ams_delta_cleanup, + .id_table = gpio_nand_plat_id_table, .driver = { .name = "ams-delta-nand", + .of_match_table = of_match_ptr(gpio_nand_of_id_table), }, }; From patchwork Wed Feb 12 00:39:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377323 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E272392A for ; Wed, 12 Feb 2020 00:45:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB4E920848 for ; Wed, 12 Feb 2020 00:45:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uu+vh94o"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XXy+baYR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB4E920848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=c0iO4ay74XxWXNLfpt0GHdayPoDR885Y2fHB8CKVz9k=; b=uu+vh94oNh2EeD d43HMN/6huT5O1wunU3OgL0Se/4N3n+ucwFmPLfQPMCIJFwDS3vYgh/DFA8LmyGSJq335DbmzjQc6 WSB39zLUS3OxNKpkiZux3+CzkqAwBfF3ZM0QO7nD8Mt/jwLhJ95d5Jb+Md9qxBO097Zs4i7r0S75a Ut6Y0kjEdy1qSdBJVG3E0UEm8Rv3lOPvOU5AKkJwVfCOHXC7o7ZbgUy+1/l7akEoisrtY8SpMiIl0 4btBnXRVC1+qWxXv1ADUz8Zpve8uuC33YHtUbjhekQ5pLeOIj8H/YpPMkm8EP3AIs7jGQtlakCHe7 +wTa9/8U+yzy6ug2C/Cg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g9R-0005Is-Vl; Wed, 12 Feb 2020 00:45:13 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4r-0008LD-C9; Wed, 12 Feb 2020 00:40:31 +0000 Received: by mail-lf1-x141.google.com with SMTP id r14so275179lfm.5; Tue, 11 Feb 2020 16:40:28 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=v/6tTpO3ty9Ickxrg60llaPHKJlLlwszXGl2q4ZEWdA=; b=XXy+baYR3VmU8+0MGUBmeB6Ufp/HhTXjpTNcm302ZvTcMx1EevlSI36N7AfkUkFY+L hikN/KF45d4Z3VpgD4ep9+f5bnN6R9yOvtZD6IKtW6JF30+QsQdYKL6ANu3J23pA2zPC vMQdRiXUl7QMICn0fkSYS4MjnkQ9yGjELAbk761xAGcGiTv5ew4ysYqRn60qsjpToxZp LdP4g+dkLb2RagCz7Srr7VCQBngZBot1UyOaQ/WSyyXpNmSVXCy6qUaKuJrhOHfOetnx +nI6CWdxR8IatlCyIFlRpeJ+xQEWEj9sCVcSc1FKF4cqaFeyYI/kEQKixttD8PiMxyIe HjJg== 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:mime-version:content-transfer-encoding; bh=v/6tTpO3ty9Ickxrg60llaPHKJlLlwszXGl2q4ZEWdA=; b=Dxk4U1xzFoKO9qZt8AFeEiB1XsADuLZSSq70bouPfyEoX/LWFwyNHqTiN+6J0QI4mV u4IE0tfo+V1iNlUsvdl4U04AUHWVnMTiaZhoQXug6jAyQMWKfMR7EwQuxJphGa4HEAd2 ro3chNzbjFyJcCfpiwtvK0hcPC1hvkAUQUqTuvteBPgss6yHR1lUNCfrZo3xZ+j8RgHr rADYySnrNehu1MAtEL5y9QxdsYMHQM7Ycr+P8hlklx0MZlVe7z3vK1hTf1JsxC80TTIH 5+JKIPNvMF/tiwPgcCes4xvxiqRqMnyELQ3Irtx7OJMnpk7vLI+Bu86MEmw2IHa6HA/d bMig== X-Gm-Message-State: APjAAAX1z5RGt9xZsx9ICLT+km39Ql5/1+ZnwNxDdcAenOHuElGX3xvL HPPdA8wOdGAwVkB/EISuzPc= X-Google-Smtp-Source: APXvYqzJQMZWjP7I8oQrWw3hIto+GJNhsSDnYXYqbb56cNLMkwksMbMcf+Z2BxWEJFVtQsbKN+icfg== X-Received: by 2002:ac2:5f74:: with SMTP id c20mr5161323lfc.15.1581468026840; Tue, 11 Feb 2020 16:40:26 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:26 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 11/14] mtd: rawnand: ams-delta: Support custom driver initialisation Date: Wed, 12 Feb 2020 01:39:26 +0100 Message-Id: <20200212003929.6682-12-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164029_447478_E5310F5E X-CRM114-Status: GOOD ( 11.10 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:141 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation for extending the driver with custom I/O support, try to obtain device specific initialisation routine from a matching device table entry and run it as an additional step of device probe. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 9857ce25debf..97e3b6629c72 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -230,6 +231,7 @@ static int ams_delta_init(struct platform_device *pdev) struct nand_chip *this; struct mtd_info *mtd; struct gpio_descs *data_gpiods; + int (*probe)(struct platform_device *pdev, struct ams_delta_nand *priv); int err = 0; if (pdata) { @@ -319,6 +321,15 @@ static int ams_delta_init(struct platform_device *pdev) priv->data_gpiods = data_gpiods; priv->data_in = true; + if (pdev->id_entry) + probe = (void *) pdev->id_entry->driver_data; + else + probe = of_device_get_match_data(&pdev->dev); + if (probe) + err = probe(pdev, priv); + if (err) + return err; + /* Initialize the NAND controller object embedded in ams_delta_nand. */ priv->base.ops = &ams_delta_ops; nand_controller_init(&priv->base); From patchwork Wed Feb 12 00:39:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377329 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C0A692A for ; Wed, 12 Feb 2020 00:46:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EAF4820848 for ; Wed, 12 Feb 2020 00:46:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uI5viCOZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YWg2OvsH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAF4820848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=ZQ58HJGhafPIMLIjrB/f+ohtP4cjOkORlvBH1jfSo04=; b=uI5viCOZ0xQL2B gzMUH3ygDehkg6WMbw0oQBw9S4NYlihg27EPG4obsl9DV1IG1GRroFcUTOtuUvF+ax0nrhVGGgvPO q4KZFNbJ7MIdxsHQYZ0ed/7Q7z7UmJa+3KwOkSLH5M7YiiCWrZhUbZDEVOpuBWvCiLJbNALIx37MI MdlysLJeO1zPuvEBrOs0+ZAyBB6clHMlYv3zq1HORJx72f+DGyqHwIqAI0bEeVUJq2gg4TO5psLT5 MulorRzLUy0Fn/Fw0ZhK0IwXHmRcKzr3HRNn3sJDscaEVGTeBlu4Y2AA58CyAVYm/ZfUzeBCnUH+8 WEPx3goTJqD54o0icivA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1gA8-00063t-Iz; Wed, 12 Feb 2020 00:45:56 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4r-0008Lp-VI; Wed, 12 Feb 2020 00:40:33 +0000 Received: by mail-lj1-x241.google.com with SMTP id e18so234374ljn.12; Tue, 11 Feb 2020 16:40:29 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=MI8IwajWT07hW6m+MFtO1fPhFSGD1JYkNnYkoSytSKc=; b=YWg2OvsH2to00WRX7NfJntW4eAb2zKY0qAiylXWiL6ZildFFKYBp35EXPz7SVkaYoA 4d3ihI0V/aicsYnxtQcEA9+Q/2PBQRVpsLA1HJujelWKhXa9B+zey+cBX4OAOTpE/BwV Aq+lEz5gy6gHgu9PkvuLehTvHC9DiDI7B8WLVXH6VLK0gDSxO7p+fz5FKm89TsMbeoN1 j0sBFp5YFndDdDKok18ADRMS1np2wnfEczINAR53elAWZUF27AHVPC3Y/vNJ/SgXlACP /trmBymxegXrQ+S0OHMbtuBqcaiVFthb7jDomTu72LkpFSHgjw5sNeUVJoVbRgJm/wQ9 C5Lg== 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:mime-version:content-transfer-encoding; bh=MI8IwajWT07hW6m+MFtO1fPhFSGD1JYkNnYkoSytSKc=; b=mCOZyEkkQXYSKve6Ov0zckUr2YpoMytkaBPSlwUwPJBxWbHQG/Bz9MqHydOCSll8CD QMLtyPVCokKE1fXou4PRu9z6JgFe/VOt5SGJNhzdd6bBU5iFyUglHmkf2i5P/wlBZw+I ooaoQioHBczK45lCICb8HFmzAZjIa1zknw/mpAMlYCLr1Cj5uIdyIenHKuF6VnVdgu5w 2HECwnsrTGKTHNxU3JsQ9N7dYoaqpcgtiKJMeBnQA0u7ntd5tjBYk1K9djr3hJ6xPRCw OaQEwVBqw+rtp6uv3VQwDfxl3vkz48pNGvUTZOYMpJPqGUekupFmlyS/AupYWdtbVP6L OSwQ== X-Gm-Message-State: APjAAAVqet2apuSf2ncjup6hKIxD4ySelJSRnHOXGo5ZAUAiMnkHUDab ULsJYVFyVumHA3Ci7GDUR0E= X-Google-Smtp-Source: APXvYqyw9cES/t4KUWxceUrhVRQz3XjbJMfNBnzNSkul+f1nDJk/BoJXNmhZyOTTwNPwsD5WWLqySA== X-Received: by 2002:a2e:6817:: with SMTP id c23mr5818737lja.263.1581468028067; Tue, 11 Feb 2020 16:40:28 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:27 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 12/14] mtd: rawnand: ams-delta: Drop useless local variable Date: Wed, 12 Feb 2020 01:39:27 +0100 Message-Id: <20200212003929.6682-13-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164030_093427_85859972 X-CRM114-Status: GOOD ( 12.45 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org For consistency with adjacent code patterns used in the driver probe function, store data GPIO array pointer directly in a respective field of the driver private structure instead of storing it intermediately in a local variable for error checking. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 97e3b6629c72..a68b7006ed69 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -230,7 +230,6 @@ static int ams_delta_init(struct platform_device *pdev) struct ams_delta_nand *priv; struct nand_chip *this; struct mtd_info *mtd; - struct gpio_descs *data_gpiods; int (*probe)(struct platform_device *pdev, struct ams_delta_nand *priv); int err = 0; @@ -312,13 +311,12 @@ static int ams_delta_init(struct platform_device *pdev) } /* Request array of data pins, initialize them as input */ - data_gpiods = devm_gpiod_get_array(&pdev->dev, "data", GPIOD_IN); - if (IS_ERR(data_gpiods)) { - err = PTR_ERR(data_gpiods); + priv->data_gpiods = devm_gpiod_get_array(&pdev->dev, "data", GPIOD_IN); + if (IS_ERR(priv->data_gpiods)) { + err = PTR_ERR(priv->data_gpiods); dev_err(&pdev->dev, "data GPIO request failed: %d\n", err); return err; } - priv->data_gpiods = data_gpiods; priv->data_in = true; if (pdev->id_entry) From patchwork Wed Feb 12 00:39:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377331 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8545492A for ; Wed, 12 Feb 2020 00:46:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 629F820842 for ; Wed, 12 Feb 2020 00:46:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BoeKtg2t"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dAoEyqxe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 629F820842 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=ln2G3ovYQpfjEU8fy53QTY102p7XQcyXwOXG2bqDCHI=; b=BoeKtg2t/elCsq vAaGaiPzLiXwmbXgOFDTefYw3vhW6SwdokgzdZ+GnrMssfV5Iu0Mnkmm8pb31KIAzztniD7YNLjQb tTgfTFhgTqxscAq+L+fdesGbsJ8zrCv+UIe5UlZ36SFOKMyDiq0wtjGzAjYW3PicBsKLTMPUs7tzz bvMupMIyPOvxDkLCOr42ivCuV/p6h8md5y7kMQBhqQ+vQrX42hN4L4Y1bDYwJXJjjlhcNyL+8eIJ6 iP/XV/nWpQKgDt59lT4ABWckEKEfSUOuJ0e9sEBgKuLwVsqK2I89HFSQKfiDs8R7hzM5nA9EkAL0+ kUWy0xTsm1HqtZV6BKxQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1gAK-0006HJ-La; Wed, 12 Feb 2020 00:46:08 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4t-0008Ns-Bx; Wed, 12 Feb 2020 00:40:34 +0000 Received: by mail-lf1-x144.google.com with SMTP id 203so248974lfa.12; Tue, 11 Feb 2020 16:40:31 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=HTf58YpqwaY9/ZfsDIcfANNUH88w2zXw+jSn3ywd04g=; b=dAoEyqxeOjz7A2KEREadDZ6VqZVRMhPyaTDrRZZW+C4fdJOBFYiwcabV31xKiYs8bs mD9PWUrXqqx+/EQndIe89NMR2DuQUpfkDvTc41UXohGgHD2WxHOLebxME02T0EJtVuXH GMgf9JRWjf8ZUjhbow6HqVrrIh9gPsTKmIhprve6OB9y5PBjyLKHQ+2i6K7h7M3H1RJ1 qTxRPYWYbmLnsz14c6lefULFIeaC15ufIop7jj1xvILyxanpeE8APDDXMfZirs59IHsI hb3tVfXPr39bHqvSOFoBkktCHplzqz796hsWSbczDlQTOMbLKv9zKJHGPSrtAA9JUsk1 HCiQ== 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:mime-version:content-transfer-encoding; bh=HTf58YpqwaY9/ZfsDIcfANNUH88w2zXw+jSn3ywd04g=; b=HpJJ7adZZZrTeK3AgPZNheiU1vXaquANykKbdUvd4lB135TgK25jjvbF8XXtDp7gK8 9IbPzVqHIiKkrKF4CHnP1X+Xr9k+M2veaOqo8WGq4sp4UPjBRjiG19ZzNggdMIzjUyxE Pq5LmV99gm+r3iSGetj0BdkXDSUlraBqcTdFlmRTYLJ9eIybovat+z5ixuwvIehwSooq MCpLFPGKjDU4atUkg/HCH+KP3/hTA9IMhC4MX7r7F0kTZvcnseR+txtmqw4CPihKMUdV jkNVxTjtz7syr/TkUiNtP4Y5Y0iYd9ZUHb/Kb3PI4T8gOhMiBuC0iqe9TYMJ83y2ihpS DNSw== X-Gm-Message-State: APjAAAUBplAMqIoF14AxepMjZogLl/zTcx0+3ZcXPMF500rgkJsd6xBd zBPsQ2Gt+opNiJFGfn6jQ9g= X-Google-Smtp-Source: APXvYqwwX3ih/dlP/s6h+fr2ICYq2BrPHs02sfYs8lBXyp00LNq1eN3hIoCLnQCndwzdhNiBZFV+jA== X-Received: by 2002:a19:748:: with SMTP id 69mr5238603lfh.40.1581468029430; Tue, 11 Feb 2020 16:40:29 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:28 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 13/14] mtd: rawnand: ams-delta: Make the driver custom I/O ready Date: Wed, 12 Feb 2020 01:39:28 +0100 Message-Id: <20200212003929.6682-14-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164031_461923_3E06C84A X-CRM114-Status: GOOD ( 13.55 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:144 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In order to be merged with "gpio-nand", the driver must support custom (non-GPIO) I/O accessors. Allow platforms to omit data GPIO port as well as NWE pin info from device setup. For the driver to still work on such platform, custom I/O accessors as well as a custom probe function which initialises the driver private structure with those accessors must be added to the driver. Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index a68b7006ed69..9e659984bf59 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -43,6 +43,9 @@ struct ams_delta_nand { bool data_in; unsigned int tRP; unsigned int tWP; + u8 (*io_read)(struct ams_delta_nand *this); + void (*io_write)(struct ams_delta_nand *this, + u8 byte); }; static void ams_delta_write_commit(struct ams_delta_nand *priv) @@ -116,18 +119,18 @@ static void ams_delta_write_buf(struct ams_delta_nand *priv, const u8 *buf, ams_delta_dir_output(priv, buf[i++]); while (i < len) - ams_delta_io_write(priv, buf[i++]); + priv->io_write(priv, buf[i++]); } static void ams_delta_read_buf(struct ams_delta_nand *priv, u8 *buf, int len) { int i; - if (!priv->data_in) + if (priv->data_gpiods && !priv->data_in) ams_delta_dir_input(priv); for (i = 0; i < len; i++) - buf[i] = ams_delta_io_read(priv); + buf[i] = priv->io_read(priv); } static void ams_delta_ctrl_cs(struct ams_delta_nand *priv, bool assert) @@ -289,7 +292,8 @@ static int ams_delta_init(struct platform_device *pdev) return err; } - priv->gpiod_nwe = devm_gpiod_get(&pdev->dev, "nwe", GPIOD_OUT_LOW); + priv->gpiod_nwe = devm_gpiod_get_optional(&pdev->dev, "nwe", + GPIOD_OUT_LOW); if (IS_ERR(priv->gpiod_nwe)) { err = PTR_ERR(priv->gpiod_nwe); dev_err(&pdev->dev, "NWE GPIO request failed (%d)\n", err); @@ -311,13 +315,24 @@ static int ams_delta_init(struct platform_device *pdev) } /* Request array of data pins, initialize them as input */ - priv->data_gpiods = devm_gpiod_get_array(&pdev->dev, "data", GPIOD_IN); + priv->data_gpiods = devm_gpiod_get_array_optional(&pdev->dev, "data", + GPIOD_IN); if (IS_ERR(priv->data_gpiods)) { err = PTR_ERR(priv->data_gpiods); dev_err(&pdev->dev, "data GPIO request failed: %d\n", err); return err; } - priv->data_in = true; + if (priv->data_gpiods) { + if (!priv->gpiod_nwe) { + dev_err(&pdev->dev, + "mandatory NWE pin not provided by platform\n"); + return -ENODEV; + } + + priv->io_read = ams_delta_io_read; + priv->io_write = ams_delta_io_write; + priv->data_in = true; + } if (pdev->id_entry) probe = (void *) pdev->id_entry->driver_data; @@ -328,6 +343,11 @@ static int ams_delta_init(struct platform_device *pdev) if (err) return err; + if (!priv->io_read || !priv->io_write) { + dev_err(&pdev->dev, "incomplete device configuration\n"); + return -ENODEV; + } + /* Initialize the NAND controller object embedded in ams_delta_nand. */ priv->base.ops = &ams_delta_ops; nand_controller_init(&priv->base); From patchwork Wed Feb 12 00:39:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11377333 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F472139A for ; Wed, 12 Feb 2020 00:47:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E580E20724 for ; Wed, 12 Feb 2020 00:47:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="r04ATPGF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IndtyLyV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E580E20724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=eAt6zC8XSu8b0Sq7XTIctzL6UFA3E42J2XfcoPU3fnk=; b=r04ATPGF3Zmee7 QxkEyoa9Iklbt2Ut+4HUrV+7EymDyU4+YjuMGi1sEf9TIUGbhvoO12X2pi3+2lQf1MEGFtndAFJOq iqcfmjv0/P29VUrhfD3x46fKxzf7WWra0NkxmWtbPOmsALq9FXFhGS2evhbCcz2G9EkxZfMdj0NDY BwtXpLKK/7A+IcADAc14WP7BvdFABzLR40IlTsmhhMgWjcV/tqBmygidovtqBgyBpa5ylf67Y3HvN QUIBjSRJLqm7jOa1ml7Zk9yt5zgoeEvsEz2tWVAQdmQUCK77yHRcTwWg8o94EIxQBhB4buJ90d5WA +vYfHik5Ug0UTcy4LNsA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1gB5-0007BE-JZ; Wed, 12 Feb 2020 00:46:55 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1g4u-0008OR-Du; Wed, 12 Feb 2020 00:40:36 +0000 Received: by mail-lf1-x143.google.com with SMTP id 9so258037lfq.10; Tue, 11 Feb 2020 16:40:32 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=2UEgY4ao2+798RrC+bgRDj1MAy2fBXO4FFMvPRI1C4g=; b=IndtyLyVtvp5a7K9IKZkW7pCthfJxOF/LdZ+pgJGVT4Gb8u/yJr/CPU0GrYi+o44n4 qQFeWSXzNDHCLjyQXTXq2V19GV+YjvFz4ET8lP8UsPB8zDrtpNHuoYcdhXcaYs0oBNAQ byexFtFsf7fcB8MYtQt0ZhrJHDg//JRBcp3BvBnYFEz3Z/TpGOSzp4epjj7OawV/xnVs EGUhAFMh1VVXBvkp5aJvYNPDP1fnVA0z7hc1m0yvrtfQUEX4vVKXSdimWT/zyls8CtGs pOCOWPA/jUJT2fa9fhzjMM45EyUqPefcJUwAvCIFN8U5pu4zLxGWwHlCxpPQUveLN8oA Nsdg== 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:mime-version:content-transfer-encoding; bh=2UEgY4ao2+798RrC+bgRDj1MAy2fBXO4FFMvPRI1C4g=; b=WBZlpxov8XS7xlCoIe5x1EesOt+pdyUn8xpuBsxnOrhNb4GWvWSRA3an68r5CQmbDu fO2FAPIiWCH0r0q/eqk3+CwfOWVvKU2PO9mUrWLDsz6qi1X2UivEzeHZ+f0aqRknzZNr uxJm3APuVrrMgOEhGiHnQH7RpU4hZdg8hUP6clAsen+d8xGut1d6LzXqF90J2Px1t3MJ IKXM3+mU1kHP32b/u35gUmnEpVjZf15UShXS+n4YhY/z/gXa8Bi8DychMV/+7JiyEcQD a3YM8Eb6zrVNEdbUFSPBrLkT2xpag+d7SJ+kY9yvcmWR1wLKYu93B+tqrbcF3WYOmUQO SHZQ== X-Gm-Message-State: APjAAAUlFuPZe48ksOi/w0Sz1SHDwYuR3vnHlsaI5nfwi3sviBt9D7eK TCKRBTaASPg1IauLnsSHGU0= X-Google-Smtp-Source: APXvYqwGzDZunZ82ZiLa1YumLPIcrrgQ3aVnv5FhxhmDF3C3h64og6Ucdk0KrfRDM6DpAQfsg8Toqg== X-Received: by 2002:ac2:4d04:: with SMTP id r4mr5183706lfi.77.1581468030700; Tue, 11 Feb 2020 16:40:30 -0800 (PST) Received: from z50.gdansk-morena.vectranet.pl (109241122244.gdansk.vectranet.pl. [109.241.122.244]) by smtp.gmail.com with ESMTPSA id e8sm3621935ljb.45.2020.02.11.16.40.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 16:40:30 -0800 (PST) From: Janusz Krzysztofik To: Miquel Raynal , Richard Weinberger Subject: [RFC PATCH 14/14] mtd: rawnand: ams-delta: Rename structures and functions to gpio_nand* Date: Wed, 12 Feb 2020 01:39:29 +0100 Message-Id: <20200212003929.6682-15-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200212003929.6682-1-jmkrzyszt@gmail.com> References: <20200212003929.6682-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200211_164032_626132_2B973DF1 X-CRM114-Status: GOOD ( 14.45 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:143 listed in] [list.dnswl.org] 1.0 HK_RANDOM_FROM From username looks random 0.6 HK_RANDOM_ENVFROM Envelope sender username looks random 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jmkrzyszt[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , Aaro Koskinen , Tony Lindgren , Janusz Krzysztofik , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Another step in preparation for merging the driver with "gpio-nand". Signed-off-by: Janusz Krzysztofik --- drivers/mtd/nand/raw/ams-delta.c | 86 ++++++++++++++++---------------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 9e659984bf59..6fda2979e820 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -29,7 +29,7 @@ /* * MTD structure for E3 (Delta) */ -struct ams_delta_nand { +struct gpio_nand { struct nand_controller base; struct nand_chip nand_chip; struct gpio_desc *gpiod_rdy; @@ -43,19 +43,18 @@ struct ams_delta_nand { bool data_in; unsigned int tRP; unsigned int tWP; - u8 (*io_read)(struct ams_delta_nand *this); - void (*io_write)(struct ams_delta_nand *this, - u8 byte); + u8 (*io_read)(struct gpio_nand *this); + void (*io_write)(struct gpio_nand *this, u8 byte); }; -static void ams_delta_write_commit(struct ams_delta_nand *priv) +static void gpio_nand_write_commit(struct gpio_nand *priv) { gpiod_set_value(priv->gpiod_nwe, 1); ndelay(priv->tWP); gpiod_set_value(priv->gpiod_nwe, 0); } -static void ams_delta_io_write(struct ams_delta_nand *priv, u8 byte) +static void gpio_nand_io_write(struct gpio_nand *priv, u8 byte) { struct gpio_descs *data_gpiods = priv->data_gpiods; DECLARE_BITMAP(values, BITS_PER_TYPE(byte)) = { byte, }; @@ -63,10 +62,10 @@ static void ams_delta_io_write(struct ams_delta_nand *priv, u8 byte) gpiod_set_raw_array_value(data_gpiods->ndescs, data_gpiods->desc, data_gpiods->info, values); - ams_delta_write_commit(priv); + gpio_nand_write_commit(priv); } -static void ams_delta_dir_output(struct ams_delta_nand *priv, u8 byte) +static void gpio_nand_dir_output(struct gpio_nand *priv, u8 byte) { struct gpio_descs *data_gpiods = priv->data_gpiods; DECLARE_BITMAP(values, BITS_PER_TYPE(byte)) = { byte, }; @@ -76,12 +75,12 @@ static void ams_delta_dir_output(struct ams_delta_nand *priv, u8 byte) gpiod_direction_output_raw(data_gpiods->desc[i], test_bit(i, values)); - ams_delta_write_commit(priv); + gpio_nand_write_commit(priv); priv->data_in = false; } -static u8 ams_delta_io_read(struct ams_delta_nand *priv) +static u8 gpio_nand_io_read(struct gpio_nand *priv) { u8 res; struct gpio_descs *data_gpiods = priv->data_gpiods; @@ -99,7 +98,7 @@ static u8 ams_delta_io_read(struct ams_delta_nand *priv) return res; } -static void ams_delta_dir_input(struct ams_delta_nand *priv) +static void gpio_nand_dir_input(struct gpio_nand *priv) { struct gpio_descs *data_gpiods = priv->data_gpiods; int i; @@ -110,68 +109,67 @@ static void ams_delta_dir_input(struct ams_delta_nand *priv) priv->data_in = true; } -static void ams_delta_write_buf(struct ams_delta_nand *priv, const u8 *buf, - int len) +static void gpio_nand_write_buf(struct gpio_nand *priv, const u8 *buf, int len) { int i = 0; if (len > 0 && priv->data_in) - ams_delta_dir_output(priv, buf[i++]); + gpio_nand_dir_output(priv, buf[i++]); while (i < len) priv->io_write(priv, buf[i++]); } -static void ams_delta_read_buf(struct ams_delta_nand *priv, u8 *buf, int len) +static void gpio_nand_read_buf(struct gpio_nand *priv, u8 *buf, int len) { int i; if (priv->data_gpiods && !priv->data_in) - ams_delta_dir_input(priv); + gpio_nand_dir_input(priv); for (i = 0; i < len; i++) buf[i] = priv->io_read(priv); } -static void ams_delta_ctrl_cs(struct ams_delta_nand *priv, bool assert) +static void gpio_nand_ctrl_cs(struct gpio_nand *priv, bool assert) { gpiod_set_value(priv->gpiod_nce, assert); } -static int ams_delta_exec_op(struct nand_chip *this, +static int gpio_nand_exec_op(struct nand_chip *this, const struct nand_operation *op, bool check_only) { - struct ams_delta_nand *priv = nand_get_controller_data(this); + struct gpio_nand *priv = nand_get_controller_data(this); const struct nand_op_instr *instr; int ret = 0; if (check_only) return 0; - ams_delta_ctrl_cs(priv, 1); + gpio_nand_ctrl_cs(priv, 1); for (instr = op->instrs; instr < op->instrs + op->ninstrs; instr++) { switch (instr->type) { case NAND_OP_CMD_INSTR: gpiod_set_value(priv->gpiod_cle, 1); - ams_delta_write_buf(priv, &instr->ctx.cmd.opcode, 1); + gpio_nand_write_buf(priv, &instr->ctx.cmd.opcode, 1); gpiod_set_value(priv->gpiod_cle, 0); break; case NAND_OP_ADDR_INSTR: gpiod_set_value(priv->gpiod_ale, 1); - ams_delta_write_buf(priv, instr->ctx.addr.addrs, + gpio_nand_write_buf(priv, instr->ctx.addr.addrs, instr->ctx.addr.naddrs); gpiod_set_value(priv->gpiod_ale, 0); break; case NAND_OP_DATA_IN_INSTR: - ams_delta_read_buf(priv, instr->ctx.data.buf.in, + gpio_nand_read_buf(priv, instr->ctx.data.buf.in, instr->ctx.data.len); break; case NAND_OP_DATA_OUT_INSTR: - ams_delta_write_buf(priv, instr->ctx.data.buf.out, + gpio_nand_write_buf(priv, instr->ctx.data.buf.out, instr->ctx.data.len); break; @@ -188,15 +186,15 @@ static int ams_delta_exec_op(struct nand_chip *this, break; } - ams_delta_ctrl_cs(priv, 0); + gpio_nand_ctrl_cs(priv, 0); return ret; } -static int ams_delta_setup_data_interface(struct nand_chip *this, int csline, +static int gpio_nand_setup_data_interface(struct nand_chip *this, int csline, const struct nand_data_interface *cf) { - struct ams_delta_nand *priv = nand_get_controller_data(this); + struct gpio_nand *priv = nand_get_controller_data(this); const struct nand_sdr_timings *sdr = nand_get_sdr_timings(cf); struct device *dev = &nand_to_mtd(this)->dev; @@ -217,23 +215,23 @@ static int ams_delta_setup_data_interface(struct nand_chip *this, int csline, return 0; } -static const struct nand_controller_ops ams_delta_ops = { - .exec_op = ams_delta_exec_op, - .setup_data_interface = ams_delta_setup_data_interface, +static const struct nand_controller_ops gpio_nand_ops = { + .exec_op = gpio_nand_exec_op, + .setup_data_interface = gpio_nand_setup_data_interface, }; /* * Main initialization routine */ -static int ams_delta_init(struct platform_device *pdev) +static int gpio_nand_probe(struct platform_device *pdev) { struct gpio_nand_platdata *pdata = dev_get_platdata(&pdev->dev); const struct mtd_partition *partitions = NULL; int num_partitions = 0; - struct ams_delta_nand *priv; + struct gpio_nand *priv; struct nand_chip *this; struct mtd_info *mtd; - int (*probe)(struct platform_device *pdev, struct ams_delta_nand *priv); + int (*probe)(struct platform_device *pdev, struct gpio_nand *priv); int err = 0; if (pdata) { @@ -242,7 +240,7 @@ static int ams_delta_init(struct platform_device *pdev) } /* Allocate memory for MTD device structure and private data */ - priv = devm_kzalloc(&pdev->dev, sizeof(struct ams_delta_nand), + priv = devm_kzalloc(&pdev->dev, sizeof(struct gpio_nand), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -329,8 +327,8 @@ static int ams_delta_init(struct platform_device *pdev) return -ENODEV; } - priv->io_read = ams_delta_io_read; - priv->io_write = ams_delta_io_write; + priv->io_read = gpio_nand_io_read; + priv->io_write = gpio_nand_io_write; priv->data_in = true; } @@ -348,8 +346,8 @@ static int ams_delta_init(struct platform_device *pdev) return -ENODEV; } - /* Initialize the NAND controller object embedded in ams_delta_nand. */ - priv->base.ops = &ams_delta_ops; + /* Initialize the NAND controller object embedded in gpio_nand. */ + priv->base.ops = &gpio_nand_ops; nand_controller_init(&priv->base); this->controller = &priv->base; @@ -385,9 +383,9 @@ static int ams_delta_init(struct platform_device *pdev) /* * Clean up routine */ -static int ams_delta_cleanup(struct platform_device *pdev) +static int gpio_nand_remove(struct platform_device *pdev) { - struct ams_delta_nand *priv = platform_get_drvdata(pdev); + struct gpio_nand *priv = platform_get_drvdata(pdev); struct mtd_info *mtd = nand_to_mtd(&priv->nand_chip); /* Apply write protection */ @@ -415,9 +413,9 @@ static const struct platform_device_id gpio_nand_plat_id_table[] = { }; MODULE_DEVICE_TABLE(of, gpio_nand_plat_id_table); -static struct platform_driver ams_delta_nand_driver = { - .probe = ams_delta_init, - .remove = ams_delta_cleanup, +static struct platform_driver gpio_nand_driver = { + .probe = gpio_nand_probe, + .remove = gpio_nand_remove, .id_table = gpio_nand_plat_id_table, .driver = { .name = "ams-delta-nand", @@ -425,7 +423,7 @@ static struct platform_driver ams_delta_nand_driver = { }, }; -module_platform_driver(ams_delta_nand_driver); +module_platform_driver(gpio_nand_driver); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Jonathan McDowell ");