get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 928,
    "url": "http://patchwork.ozlabs.org/api/patches/928/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20080922194357.GA32041@pengutronix.de/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<20080922194357.GA32041@pengutronix.de>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20080922194357.GA32041@pengutronix.de/",
    "date": "2008-09-22T19:43:57",
    "name": "[RFC] GPIO-Watchdog in devicetree",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "f5bedc547a22901ae2b0426f65af9c8a8e3dd10e",
    "submitter": {
        "id": 263,
        "url": "http://patchwork.ozlabs.org/api/people/263/?format=api",
        "name": "Wolfram Sang",
        "email": "w.sang@pengutronix.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20080922194357.GA32041@pengutronix.de/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/928/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/928/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@ozlabs.org"
        ],
        "Received": [
            "from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id CA2C7DE56B\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 23 Sep 2008 05:44:21 +1000 (EST)",
            "from metis.extern.pengutronix.de (metis.extern.pengutronix.de\n\t[83.236.181.26]) by ozlabs.org (Postfix) with ESMTP id 7831ADDEE4\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 23 Sep 2008 05:44:02 +1000 (EST)",
            "from octopus.labnet.pengutronix.de ([10.1.1.3])\n\tby metis.extern.pengutronix.de with esmtp (Exim 4.63)\n\t(envelope-from <wsa@pengutronix.de>) id 1KhrK9-0002zP-OA\n\tfor linuxppc-dev@ozlabs.org; Mon, 22 Sep 2008 21:43:57 +0200",
            "from wsa by octopus.labnet.pengutronix.de with local (Exim 4.69)\n\t(envelope-from <wsa@pengutronix.de>) id 1KhrK9-0008Mo-DL\n\tfor linuxppc-dev@ozlabs.org; Mon, 22 Sep 2008 21:43:57 +0200"
        ],
        "Date": "Mon, 22 Sep 2008 21:43:57 +0200",
        "From": "Wolfram Sang <w.sang@pengutronix.de>",
        "To": "linuxppc-dev@ozlabs.org",
        "Subject": "[RFC] GPIO-Watchdog in devicetree",
        "Message-ID": "<20080922194357.GA32041@pengutronix.de>",
        "MIME-Version": [
            "1.0",
            "1.0"
        ],
        "User-Agent": "Mutt/1.5.18 (2008-05-17)",
        "X-SA-Exim-Connect-IP": "10.1.1.3",
        "X-SA-Exim-Mail-From": "wsa@pengutronix.de",
        "X-SA-Exim-Scanned": "No (on metis.extern.pengutronix.de);\n\tSAEximRunCond expanded to false",
        "X-BeenThere": "linuxppc-dev@ozlabs.org",
        "X-Mailman-Version": "2.1.11",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>",
        "List-Unsubscribe": "<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://ozlabs.org/pipermail/linuxppc-dev>",
        "List-Post": "<mailto:linuxppc-dev@ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@ozlabs.org?subject=help>",
        "List-Subscribe": "<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>",
        "Content-Type": "multipart/mixed; boundary=\"===============1256704977==\"",
        "Mime-version": [
            "1.0",
            "1.0"
        ],
        "Sender": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org"
    },
    "content": "Hello all,\n\nI understood that the device-tree is for describing hardware and should\nnot contain driver specific information. I have problems drawing this\nline right now. I made a driver for watchdogs which are pinged by\ntoggling a gpio. Currently the device-tree entry looks like this:\n\n\twatchdog@gpio {\n\t\tcompatible = \"gpio-watchdog\";\n\t\tgpios =\t<&gpio_simple 19 0>;\n\t};\n\nThen, there are two module parameters. One to define the initial state of\nthe gpio (0 or 1), one to define the length of the pulse when serving\nthe watchdog (default 1 us). Now my question is:\n\nIs it plausible to say that the module parameters would also fit to the\ndevice-tree as properties? Recently, I tend to say so as otherwise the\ndescription of the watchdog is incomplete. Then again, one might argue\nto develop a specific watchdog driver instead of a generic one, and use\nsomething like compatible = \"<myvendor>, <mywatchdog>\" which would\nresult in lots of duplicated code per watchdog. So, which way to go? I\nam really undecided and would be happy to hear opinions.\n\nFor completeness, I'll append the current version of my driver.\n\nAll the best,\n\n   Wolfram",
    "diff": "===\n\nFrom; Wolfram Sang <w.sang@pengutronix.de>\nSubject; of-driver for external gpio-triggered watchdogs\n\nStill needs tests and review before it can go mainline.\n\nSigned-off-by: Wolfram Sang <w.sang@pengutronix.de>\n---\n drivers/watchdog/Kconfig       |    8 +\n drivers/watchdog/Makefile      |    1 \n drivers/watchdog/of_gpio_wdt.c |  188 +++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 197 insertions(+)\n\nIndex: drivers/watchdog/Kconfig\n===================================================================\n--- drivers/watchdog/Kconfig.orig\n+++ drivers/watchdog/Kconfig\n@@ -55,6 +55,14 @@\n \t  To compile this driver as a module, choose M here: the\n \t  module will be called softdog.\n \n+config OF_GPIO_WDT\n+\ttristate \"OF GPIO watchdog\"\n+\thelp\n+\t  This driver handles external watchdogs which are triggered by a gpio.\n+\n+\t  To compile this driver as a module, choose M here: the\n+\t  module will be called of_gpio_wdt.\n+\n # ALPHA Architecture\n \n # ARM Architecture\nIndex: drivers/watchdog/Makefile\n===================================================================\n--- drivers/watchdog/Makefile.orig\n+++ drivers/watchdog/Makefile\n@@ -124,4 +124,5 @@\n # XTENSA Architecture\n \n # Architecture Independant\n+obj-$(CONFIG_OF_GPIO_WDT) += of_gpio_wdt.o\n obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o\nIndex: drivers/watchdog/of_gpio_wdt.c\n===================================================================\n--- /dev/null\n+++ drivers/watchdog/of_gpio_wdt.c\n@@ -0,0 +1,188 @@\n+/*\n+ * of_gpio_wdt.c - driver for gpio-driven watchdogs\n+ *\n+ * Copyright (C) 2008 Pengutronix e.K.\n+ *\n+ * Author: Wolfram Sang <w.sang@pengutronix.de>\n+ *\n+ * This program is free software; you can redistribute it and/or modify it\n+ * under the terms of  the GNU General Public License as published by the\n+ * Free Software Foundation; version 2 of the License.\n+ *\n+ */\n+\n+#include <linux/init.h>\n+#include <linux/kernel.h>\n+#include <linux/miscdevice.h>\n+#include <linux/of_platform.h>\n+#include <linux/of_gpio.h>\n+#include <linux/fs.h>\n+#include <linux/module.h>\n+#include <linux/watchdog.h>\n+#include <linux/gpio.h>\n+#include <linux/io.h>\n+#include <linux/uaccess.h>\n+\n+#define DRIVER_NAME \"of-gpio-wdt\"\n+\n+\n+static int wdt_gpio;\n+\n+static int wdt_init_state;\n+module_param(wdt_init_state, bool, 0);\n+MODULE_PARM_DESC(wdt_init_state,\n+\t\"Initial state of the gpio pin (0/1), default = 0\");\n+\n+static int wdt_toggle_delay = 1;\n+module_param(wdt_toggle_delay, int, 0);\n+MODULE_PARM_DESC(wdt_toggle_delay,\n+\t\"Delay in us to keep the gpio triggered, default = 1\");\n+\n+static void of_gpio_wdt_ping(void)\n+{\n+\tgpio_set_value(wdt_gpio, wdt_init_state ^ 1);\n+\tudelay(wdt_toggle_delay);\n+\tgpio_set_value(wdt_gpio, wdt_init_state);\n+}\n+\n+static ssize_t of_gpio_wdt_write(struct file *file, const char __user *buf,\n+\t\t\t\t size_t count, loff_t *ppos)\n+{\n+\tif (count)\n+\t\tof_gpio_wdt_ping();\n+\treturn count;\n+}\n+\n+static int of_gpio_wdt_open(struct inode *inode, struct file *file)\n+{\n+\tof_gpio_wdt_ping();\n+\treturn nonseekable_open(inode, file);\n+}\n+\n+static int of_gpio_wdt_release(struct inode *inode, struct file *file)\n+{\n+\tprintk(KERN_CRIT \"Unexpected close on watchdog device. \"\n+\t\t\t \"File is closed, but watchdog is still running!\\n\");\n+\treturn 0;\n+}\n+\n+static int of_gpio_wdt_ioctl(struct inode *inode, struct file *file,\n+\t\t\t\tunsigned int cmd, unsigned long arg)\n+{\n+\tvoid __user *argp = (void __user *)arg;\n+\tstatic struct watchdog_info ident = {\n+\t\t.options = WDIOF_KEEPALIVEPING,\n+\t\t.firmware_version = 0,\n+\t\t.identity = DRIVER_NAME,\n+\t};\n+\n+\tswitch (cmd) {\n+\n+\tcase WDIOC_GETSUPPORT:\n+\t\tif (copy_to_user(argp, &ident, sizeof(ident)))\n+\t\t\treturn -EFAULT;\n+\t\tbreak;\n+\n+\tcase WDIOC_KEEPALIVE:\n+\t\tof_gpio_wdt_ping();\n+\t\tbreak;\n+\n+\tcase WDIOC_GETTEMP:\n+\tcase WDIOC_GETTIMEOUT:\n+\tcase WDIOC_SETOPTIONS:\n+\tcase WDIOC_SETTIMEOUT:\n+\t\treturn -EOPNOTSUPP;\n+\n+\tdefault:\n+\t\treturn -ENOTTY;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static const struct file_operations of_gpio_wdt_fops = {\n+\t.owner\t\t= THIS_MODULE,\n+\t.llseek\t\t= no_llseek,\n+\t.write\t\t= of_gpio_wdt_write,\n+\t.ioctl\t\t= of_gpio_wdt_ioctl,\n+\t.open\t\t= of_gpio_wdt_open,\n+\t.release\t= of_gpio_wdt_release,\n+};\n+\n+static struct miscdevice of_gpio_wdt_miscdev = {\n+\t.minor\t= WATCHDOG_MINOR,\n+\t.name\t= \"watchdog\",\n+\t.fops\t= &of_gpio_wdt_fops,\n+};\n+\n+static int __devinit of_gpio_wdt_probe(struct of_device *op,\n+\t\t\tconst struct of_device_id *match)\n+{\n+\tint ret;\n+\n+\twdt_gpio = of_get_gpio(op->node, 0);\n+\tif (wdt_gpio < 0) {\n+\t\tdev_err(&op->dev, \"could not determine gpio! (err=%d)\\n\",\n+\t\t\twdt_gpio);\n+\t\treturn wdt_gpio;\n+\t}\n+\n+\tret = gpio_request(wdt_gpio, DRIVER_NAME);\n+\tif (ret) {\n+\t\tdev_err(&op->dev, \"could not get gpio! (err=%d)\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tgpio_direction_output(wdt_gpio, wdt_init_state);\n+\n+\tret = misc_register(&of_gpio_wdt_miscdev);\n+\tif (ret) {\n+\t\tdev_err(&op->dev, \"cannot register miscdev on minor=%d \"\n+\t\t\t\t\"(err=%d)\\n\", WATCHDOG_MINOR, ret);\n+\t\tgpio_free(wdt_gpio);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tdev_info(&op->dev, \"gpio-watchdog driver started using gpio %d.\\n\",\n+\t\twdt_gpio);\n+\treturn 0;\n+}\n+\n+static int __devexit of_gpio_wdt_remove(struct of_device *op)\n+{\n+\tmisc_deregister(&of_gpio_wdt_miscdev);\n+\tgpio_free(wdt_gpio);\n+\treturn 0;\n+}\n+\n+static struct of_device_id of_gpio_wdt_match[] = {\n+\t{ .compatible = \"gpio-watchdog\", },\n+\t{},\n+};\n+MODULE_DEVICE_TABLE(of, of_gpio_wdt_match);\n+\n+static struct of_platform_driver of_gpio_wdt_driver = {\n+\t.owner = THIS_MODULE,\n+\t.name = DRIVER_NAME,\n+\t.match_table = of_gpio_wdt_match,\n+\t.probe = of_gpio_wdt_probe,\n+\t.remove = __devexit_p(of_gpio_wdt_remove),\n+};\n+\n+static int __init of_gpio_wdt_init(void)\n+{\n+\treturn of_register_platform_driver(&of_gpio_wdt_driver);\n+}\n+\n+static void __exit of_gpio_wdt_exit(void)\n+{\n+\tof_unregister_platform_driver(&of_gpio_wdt_driver);\n+}\n+\n+module_init(of_gpio_wdt_init);\n+module_exit(of_gpio_wdt_exit);\n+\n+MODULE_AUTHOR(\"Wolfram Sang <w.sang@pengutronix.de>\");\n+MODULE_DESCRIPTION(\"Driver for gpio-triggered watchdogs\");\n+MODULE_LICENSE(\"GPL v2\");\n+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);\n",
    "prefixes": [
        "RFC"
    ]
}