Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/814492/?format=api
{ "id": 814492, "url": "http://patchwork.ozlabs.org/api/patches/814492/?format=api", "web_url": "http://patchwork.ozlabs.org/project/devicetree-bindings/patch/20170916104220.3742-10-fancer.lancer@gmail.com/", "project": { "id": 37, "url": "http://patchwork.ozlabs.org/api/projects/37/?format=api", "name": "Devicetree Bindings", "link_name": "devicetree-bindings", "list_id": "devicetree.vger.kernel.org", "list_email": "devicetree@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170916104220.3742-10-fancer.lancer@gmail.com>", "list_archive_url": null, "date": "2017-09-16T10:42:20", "name": "[9/9,v2] usb: usb251xb: Use GPIO descriptor consumer interface", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "b09a9b2060052591279e49907955d734ba4e5bfb", "submitter": { "id": 70038, "url": "http://patchwork.ozlabs.org/api/people/70038/?format=api", "name": "Serge Semin", "email": "fancer.lancer@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/devicetree-bindings/patch/20170916104220.3742-10-fancer.lancer@gmail.com/mbox/", "series": [ { "id": 3430, "url": "http://patchwork.ozlabs.org/api/series/3430/?format=api", "web_url": "http://patchwork.ozlabs.org/project/devicetree-bindings/list/?series=3430", "date": "2017-09-16T10:42:11", "name": "usb: usb251xb: Add USB2517i hub support and fix some bugs", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/3430/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/814492/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/814492/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<devicetree-owner@vger.kernel.org>", "X-Original-To": "incoming-dt@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming-dt@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"NJ10JNte\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xvTQQ3PKrz9t30\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 20:43:42 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751503AbdIPKn0 (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tSat, 16 Sep 2017 06:43:26 -0400", "from mail-lf0-f67.google.com ([209.85.215.67]:38655 \"EHLO\n\tmail-lf0-f67.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751365AbdIPKmd (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Sat, 16 Sep 2017 06:42:33 -0400", "by mail-lf0-f67.google.com with SMTP id m199so2326353lfe.5;\n\tSat, 16 Sep 2017 03:42:32 -0700 (PDT)", "from linux.local ([95.79.181.62]) by smtp.gmail.com with ESMTPSA id\n\tf199sm553379lfg.85.2017.09.16.03.42.30\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tSat, 16 Sep 2017 03:42:31 -0700 (PDT)" ], "DKIM-Signature": "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=Ks72+wqK7YGG7xcjPJO468pSrOWMQo3rUJJ3XwxrDkc=;\n\tb=NJ10JNte//l09EgPbJ7+0Rq1ytUhXDh1xtjcMw8ywdHuKUdULdBrive1nfqfQyZzcS\n\t1lkbDw3J+ICyz75wVyqTuY1y2DwkTGg/eXJlWTEYAhR6MMDOEIT9r51knILSfFxZ6qBc\n\tRM+R9WDBWO8OPSmWC9Um01hF2pWFNaoSWscwL4zjVdO5YXFNy3/bzkrheTtFEYIBzLGO\n\tI1p22405B0yPk33cVsOLR24mHLkaeSB/Ok/0RG9V7tvdtxBrPMJhcqCH0WrDhnJs3vX5\n\tdYg8E7X0zumBjaxZpd/xHLHj9iSWA27OJMCNTG9rJvZ7+ZXX71LLDAXHTuTXr+QAnDJc\n\tRAsA==", "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=Ks72+wqK7YGG7xcjPJO468pSrOWMQo3rUJJ3XwxrDkc=;\n\tb=ICroH1qO5UFywYVD66KWXF8JliJlQBlYA+oFnhrjuaBAliOQC4G7ZGFeEXgpaoFbTt\n\tSPrvKv6CdJPfIHCBF2NBal6bnT/637cAZ9TiMuzm34+EYChr17wlTUkDj3VmGEaDFA1U\n\tzSDQEso3gyc+174VQTk/mi2LlYY8R1h4ATbicgq1nOmTjcZ7xfVt2FSDltjfgfQ3oIIz\n\tjTp1Bh8wqpVeIwzW+Fs5A7Qlx2Y2FvDe+jbgv/VcLQMi7WElmdBBnfb7AmWXwVUkAwpX\n\trzW5ZZFLNDzuFbp3EBfJMzpWkt6FG7Oom335u5AQuWavh4mWvZXZT0KSqVyoLCYRwWCI\n\t4E3Q==", "X-Gm-Message-State": "AHPjjUjuI4v+7BnbNdMNqL3aY8N3Eoyf0aLXUAyRYNUItKfq/D/ylgBN\n\tb6x9HQprX159zUB2qGI=", "X-Google-Smtp-Source": "AOwi7QDXR0W1+ILdi1ddYkBiRNglEIcHLEf8J4bDikl7wj4vbaKN9lgkw1kPFBkjh+BnMM2iOgRnHg==", "X-Received": "by 10.46.19.26 with SMTP id 26mr10690849ljt.20.1505558551926;\n\tSat, 16 Sep 2017 03:42:31 -0700 (PDT)", "From": "Serge Semin <fancer.lancer@gmail.com>", "To": "richard.leitner@skidata.com, gregkh@linuxfoundation.org,\n\trobh+dt@kernel.org, mark.rutland@arm.com", "Cc": "Sergey.Semin@t-platforms.ru, linux-usb@vger.kernel.org,\n\tdevicetree@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tSerge Semin <fancer.lancer@gmail.com>", "Subject": "[PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer interface", "Date": "Sat, 16 Sep 2017 13:42:20 +0300", "Message-Id": "<20170916104220.3742-10-fancer.lancer@gmail.com>", "X-Mailer": "git-send-email 2.12.0", "In-Reply-To": "<20170916104220.3742-1-fancer.lancer@gmail.com>", "References": "<20170915233113.17855-1-fancer.lancer@gmail.com>\n\t<20170916104220.3742-1-fancer.lancer@gmail.com>", "Sender": "devicetree-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<devicetree.vger.kernel.org>", "X-Mailing-List": "devicetree@vger.kernel.org" }, "content": "The driver used to be developed with legacy GPIO API support. It's\nbetter to use descriptor-based interface for several reasons. First\nof all the legacy API doesn't support the ACTIVE_LOW/HIGH flag of dts\nnodes, which is essential since different hardware may have different\nGPIOs connectivity including the logical value inversion. Secondly,\nby requesting the reset GPIO descriptor the driver prevent the other\napplications from changing its value. And last but not least the\nlegacy GPIO interface should be avoided in the new code due to it\nobsolescence.\n\nSigned-off-by: Serge Semin <fancer.lancer@gmail.com>\n---\n Documentation/devicetree/bindings/usb/usb251xb.txt | 2 +-\n drivers/usb/misc/usb251xb.c | 34 +++++++++-------------\n 2 files changed, 15 insertions(+), 21 deletions(-)", "diff": "diff --git a/Documentation/devicetree/bindings/usb/usb251xb.txt b/Documentation/devicetree/bindings/usb/usb251xb.txt\nindex dd59a32e7..7c981d556 100644\n--- a/Documentation/devicetree/bindings/usb/usb251xb.txt\n+++ b/Documentation/devicetree/bindings/usb/usb251xb.txt\n@@ -8,10 +8,10 @@ Required properties :\n \t\"microchip,usb2512b\", \"microchip,usb2512bi\", \"microchip,usb2513b\",\n \t\"microchip,usb2513bi\", \"microchip,usb2514b\", \"microchip,usb2514bi\",\n \t\"microchip,usb2517\", \"microchip,usb2517i\"\n- - reset-gpios : Should specify the gpio for hub reset\n - reg : I2C address on the selected bus (default is <0x2C>)\n \n Optional properties :\n+ - reset-gpios : Should specify the gpio for hub reset\n - skip-config : Skip Hub configuration, but only send the USB-Attach command\n - vendor-id : Set USB Vendor ID of the hub (16 bit, default is 0x0424)\n - product-id : Set USB Product ID of the hub (16 bit, default depends on type)\ndiff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c\nindex 71994b883..c2dd9742f 100644\n--- a/drivers/usb/misc/usb251xb.c\n+++ b/drivers/usb/misc/usb251xb.c\n@@ -3,6 +3,7 @@\n * Configuration via SMBus.\n *\n * Copyright (c) 2017 SKIDATA AG\n+ * Copyright (c) 2017 T-platforms\n *\n * This work is based on the USB3503 driver by Dongjin Kim and\n * a not-accepted patch by Fabien Lahoudere, see:\n@@ -20,12 +21,11 @@\n */\n \n #include <linux/delay.h>\n-#include <linux/gpio.h>\n+#include <linux/gpio/consumer.h>\n #include <linux/i2c.h>\n #include <linux/module.h>\n #include <linux/nls.h>\n #include <linux/of_device.h>\n-#include <linux/of_gpio.h>\n #include <linux/slab.h>\n \n /* Internal Register Set Addresses & Default Values acc. to DS00001692C */\n@@ -127,7 +127,7 @@ struct usb251xb {\n \tstruct device *dev;\n \tstruct i2c_client *i2c;\n \tu8 skip_config;\n-\tint gpio_reset;\n+\tstruct gpio_desc *gpio_reset;\n \tu16 vendor_id;\n \tu16 product_id;\n \tu16 device_id;\n@@ -235,13 +235,13 @@ static const struct usb251xb_data usb2517i_data = {\n \n static void usb251xb_reset(struct usb251xb *hub, int state)\n {\n-\tif (!gpio_is_valid(hub->gpio_reset))\n+\tif (!hub->gpio_reset)\n \t\treturn;\n \n-\tgpio_set_value_cansleep(hub->gpio_reset, state);\n+\tgpiod_set_value_cansleep(hub->gpio_reset, state);\n \n \t/* wait for hub recovery/stabilization */\n-\tif (state)\n+\tif (!state)\n \t\tusleep_range(500, 750);\t/* >=500us at power on */\n \telse\n \t\tusleep_range(1, 10);\t/* >=1us at power down */\n@@ -260,7 +260,7 @@ static int usb251xb_connect(struct usb251xb *hub)\n \t\ti2c_wb[0] = 0x01;\n \t\ti2c_wb[1] = USB251XB_STATUS_COMMAND_ATTACH;\n \n-\t\tusb251xb_reset(hub, 1);\n+\t\tusb251xb_reset(hub, 0);\n \n \t\terr = i2c_smbus_write_i2c_block_data(hub->i2c,\n \t\t\t\tUSB251XB_ADDR_STATUS_COMMAND, 2, i2c_wb);\n@@ -310,7 +310,7 @@ static int usb251xb_connect(struct usb251xb *hub)\n \ti2c_wb[USB251XB_ADDR_PORT_MAP_7] = hub->port_map7;\n \ti2c_wb[USB251XB_ADDR_STATUS_COMMAND] = USB251XB_STATUS_COMMAND_ATTACH;\n \n-\tusb251xb_reset(hub, 1);\n+\tusb251xb_reset(hub, 0);\n \n \t/* write registers */\n \tfor (i = 0; i < (USB251XB_I2C_REG_SZ / USB251XB_I2C_WRITE_SZ); i++) {\n@@ -363,19 +363,13 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,\n \telse\n \t\thub->skip_config = 0;\n \n-\thub->gpio_reset = of_get_named_gpio(np, \"reset-gpios\", 0);\n-\tif (hub->gpio_reset == -EPROBE_DEFER)\n+\thub->gpio_reset = devm_gpiod_get_optional(dev, \"reset\", GPIOD_OUT_HIGH);\n+\tif (PTR_ERR(hub->gpio_reset) == -EPROBE_DEFER) {\n \t\treturn -EPROBE_DEFER;\n-\tif (gpio_is_valid(hub->gpio_reset)) {\n-\t\terr = devm_gpio_request_one(dev, hub->gpio_reset,\n-\t\t\t\t\t GPIOF_OUT_INIT_LOW,\n-\t\t\t\t\t \"usb251xb reset\");\n-\t\tif (err) {\n-\t\t\tdev_err(dev,\n-\t\t\t\t\"unable to request GPIO %d as reset pin (%d)\\n\",\n-\t\t\t\thub->gpio_reset, err);\n-\t\t\treturn err;\n-\t\t}\n+\t} else if (IS_ERR(hub->gpio_reset)) {\n+\t\terr = PTR_ERR(hub->gpio_reset);\n+\t\tdev_err(dev, \"unable to request GPIO reset pin (%d)\\n\", err);\n+\t\treturn err;\n \t}\n \n \tif (of_property_read_u16_array(np, \"vendor-id\", &hub->vendor_id, 1))\n", "prefixes": [ "9/9", "v2" ] }