Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/809277/?format=api
{ "id": 809277, "url": "http://patchwork.ozlabs.org/api/patches/809277/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/20170903124156.7440-2-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-2-hdegoede@redhat.com>", "list_archive_url": null, "date": "2017-09-03T12:41:54", "name": "[v4,1/3] i2c: Allow overriding dev_name through board_info", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4e9c55058b2500316a3380b48698f3925df010fb", "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-2-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/809277/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/809277/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-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx08.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 3xlXgr07xDz9s2G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 3 Sep 2017 22:42:48 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752863AbdICMmF (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tSun, 3 Sep 2017 08:42:05 -0400", "from mx1.redhat.com ([209.132.183.28]:49794 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752840AbdICMmC (ORCPT <rfc822;linux-i2c@vger.kernel.org>);\n\tSun, 3 Sep 2017 08:42:02 -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 2C34BC0587C8;\n\tSun, 3 Sep 2017 12:42:02 +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 7291C6031E;\n\tSun, 3 Sep 2017 12:42:00 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 2C34BC0587C8", "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 1/3] i2c: Allow overriding dev_name through board_info", "Date": "Sun, 3 Sep 2017 14:41:54 +0200", "Message-Id": "<20170903124156.7440-2-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.32]);\n\tSun, 03 Sep 2017 12:42:02 +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": "For devices not instantiated through ACPI the i2c-client's device-name\ngets set to <busnr>-<addr> by default, e.g. \"0-0022\" this means that\nthe device-name is dependent on the order in which the i2c-busses are\nenumerated.\n\nIn some cases having a predictable constant device-name is desirable,\nfor example on non device-tree platforms the link between a regulator\nand its consumers is specified by the platform code by setting\nregulator_init_data.consumers. This array identifies the regulator's\nconsumers by dev_name and supply(-name). Which requires a constant\ndev_name.\n\nThis commit adds a dev_name field to i2c_board_info allowing\nplatform code to set a contstant dev_name so that the device can\nbe identified by its dev_name in other platform code.\n\nSigned-off-by: Hans de Goede <hdegoede@redhat.com>\n---\n drivers/i2c/i2c-core-base.c | 10 ++++++++--\n include/linux/i2c.h | 2 ++\n 2 files changed, 10 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c\nindex 45fafcc88b93..5cdf3b947c23 100644\n--- a/drivers/i2c/i2c-core-base.c\n+++ b/drivers/i2c/i2c-core-base.c\n@@ -672,10 +672,16 @@ static void i2c_adapter_unlock_bus(struct i2c_adapter *adapter,\n }\n \n static void i2c_dev_set_name(struct i2c_adapter *adap,\n-\t\t\t struct i2c_client *client)\n+\t\t\t struct i2c_client *client,\n+\t\t\t struct i2c_board_info const *info)\n {\n \tstruct acpi_device *adev = ACPI_COMPANION(&client->dev);\n \n+\tif (info && info->dev_name) {\n+\t\tdev_set_name(&client->dev, \"i2c-%s\", info->dev_name);\n+\t\treturn;\n+\t}\n+\n \tif (adev) {\n \t\tdev_set_name(&client->dev, \"i2c-%s\", acpi_dev_name(adev));\n \t\treturn;\n@@ -772,7 +778,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)\n \tclient->dev.of_node = info->of_node;\n \tclient->dev.fwnode = info->fwnode;\n \n-\ti2c_dev_set_name(adap, client);\n+\ti2c_dev_set_name(adap, client, info);\n \n \tif (info->properties) {\n \t\tstatus = device_add_properties(&client->dev, info->properties);\ndiff --git a/include/linux/i2c.h b/include/linux/i2c.h\nindex 701ad26fa6b4..d3655cfe9a3e 100644\n--- a/include/linux/i2c.h\n+++ b/include/linux/i2c.h\n@@ -310,6 +310,7 @@ static inline bool i2c_detect_slave_mode(struct device *dev) { return false; }\n * @type: chip type, to initialize i2c_client.name\n * @flags: to initialize i2c_client.flags\n * @addr: stored in i2c_client.addr\n+ * @dev_name: Overrides the default <busnr>-<addr> dev_name if set\n * @platform_data: stored in i2c_client.dev.platform_data\n * @archdata: copied into i2c_client.dev.archdata\n * @of_node: pointer to OpenFirmware device node\n@@ -334,6 +335,7 @@ struct i2c_board_info {\n \tchar\t\ttype[I2C_NAME_SIZE];\n \tunsigned short\tflags;\n \tunsigned short\taddr;\n+\tconst char\t*dev_name;\n \tvoid\t\t*platform_data;\n \tstruct dev_archdata\t*archdata;\n \tstruct device_node *of_node;\n", "prefixes": [ "v4", "1/3" ] }