Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/807545/?format=api
{ "id": 807545, "url": "http://patchwork.ozlabs.org/api/patches/807545/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/20170830094814.17758-11-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-11-hdegoede@redhat.com>", "list_archive_url": null, "date": "2017-08-30T09:48:13", "name": "[v3,10/11] i2c-cht-wc: Add device-properties for fusb302 integration", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "12ec13b038f2e79d85335cd60f1fe1054e267a65", "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-11-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/807545/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807545/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-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx01.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 3xj12W3BnRz9sNn\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 19:50:11 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751480AbdH3Jsz (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 30 Aug 2017 05:48:55 -0400", "from mx1.redhat.com ([209.132.183.28]:38866 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751860AbdH3Jsw (ORCPT <rfc822;linux-i2c@vger.kernel.org>);\n\tWed, 30 Aug 2017 05:48:52 -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 6C9E981DF8;\n\tWed, 30 Aug 2017 09:48:52 +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 C4E8187C87;\n\tWed, 30 Aug 2017 09:48:49 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 6C9E981DF8", "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", "Subject": "[PATCH v3 10/11] i2c-cht-wc: Add device-properties for fusb302\n\tintegration", "Date": "Wed, 30 Aug 2017 11:48:13 +0200", "Message-Id": "<20170830094814.17758-11-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.25]);\n\tWed, 30 Aug 2017 09:48:52 +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": "Add device-properties to make the bq24292i charger connected to\nthe bus get its input-current-limit from the fusb302 Type-C port\ncontroller which is used on boards with the cht-wc PMIC,\nas well as regulator_init_data for the 5V boost converter on\nthe bq24292i.\n\nSince this means we now hook-up the bq24292i to the fusb302 Type-C port\ncontroller add a check for the ACPI device which instantiates the fusb302.\n\nSigned-off-by: Hans de Goede <hdegoede@redhat.com>\n---\nChanges in v2:\n-Set board_info.dev_name\n-Define and pass regulator_init_data for the bq24292i\n-Add a check for the ACPI device which instantiates the fusb302\n---\n drivers/i2c/busses/Kconfig | 5 ++++\n drivers/i2c/busses/i2c-cht-wc.c | 52 +++++++++++++++++++++++++++++++++++------\n 2 files changed, 50 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig\nindex 79c33817e412..272ef10fb629 100644\n--- a/drivers/i2c/busses/Kconfig\n+++ b/drivers/i2c/busses/Kconfig\n@@ -197,6 +197,11 @@ config I2C_CHT_WC\n \t SMBus controller found in the Intel Cherry Trail Whiskey Cove PMIC\n \t found on some Intel Cherry Trail systems.\n \n+\t Note this controller is hooked up to a TI bq24292i charger-IC,\n+\t combined with a FUSB302 Type-C port-controller as such it is advised\n+\t to also select CONFIG_CHARGER_BQ24190=m and CONFIG_TYPEC_FUSB302=m\n+\t (the fusb302 driver currently is in drivers/staging).\n+\n config I2C_NFORCE2\n \ttristate \"Nvidia nForce2, nForce3 and nForce4\"\n \tdepends on PCI\ndiff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c\nindex 21312eed09e4..69a159fc661a 100644\n--- a/drivers/i2c/busses/i2c-cht-wc.c\n+++ b/drivers/i2c/busses/i2c-cht-wc.c\n@@ -16,6 +16,7 @@\n * GNU General Public License for more details.\n */\n \n+#include <linux/acpi.h>\n #include <linux/completion.h>\n #include <linux/delay.h>\n #include <linux/i2c.h>\n@@ -25,6 +26,7 @@\n #include <linux/mfd/intel_soc_pmic.h>\n #include <linux/module.h>\n #include <linux/platform_device.h>\n+#include <linux/power/bq24190_charger.h>\n #include <linux/slab.h>\n \n #define CHT_WC_I2C_CTRL\t\t\t0x5e24\n@@ -232,13 +234,36 @@ static const struct irq_chip cht_wc_i2c_irq_chip = {\n \t.name\t\t\t= \"cht_wc_ext_chrg_irq_chip\",\n };\n \n+static const char * const bq24190_suppliers[] = { \"fusb302-typec-source\" };\n+\n static const struct property_entry bq24190_props[] = {\n-\tPROPERTY_ENTRY_STRING(\"extcon-name\", \"cht_wcove_pwrsrc\"),\n+\tPROPERTY_ENTRY_STRING_ARRAY(\"supplied-from\", bq24190_suppliers),\n+\tPROPERTY_ENTRY_BOOL(\"ti,input-current-limit-from-supplier\"),\n \tPROPERTY_ENTRY_BOOL(\"omit-battery-class\"),\n \tPROPERTY_ENTRY_BOOL(\"disable-reset\"),\n \t{ }\n };\n \n+static struct regulator_consumer_supply fusb302_consumer = {\n+\t.supply = \"vbus\",\n+\t/* Must match fusb302 dev_name in intel_cht_int33fe.c */\n+\t.dev_name = \"i2c-fusb302\",\n+};\n+\n+static const struct regulator_init_data bq24190_vbus_init_data = {\n+\t.constraints = {\n+\t\t/* The name is used in intel_cht_int33fe.c do not change. */\n+\t\t.name = \"cht_wc_usb_typec_vbus\",\n+\t\t.valid_ops_mask = REGULATOR_CHANGE_STATUS,\n+\t},\n+\t.consumer_supplies = &fusb302_consumer,\n+\t.num_consumer_supplies = 1,\n+};\n+\n+static struct bq24190_platform_data bq24190_pdata = {\n+\t.regulator_init_data = &bq24190_vbus_init_data,\n+};\n+\n static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)\n {\n \tstruct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent);\n@@ -246,7 +271,9 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)\n \tstruct i2c_board_info board_info = {\n \t\t.type = \"bq24190\",\n \t\t.addr = 0x6b,\n+\t\t.dev_name = \"bq24190\",\n \t\t.properties = bq24190_props,\n+\t\t.platform_data = &bq24190_pdata,\n \t};\n \tint ret, reg, irq;\n \n@@ -314,11 +341,21 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)\n \tif (ret)\n \t\tgoto remove_irq_domain;\n \n-\tboard_info.irq = adap->client_irq;\n-\tadap->client = i2c_new_device(&adap->adapter, &board_info);\n-\tif (!adap->client) {\n-\t\tret = -ENOMEM;\n-\t\tgoto del_adapter;\n+\t/*\n+\t * Normally the Whiskey Cove PMIC is paired with a TI bq24292i charger,\n+\t * connected to this i2c bus, and a max17047 fuel-gauge and a fusb302\n+\t * USB Type-C controller connected to another i2c bus. In this setup\n+\t * the max17047 and fusb302 devices are enumerated through an INT33FE\n+\t * ACPI device. If this device is present register an i2c-client for\n+\t * the TI bq24292i charger.\n+\t */\n+\tif (acpi_dev_present(\"INT33FE\", NULL, -1)) {\n+\t\tboard_info.irq = adap->client_irq;\n+\t\tadap->client = i2c_new_device(&adap->adapter, &board_info);\n+\t\tif (!adap->client) {\n+\t\t\tret = -ENOMEM;\n+\t\t\tgoto del_adapter;\n+\t\t}\n \t}\n \n \tplatform_set_drvdata(pdev, adap);\n@@ -335,7 +372,8 @@ static int cht_wc_i2c_adap_i2c_remove(struct platform_device *pdev)\n {\n \tstruct cht_wc_i2c_adap *adap = platform_get_drvdata(pdev);\n \n-\ti2c_unregister_device(adap->client);\n+\tif (adap->client)\n+\t\ti2c_unregister_device(adap->client);\n \ti2c_del_adapter(&adap->adapter);\n \tirq_domain_remove(adap->irq_domain);\n \n", "prefixes": [ "v3", "10/11" ] }