From patchwork Mon Nov 26 15:08:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10698445 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD84D109C for ; Mon, 26 Nov 2018 15:09:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CED5829D2F for ; Mon, 26 Nov 2018 15:09:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C28A029D36; Mon, 26 Nov 2018 15:09:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 729D829D2F for ; Mon, 26 Nov 2018 15:09:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727309AbeK0CDr (ORCPT ); Mon, 26 Nov 2018 21:03:47 -0500 Received: from mga01.intel.com ([192.55.52.88]:57910 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727192AbeK0CDr (ORCPT ); Mon, 26 Nov 2018 21:03:47 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Nov 2018 07:09:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,282,1539673200"; d="scan'208";a="92275438" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 26 Nov 2018 07:09:03 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3612D82A; Mon, 26 Nov 2018 17:08:59 +0200 (EET) From: Andy Shevchenko To: Darren Hart , platform-driver-x86@vger.kernel.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Jonathan Cameron , Wolfram Sang , Mika Westerberg , linux-i2c@vger.kernel.org, Hans de Goede , Heikki Krogerus , linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v2 12/13] ACPI / scan: Create platform device for INT3515 ACPI nodes Date: Mon, 26 Nov 2018 17:08:57 +0200 Message-Id: <20181126150858.16901-13-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181126150858.16901-1-andriy.shevchenko@linux.intel.com> References: <20181126150858.16901-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ACPI device with INT3515 _HID is representing a complex USB PD hardware infrastructure which includes several I2C slave ICs. We add an ID to the I2C multi instantiate list to enumerate all I2C slaves correctly. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/acpi/scan.c | 1 + drivers/platform/x86/i2c-multi-instantiate.c | 9 +++++++++ drivers/usb/typec/tps6598x.c | 8 ++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index bd1c59fb0e17..e9eda5558c1f 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1541,6 +1541,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device) static const struct acpi_device_id i2c_multi_instantiate_ids[] = { {"BSG1160", }, {"INT33FE", }, + {"INT3515", }, {} }; diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c index d184833bfd05..ab50dda6062a 100644 --- a/drivers/platform/x86/i2c-multi-instantiate.c +++ b/drivers/platform/x86/i2c-multi-instantiate.c @@ -163,12 +163,21 @@ static const struct i2c_inst_data bsg1160_data[] = { {} }; +static const struct i2c_inst_data int3515_data[] = { + { "tps6598x", IRQ_RESOURCE_APIC, 0 }, + { "tps6598x", IRQ_RESOURCE_APIC, 1 }, + { "tps6598x", IRQ_RESOURCE_APIC, 2 }, + { "tps6598x", IRQ_RESOURCE_APIC, 3 }, + {} +}; + /* * Note new device-ids must also be added to i2c_multi_instantiate_ids in * drivers/acpi/scan.c: acpi_device_enumeration_by_parent(). */ static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = { { "BSG1160", (unsigned long)bsg1160_data }, + { "INT3515", (unsigned long)int3515_data }, { } }; MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids); diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c index c84c8c189e90..1c0033ad8738 100644 --- a/drivers/usb/typec/tps6598x.c +++ b/drivers/usb/typec/tps6598x.c @@ -501,19 +501,19 @@ static int tps6598x_remove(struct i2c_client *client) return 0; } -static const struct acpi_device_id tps6598x_acpi_match[] = { - { "INT3515", 0 }, +static const struct i2c_device_id tps6598x_id[] = { + { "tps6598x" }, { } }; -MODULE_DEVICE_TABLE(acpi, tps6598x_acpi_match); +MODULE_DEVICE_TABLE(i2c, tps6598x_id); static struct i2c_driver tps6598x_i2c_driver = { .driver = { .name = "tps6598x", - .acpi_match_table = tps6598x_acpi_match, }, .probe_new = tps6598x_probe, .remove = tps6598x_remove, + .id_table = tps6598x_id, }; module_i2c_driver(tps6598x_i2c_driver);