Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1000187imc; Mon, 11 Mar 2019 04:23:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqylRgWa7/x3MFgb/UI4wKG5gMM/h/ZkSbISxRXY3JK6bC599TJ0i8SnmQ54BkcunQn/QXbO X-Received: by 2002:a17:902:2a6b:: with SMTP id i98mr33585113plb.153.1552303388384; Mon, 11 Mar 2019 04:23:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552303388; cv=none; d=google.com; s=arc-20160816; b=iGHgjrOrQEWQQ/kmDwzZrTrAocyNauEMef3rz6AeTwsoGwEdqS7fsaHFDtb8ThWaP4 CHIo09rC1kXb+ZrTwKMOhwuyPTXJzrYxBUy9hkTHNfLsKFYVyGfRnoqFpXlOXmdsHJog uiS/mfsPbJ5+pOx4PPIcmxhS7fBAetFS2PEGoNi+jrCuNA4LEJn95+up5cW+21IQoJg3 Xe3UC2mAlzw0rvzwOFaqTEcO0grY+9HSeKNYmIWRodu6xhY+Fboen9NDngllSRDbN5S+ On6tATuOBaxdV0dHTqAbEi0roIPYhjaOXLQjKJ2Qk+GbIwVrIv9wY+L+XLpI+3HeisR8 DGHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vl4atPP75+kThpxFMBBY4Mia4hbLOXsqX+hcyyVlgWM=; b=u4C3l2RLHypYhYY7DndMvz9VEVRqjOlaIQeoMaAXsVdUmgV4yp7XZakSLZUJzNQ6w3 eZ6bS+dc71ltl8pxaw5pRR7miyjAQ698hQ+RpH/XP9NLtAl2Byaep05VEWf3oU06J/hG Etw79zrzqjlzwyBXBuJ23HLtjBuHYgAX7b/r1YEpsDiB4l1QPwuSo3sIEQ62uQJluY+M pS5bi71cD/XFz9JVeXOCmZivvs7JlhqfBLZpAWZAc7U4zvWmnk/x/Q7kOun3DryimdEB 9WsbA1WewTeaUVGdtRZI3McUoaSf2rmZOLjWGVoX4TFZ1zYP/r5rWruekc+VRuvcwqaG OKKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si4581751pgv.209.2019.03.11.04.22.52; Mon, 11 Mar 2019 04:23:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727460AbfCKLWZ (ORCPT + 99 others); Mon, 11 Mar 2019 07:22:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35008 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727239AbfCKLWX (ORCPT ); Mon, 11 Mar 2019 07:22:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C064882F5; Mon, 11 Mar 2019 11:22:23 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-117-37.ams2.redhat.com [10.36.117.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B3AC5C579; Mon, 11 Mar 2019 11:22:21 +0000 (UTC) From: Hans de Goede To: Jarkko Nikula , Wolfram Sang , Andy Shevchenko , Mika Westerberg , Lee Jones Cc: Hans de Goede , linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] mfd: intel-lpss: Add "linux,use-dynamic-adapter-nr" device-prop to i2c-devices Date: Mon, 11 Mar 2019 12:22:16 +0100 Message-Id: <20190311112216.31391-3-hdegoede@redhat.com> In-Reply-To: <20190311112216.31391-1-hdegoede@redhat.com> References: <20190311112216.31391-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 11 Mar 2019 11:22:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The i2c-designware-platdrv assumes that if the pdev has an apci-companion it should use a dynamic adapter-nr and otherwise it will use pdev->id as adapter-nr. On some devices e.g. the Apollo Lake using Acer TravelMate Spin B118, some of the LPSS i2c-adapters are enumerated through PCI and do not have an ACPI fwnode. These devices are handled as mfd devices so they end up using the i2c-designware-platdrv driver. This results in the i2c-adapter being registered with the mfd generated pdev->id as adapter-nr, which conflicts with existing adapters, triggering a WARN(id < 0, "couldn't get idr") in i2c-core-base.c and causing the adapter registration to fail. To fix this the i2c-designware-platdrv now also supports a "linux,use-dynamic-adapter-nr" device-property, which tells it to use a dynamic adapter nr even if there is no ACPI fwnode for the device. This commit adds this device-property to the properties list for PCI enumerated LPSS i2c-adapters. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1687065 Signed-off-by: Hans de Goede --- drivers/mfd/intel-lpss-pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index 0e5282fc1467..c7b84a0f090e 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -69,6 +69,7 @@ static const struct intel_lpss_platform_info spt_info = { static struct property_entry spt_i2c_properties[] = { PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 230), + PROPERTY_ENTRY_BOOL("linux,use-dynamic-adapter-nr"), { }, }; @@ -104,6 +105,7 @@ static struct property_entry bxt_i2c_properties[] = { PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42), PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171), PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208), + PROPERTY_ENTRY_BOOL("linux,use-dynamic-adapter-nr"), { }, }; @@ -116,6 +118,7 @@ static struct property_entry apl_i2c_properties[] = { PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 207), PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171), PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208), + PROPERTY_ENTRY_BOOL("linux,use-dynamic-adapter-nr"), { }, }; -- 2.20.1