Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/811660/?format=api
{ "id": 811660, "url": "http://patchwork.ozlabs.org/api/patches/811660/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170908153604.28383-8-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-8-romain.izard.pro@gmail.com>", "list_archive_url": null, "date": "2017-09-08T15:36:01", "name": "[v1,07/10] iio:adc:at91-sama5d2: Support backup mode", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "43f9f0f54bdc301a1bfe15ca7e09cacf15e5278f", "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-8-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/811660/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811660/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=\"o1RjT7Ru\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"j+4lTOQl\"; 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 3xphQF1f3Qz9t66\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 9 Sep 2017 01:41:57 +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 1dqLPg-0002Nx-BC; Fri, 08 Sep 2017 15:41:48 +0000", "from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dqLKn-00068X-Oa; Fri, 08 Sep 2017 15:36:53 +0000", "by mail-wm0-x242.google.com with SMTP id x17so1975539wmd.5;\n\tFri, 08 Sep 2017 08:36:26 -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.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Sep 2017 08:36:24 -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=98chZD2IOoLhWskJPKlA41m7NWuYKsMLA6+Cvp/An+o=;\n\tb=o1RjT7RubkyKxHTJh+jCUxDK/6\n\tTcMRr6XBMwhe0qZfMDLYJ1htsV2ZnUkNU2D5Fe4VZCsWVIzmNRxhfPdrm4VbZ2UrRvG+pmhiv9Jjj\n\tvFdwr6gh1ojkD0SemlL1wgWKOUWSrnSRXNroyMw+7zcZLn72cHN0C15nF5O4OJdw/wVsCEfWKl061\n\tt5d0bIorbIHQcOyuZg08vkHXKTJnY436b68bGSQ9pKl8Dw7mSGX6zx4D7xZH7uSSxj30UguffZ3sp\n\twtIOAVysqU+8MT5WrYzpOch/7gr7VIvk/kMpMcOniyZMGoMkeTBY3O/6Gj6DbJgvdJ6uqkvfOqOU4\n\tRP8o3/Kw==;", "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=leYrW6L0ZAgin3ZE6IBF4T1AHRveuovX/Zppbk5tYX0=;\n\tb=j+4lTOQltgZ+smEkBmKTjvXaLZqAtgLVsu5bj/O6S/VrHeH+Sfr48Wqo3UCJBp4Ah+\n\th3Uau5W4dwdo4ubpSbh5ANhgfzhpn2WFAp5MgiuCtXAJXC8/y/eWfcqJxArUx7gAP4X1\n\tiR4xk4ZyMjg4GBeu5opA1oHrmKpK5/E0EZLKWyTrLUKeRnOPcEeODcjtDeYMXu4Csh9J\n\t9F1nIM7Qa0JUPPt4f8aiEW/rt7wP92dsSfZTIoO/fh33FKUGPYy/XZT+b5Jro7BcWGi9\n\tVSNDXo2HpRa6b7Gt86EU5FHtGrzrr/cESaDiNyVt8jKeETXhqWG6lqQy8MnxRYu1OQ9q\n\tkufg==" ], "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=leYrW6L0ZAgin3ZE6IBF4T1AHRveuovX/Zppbk5tYX0=;\n\tb=lks7sRP1yoPUzvA9CSsFxdl6/6LoTbGIzugfmIERLIK+/yeVzto16BdFkkelhBiu6p\n\t5NERt6gyGfdLkyzFBPdjc8Vk5KCHOmKhW4m2tAVJeyL9MSIW1rWrZG8TjTeSNvcjaYn+\n\tnCEQV/u1KjaYrQzEDnD9v1UrUbfsj5gpQrf/ebZcsvB5vmwEFS+5M6FV5Qzc47PPgmcT\n\tSl+Pax5TmRCLixd/+706+2BekRpV9hJV+qGxKusCq3xnmGjeLUXci7nUqXwvvq5tNhIV\n\t5+pYYzwPJNu+nUt66EULnr2MGpnNPqoEPSaCSBjXyDqPZOB+xM6qqy5UTP2L7bWYPsw9\n\tB1Dw==", "X-Gm-Message-State": "AHPjjUjX59K+cBTMYuNSInHIvHdZZki60HXaW3o9XdwBikYQqlrxAFbX\n\tMh2GocahsroPldsVFxPkktc=", "X-Google-Smtp-Source": "AOwi7QCuZrYWjFlTk6VAnjoV4RNmAdRDCKjWHnUIqtUUP0EBxrSoKQSMpXuCu34A1JUFXlARvJVSoQ==", "X-Received": "by 10.28.15.210 with SMTP id 201mr2181914wmp.10.1504884985380;\n\tFri, 08 Sep 2017 08:36:25 -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 07/10] iio:adc:at91-sama5d2: Support backup mode", "Date": "Fri, 8 Sep 2017 17:36:01 +0200", "Message-Id": "<20170908153604.28383-8-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_083646_327312_EDC963B4 ", "X-CRM114-Status": "GOOD ( 13.46 )", "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:c09:0:0:0:242 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": "Support the backup mode for platform suspend, by restoring the hardware\nregisters on resume.\n\nSigned-off-by: Romain Izard <romain.izard.pro@gmail.com>\n---\n drivers/iio/adc/at91-sama5d2_adc.c | 71 ++++++++++++++++++++++++++++++++------\n 1 file changed, 61 insertions(+), 10 deletions(-)", "diff": "diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c\nindex e10dca3ed74b..f9718c863363 100644\n--- a/drivers/iio/adc/at91-sama5d2_adc.c\n+++ b/drivers/iio/adc/at91-sama5d2_adc.c\n@@ -200,6 +200,7 @@ struct at91_adc_state {\n \tu32\t\t\t\tconversion_value;\n \tstruct at91_adc_soc_info\tsoc_info;\n \twait_queue_head_t\t\twq_data_available;\n+\tunsigned int\t\t\tcurrent_rate;\n \t/*\n \t * lock to prevent concurrent 'single conversion' requests through\n \t * sysfs.\n@@ -269,6 +270,8 @@ static void at91_adc_setup_samp_freq(struct at91_adc_state *st, unsigned freq)\n \tmr |= AT91_SAMA5D2_MR_PRESCAL(prescal);\n \tat91_adc_writel(st, AT91_SAMA5D2_MR, mr);\n \n+\tst->current_rate = freq;\n+\n \tdev_dbg(&indio_dev->dev, \"freq: %u, startup: %u, prescal: %u\\n\",\n \t\tfreq, startup, prescal);\n }\n@@ -375,7 +378,9 @@ static int at91_adc_write_raw(struct iio_dev *indio_dev,\n \t val > st->soc_info.max_sample_rate)\n \t\treturn -EINVAL;\n \n+\tmutex_lock(&st->lock);\n \tat91_adc_setup_samp_freq(st, val);\n+\tmutex_unlock(&st->lock);\n \n \treturn 0;\n }\n@@ -386,6 +391,21 @@ static const struct iio_info at91_adc_info = {\n \t.driver_module = THIS_MODULE,\n };\n \n+static void at91_adc_init_hw(struct at91_adc_state *st, unsigned int freq)\n+{\n+\tat91_adc_writel(st, AT91_SAMA5D2_CR, AT91_SAMA5D2_CR_SWRST);\n+\tat91_adc_writel(st, AT91_SAMA5D2_IDR, 0xffffffff);\n+\t/*\n+\t * Transfer field must be set to 2 according to the datasheet and\n+\t * allows different analog settings for each channel.\n+\t */\n+\tat91_adc_writel(st, AT91_SAMA5D2_MR,\n+\t\t\tAT91_SAMA5D2_MR_TRANSFER(2) | AT91_SAMA5D2_MR_ANACH);\n+\n+\tat91_adc_setup_samp_freq(st, freq);\n+\n+}\n+\n static int at91_adc_probe(struct platform_device *pdev)\n {\n \tstruct iio_dev *indio_dev;\n@@ -482,16 +502,7 @@ static int at91_adc_probe(struct platform_device *pdev)\n \t\tgoto vref_disable;\n \t}\n \n-\tat91_adc_writel(st, AT91_SAMA5D2_CR, AT91_SAMA5D2_CR_SWRST);\n-\tat91_adc_writel(st, AT91_SAMA5D2_IDR, 0xffffffff);\n-\t/*\n-\t * Transfer field must be set to 2 according to the datasheet and\n-\t * allows different analog settings for each channel.\n-\t */\n-\tat91_adc_writel(st, AT91_SAMA5D2_MR,\n-\t\t\tAT91_SAMA5D2_MR_TRANSFER(2) | AT91_SAMA5D2_MR_ANACH);\n-\n-\tat91_adc_setup_samp_freq(st, st->soc_info.min_sample_rate);\n+\tat91_adc_init_hw(st, st->soc_info.min_sample_rate);\n \n \tret = clk_prepare_enable(st->per_clk);\n \tif (ret)\n@@ -541,12 +552,52 @@ static const struct of_device_id at91_adc_dt_match[] = {\n };\n MODULE_DEVICE_TABLE(of, at91_adc_dt_match);\n \n+#ifdef CONFIG_PM_SLEEP\n+static int at91_adc_suspend(struct device *dev)\n+{\n+\tstruct platform_device *pdev = to_platform_device(dev);\n+\tstruct iio_dev *indio_dev = platform_get_drvdata(pdev);\n+\tstruct at91_adc_state *st = iio_priv(indio_dev);\n+\n+\tclk_disable_unprepare(st->per_clk);\n+\n+\tregulator_disable(st->vref);\n+\tregulator_disable(st->reg);\n+\n+\treturn 0;\n+}\n+\n+static int at91_adc_resume(struct device *dev)\n+{\n+\tstruct platform_device *pdev = to_platform_device(dev);\n+\tstruct iio_dev *indio_dev = platform_get_drvdata(pdev);\n+\tstruct at91_adc_state *st = iio_priv(indio_dev);\n+\tint err;\n+\n+\terr = regulator_enable(st->reg);\n+\tif (err)\n+\t\treturn err;\n+\n+\terr = regulator_enable(st->vref);\n+\tif (err)\n+\t\treturn err;\n+\n+\tat91_adc_init_hw(st, st->current_rate);\n+\n+\terr = clk_prepare_enable(st->per_clk);\n+\treturn err;\n+}\n+#endif\n+\n+static SIMPLE_DEV_PM_OPS(at91_adc_pm_ops, at91_adc_suspend, at91_adc_resume);\n+\n static struct platform_driver at91_adc_driver = {\n \t.probe = at91_adc_probe,\n \t.remove = at91_adc_remove,\n \t.driver = {\n \t\t.name = \"at91-sama5d2_adc\",\n \t\t.of_match_table = at91_adc_dt_match,\n+\t\t.pm = &at91_adc_pm_ops,\n \t},\n };\n module_platform_driver(at91_adc_driver)\n", "prefixes": [ "v1", "07/10" ] }