Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2340993lqo; Mon, 20 May 2024 02:47:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVR9QHSYTn9aIDPbH2xtUqQpHNZ9PoCA122XN1lWoZXkrkwiAWbAkosAGEUHHvZulNTfzgvdtzrLBATf+AhHHRh3rwBwDZNHU6QITvNeg== X-Google-Smtp-Source: AGHT+IFQSNNY1loYo5Crj2DNxLL3oceCXg43kJslLivLnl2ujPw84OBk205jSxzwEBt9JMEDtN87 X-Received: by 2002:a05:620a:384:b0:790:b1db:d28 with SMTP id af79cd13be357-792c75f26bcmr3179774885a.48.1716198468475; Mon, 20 May 2024 02:47:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716198468; cv=pass; d=google.com; s=arc-20160816; b=gwYknB99WAIESh+BOkhFDMBPC5a5K19tiaJnEAQAxU5Y0SYKAvyyIpF//slT95779C iUa0WwzNBIuXOI2VlWVF1lTssv/OpF7sjhj5e7gFWfKiufRbBDZVFXOsBrw6nvie/+K3 gJJ4J+kwnstyg3fDnpGw2sTzwMfhQxxO3oYTQ72bfOns8nnWzgNC93vdV71mX6ynJBsx eDoiMsIMrmZbMXgfEdf1IzvUoPp/BDOHSsRRUAMmunrCidbjDOyiIy54LP+aw3z+cPDo 16NlocLP2PZh0EuqZOjqWfpSdIwItT6nST9fBD5Q8A30wuFYb2qZS05RTBUly8zx8OBK NWDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=75JddjR9mmjQplUgoRM1G6jkHZHg7oQEEyBjyj3cza8=; fh=O7W32hzrxLioy2lU7cq0myUffGADZNPHRUPmOpshY3A=; b=HAzztpceMm+65AG79KZJN60+BUXA0RgZph/92QQOCJEBp4aUopzglUH2EzI0Rgvx/M yoa2exvx+pvlCaSWbqUy0kcSit6Op7PouP+OHN446djhWJbKuxurzzP05vMRwZJ+cdtM S43bFmDIM/tBSROfa3qt3BSR8csIa/8ccikxQZ8d9PMxcsubhJJR02r+WVflloF6kCTR 4/VKcDh1Jwi/O9OhyuqYgzIy93NQGtV1XnAOctX4mHgANqKnEUGUwwrSpYScFEgDVSRm cY2mQHBew3s3DaML/kB9Mcn6fRToSliGU21MUWmbw+R4BVM++iUcrr/zUpUcSPZBgU/J o4dQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SLC4r0tW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183564-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792ff8d177bsi371448885a.613.2024.05.20.02.47.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 02:47:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183564-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SLC4r0tW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183564-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D2AE21C2090F for ; Mon, 20 May 2024 09:47:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CE3D35894; Mon, 20 May 2024 09:47:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SLC4r0tW" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7554B10A24; Mon, 20 May 2024 09:47:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716198426; cv=none; b=C8A+XV254v5Dm+rKFrLBWr5Ihq1Clb9EgGTbZqcfTrgWSgqB+/ObYH99Kj9THdshGNJ5f4wssrEQdkT5wKZsf4Wr+13ZTIEtCAqjhFMXMvgPW+SxnyEOIjDaYgkKfUEBVdc5lTBqik/BDdgu35qsLJeCs2vbZnpNy7BpeIDzETU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716198426; c=relaxed/simple; bh=v10n7LWWPZ4WW9t30Xp+EAF2iLYvof73nLcKeQE2e+I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BMVQGV4G+bsM/P0zZRPI7MxAGel34j7/6eC2KE1PR0DWGHW1WRO+eIl809VIhGzmz37eT/VRnOp3s3tQgMaA9K8hO44yHcjreaPM3pEr4pLjemq/JzHG4kbqzIimMwsoxESGKzlm9vZ/y1M6BJ5RI3RjzNwUbgHXrkgqEz1xnpg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SLC4r0tW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9B36C2BD10; Mon, 20 May 2024 09:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716198426; bh=v10n7LWWPZ4WW9t30Xp+EAF2iLYvof73nLcKeQE2e+I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SLC4r0tWXjZtpd961eJ1gr5oe87pn92ep2KtReCdJcov1zuJSSuLVx95aLxvoGSH8 l1lphrYpg4aEGxJm5YwNDHV+Amy7haysV0s2ek5O1Vr7SLddK97pwWsTl6KDiPmy3A xvqM9Js1Q8/C/E2Z6RDdN3vTNpSrPJuJi4QVSyvjWiZ67ZlDCPo9/hULv5Eff6aTzN bXWfG4Yl3YLUo54GPqvvIENitegu9KRIKI0y/IRH6F+5jfl9VGT4zMPde1vwYQgNaC G5YqIpZDaxEkXFc+ljHPre58PSVK6yUCwCA0xM7zuBuOn2gjC28uVd6UPSKIDA2PQD mBuwKHo5GCL2Q== Date: Mon, 20 May 2024 17:47:02 +0800 From: Tzung-Bi Shih To: Ben Walsh Cc: Benson Leung , Guenter Roeck , "Dustin L. Howett" , Kieran Levin , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Mario Limonciello , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/6] platform/chrome: cros_ec_lpc: Correct ACPI name for Framework Laptop Message-ID: References: <20240515055631.5775-1-ben@jubnut.com> <20240515055631.5775-6-ben@jubnut.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240515055631.5775-6-ben@jubnut.com> On Wed, May 15, 2024 at 06:56:30AM +0100, Ben Walsh wrote: > Framework Laptops' ACPI exposes the EC as name "PNP0C09". Use this to > find the device. This makes it easy to find the AML mutex via the > ACPI_COMPANION device. > > The name "PNP0C09" is part of the ACPI standard, not Chrome-specific, > so only recognise the device if the DMI data is recognised too. I don't quite understand the statement. Why it needs DMI data? > diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c [...] > -/* True if ACPI device is present */ > -static bool cros_ec_lpc_acpi_device_found; > +/* > + * Index into cros_ec_lpc_acpi_device_ids of ACPI device, > + * negative for ACPI device not found. > + */ > +static int cros_ec_lpc_acpi_device_found; Rename it to `cros_ec_lpc_acpi_device_index` for clarity? > static int __init cros_ec_lpc_init(void) > { > int ret; > - acpi_status status; > const struct dmi_system_id *dmi_match; > > - status = acpi_get_devices(ACPI_DRV_NAME, cros_ec_lpc_parse_device, > - &cros_ec_lpc_acpi_device_found, NULL); > - if (ACPI_FAILURE(status)) > - pr_warn(DRV_NAME ": Looking for %s failed\n", ACPI_DRV_NAME); > + cros_ec_lpc_acpi_device_found = cros_ec_lpc_find_acpi_dev( > + cros_ec_lpc_driver.driver.acpi_match_table); Or just use `cros_ec_lpc_acpi_device_ids`. > - } else if (!cros_ec_lpc_acpi_device_found) { > + } else if (cros_ec_lpc_acpi_device_found <= 0) { > + /* Standard EC "PNP0C09" not supported without DMI data */ Asked the same question above, why PNP0C09 needs DMI data? Also the way is a bit confusing as "PNP0C09" must be at index 0 in the acpi_device_id.