Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/811657/?format=api
{ "id": 811657, "url": "http://patchwork.ozlabs.org/api/patches/811657/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170908153604.28383-10-romain.izard.pro@gmail.com/", "project": { "id": 3, "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api", "name": "Linux MTD development", "link_name": "linux-mtd", "list_id": "linux-mtd.lists.infradead.org", "list_email": "linux-mtd@lists.infradead.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170908153604.28383-10-romain.izard.pro@gmail.com>", "list_archive_url": null, "date": "2017-09-08T15:36:03", "name": "[v1,09/10] atmel_flexcom: Support backup mode", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "1e900756cc432cce1416b9d27eefdff16e657f04", "submitter": { "id": 8236, "url": "http://patchwork.ozlabs.org/api/people/8236/?format=api", "name": "Romain Izard", "email": "romain.izard.pro@gmail.com" }, "delegate": { "id": 58324, "url": "http://patchwork.ozlabs.org/api/users/58324/?format=api", "username": "bbrezillon", "first_name": "Boris", "last_name": "Brezillon", "email": "boris.brezillon@free-electrons.com" }, "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170908153604.28383-10-romain.izard.pro@gmail.com/mbox/", "series": [ { "id": 2239, "url": "http://patchwork.ozlabs.org/api/series/2239/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=2239", "date": "2017-09-08T15:35:55", "name": "Various patches for SAMA5D2 backup mode", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2239/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/811657/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811657/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"OguH5LaP\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"kQlJKNEO\"; dkim-atps=neutral" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xphSN54HXz9tX9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 9 Sep 2017 01:43:47 +1000 (AEST)", "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dqLRX-0003nA-0j; Fri, 08 Sep 2017 15:43:43 +0000", "from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dqLKr-00068v-OL; Fri, 08 Sep 2017 15:36:57 +0000", "by mail-wr0-x243.google.com with SMTP id b9so1418764wra.0;\n\tFri, 08 Sep 2017 08:36:29 -0700 (PDT)", "from localhost.localdomain (146.187.3.109.rev.sfr.net.\n\t[109.3.187.146]) by smtp.gmail.com with ESMTPSA id\n\tp199sm1689224wmb.28.2017.09.08.08.36.26\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Sep 2017 08:36:27 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:\n\tIn-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=PU8vANkLkASRBw5C6JDFCDR9y1Tuq4WkDFSVYi0vLV8=;\n\tb=OguH5LaPxFl383bN/xeSbB+bnZ\n\tQ99OtgOIWbjdSjklbxWjtQLMwAnTq2Qxb3rqDAitBIxn08ZFnxcei3Y+Zul4TwNIzOEClJm0/EEOx\n\tabf29iqc2fW1wwd+4/CR3Ynk9mSPNGMhiwWVlCyJsIIeGQMD45+U7CLUIuWY08q8TpDNjH8/6iblZ\n\t5FSQQgGr9sCEgPuAluAJEiW1cxreN0GjytbtfMG7PrYiyTN5wobC8Re8IJ9FmQECECNqolLyNvkFP\n\t4G2W0EMkgEgtP9eWcS1jZeif2JYVvZ1oxbur6lIVV68jObXrD1pPda3Mq0ftiIhdCYa2R5vG2OtIa\n\tynztTorQ==;", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=ODEsLfkb3lvipUolMLb7ScB3ja2VrqHu5R+0EqPP1yQ=;\n\tb=kQlJKNEOAJMGPm/b6tnfxUlVl2kT6QoNOIRe5QWkqQqCxB9FfRN7t+V9bY8rvDE2H1\n\tEFhXSyYLHX8BeOXM0j1GWFn+SvSGFe2zzXYVxnmJZ4S18sDK/W5DHggP6pS0W+RFWgxX\n\t9FH4Q8iOGOjwk3CBvvPOFL89UK6lm7cSpCOLens3ciAbUTHnvW1frRW5ZD631hWQMKk/\n\tqfLnFagoIiAPK4fVSqLaCVNWDs+mBOAco04yxKJLuHeZ7M7mLvPJDyKzbj6fk9B5b4Df\n\t8od2rk4gjn/oh1E3bedRfkgjF8gEKviKh00GNMcDoG7++AT+oyzFbQdm5gC87L0xU0J+\n\tRo3w==" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=ODEsLfkb3lvipUolMLb7ScB3ja2VrqHu5R+0EqPP1yQ=;\n\tb=WgKZjR6sXF8M57iOeonv7BgeI5EH5OpFgfNP7aDRmAhPi4fWO/hBv5vjEJTPBU96ng\n\tfYQXDe+X/ny+0WvJHy6QBUVUbz1CUW8EOB45aAv/aQy3hKDvPg52hyYphncrtHyavr0j\n\t17bzxFT+nDdalbe7avONzu+Cghhn5Bsj1Tgr8P+jE9kE6Uj3J1Cwzismy8bd+B9kbNc8\n\twzB7oDMoazed5eotuXRX/EX9r+JX/M3tGNyYjE1ixULvawHuJ2BfuDHoPtWYW7zA10xp\n\tHXn8mPTjdtJ5TyVMnLBex/MpgQoIH/lN7VcZQsQHDxNzlDh1pFudeOF1QPy/h2/wuzK5\n\tS/iw==", "X-Gm-Message-State": "AHPjjUjwxK/0xcyH/jupEtAqVlO14sftToouVb48xaPterAAbdPCKg2a\n\tNwo8aTyBq1Fy/w==", "X-Google-Smtp-Source": "ADKCNb7h6mmGG+LclTSLdoGtlEcr/ag/nvgWL/WEteUruwWBbuJoERN9oSXBzzmou6krUjyx1tllDw==", "X-Received": "by 10.223.157.3 with SMTP id k3mr2436226wre.122.1504884988002;\n\tFri, 08 Sep 2017 08:36:28 -0700 (PDT)", "From": "Romain Izard <romain.izard.pro@gmail.com>", "To": "Nicolas Ferre <nicolas.ferre@microchip.com>,\n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@codeaurora.org>,\n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tJonathan Cameron <jic23@kernel.org>,\n\tWenyou Yang <wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>, \n\tBrian Norris <computersforpeace@gmail.com>,\n\tMarek Vasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tAlan Stern <stern@rowland.harvard.edu>", "Subject": "[PATCH v1 09/10] atmel_flexcom: Support backup mode", "Date": "Fri, 8 Sep 2017 17:36:03 +0200", "Message-Id": "<20170908153604.28383-10-romain.izard.pro@gmail.com>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": "<20170908153604.28383-1-romain.izard.pro@gmail.com>", "References": "<20170908153604.28383-1-romain.izard.pro@gmail.com>", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20170908_083650_292664_453948F6 ", "X-CRM114-Status": "GOOD ( 14.78 )", "X-Spam-Score": "-2.0 (--)", "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details: (-2.0 points)\n\tpts rule name description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2a00:1450:400c:c0c:0:0:0:243 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (romain.izard.pro[at]gmail.com)\n\t-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain", "X-BeenThere": "linux-mtd@lists.infradead.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>", "List-Post": "<mailto:linux-mtd@lists.infradead.org>", "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>", "Cc": "linux-pwm@vger.kernel.org, linux-iio@vger.kernel.org,\n\tlinux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org, linux-serial@vger.kernel.org,\n\tRomain Izard <romain.izard.pro@gmail.com>, linux-clk@vger.kernel.org, \n\tlinux-arm-kernel@lists.infradead.org", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>", "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "The controller used by a flexcom module is configured at boot, and left\nalone after this. As the configuration will be lost after backup mode,\nrestore the state of the flexcom driver on resume.\n\nSigned-off-by: Romain Izard <romain.izard.pro@gmail.com>\n---\n drivers/mfd/atmel-flexcom.c | 65 ++++++++++++++++++++++++++++++++++-----------\n 1 file changed, 50 insertions(+), 15 deletions(-)", "diff": "diff --git a/drivers/mfd/atmel-flexcom.c b/drivers/mfd/atmel-flexcom.c\nindex 064bde9cff5a..ef1235c4a179 100644\n--- a/drivers/mfd/atmel-flexcom.c\n+++ b/drivers/mfd/atmel-flexcom.c\n@@ -39,34 +39,44 @@\n #define FLEX_MR_OPMODE(opmode)\t(((opmode) << FLEX_MR_OPMODE_OFFSET) &\t\\\n \t\t\t\t FLEX_MR_OPMODE_MASK)\n \n+struct atmel_flexcom {\n+\tvoid __iomem *base;\n+\tu32 opmode;\n+\tstruct clk *clk;\n+};\n \n static int atmel_flexcom_probe(struct platform_device *pdev)\n {\n \tstruct device_node *np = pdev->dev.of_node;\n-\tstruct clk *clk;\n \tstruct resource *res;\n-\tvoid __iomem *base;\n-\tu32 opmode;\n+\tstruct atmel_flexcom *afc;\n \tint err;\n+\tu32 val;\n+\n+\tafc = devm_kzalloc(&pdev->dev, sizeof(*afc), GFP_KERNEL);\n+\tif (!afc)\n+\t\treturn -ENOMEM;\n \n-\terr = of_property_read_u32(np, \"atmel,flexcom-mode\", &opmode);\n+\tplatform_set_drvdata(pdev, afc);\n+\n+\terr = of_property_read_u32(np, \"atmel,flexcom-mode\", &afc->opmode);\n \tif (err)\n \t\treturn err;\n \n-\tif (opmode < ATMEL_FLEXCOM_MODE_USART ||\n-\t opmode > ATMEL_FLEXCOM_MODE_TWI)\n+\tif (afc->opmode < ATMEL_FLEXCOM_MODE_USART ||\n+\t afc->opmode > ATMEL_FLEXCOM_MODE_TWI)\n \t\treturn -EINVAL;\n \n \tres = platform_get_resource(pdev, IORESOURCE_MEM, 0);\n-\tbase = devm_ioremap_resource(&pdev->dev, res);\n-\tif (IS_ERR(base))\n-\t\treturn PTR_ERR(base);\n+\tafc->base = devm_ioremap_resource(&pdev->dev, res);\n+\tif (IS_ERR(afc->base))\n+\t\treturn PTR_ERR(afc->base);\n \n-\tclk = devm_clk_get(&pdev->dev, NULL);\n-\tif (IS_ERR(clk))\n-\t\treturn PTR_ERR(clk);\n+\tafc->clk = devm_clk_get(&pdev->dev, NULL);\n+\tif (IS_ERR(afc->clk))\n+\t\treturn PTR_ERR(afc->clk);\n \n-\terr = clk_prepare_enable(clk);\n+\terr = clk_prepare_enable(afc->clk);\n \tif (err)\n \t\treturn err;\n \n@@ -76,9 +86,10 @@ static int atmel_flexcom_probe(struct platform_device *pdev)\n \t * inaccessible and are read as zero. Also the external I/O lines of the\n \t * Flexcom are muxed to reach the selected device.\n \t */\n-\twritel(FLEX_MR_OPMODE(opmode), base + FLEX_MR);\n+\tval = FLEX_MR_OPMODE(afc->opmode);\n+\twritel(val, afc->base + FLEX_MR);\n \n-\tclk_disable_unprepare(clk);\n+\tclk_disable_unprepare(afc->clk);\n \n \treturn devm_of_platform_populate(&pdev->dev);\n }\n@@ -89,10 +100,34 @@ static const struct of_device_id atmel_flexcom_of_match[] = {\n };\n MODULE_DEVICE_TABLE(of, atmel_flexcom_of_match);\n \n+#ifdef CONFIG_PM_SLEEP\n+static int atmel_flexcom_resume(struct device *dev)\n+{\n+\tstruct atmel_flexcom *afc = dev_get_drvdata(dev);\n+\tint err;\n+\tu32 val;\n+\n+\terr = clk_prepare_enable(afc->clk);\n+\tif (err)\n+\t\treturn err;\n+\n+\tval = FLEX_MR_OPMODE(afc->opmode),\n+\twritel(val, afc->base + FLEX_MR);\n+\n+\tclk_disable_unprepare(afc->clk);\n+\n+\treturn 0;\n+}\n+#endif\n+\n+static SIMPLE_DEV_PM_OPS(atmel_flexcom_pm_ops, NULL,\n+\t\t\t atmel_flexcom_resume);\n+\n static struct platform_driver atmel_flexcom_driver = {\n \t.probe\t= atmel_flexcom_probe,\n \t.driver\t= {\n \t\t.name\t\t= \"atmel_flexcom\",\n+\t\t.pm\t\t= &atmel_flexcom_pm_ops,\n \t\t.of_match_table\t= atmel_flexcom_of_match,\n \t},\n };\n", "prefixes": [ "v1", "09/10" ] }