get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/811658/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 811658,
    "url": "http://patchwork.ozlabs.org/api/patches/811658/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170908153604.28383-9-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-9-romain.izard.pro@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-08T15:36:02",
    "name": "[v1,08/10] pwm: atmel-tcb: Support backup mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "93c682676178439e5c82911415f64b6a91550c07",
    "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-9-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/811658/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/811658/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=\"kNAKhv0b\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"TY6o7LVn\"; 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 3xphQc1skMz9t67\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  9 Sep 2017 01:42:16 +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 1dqLQ0-0002dG-9S; Fri, 08 Sep 2017 15:42:08 +0000",
            "from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dqLKo-00068q-0S; Fri, 08 Sep 2017 15:36:53 +0000",
            "by mail-wr0-x242.google.com with SMTP id g50so1407656wra.3;\n\tFri, 08 Sep 2017 08:36:27 -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.25\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Sep 2017 08:36:25 -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=USiH5aO4/OEJZbkuDtBkVsD/7EbCMEpcnKbJ7bbtJ1A=;\n\tb=kNAKhv0bDMel7tV64DGC/3As1k\n\t47gCQoIXkxlkCrHXv7SyN94fLvK1cqzJgOqVJ9JkLvEargOCtPy3D8LBTQ2AfhzOQBbwzCJzs9aWm\n\tbW4K+ASnmaBp59dZSKqctflHljOA/z4iECoW+gqAggzR/1O5m2i17LLblriJYbi4RoQD4gJ7lw59e\n\t+cN7BQL/BXduHH2MqXnYfNzBkx6mQQngxQkJuJjPcUlZUoPJY6J0bllirMzPtX+02A4WPNgkv1B7V\n\tY/HX9PJQZpsxicjItA+iM2LScKxPru8zf/XFUHorRN0xJvnemOeolHfquQdD0FVo/BsNmFXjsmOLF\n\tcpO4BjBQ==;",
            "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=NDApdviIu3Db8+b8uunR9YuI98yCLIzKvo6HtsMxdgo=;\n\tb=TY6o7LVn7upJV/xZG7/pwh21Y5X/pp1AjKZxOFKXBoqLCvSsEg++mumqANjWJwQlPa\n\tAl0tsecTQ4AUPovH1tVgSu3XA/DS7Cj1AHpi8w9b8gHtkTIQw3DlWLbkP95jl6ZohY75\n\tVRmSHCK6eW3Ylm7WHLH1iMxrCavEmu9Af/8c9jZ4cgrzkOW+1pFqEp8SoT8XypxuetwB\n\tkaXGu2n3DGivupzya66H03ZL9AoFFKoTKiow5W3PJJDmy5gL3eeEdT98I0sX4caY8qSM\n\tcR+GNLFlPAa1pzxx1SAO3gG4/4lJq8e83g69oAn7eKkfV9qyhrExHMCRXpINs7Q3M+pg\n\tufdA=="
        ],
        "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=NDApdviIu3Db8+b8uunR9YuI98yCLIzKvo6HtsMxdgo=;\n\tb=GWB2bx0GwLg7uC+kRaQOh7BJF3BEMyJeA+P0v/fXC24rW4HPnwPDWMghXChw47ZbN3\n\tJrBrAXdXEan1kBfPYLvFAi9gX+AJmQDwG4LodhZr+oU1CG984qjAQWJsFB09oOsb9ZLV\n\tArY9YaxItMhUNKeAzLRCh95WzFaN6Os8EPZ/TvwORkuu7JqUK2hcyKYzYckXLmNAwdGA\n\toCb+Cr57XRvfVGCBh95I82pJ9b9OhnXHnN9bwJnI7kUAhsAoPD0ndUwwYS8Xl+HXjzhe\n\tLxBcc05ibrc6NhmvCGDTi9unQ0JYrI1s7Q8n0i3gNFPUJviMFaPRfEYu1LED7cOttgqO\n\tD59Q==",
        "X-Gm-Message-State": "AHPjjUjX+oHqgwAgj8PqCTX6itE7QJPP+gZVM0cgZRNnqsY2q1rtXxnJ\n\tpCCdZMmana/25Q==",
        "X-Google-Smtp-Source": "ADKCNb6DntRxaG+4IaMIUDWaqhFd16uZqFk7iKuRXdfWIoxx3lusMdsQ/dZa6qIH2pU8xyXYNCtgWg==",
        "X-Received": "by 10.223.153.163 with SMTP id y32mr2616385wrb.8.1504884986460; \n\tFri, 08 Sep 2017 08:36:26 -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 08/10] pwm: atmel-tcb: Support backup mode",
        "Date": "Fri,  8 Sep 2017 17:36:02 +0200",
        "Message-Id": "<20170908153604.28383-9-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_611485_6680139C ",
        "X-CRM114-Status": "GOOD (  15.79  )",
        "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: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": "Save and restore registers for the PWM on suspend and resume, which\nmakes hibernation and backup modes possible.\n\nSigned-off-by: Romain Izard <romain.izard.pro@gmail.com>\n---\n drivers/pwm/pwm-atmel-tcb.c | 63 +++++++++++++++++++++++++++++++++++++++++++--\n 1 file changed, 61 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c\nindex 75db585a2a94..acd3ce8ecf3f 100644\n--- a/drivers/pwm/pwm-atmel-tcb.c\n+++ b/drivers/pwm/pwm-atmel-tcb.c\n@@ -37,11 +37,20 @@ struct atmel_tcb_pwm_device {\n \tunsigned period;\t\t/* PWM period expressed in clk cycles */\n };\n \n+struct atmel_tcb_channel {\n+\tu32 enabled;\n+\tu32 cmr;\n+\tu32 ra;\n+\tu32 rb;\n+\tu32 rc;\n+};\n+\n struct atmel_tcb_pwm_chip {\n \tstruct pwm_chip chip;\n \tspinlock_t lock;\n \tstruct atmel_tc *tc;\n \tstruct atmel_tcb_pwm_device *pwms[NPWM];\n+\tstruct atmel_tcb_channel bkup[NPWM / 2];\n };\n \n static inline struct atmel_tcb_pwm_chip *to_tcb_chip(struct pwm_chip *chip)\n@@ -175,12 +184,15 @@ static void atmel_tcb_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)\n \t * Use software trigger to apply the new setting.\n \t * If both PWM devices in this group are disabled we stop the clock.\n \t */\n-\tif (!(cmr & (ATMEL_TC_ACPC | ATMEL_TC_BCPC)))\n+\tif (!(cmr & (ATMEL_TC_ACPC | ATMEL_TC_BCPC))) {\n \t\t__raw_writel(ATMEL_TC_SWTRG | ATMEL_TC_CLKDIS,\n \t\t\t     regs + ATMEL_TC_REG(group, CCR));\n-\telse\n+\t\ttcbpwmc->bkup[group].enabled = 1;\n+\t} else {\n \t\t__raw_writel(ATMEL_TC_SWTRG, regs +\n \t\t\t     ATMEL_TC_REG(group, CCR));\n+\t\ttcbpwmc->bkup[group].enabled = 0;\n+\t}\n \n \tspin_unlock(&tcbpwmc->lock);\n }\n@@ -263,6 +275,7 @@ static int atmel_tcb_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)\n \t/* Use software trigger to apply the new setting */\n \t__raw_writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG,\n \t\t     regs + ATMEL_TC_REG(group, CCR));\n+\ttcbpwmc->bkup[group].enabled = 1;\n \tspin_unlock(&tcbpwmc->lock);\n \treturn 0;\n }\n@@ -445,10 +458,56 @@ static const struct of_device_id atmel_tcb_pwm_dt_ids[] = {\n };\n MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);\n \n+#ifdef CONFIG_PM_SLEEP\n+static int atmel_tcb_pwm_suspend(struct device *dev)\n+{\n+\tstruct platform_device *pdev = to_platform_device(dev);\n+\tstruct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);\n+\tvoid __iomem *base = tcbpwm->tc->regs;\n+\tint i;\n+\n+\tfor (i = 0; i < (NPWM / 2); i++) {\n+\t\tstruct atmel_tcb_channel *chan = &tcbpwm->bkup[i];\n+\n+\t\tchan->cmr = readl(base + ATMEL_TC_REG(i, CMR));\n+\t\tchan->ra = readl(base + ATMEL_TC_REG(i, RA));\n+\t\tchan->rb = readl(base + ATMEL_TC_REG(i, RB));\n+\t\tchan->rc = readl(base + ATMEL_TC_REG(i, RC));\n+\t}\n+\treturn 0;\n+}\n+\n+static int atmel_tcb_pwm_resume(struct device *dev)\n+{\n+\tstruct platform_device *pdev = to_platform_device(dev);\n+\tstruct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);\n+\tvoid __iomem *base = tcbpwm->tc->regs;\n+\tint i;\n+\n+\tfor (i = 0; i < (NPWM / 2); i++) {\n+\t\tstruct atmel_tcb_channel *chan = &tcbpwm->bkup[i];\n+\n+\t\twritel(chan->cmr, base + ATMEL_TC_REG(i, CMR));\n+\t\twritel(chan->ra, base + ATMEL_TC_REG(i, RA));\n+\t\twritel(chan->rb, base + ATMEL_TC_REG(i, RB));\n+\t\twritel(chan->rc, base + ATMEL_TC_REG(i, RC));\n+\t\tif (chan->enabled) {\n+\t\t\twritel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG,\n+\t\t\t\tbase + ATMEL_TC_REG(i, CCR));\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+#endif\n+\n+static SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend,\n+\t\t\t atmel_tcb_pwm_resume);\n+\n static struct platform_driver atmel_tcb_pwm_driver = {\n \t.driver = {\n \t\t.name = \"atmel-tcb-pwm\",\n \t\t.of_match_table = atmel_tcb_pwm_dt_ids,\n+\t\t.pm = &atmel_tcb_pwm_pm_ops,\n \t},\n \t.probe = atmel_tcb_pwm_probe,\n \t.remove = atmel_tcb_pwm_remove,\n",
    "prefixes": [
        "v1",
        "08/10"
    ]
}