Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2396699lqb; Mon, 27 May 2024 20:08:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQ7dJqkfgep3bCZkpWj1kx6latqlncy4O+bZnFg70UgTObic5j5nnnVusiZggruwoD7ZEwnbWyQ3qIUftOFtKkk8yaDnD7ZnPFdLjNFw== X-Google-Smtp-Source: AGHT+IHxxFT0e/ci6FxVV+8yXWF9M6REhDHHRkdUNg4gIaULcqeU+kjI9ZzF5BkaCmCdgqeKLuXA X-Received: by 2002:a05:6a00:1d07:b0:6f8:b1dc:d97e with SMTP id d2e1a72fcca58-6f8f3d6824bmr10870348b3a.23.1716865733153; Mon, 27 May 2024 20:08:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716865733; cv=pass; d=google.com; s=arc-20160816; b=SSikhHI6T+iLb2CHG2/92LLNV2eH0WVmcB3Td7jPOLEpQGn9w1cesS+3x+iM2VsRoU eSFUYtAwu6QBVBM8lYyX8FN5agTRNQQ6moM4ifKg8MjzgnWay9YqP0pz7Qw0x7SsHxJo PRB7I6+fbvIoKbRHm1aFaz7MH5waXBaI3UicsMN0NJVLQIfTI1deJy6W0Q5HLM8J91H+ Lb+XUp++VbbT8E4qziO/45ZHD8dwMyjhmB4RWy/z8Ztf8pQI7abMo7uQMc+PvkFSVdS2 bVTY7vrqjGIOFAJ4a0IiYeK9HKRo0VwHWXz9RWHI9Rk3DCTyxB3eAccfVj2nHqcy+aAv QqYg== 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=Nx+RZEyWMrBDmMWfYXQ77FuBI1xQbO4/MgPv93O1whQ=; fh=O7W32hzrxLioy2lU7cq0myUffGADZNPHRUPmOpshY3A=; b=JrYjUuwuCkBnl3SI9tFY0ybTfhDA8GphqXrLbY1Pecx416xve6iMooNu3b8d4gh6Ir D63yiJ/Vb/l2QSTgJyApQ0z/2DPyMKcc+Fvz3k77BS5DhvBwv97esHhu/ssMxjFskiFl acZjTqudl0j2miF1q0PQVn7+9cnYuDXznEAuI6qL2SEoWuLv1foOikqyawMAWXQ/rCxO f4OgAGDOAMxfcS1h2g3jQvPfX+jVpap+814hwF0CAWZMTqQYSzBNZGnLM3q1hcv6f66x kj8xMi1ZTJWMcGZugX1w07Jy9wTSX65DAxsEv6xs4f8WIYV+YJwYJuPga5zyUBgO3bry QxIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RvHwy407; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-191670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191670-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68221b73ae4si7634755a12.7.2024.05.27.20.08.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 20:08:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RvHwy407; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-191670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191670-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 07EE4B21DF5 for ; Tue, 28 May 2024 03:08:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27F911D68F; Tue, 28 May 2024 03:08:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RvHwy407" 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 4E2BA1C68E; Tue, 28 May 2024 03:08:40 +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=1716865720; cv=none; b=FHwZwpCwFoCYzMeVVdMEabmep2mk9SQwXELrYZ5Mp2E/k6L8ClcHqyPTVlz3wPa1i41Rcnfz+te9UmVj0GGtcWxttylex7S9K4ICGjlXsjFXMsIoYME6hEPomOD09Zzw51HINEdtW7aLeq2ADq09oWoLPzTbKNaGMzjt15vSmW0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716865720; c=relaxed/simple; bh=d7d5F6caD9/yJ3kRjdZS1IPLThXJka7WSNS5A4PF+fI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZpnnAxqKmWdoeux2PNYKnKsSuBqdq3wvf9WO1jTJjPVy8A0uiQMWp4IlO+hAeF38DiSt20xh3VHG50mVCnObW15DAc8Y7HgZMknQlJak441gsfbKkVJdhaFO5BJgTEgcUvH30lJTQe3R2QFzc9HmsKN7ar463UqoUMI3OSWB2Ls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RvHwy407; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 784D4C2BBFC; Tue, 28 May 2024 03:08:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716865719; bh=d7d5F6caD9/yJ3kRjdZS1IPLThXJka7WSNS5A4PF+fI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RvHwy407wYBqxzTnTcA53k/E8zgm1pDTTfjIQXaUzK3/TpImMrDDUZB3odnqXQyhC 6vPE23w45KBrQ7BtUzZMuThb1bl84dr2YscivnKnXTQsQ0ufMMW14rDEm9Tx3uh+uG Kdy+HSAyRxk4vCvBNnr5NsOtQqD8eHQeXkA/i+WQIv2z/Cmr5KTX87daCqpAep3H69 18g3xUEkP/CgatryUq61t91zjQcjhHPVr4sGLQwYdGooaF8aaXXMk8dQe9yf2FCEFB weRefEEoI9zmePnNV7pachBaw4yKpdfeawo9LDU1l0PaaeKZek1vNkkzwv/Zbk+JDK ZGpzDkDUsEhfA== Date: Tue, 28 May 2024 03:08:36 +0000 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> <87jzjk1ibr.fsf@jubnut.com> <87cypb12j9.fsf@jubnut.com> <877cff2kpb.fsf@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: <877cff2kpb.fsf@jubnut.com> On Mon, May 27, 2024 at 07:06:40PM +0100, Ben Walsh wrote: > Tzung-Bi Shih writes: > > > On Fri, May 24, 2024 at 07:35:22PM +0100, Ben Walsh wrote: > > >> I could add a new quirk which provides an alternative ACPI match table > >> to be used instead of the default. In the default case the match_table > >> will contain only "GOOG0004" as before. But in the Framework EC case the > >> match table will be "PNP0C09". > > > > I think it doesn't work as the current quirk is handling in > > cros_ec_lpc_probe() which is after matching. > > I was thinking of a new quirk called CROS_EC_LPC_QUIRK_ACPI_MATCH, and > putting it in cros_ec_lpc_init(), not cros_ec_lpc_probe(). Do we have to > do all quirk handling in cros_ec_lpc_probe()? No, but there is already code in cros_ec_lpc_probe() for handling quirks and we would like to reuse them if we could. Also a possible issue: MODULE_DEVICE_TABLE() wouldn't work if the table changes during runtime. > > > My original idea: would it be possible to get the `adev` in cros_ec_lpc_probe() > > via any lookup API? If yes, it could still use DMI match and get `adev` if > > required. > > That works; I've tested it. > > In this scenario we're not using the existing PNP0C09 platform device, > which means I can't look at > /sys/bus/acpi/devices/PNP0C09\:00/physical_node/driver and see the > driver. Is this OK? > > (Note that ACPI_COMPANION_SET() doesn't fix this. You can use > acpi_bind_one() but that seems more like internal plumbing). As long as ACPI_COMPANION() in the driver can get the correct `adev`, I guess it's fine. Otherwise, put the `adev` to somewhere device specific (e.g. struct cros_ec_lpc) should also work.