Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/809276/?format=api
{ "id": 809276, "url": "http://patchwork.ozlabs.org/api/patches/809276/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/20170903124156.7440-4-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": "<20170903124156.7440-4-hdegoede@redhat.com>", "list_archive_url": null, "date": "2017-09-03T12:41:56", "name": "[v4,3/3] platform/x86: intel_cht_int33fe: Update fusb302 type string, add properties", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "05a39f2ff0c3f5776f1f26ff963abe27914e4f40", "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/20170903124156.7440-4-hdegoede@redhat.com/mbox/", "series": [ { "id": 1226, "url": "http://patchwork.ozlabs.org/api/series/1226/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/list/?series=1226", "date": "2017-09-03T12:41:53", "name": "i2c: Hookup typec power-negotation to the PMIC and charger", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/1226/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/809276/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/809276/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-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx06.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 3xlXgY31BZz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 3 Sep 2017 22:42:33 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752952AbdICMmM (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tSun, 3 Sep 2017 08:42:12 -0400", "from mx1.redhat.com ([209.132.183.28]:36978 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752907AbdICMmI (ORCPT <rfc822;linux-i2c@vger.kernel.org>);\n\tSun, 3 Sep 2017 08:42:08 -0400", "from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\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 C45DB356E3;\n\tSun, 3 Sep 2017 12:42:07 +0000 (UTC)", "from shalem.localdomain.com (ovpn-116-76.ams2.redhat.com\n\t[10.36.116.76])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 1636D6031E;\n\tSun, 3 Sep 2017 12:42:05 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com C45DB356E3", "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>, Guenter 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", "Subject": "[PATCH v4 3/3] platform/x86: intel_cht_int33fe: Update fusb302 type\n\tstring, add properties", "Date": "Sun, 3 Sep 2017 14:41:56 +0200", "Message-Id": "<20170903124156.7440-4-hdegoede@redhat.com>", "In-Reply-To": "<20170903124156.7440-1-hdegoede@redhat.com>", "References": "<20170903124156.7440-1-hdegoede@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.11", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tSun, 03 Sep 2017 12:42:07 +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": "The fusb302 driver as merged in staging uses \"typec_fusb302\" as i2c-id\nrather then just \"fusb302\" and needs us to set a number of device-\nproperties, adjust the intel_cht_int33fe driver accordingly.\n\nOne of the properties set is max-snk-mv which makes the fusb302 driver\nnegotiate up to 12V charging voltage, which is a bad idea on boards\nwhich are not setup to handle this, so this commit also adds 2 extra\nsanity checks to make sure that the expected Whiskey Cove PMIC +\nTI bq24292i charger combo, which can handle 12V, is present.\n\nSigned-off-by: Hans de Goede <hdegoede@redhat.com>\n---\nChanges in v2:\n-Set board_info.dev_name\n-Adjust for changes in other patches in this patch-set\n---\n drivers/platform/x86/Kconfig | 6 ++++-\n drivers/platform/x86/intel_cht_int33fe.c | 44 +++++++++++++++++++++++++++++++-\n 2 files changed, 48 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig\nindex 80b87954f6dd..c5554577681a 100644\n--- a/drivers/platform/x86/Kconfig\n+++ b/drivers/platform/x86/Kconfig\n@@ -793,7 +793,7 @@ config ACPI_CMPC\n \n config INTEL_CHT_INT33FE\n \ttristate \"Intel Cherry Trail ACPI INT33FE Driver\"\n-\tdepends on X86 && ACPI && I2C\n+\tdepends on X86 && ACPI && I2C && REGULATOR\n \t---help---\n \t This driver add support for the INT33FE ACPI device found on\n \t some Intel Cherry Trail devices.\n@@ -804,6 +804,10 @@ config INTEL_CHT_INT33FE\n \t This driver instantiates i2c-clients for these, so that standard\n \t i2c drivers for these chips can bind to the them.\n \n+\t If you enable this driver it is advised to also select\n+\t CONFIG_CHARGER_BQ24190=m, CONFIG_BATTERY_MAX17042=m and\n+\t CONFIG_TYPEC_FUSB302=m (currently in drivers/staging).\n+\n config INTEL_INT0002_VGPIO\n \ttristate \"Intel ACPI INT0002 Virtual GPIO driver\"\n \tdepends on GPIOLIB && ACPI\ndiff --git a/drivers/platform/x86/intel_cht_int33fe.c b/drivers/platform/x86/intel_cht_int33fe.c\nindex a9cbc4b8ca63..b2925d996613 100644\n--- a/drivers/platform/x86/intel_cht_int33fe.c\n+++ b/drivers/platform/x86/intel_cht_int33fe.c\n@@ -24,6 +24,7 @@\n #include <linux/i2c.h>\n #include <linux/interrupt.h>\n #include <linux/module.h>\n+#include <linux/regulator/consumer.h>\n #include <linux/slab.h>\n \n #define EXPECTED_PTYPE\t\t4\n@@ -77,12 +78,21 @@ static const struct property_entry max17047_props[] = {\n \t{ }\n };\n \n+static const struct property_entry fusb302_props[] = {\n+\tPROPERTY_ENTRY_STRING(\"fcs,extcon-name\", \"cht_wcove_pwrsrc\"),\n+\tPROPERTY_ENTRY_U32(\"fcs,max-sink-microvolt\", 12000000),\n+\tPROPERTY_ENTRY_U32(\"fcs,max-sink-microamp\", 3000000),\n+\tPROPERTY_ENTRY_U32(\"fcs,max-sink-microwatt\", 36000000),\n+\t{ }\n+};\n+\n static int cht_int33fe_probe(struct i2c_client *client)\n {\n \tstruct device *dev = &client->dev;\n \tstruct i2c_board_info board_info;\n \tstruct cht_int33fe_data *data;\n \tstruct i2c_client *max17047;\n+\tstruct regulator *regulator;\n \tunsigned long long ptyp;\n \tacpi_status status;\n \tint ret, fusb302_irq;\n@@ -100,6 +110,34 @@ static int cht_int33fe_probe(struct i2c_client *client)\n \tif (ptyp != EXPECTED_PTYPE)\n \t\treturn -ENODEV;\n \n+\t/* Check presence of INT34D3 (hardware-rev 3) expected for ptype == 4 */\n+\tif (!acpi_dev_present(\"INT34D3\", \"1\", 3)) {\n+\t\tdev_err(dev, \"Error PTYPE == %d, but no INT34D3 device\\n\",\n+\t\t\tEXPECTED_PTYPE);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\t/*\n+\t * We expect the WC PMIC to be paired with a TI bq24292i charger-IC.\n+\t * We check for the bq24292i vbus regulator here, this has 2 purposes:\n+\t * 1) The bq24292i allows charging with up to 12V, setting the fusb302's\n+\t * max-snk voltage to 12V with another charger-IC is not good.\n+\t * 2) For the fusb302 driver to get the bq24292i vbus regulator, the\n+\t * regulator-map, which is part of the bq24292i regulator_init_data,\n+\t * must be registered before the fusb302 is instantiated, otherwise\n+\t * it will end up with a dummy-regulator.\n+\t * Note \"cht_wc_usb_typec_vbus\" comes from the regulator_init_data\n+\t * which is defined in i2c-cht-wc.c from where the bq24292i i2c-client\n+\t * gets instantiated. We use regulator_get_optional here so that we\n+\t * don't end up getting a dummy-regulator ourselves.\n+\t */\n+\tregulator = regulator_get_optional(dev, \"cht_wc_usb_typec_vbus\");\n+\tif (IS_ERR(regulator)) {\n+\t\tret = PTR_ERR(regulator);\n+\t\treturn (ret == -ENODEV) ? -EPROBE_DEFER : ret;\n+\t}\n+\tregulator_put(regulator);\n+\n \t/* The FUSB302 uses the irq at index 1 and is the only irq user */\n \tfusb302_irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 1);\n \tif (fusb302_irq < 0) {\n@@ -126,6 +164,7 @@ static int cht_int33fe_probe(struct i2c_client *client)\n \t} else {\n \t\tmemset(&board_info, 0, sizeof(board_info));\n \t\tstrlcpy(board_info.type, \"max17047\", I2C_NAME_SIZE);\n+\t\tboard_info.dev_name = \"max17047\";\n \t\tboard_info.properties = max17047_props;\n \t\tdata->max17047 = i2c_acpi_new_device(dev, 1, &board_info);\n \t\tif (!data->max17047)\n@@ -133,7 +172,9 @@ static int cht_int33fe_probe(struct i2c_client *client)\n \t}\n \n \tmemset(&board_info, 0, sizeof(board_info));\n-\tstrlcpy(board_info.type, \"fusb302\", I2C_NAME_SIZE);\n+\tstrlcpy(board_info.type, \"typec_fusb302\", I2C_NAME_SIZE);\n+\tboard_info.dev_name = \"fusb302\";\n+\tboard_info.properties = fusb302_props;\n \tboard_info.irq = fusb302_irq;\n \n \tdata->fusb302 = i2c_acpi_new_device(dev, 2, &board_info);\n@@ -141,6 +182,7 @@ static int cht_int33fe_probe(struct i2c_client *client)\n \t\tgoto out_unregister_max17047;\n \n \tmemset(&board_info, 0, sizeof(board_info));\n+\tboard_info.dev_name = \"pi3usb30532\";\n \tstrlcpy(board_info.type, \"pi3usb30532\", I2C_NAME_SIZE);\n \n \tdata->pi3usb30532 = i2c_acpi_new_device(dev, 3, &board_info);\n", "prefixes": [ "v4", "3/3" ] }