Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/807551/?format=api
{ "id": 807551, "url": "http://patchwork.ozlabs.org/api/patches/807551/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/20170830094814.17758-5-hdegoede@redhat.com/", "project": { "id": 35, "url": "http://patchwork.ozlabs.org/api/projects/35/?format=api", "name": "Linux I2C development", "link_name": "linux-i2c", "list_id": "linux-i2c.vger.kernel.org", "list_email": "linux-i2c@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170830094814.17758-5-hdegoede@redhat.com>", "list_archive_url": null, "date": "2017-08-30T09:48:07", "name": "[v3,04/11] staging: typec: fusb302: Get max snk mv/ma/mw from device-properties", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f88cad47c967aa7f13794d0757443bdce2354b21", "submitter": { "id": 1893, "url": "http://patchwork.ozlabs.org/api/people/1893/?format=api", "name": "Hans de Goede", "email": "hdegoede@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-i2c/patch/20170830094814.17758-5-hdegoede@redhat.com/mbox/", "series": [ { "id": 564, "url": "http://patchwork.ozlabs.org/api/series/564/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/list/?series=564", "date": "2017-08-30T09:48:14", "name": "Hookup typec power-negotation to the PMIC and charger", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/564/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/807551/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807551/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-i2c-owner@vger.kernel.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@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=linux-i2c-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=hdegoede@redhat.com" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xj1450399z9sNn\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 19:51:33 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751704AbdH3Jsf (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 30 Aug 2017 05:48:35 -0400", "from mx1.redhat.com ([209.132.183.28]:60960 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751683AbdH3Jsc (ORCPT <rfc822;linux-i2c@vger.kernel.org>);\n\tWed, 30 Aug 2017 05:48:32 -0400", "from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 32BAA5F7B1;\n\tWed, 30 Aug 2017 09:48:32 +0000 (UTC)", "from shalem.localdomain.com (ovpn-116-238.ams2.redhat.com\n\t[10.36.116.238])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 9993D87C87;\n\tWed, 30 Aug 2017 09:48:28 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 32BAA5F7B1", "From": "Hans de Goede <hdegoede@redhat.com>", "To": "Darren Hart <dvhart@infradead.org>, Andy Shevchenko <andy@infradead.org>,\n\tWolfram Sang <wsa@the-dreams.de>, Sebastian Reichel <sre@kernel.org>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tGuenter Roeck <linux@roeck-us.net>,\n\tHeikki Krogerus <heikki.krogerus@linux.intel.com>", "Cc": "Hans de Goede <hdegoede@redhat.com>,\n\tplatform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-i2c@vger.kernel.org, Liam Breck <liam@networkimprov.net>,\n\tTony Lindgren <tony@atomide.com>, linux-pm@vger.kernel.org,\n\tdevel@driverdev.osuosl.org, Rob Herring <robh+dt@kernel.org>,\n\tFrank Rowand <frowand.list@gmail.com>, devicetree@vger.kernel.org,\n\t\"Yueyao (Nathan) Zhu\" <yueyao@google.com>", "Subject": "[PATCH v3 04/11] staging: typec: fusb302: Get max snk mv/ma/mw from\n\tdevice-properties", "Date": "Wed, 30 Aug 2017 11:48:07 +0200", "Message-Id": "<20170830094814.17758-5-hdegoede@redhat.com>", "In-Reply-To": "<20170830094814.17758-1-hdegoede@redhat.com>", "References": "<20170830094814.17758-1-hdegoede@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tWed, 30 Aug 2017 09:48:32 +0000 (UTC)", "Sender": "linux-i2c-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-i2c.vger.kernel.org>", "X-Mailing-List": "linux-i2c@vger.kernel.org" }, "content": "This is board specific info so it should come from board config, such\nas devicetree.\n\nI've chosen to prefix these with \"fcs,\" treating them as fusb302 driver\nspecific for now. We may want to revisit this and replace these with\nproperties which are part of a (to be written) generic type-c controller\ndevicetree binding.\n\nSince this commit adds new dt-properties it also adds devicetree-bindings\ndocumentation (which so far was absent for the fusb302 driver).\n\nCc: Rob Herring <robh+dt@kernel.org>\nCc: Frank Rowand <frowand.list@gmail.com>\nCc: devicetree@vger.kernel.org\nCc: \"Yueyao (Nathan) Zhu\" <yueyao@google.com>\nSigned-off-by: Hans de Goede <hdegoede@redhat.com>\nAcked-by: Rob Herring <robh@kernel.org>\n---\nChanges in v2:\n-Use micro... instead of mili...\n-Add devicetree bindings documentation\n\nChanges in v3:\n-Use sink rather then snk in property names\n-Add Rob's Acked-by\n---\n .../devicetree/bindings/usb/fcs,fusb302.txt | 29 ++++++++++++++++++++++\n drivers/staging/typec/fusb302/TODO | 4 +++\n drivers/staging/typec/fusb302/fusb302.c | 18 +++++++++++++-\n 3 files changed, 50 insertions(+), 1 deletion(-)\n create mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.txt", "diff": "diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt\nnew file mode 100644\nindex 000000000000..472facfa5a71\n--- /dev/null\n+++ b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt\n@@ -0,0 +1,29 @@\n+Fairchild FUSB302 Type-C Port controllers\n+\n+Required properties :\n+- compatible : \"fcs,fusb302\"\n+- reg : I2C slave address\n+- interrupts : Interrupt specifier\n+\n+Optional properties :\n+- fcs,max-sink-microvolt : Maximum voltage to negotiate when configured as sink\n+- fcs,max-sink-microamp : Maximum current to negotiate when configured as sink\n+- fcs,max-sink-microwatt : Maximum power to negotiate when configured as sink\n+\t\t\t If this is less then max-sink-microvolt *\n+\t\t\t max-sink-microamp then the configured current will\n+\t\t\t be clamped.\n+- fcs,operating-sink-microwatt :\n+\t\t\t Minimum amount of power accepted from a sink\n+\t\t\t when negotiating\n+\n+Example:\n+\n+fusb302: typec-portc@54 {\n+\tcompatible = \"fcs,fusb302\";\n+\treg = <0x54>;\n+\tinterrupt-parent = <&nmi_intc>;\n+\tinterrupts = <0 IRQ_TYPE_LEVEL_LOW>;\n+\tfcs,max-sink-microvolt = <12000000>;\n+\tfcs,max-sink-microamp = <3000000>;\n+\tfcs,max-sink-microwatt = <36000000>;\n+};\ndiff --git a/drivers/staging/typec/fusb302/TODO b/drivers/staging/typec/fusb302/TODO\nindex 4933a1d92c32..19b466eb585d 100644\n--- a/drivers/staging/typec/fusb302/TODO\n+++ b/drivers/staging/typec/fusb302/TODO\n@@ -4,3 +4,7 @@ fusb302:\n - Find a non-hacky way to coordinate between PM and I2C access\n - Documentation? The FUSB302 datasheet provides information on the chip to help\n understand the code. But it may still be helpful to have a documentation.\n+- We may want to replace the \"fcs,max-snk-microvolt\", \"fcs,max-snk-microamp\",\n+ \"fcs,max-snk-microwatt\" and \"fcs,operating-snk-microwatt\" device(tree)\n+ properties with properties which are part of a generic type-c controller\n+ devicetree binding.\ndiff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c\nindex 6baed06a3c0d..1c1751c994db 100644\n--- a/drivers/staging/typec/fusb302/fusb302.c\n+++ b/drivers/staging/typec/fusb302/fusb302.c\n@@ -90,6 +90,7 @@ struct fusb302_chip {\n \tstruct i2c_client *i2c_client;\n \tstruct tcpm_port *tcpm_port;\n \tstruct tcpc_dev tcpc_dev;\n+\tstruct tcpc_config tcpc_config;\n \n \tstruct regulator *vbus;\n \n@@ -1198,7 +1199,6 @@ static const struct tcpc_config fusb302_tcpc_config = {\n \n static void init_tcpc_dev(struct tcpc_dev *fusb302_tcpc_dev)\n {\n-\tfusb302_tcpc_dev->config = &fusb302_tcpc_config;\n \tfusb302_tcpc_dev->init = tcpm_init;\n \tfusb302_tcpc_dev->get_vbus = tcpm_get_vbus;\n \tfusb302_tcpc_dev->set_cc = tcpm_set_cc;\n@@ -1684,7 +1684,9 @@ static int fusb302_probe(struct i2c_client *client,\n {\n \tstruct fusb302_chip *chip;\n \tstruct i2c_adapter *adapter;\n+\tstruct device *dev = &client->dev;\n \tint ret = 0;\n+\tu32 v;\n \n \tadapter = to_i2c_adapter(client->dev.parent);\n \tif (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {\n@@ -1699,8 +1701,22 @@ static int fusb302_probe(struct i2c_client *client,\n \tchip->i2c_client = client;\n \ti2c_set_clientdata(client, chip);\n \tchip->dev = &client->dev;\n+\tchip->tcpc_config = fusb302_tcpc_config;\n+\tchip->tcpc_dev.config = &chip->tcpc_config;\n \tmutex_init(&chip->lock);\n \n+\tif (!device_property_read_u32(dev, \"fcs,max-sink-microvolt\", &v))\n+\t\tchip->tcpc_config.max_snk_mv = v / 1000;\n+\n+\tif (!device_property_read_u32(dev, \"fcs,max-sink-microamp\", &v))\n+\t\tchip->tcpc_config.max_snk_ma = v / 1000;\n+\n+\tif (!device_property_read_u32(dev, \"fcs,max-sink-microwatt\", &v))\n+\t\tchip->tcpc_config.max_snk_mw = v / 1000;\n+\n+\tif (!device_property_read_u32(dev, \"fcs,operating-sink-microwatt\", &v))\n+\t\tchip->tcpc_config.operating_snk_mw = v / 1000;\n+\n \tret = fusb302_debugfs_init(chip);\n \tif (ret < 0)\n \t\treturn ret;\n", "prefixes": [ "v3", "04/11" ] }