Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1819808ybz; Sun, 26 Apr 2020 05:03:06 -0700 (PDT) X-Google-Smtp-Source: APiQypJnAE1RB5SNioUBC574VSMlhb/FraaRJg3bhPP8xoUsDO9wmyHJPIq9kF1DfRubz0uoJuTI X-Received: by 2002:a05:6402:1a49:: with SMTP id bf9mr5023245edb.189.1587902585874; Sun, 26 Apr 2020 05:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587902585; cv=none; d=google.com; s=arc-20160816; b=zE3tAV+brKJYOGTXz73QadMAvlAecQqG6+QvtNB25hwLlVqDcc0yhIrxoJKVFiSz0b MMnM7I0qT5wWUtfRco80vsJEBnCyEdwCd6Nbl5QIcrBpplvylopWRFcimhxwLq+WuZGj NbqTGLcEOXoXc0i7tQjf88En9RELKT2OcaNIFUiShArpDfMqN27yB/+sDhLu5jHtjQGc EzcGNFSDkPHSHG5LWCKuDCnoTT207B5VcIcsyyBc2Z2inxcmttu+PwYdbfh6v+6Nu+iY /6ygYWWcLCW0PUOmyEbmJFdNp4oy3hBHcQ7Hivg5YBO1/04gXpTd2yIj5NHxmK+9MB3n Fv1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=1ybWhQKicq3BRCiYVQDh4zWliFFrm/KJg+jIJlyUI9M=; b=pdckCoAKq9A7powDbxlj5NoujQO2XMT5LwXS9ywso3JqUq8ia9TT3OWAv08FI4c+Ml W9MGnCtLzOxWCwSGzyiV3CQsLVjkQWk3/pOF27XVFuYfBkp4D94e3f3eIiNGJHHeLmGA nwzmged45qB5bMhkgpgQ6b2pmJxe9SoDjko7lKPFicTYHWkSPfOzzAZ9HKCtG8E63zqW sHpuGbze0k1gLc6oKxPczuDxIqEr+n0+BsLOsxqIH2UN1p6Ks8U8yIlquJHfS18Pw6EV hQ1vB1dVw3VIQIIKQVQ23OHWm2Li7H5+dPVoricArgVqphKooVNx5HKaSXFKNCix8jRj CiFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x61si6549971ede.23.2020.04.26.05.02.42; Sun, 26 Apr 2020 05:03:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726146AbgDZMA6 (ORCPT + 99 others); Sun, 26 Apr 2020 08:00:58 -0400 Received: from mail-oo1-f65.google.com ([209.85.161.65]:33837 "EHLO mail-oo1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbgDZMA5 (ORCPT ); Sun, 26 Apr 2020 08:00:57 -0400 Received: by mail-oo1-f65.google.com with SMTP id q204so3222802ooq.1; Sun, 26 Apr 2020 05:00:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1ybWhQKicq3BRCiYVQDh4zWliFFrm/KJg+jIJlyUI9M=; b=ej2BtiMWjS/6fppDztqzCZYy09Qnh4QSrZLZKOUCDxkrg/uDfa1bWAQFX0sBhxJ2Lr 1s5Ntg09X10k284ICoJ2f0XZIYt0GUV7In/MCOWmQfX591iAdfB7KD+oulO+Nh79D8LZ gRvux9h0Bx72Yoechl3a6gyrpxeDG33nGI4ybjcvfwMLA8IkPufktewWeYICZhOjXGkL HLVufYEibkdAslV6cllqQrx7EWF+jjjBEwn7eBonNeVAwzKZB5lp3lxfw0xBvbN/o2Lg wKOUg0/Pk6FY3153/rGO6CsCBkUJv6IxYrTRojThhPjKjHn0GqFgb4yc25HaemDy/uq8 7sVw== X-Gm-Message-State: AGi0PuZsO3kQr/1FIm1vbrOT4RSq0Y27NQhQiYF9jnHkyRs6X/8nrG5Q L+cSNpdqfb8cmFnqZt04XiGkEJWxnMIkAoH6c2o= X-Received: by 2002:a4a:a286:: with SMTP id h6mr15108432ool.38.1587902455878; Sun, 26 Apr 2020 05:00:55 -0700 (PDT) MIME-Version: 1.0 References: <20200426104713.216896-1-hdegoede@redhat.com> <20200426104713.216896-3-hdegoede@redhat.com> In-Reply-To: <20200426104713.216896-3-hdegoede@redhat.com> From: "Rafael J. Wysocki" Date: Sun, 26 Apr 2020 14:00:44 +0200 Message-ID: Subject: Re: [PATCH 2/2] ACPI / scan: Create platform device for CPLM3218 ACPI nodes To: Hans de Goede Cc: "Rafael J . Wysocki" , Len Brown , Darren Hart , Andy Shevchenko , ACPI Devel Maling List , Platform Driver , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 26, 2020 at 12:47 PM Hans de Goede wrote: > > Some CPLM3218 ACPI nodes also put the SMBus Alert Response Address (0x0c) > in their ACPI resource table; and they put it there as the first entry, > here is an example from the CPLM3218 device in the DSDT of an Asus T100TA: > > Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings > { > Name (SBUF, ResourceTemplate () > { > I2cSerialBusV2 (0x000C, ControllerInitiated, 0x00061A80, > AddressingMode7Bit, "\\_SB.I2C3", > 0x00, ResourceConsumer, , Exclusive, > ) > I2cSerialBusV2 (0x0048, ControllerInitiated, 0x00061A80, > AddressingMode7Bit, "\\_SB.I2C3", > 0x00, ResourceConsumer, , Exclusive, > ) > Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) > { > 0x00000033, > } > }) > Return (SBUF) /* \_SB_.I2C3.ALSD._CRS.SBUF */ > } > > The actual I2C address of the sensor in this case is the 0x48 address > from the second resource-table entry. On some other devices > (e.g. HP X2 Bay Trail models, Acer SW5-012) the CPLM3218 node contains > only 1 I2C resource. > > Add the CPLM3218 to the I2C multi instantiate list, so that the > i2c-multi-instantiate.c driver can handle it. > > Note in the case where there are 2 I2C resources we simply instatiate > i2c-clients for both and let the cm32181 driver figure out that the > first one is not the one it wants. > > Doing things this way is actually desirable because on devices where > there are 2 I2C resources it seems that we first need to do a SMBus > read of the 0x0c address before the sensor will respond to I2C transfers > on its actual address. > > Signed-off-by: Hans de Goede Acked-by: Rafael J. Wysocki for the scan.c change and I'm expecting platform/x86 to take care of this series. Thanks! > --- > drivers/acpi/scan.c | 1 + > drivers/platform/x86/i2c-multi-instantiate.c | 7 +++++++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c > index 6d3448895382..937d72fc212c 100644 > --- a/drivers/acpi/scan.c > +++ b/drivers/acpi/scan.c > @@ -1544,6 +1544,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device) > static const struct acpi_device_id i2c_multi_instantiate_ids[] = { > {"BSG1160", }, > {"BSG2150", }, > + {"CPLM3218", }, > {"INT33FE", }, > {"INT3515", }, > {} > diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c > index dcafb1a29d17..e1cdc44e6f57 100644 > --- a/drivers/platform/x86/i2c-multi-instantiate.c > +++ b/drivers/platform/x86/i2c-multi-instantiate.c > @@ -180,6 +180,12 @@ static const struct i2c_inst_data int3515_data[] = { > {} > }; > > +static const struct i2c_inst_data cplm3218_data[] = { > + { "cm32181", PASS_FWNODE }, > + { "cm32181", PASS_FWNODE }, > + {} > +}; > + > /* > * Note new device-ids must also be added to i2c_multi_instantiate_ids in > * drivers/acpi/scan.c: acpi_device_enumeration_by_parent(). > @@ -187,6 +193,7 @@ static const struct i2c_inst_data int3515_data[] = { > static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = { > { "BSG1160", (unsigned long)bsg1160_data }, > { "BSG2150", (unsigned long)bsg2150_data }, > + { "CPLM3218", (unsigned long)cplm3218_data }, > { "INT3515", (unsigned long)int3515_data }, > { } > }; > -- > 2.26.0 >