From nobody Thu Apr 9 20:27:22 2026 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 F3352287257; Thu, 5 Mar 2026 19:48:11 +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=1772740092; cv=none; b=m6MXoB+yCT4zA7E4BCKrcjRC8yv390vEt1zAd3HZbLltxLdLekTAre9WtKGj3+EwXhuy3p+GF0Ve3G0Bht7F6l4FKatpad0ZP5+Jtv4hY6nBNoKCPglNZ/rT8f1l+P7fvYJALLgxsCN173zZOChPYf4FGAmT+dZkFWncciWrZpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772740092; c=relaxed/simple; bh=yawNC3/TxNcH+OB5pG83WCAh7HJ5dwYdwe7kKNkMnHg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WI0iTi+z38hBGYVgMoknC5p2CUGUZZzD75GdYR7F31T3oc4mXI3SZIgkOuql42D1XMKaX45DLWfnV8295N4vwUS3Il6sW4/1FKX/YEHOT89OxhasdsIPXcEWgqOZX7fj/NedTABmaRVCYI0t5Slk/7UrU/9bylmtSm4Cow4bJzA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B2gQWeK/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B2gQWeK/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 476A6C116C6; Thu, 5 Mar 2026 19:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772740091; bh=yawNC3/TxNcH+OB5pG83WCAh7HJ5dwYdwe7kKNkMnHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B2gQWeK/YxvQLY+ypXqzCLQO8gAzDmT72p4teuVRmGyw3RWriocml+AS3/s62v3ht ols8cNDUkf9By9fBf0sV5LHMJ8BKIBY4kBTgWMUvLy9XiLfKyJRd6DUs2/Hp3+J5/A bzEuapQkhy+z068TgJ4VoOkcQfs2+xpBrKI+OSSPQ0AtTV9DXnqXXq32edIWhOq+sV +HZu2qns05di6nKmRp5xt/0L8HgbdOMEKrHFMaXGze0QWTPIghIgPZaihBhEnIVfKF 4WI4FbP50MnyzvyDeAXXidag+PAMqsbNcLrl/Oyq8R8TkO9hru8tVgX88OmaWe0gOz wXWS9sX2u+tTg== From: "Rafael J. Wysocki" To: Tzung-Bi Shih Cc: chrome-platform@lists.linux.dev, LKML , Linux ACPI , Benson Leung , Enric Balletbo i Serra , Ravi Chandra Sadineni Subject: [PATCH v2 5/6] platform/chrome: wilco_ec: event: Register ACPI notify handler Date: Thu, 05 Mar 2026 20:43:59 +0100 Message-ID: <7931926.EvYhyI6sBW@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <6259948.lOV4Wx5bFT@rafael.j.wysocki> References: <6259948.lOV4Wx5bFT@rafael.j.wysocki> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Rafael J. Wysocki" To facilitate subsequent conversion of the driver to a platform one, make it install an ACPI notify handler directly instead of using a .notify() callback in struct acpi_driver. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- v1 -> v2: No changes --- drivers/platform/chrome/wilco_ec/event.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/platform/chrome/wilco_ec/event.c b/drivers/platform/ch= rome/wilco_ec/event.c index 743cd4839bff..f4500dd05f93 100644 --- a/drivers/platform/chrome/wilco_ec/event.c +++ b/drivers/platform/chrome/wilco_ec/event.c @@ -253,14 +253,16 @@ static int enqueue_events(struct acpi_device *adev, c= onst u8 *buf, u32 length) =20 /** * event_device_notify() - Callback when EC generates an event over ACPI. - * @adev: The device that the event is coming from. + * @handle: ACPI handle of the device that the event is coming from. * @value: Value passed to Notify() in ACPI. + * @data: Notify handler data. * * This function will read the events from the device and enqueue them. */ -static void event_device_notify(struct acpi_device *adev, u32 value) +static void event_device_notify(acpi_handle handle, u32 value, void *data) { struct acpi_buffer event_buffer =3D { ACPI_ALLOCATE_BUFFER, NULL }; + struct acpi_device *adev =3D data; union acpi_object *obj; acpi_status status; =20 @@ -489,8 +491,16 @@ static int event_device_add(struct acpi_device *adev) if (error) goto free_dev_data; =20 + /* Install an ACPI notify handler. */ + error =3D acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY, + event_device_notify, adev); + if (error) + goto free_cdev; + return 0; =20 +free_cdev: + cdev_device_del(&dev_data->cdev, &dev_data->dev); free_dev_data: hangup_device(dev_data); free_minor: @@ -502,6 +512,8 @@ static void event_device_remove(struct acpi_device *ade= v) { struct event_device_data *dev_data =3D adev->driver_data; =20 + acpi_dev_remove_notify_handler(adev, ACPI_DEVICE_NOTIFY, + event_device_notify); cdev_device_del(&dev_data->cdev, &dev_data->dev); ida_free(&event_ida, MINOR(dev_data->dev.devt)); hangup_device(dev_data); @@ -519,7 +531,6 @@ static struct acpi_driver event_driver =3D { .ids =3D event_acpi_ids, .ops =3D { .add =3D event_device_add, - .notify =3D event_device_notify, .remove =3D event_device_remove, }, }; --=20 2.51.0