From patchwork Wed Dec 20 23:54:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181902 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp83697dyi; Wed, 20 Dec 2023 15:56:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IExUh2PzYYiXi7EZSQyuow775Am+PTYt5Gu/vDOHWiwIMfd61qmy/cm7ReJBog0xGZ9PoyM X-Received: by 2002:a50:c905:0:b0:54c:4837:7594 with SMTP id o5-20020a50c905000000b0054c48377594mr10797859edh.64.1703116565602; Wed, 20 Dec 2023 15:56:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116565; cv=none; d=google.com; s=arc-20160816; b=ONWTY8ATAfO/sz/w2nl7utSIlavDyKZp/jX04q+p/uqxpzgQ2TgCdIPkK+/uKGrCKF SZIZt0Wcr4ogd6s/cqcsKQSEok2fZHNHFHXyOrq81U29ZIZNDMu7rN5jL2ftyByBb2j2 rqMRJSCSVcPQ/YlfXgX9A9+6QGhSfKGdtxDS/LePAyxtk9vt1V8WTlPL0swAcNPI5p8a YDo/pRwEVzuHBMfmnDuCz8ZRhe3qHRyd++5Zi9AglpdH1rFtEbD2oVtGkv9WOQD/LHyH 5tJJzD6xvrOIXmVZ7PxHU479E+ExlB5FnKQf+supFZRj19E0dxmz/Dww0bFIWBYMVB2Z 1iWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=J4PHO7Jw/IWJrb0Mf1SLe4BFSupAlBrmRHdwYgRla00=; fh=3z5JeRWtcEl8Gzy3/rvKFjEAHsR+0njQZwNZYgKN/BU=; b=KSGa2edVzI94U3STvOHzA6KZOUD1mH+m5fobgzdk9Ff4D2itxpabWxdd+qVF4IZxSd r7BNWAYUwOgHBDv77xOr4RhRdXm6AYMYEJMzKJYu4AG5pBWYso2lo5icw4fl7031Rong OI4qIZgHlRpkjhakM9vLpKwe24AKzPetroAFSBpzoV+4F6IA4ch82drMl0lKjo/YDI/n HQ3/90maosjpLs4xsOscwlmTGxTsiLz3VycqIeP4wRM69RnF+umvx2JsMQjSbhvSEZjd kcRpIYJOL+7Z2cOQt3Kd8b19TYbhd6ZXHTcSbtE0GtRWgsCyQxq3oImQr1XP1GLCBX1i WvgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RFbvA5Xq; spf=pass (google.com: domain of linux-kernel+bounces-7652-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7652-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a59-20020a509ec1000000b005534e422bfesi291903edf.314.2023.12.20.15.56.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:56:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7652-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RFbvA5Xq; spf=pass (google.com: domain of linux-kernel+bounces-7652-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7652-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0F9A31F2123D for ; Wed, 20 Dec 2023 23:56:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F5894C627; Wed, 20 Dec 2023 23:55:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RFbvA5Xq" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8805F4B5AD for ; Wed, 20 Dec 2023 23:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-35fceb46c5fso672935ab.0 for ; Wed, 20 Dec 2023 15:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116508; x=1703721308; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J4PHO7Jw/IWJrb0Mf1SLe4BFSupAlBrmRHdwYgRla00=; b=RFbvA5XqAwcl+y2f/yvdDqW4T70wVF4nPS/ukZQErT+rodUh9LH/azDIrv5siBKYnp 0aIbFWPqjYZBjOWWydoyQTT7Y0ocsxLXC3J1rmZ6xebUMXDiUOYu3oKJRggCll2e6cJ7 /zGPXZCH/b3SsQMO7NK639rk79lMl4Ao0Nd9U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116508; x=1703721308; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J4PHO7Jw/IWJrb0Mf1SLe4BFSupAlBrmRHdwYgRla00=; b=TMbYPB2yd38YH8ie8l4BR9wH2ZPFEMQTKP9jld6bmvvI4ENYcUCZYyF1mJ+ziT4xjL 6GO5wKrzHs6e7bCLFUg/AelltK9bmqL9tNSGLBcRCz3+iuK6xuVkviGUWIJKbdueRenv nwXhekqfrdlE6A10CvPp14sMK2llmJ8CmeKvyw+J/zsWnAmmnGp8fRo0kHdfI/B6Rc35 DVpYtjRZp6yS/rHlyWkTlAzFgLWakC26+0mn1zUFHjRKMzoLNbL64C4cSCO6cMI/KGLk LK2LURoNJtDesxRgL/be73913gWG3nxWHuYSI8yhRSu3TmyUNuqlh40p9FiVcVY53dLC LtAw== X-Gm-Message-State: AOJu0YwOQNGWcQIxgELaakfkmASmi8tMPfSd3MrN6REkr0tc3f4KaWfc OjOccoIWBuhbsKQEO0pEC18PQ8XwIlMYE2dqVvBcUBSHlYGb X-Received: by 2002:a05:6e02:154d:b0:35d:59b3:2f87 with SMTP id j13-20020a056e02154d00b0035d59b32f87mr2865766ilu.28.1703116508461; Wed, 20 Dec 2023 15:55:08 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:08 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Andy Shevchenko , Bartosz Golaszewski , Len Brown , Linus Walleij , Mika Westerberg , "Rafael J. Wysocki" , Wolfram Sang , linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [PATCH v2 01/22] gpiolib: acpi: Modify acpi_dev_irq_wake_get_by() to use resource Date: Wed, 20 Dec 2023 16:54:15 -0700 Message-ID: <20231220165423.v2.1.Ifd0903f1c351e84376d71dbdadbd43931197f5ea@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847156288176770 X-GMAIL-MSGID: 1785847156288176770 Other information besides wake capability can be provided about GPIO IRQs such as triggering, polarity, and sharability. Use resource flags to provide this information to the caller if they want it. This should keep the API more robust over time as flags are added, modified, or removed. It also more closely matches acpi_irq_get() which take a resource as an argument. Rename the function to acpi_dev_get_gpio_irq_resource() to better describe the function's new behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Remove explicit cast to struct resource -irq -> IRQ drivers/gpio/gpiolib-acpi.c | 25 ++++++++++++++++--------- drivers/i2c/i2c-core-acpi.c | 10 ++++++++-- include/linux/acpi.h | 23 ++++++++++------------- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 88066826d8e5b..ef98b50f42f86 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -111,6 +111,7 @@ struct acpi_gpio_info { int polarity; int triggering; bool wake_capable; + bool shareable; unsigned int debounce; unsigned int quirks; }; @@ -760,6 +761,7 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data) lookup->info.debounce = agpio->debounce_timeout; lookup->info.gpioint = gpioint; lookup->info.wake_capable = acpi_gpio_irq_is_wake(&lookup->info.adev->dev, agpio); + lookup->info.shareable = agpio->shareable == ACPI_SHARED; /* * Polarity and triggering are only specified for GpioInt @@ -1004,11 +1006,11 @@ struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode, } /** - * acpi_dev_gpio_irq_wake_get_by() - Find GpioInt and translate it to Linux IRQ number + * acpi_dev_get_gpio_irq_resource() - Find GpioInt and populate resource struct * @adev: pointer to a ACPI device to get IRQ from * @name: optional name of GpioInt resource * @index: index of GpioInt resource (starting from %0) - * @wake_capable: Set to true if the IRQ is wake capable + * @r: pointer to resource to populate with IRQ information. * * If the device has one or more GpioInt resources, this function can be * used to translate from the GPIO offset in the resource to the Linux IRQ @@ -1023,10 +1025,12 @@ struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode, * The GPIO is considered wake capable if the GpioInt resource specifies * SharedAndWake or ExclusiveAndWake. * - * Return: Linux IRQ number (> %0) on success, negative errno on failure. + * IRQ number will be available in the resource structure. + * + * Return: 0 on success, negative errno on failure. */ -int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *name, int index, - bool *wake_capable) +int acpi_dev_get_gpio_irq_resource(struct acpi_device *adev, const char *name, int index, + struct resource *r) { int idx, i; unsigned int irq_flags; @@ -1084,16 +1088,19 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *name, in } /* avoid suspend issues with GPIOs when systems are using S3 */ - if (wake_capable && acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) - *wake_capable = info.wake_capable; + if (info.wake_capable && !(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) + info.wake_capable = false; - return irq; + *r = DEFINE_RES_IRQ(irq); + r->flags = acpi_dev_irq_flags(info.triggering, info.polarity, + info.shareable, info.wake_capable); + return 0; } } return -ENOENT; } -EXPORT_SYMBOL_GPL(acpi_dev_gpio_irq_wake_get_by); +EXPORT_SYMBOL_GPL(acpi_dev_get_gpio_irq_resource); static acpi_status acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index d6037a3286690..8126a87baf3d4 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -203,6 +203,7 @@ int i2c_acpi_get_irq(struct i2c_client *client, bool *wake_capable) { struct acpi_device *adev = ACPI_COMPANION(&client->dev); struct list_head resource_list; + struct resource irqres; struct i2c_acpi_irq_context irq_ctx = { .irq = -ENOENT, }; @@ -217,8 +218,13 @@ int i2c_acpi_get_irq(struct i2c_client *client, bool *wake_capable) acpi_dev_free_resource_list(&resource_list); - if (irq_ctx.irq == -ENOENT) - irq_ctx.irq = acpi_dev_gpio_irq_wake_get(adev, 0, &irq_ctx.wake_capable); + if (irq_ctx.irq == -ENOENT) { + ret = acpi_dev_get_gpio_irq_resource(adev, NULL, 0, &irqres); + if (ret) + return ret; + irq_ctx.irq = irqres.start; + irq_ctx.wake_capable = irqres.flags & IORESOURCE_IRQ_WAKECAPABLE; + } if (irq_ctx.irq < 0) return irq_ctx.irq; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 118a18b7ff844..83aa2fa8e81fc 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1221,8 +1221,8 @@ bool acpi_gpio_get_irq_resource(struct acpi_resource *ares, struct acpi_resource_gpio **agpio); bool acpi_gpio_get_io_resource(struct acpi_resource *ares, struct acpi_resource_gpio **agpio); -int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *name, int index, - bool *wake_capable); +int acpi_dev_get_gpio_irq_resource(struct acpi_device *adev, const char *name, int index, + struct resource *r); #else static inline bool acpi_gpio_get_irq_resource(struct acpi_resource *ares, struct acpi_resource_gpio **agpio) @@ -1234,28 +1234,25 @@ static inline bool acpi_gpio_get_io_resource(struct acpi_resource *ares, { return false; } -static inline int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *name, - int index, bool *wake_capable) +static inline int acpi_dev_get_gpio_irq_resource(struct acpi_device *adev, const char *name, + int index, struct resource *r) { return -ENXIO; } #endif -static inline int acpi_dev_gpio_irq_wake_get(struct acpi_device *adev, int index, - bool *wake_capable) +static inline int acpi_dev_gpio_irq_get_by(struct acpi_device *adev, const char *name, int index) { - return acpi_dev_gpio_irq_wake_get_by(adev, NULL, index, wake_capable); -} + struct resource r; + int ret; -static inline int acpi_dev_gpio_irq_get_by(struct acpi_device *adev, const char *name, - int index) -{ - return acpi_dev_gpio_irq_wake_get_by(adev, name, index, NULL); + ret = acpi_dev_get_gpio_irq_resource(adev, name, index, &r); + return ret ?: r.start; } static inline int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index) { - return acpi_dev_gpio_irq_wake_get_by(adev, NULL, index, NULL); + return acpi_dev_gpio_irq_get_by(adev, NULL, index); } /* Device properties */ From patchwork Wed Dec 20 23:54:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181903 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp83792dyi; Wed, 20 Dec 2023 15:56:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHM00YeVblpErrUzWaPV5E4JL3zGTW9S6tlnh7fhzl5crqfPMqgw8AikdiirFNEzHXtPmIl X-Received: by 2002:a17:906:100e:b0:a23:4faa:d4e9 with SMTP id 14-20020a170906100e00b00a234faad4e9mr2826175ejm.21.1703116578268; Wed, 20 Dec 2023 15:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116578; cv=none; d=google.com; s=arc-20160816; b=HO9uUmPKjONASad8WBGa0L3U+WQ53wjdUIoVRnd56Hsz1mH+XHyZSC92hxmZSKgsid iPaUWi9hdkqYzi4R0qHeDD2JtWWnFOQodPmFJZpASHI+9Hw3VRcMqGSjxOu/Q+9TTQjP LrbV+ZUi8HxGOe4TkEeV8yZBEwj2Va9tv/srZUmJua3e9QQfGZSVwQT0qQbz40gVABNZ zRqRkeB0zDCTwn4HDhMDfWbLubtgUrJ284q2r1TZHNUEcHIJJDhD9WpG+tI+zIYsQWdK l+YSNk/FpjJsReoQ5xLUXnWEJYZ2OEnYQBEkkT0nJxyO9p8BKWIFmpKCNFhSz9Q6T9KD 9M2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/o+KKmDTnImF1c7hrNdqiBoZEXBQ6geLnhMdio5wPuY=; fh=b4gbDD3IhyRab/rWFGdhiV1GwfqPqc0jYcaAFchRne0=; b=AnxBSjfgpPk2U3ad3ZSvLb5jGjhVHORoDFfxbRID3QiHSziO8QX8/mGJHvW3kBnHWR 5s9bVgXohqgkCVlEaVQl2zLxGXen08zDpTv0Ym5m0rHUFNHDnYAb/H9XJbvs90feyUCF VtY2Tr2oSyuBMoR8Y/N6QpnnzCdFNl0vVhMM3eZRdOSoJwVlKnjzetd3SSLcmFPermG9 RorryTVJf6ukqJM5J0+LoKYEsC1UqZZhtnaUAQf9mllG2B/dapPqt7Y3IK5b6Z5wdlLo 6HU0b7Uz9aqdYi2k7IdIz6GQb81LOsKZOpGivkiTZvx5Trqq9Vl5ux+AI3LQDaNXSF61 Y0JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="bQ/OcYOU"; spf=pass (google.com: domain of linux-kernel+bounces-7653-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7653-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t22-20020a1709063e5600b00a2471c5770fsi278742eji.359.2023.12.20.15.56.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:56:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7653-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="bQ/OcYOU"; spf=pass (google.com: domain of linux-kernel+bounces-7653-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7653-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id B92E91F2147B for ; Wed, 20 Dec 2023 23:56:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EB134CB34; Wed, 20 Dec 2023 23:55:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bQ/OcYOU" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AD4D4B5C3 for ; Wed, 20 Dec 2023 23:55:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7ba84a3cc96so7619639f.3 for ; Wed, 20 Dec 2023 15:55:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116509; x=1703721309; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/o+KKmDTnImF1c7hrNdqiBoZEXBQ6geLnhMdio5wPuY=; b=bQ/OcYOU42ClsodC12+3G1i/51oibHkhqKyPVpnJP9AE81z80dDb8HxVcq7mr0fFQz cNDhMqlhOjBPL0IhF5IvOyhw/8r7H+dTrI7B84YwoDkl5iBjV4tzSbpxzRxUdm/2l/t3 evVRJSj4/k5XQSAp+y3QNlzuKbHlfshj8NnmI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116509; x=1703721309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/o+KKmDTnImF1c7hrNdqiBoZEXBQ6geLnhMdio5wPuY=; b=JtBt0Xldu5CTMKWvg3tTF33bbKp0xdI7eO8FO6C5p3tERYsgBF2No+lbsZWhyckZSs s2UZJGGHrWQ4jy6b0FlkpVhPqBnTgTh3aHXMRbxkjaalq3i1Q/8PvbLuJgAs0v81D6Qh 1AHgYcqv4vgy6TzRrdDtpPPZxtd5JS8kPVYGNawbgf4+7xU5QShzNmtIZNUI4EBztVL7 OjQ1fRve7B2L5H8XyINoXOM0INDsKQ2PH3KT5OLv0l1QFU9PLrTSjDuibPmz4hDajBfh JyEpBiH/6prBB5u4u7BsPB1VDLKp9yQJXrGV9j4VEME2TLX5UCi59IL/G3KoMIDGQUzz LIWQ== X-Gm-Message-State: AOJu0YwjiYsTcaDv1YF0zsT4K3dz7Yn8z6W14XfGpUZQuzwhjsNR56ho oGOng7woaSC93wCjJh2BnEZh/AAsraMQjNJQvdpJGA== X-Received: by 2002:a5d:8d95:0:b0:7b7:2bb4:c2b6 with SMTP id b21-20020a5d8d95000000b007b72bb4c2b6mr23483716ioj.31.1703116509294; Wed, 20 Dec 2023 15:55:09 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:09 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Mika Westerberg , Wolfram Sang , linux-acpi@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [PATCH v2 02/22] i2c: acpi: Modify i2c_acpi_get_irq() to use resource Date: Wed, 20 Dec 2023 16:54:16 -0700 Message-ID: <20231220165423.v2.2.Ib65096357993ff602e7dd0000dd59a36571c48d8@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847169195923384 X-GMAIL-MSGID: 1785847169195923384 The i2c_acpi_irq_context structure provides redundant information that can be provided with struct resource. Refactor i2c_acpi_get_irq() to use struct resource instead of struct i2c_acpi_irq_context. Signed-off-by: Mark Hasemeyer --- Changes in v2: -New patch drivers/i2c/i2c-core-acpi.c | 44 ++++++++++++++----------------------- drivers/i2c/i2c-core-base.c | 6 ++--- drivers/i2c/i2c-core.h | 4 ++-- 3 files changed, 22 insertions(+), 32 deletions(-) diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index 8126a87baf3d4..01cf140da21af 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -175,64 +175,54 @@ static int i2c_acpi_do_lookup(struct acpi_device *adev, static int i2c_acpi_add_irq_resource(struct acpi_resource *ares, void *data) { - struct i2c_acpi_irq_context *irq_ctx = data; - struct resource r; + struct resource *r = data; - if (irq_ctx->irq > 0) + if (r->start > 0) return 1; - if (!acpi_dev_resource_interrupt(ares, 0, &r)) + if (!acpi_dev_resource_interrupt(ares, 0, r)) return 1; - irq_ctx->irq = i2c_dev_irq_from_resources(&r, 1); - irq_ctx->wake_capable = r.flags & IORESOURCE_IRQ_WAKECAPABLE; + i2c_dev_irq_from_resources(r, 1); return 1; /* No need to add resource to the list */ } /** - * i2c_acpi_get_irq - get device IRQ number from ACPI + * i2c_acpi_get_irq - get device IRQ number from ACPI and populate resource * @client: Pointer to the I2C client device - * @wake_capable: Set to true if the IRQ is wake capable + * @r: resource with populated IRQ information * * Find the IRQ number used by a specific client device. * * Return: The IRQ number or an error code. */ -int i2c_acpi_get_irq(struct i2c_client *client, bool *wake_capable) +int i2c_acpi_get_irq(struct i2c_client *client, struct resource *r) { struct acpi_device *adev = ACPI_COMPANION(&client->dev); struct list_head resource_list; - struct resource irqres; - struct i2c_acpi_irq_context irq_ctx = { - .irq = -ENOENT, - }; int ret; + if (IS_ERR_OR_NULL(r)) + return -EINVAL; + INIT_LIST_HEAD(&resource_list); ret = acpi_dev_get_resources(adev, &resource_list, - i2c_acpi_add_irq_resource, &irq_ctx); + i2c_acpi_add_irq_resource, r); if (ret < 0) return ret; acpi_dev_free_resource_list(&resource_list); - if (irq_ctx.irq == -ENOENT) { - ret = acpi_dev_get_gpio_irq_resource(adev, NULL, 0, &irqres); - if (ret) - return ret; - irq_ctx.irq = irqres.start; - irq_ctx.wake_capable = irqres.flags & IORESOURCE_IRQ_WAKECAPABLE; - } - - if (irq_ctx.irq < 0) - return irq_ctx.irq; + if (r->start > 0) + return r->start; - if (wake_capable) - *wake_capable = irq_ctx.wake_capable; + ret = acpi_dev_get_gpio_irq_resource(adev, NULL, 0, r); + if (!ret) + return r->start; - return irq_ctx.irq; + return ret; } static int i2c_acpi_get_info(struct acpi_device *adev, diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 3bd48d4b6318f..8b8c7581a60c2 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -513,10 +513,10 @@ static int i2c_device_probe(struct device *dev) if (irq == -EINVAL || irq == -ENODATA) irq = of_irq_get(dev->of_node, 0); } else if (ACPI_COMPANION(dev)) { - bool wake_capable; + struct resource r = {0}; - irq = i2c_acpi_get_irq(client, &wake_capable); - if (irq > 0 && wake_capable) + irq = i2c_acpi_get_irq(client, &r); + if (irq > 0 && r.flags & IORESOURCE_IRQ_WAKECAPABLE) client->flags |= I2C_CLIENT_WAKE; } if (irq == -EPROBE_DEFER) { diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h index 05b8b8dfa9bdd..b5dc559c49d11 100644 --- a/drivers/i2c/i2c-core.h +++ b/drivers/i2c/i2c-core.h @@ -61,11 +61,11 @@ static inline int __i2c_check_suspended(struct i2c_adapter *adap) #ifdef CONFIG_ACPI void i2c_acpi_register_devices(struct i2c_adapter *adap); -int i2c_acpi_get_irq(struct i2c_client *client, bool *wake_capable); +int i2c_acpi_get_irq(struct i2c_client *client, struct resource *r); #else /* CONFIG_ACPI */ static inline void i2c_acpi_register_devices(struct i2c_adapter *adap) { } -static inline int i2c_acpi_get_irq(struct i2c_client *client, bool *wake_capable) +static inline int i2c_acpi_get_irq(struct i2c_client *client, struct resource *r) { return 0; } From patchwork Wed Dec 20 23:54:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp83876dyi; Wed, 20 Dec 2023 15:56:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEidO77K26KNhyU0A5lhKuNEoGdzc1ZWx9Hh5CRpp8Wt5PTPaB/G93wv659nCvC+zFMxrNu X-Received: by 2002:a05:622a:1883:b0:425:4043:41ae with SMTP id v3-20020a05622a188300b00425404341aemr31596281qtc.90.1703116589829; Wed, 20 Dec 2023 15:56:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116589; cv=none; d=google.com; s=arc-20160816; b=ZigGdJ6n/hjn6nEHdAEuqHSgdoaKXTFxRVsL0103LfPzJLRnUNTDklqXSXoH5go+0o l0dtkrGuN5ijV/UH+ahi2R4BF9N23cQEnJMOg4zsGec5FnhWsbvnf4wo09cp3ANW+/dy ao/Kk9vixatzFruH/oWvi7ygHI7ZVY8LfhqkrT95LUrZ3K4uC5MyMSUKC9SeucjzdNN5 kfix942EBZjsDHecrm2x1UdzBwCHrtgePR11bzzmI0Ip0pafudE7SAEpnJ/RFT2iLfkt S6j+egaH0nYEAoWKNIXXDUXKpC9qvXcQK/0ixjtVssd5Uycz0Fs0KV/c9DaT2ILfLLIm jV8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=pRvpMTwdfOti1O2FiABGEbKxnsSHcyKdzfu7EEJhob4=; fh=FojAGB4EDBm2/HJnqHVL8Who3DGa3eiBg8AsvvJn678=; b=p38etWrODx1szkMgS29JgAtYvqjTFcVUGFnZj/eeA1/G0dC5x4vwt19KzNFlZQ1ZkN ejlrLjU6MFAOMJ7mKaawcyPnGR0z5ZrexX912+KdqS4CFFdzlv1NogK9Y1DY0zY+PZh2 peEiWtNUHr2j5OYxnknIaYRHKGQlsl5DDQ9a1USXnKM99jj+IvLyESYfbTRwkacywuNY vK8VP2f94zaD1GbjGCiP3mwos/96XtqZGZfBVgKswh8WevuFTvp27cVK+lxaYQSEDnKb teyO+8FOa0uhmmupUHpQxTMuPPS+Mz6utcAjcnwDzG4B69shbn9g2QHVuNjWC5m9SiHH WM5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UoatwZ4i; spf=pass (google.com: domain of linux-kernel+bounces-7655-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7655-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j15-20020ac85f8f000000b00425daf073fesi804807qta.318.2023.12.20.15.56.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:56:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7655-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UoatwZ4i; spf=pass (google.com: domain of linux-kernel+bounces-7655-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7655-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 9C1421C2361D for ; Wed, 20 Dec 2023 23:56:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50D394CB56; Wed, 20 Dec 2023 23:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UoatwZ4i" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 510124B5CA for ; Wed, 20 Dec 2023 23:55:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7b798e6f702so8431739f.2 for ; Wed, 20 Dec 2023 15:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116510; x=1703721310; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pRvpMTwdfOti1O2FiABGEbKxnsSHcyKdzfu7EEJhob4=; b=UoatwZ4iml1hN1QxLiYWvS5o5aZ8KsYbpWuj2St8UO820yw4ti1xYKe+M3+hWqXAWG E9Lq3PNJgEWxozl3VGkcaxtNTVTEtbJpL4KYN3BoTCobgrm2vj2HIblbGIJ//Se/MGvQ hh/WzI4eznFLsxooAHAgtzZNl0Fykkxb3GLcQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116510; x=1703721310; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pRvpMTwdfOti1O2FiABGEbKxnsSHcyKdzfu7EEJhob4=; b=c/Gc2G2q+hkDkpFMvhIb09e6/gA/5l1fRehE8Pz+o11O5L/GENApG7wwmy7VXNOEF4 6KDFi+bseKR1Kd9rDdD0Xl6bJwu0UnhrPWf3lqN4md1NK+1nqwhtShdMd/LgJXciGB+M 9j3gBnyDYvc65B2pcsLIPZCLRZh0LAgmjRNh8utftsbyNJ4K9C5/O+smuKhz19qXy80T jnrqq0jVCHSAB+U0iDzdo1ugxpfQrtTjmCh532mkCNJkCX8y9r65AB93IaEhsQC3dsZf yU5+UGdAZH8dx7pwNu11fGGzawemnf4ztbl7GnJqCPDdCHtUAirEPCjsvF0sWW4HbFh2 qqPg== X-Gm-Message-State: AOJu0YzB9eV/DQfyNKxCZhSGsBo+BKVoAT/wpq2ESIWCJm6t4jkcIzAQ U4FOQmM4iHiqXmTk+jicemXGAyvvbaqebiK4fik= X-Received: by 2002:a05:6602:2bed:b0:7ba:86c3:d975 with SMTP id d13-20020a0566022bed00b007ba86c3d975mr151496ioy.26.1703116510370; Wed, 20 Dec 2023 15:55:10 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:09 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Conor Dooley , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property Date: Wed, 20 Dec 2023 16:54:17 -0700 Message-ID: <20231220165423.v2.3.I1016a45ac9e8daf8a9ebc9854ab90ec3542e7c30@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847181557354092 X-GMAIL-MSGID: 1785847181557354092 The wording in the current documentation is a little strong. The intention was not to fix any particular interrupt as wakeup capable but leave those details to the device. It wasn't intended to enforce any rules as what can be or can't be a wakeup interrupt. Soften the wording to not mandate that the 'wakeup-source' property be used, and clarify what it means when an interrupt is marked (or not marked) for wakeup. Link: https://lore.kernel.org/all/ZYAjxxHcCOgDVMTQ@bogus/ Link: https://lore.kernel.org/all/CAL_Jsq+MYwOG40X26cYmO9EkZ9xqWrXDi03MaRfxnV-+VGkXWQ@mail.gmail.com/ Signed-off-by: Mark Hasemeyer --- Changes in v2: -New patch .../bindings/power/wakeup-source.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/power/wakeup-source.txt b/Documentation/devicetree/bindings/power/wakeup-source.txt index 697333a56d5e2..75bc20b95688f 100644 --- a/Documentation/devicetree/bindings/power/wakeup-source.txt +++ b/Documentation/devicetree/bindings/power/wakeup-source.txt @@ -3,16 +3,20 @@ Specifying wakeup capability for devices Any device nodes ---------------- -Nodes that describe devices which has wakeup capability must contain an +Nodes that describe devices which have wakeup capability may contain a "wakeup-source" boolean property. -Also, if device is marked as a wakeup source, then all the primary -interrupt(s) can be used as wakeup interrupt(s). +If the device is marked as a wakeup-source, interrupt wake capability depends +on the device specific "interrupt-names" property. If no interrupts are labeled +as wake capable, then it is up to the device to determine which interrupts can +wake the system. -However if the devices have dedicated interrupt as the wakeup source -then they need to specify/identify the same using device specific -interrupt name. In such cases only that interrupt can be used as wakeup -interrupt. +However if a device has a dedicated interrupt as the wakeup source, then it +needs to specify/identify it using a device specific interrupt name. In such +cases only that interrupt can be used as a wakeup interrupt. + +While various legacy interrupt names exist, new devices should use "wakeup" as +the canonical interrupt name. List of legacy properties and respective binding document --------------------------------------------------------- From patchwork Wed Dec 20 23:54:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp83947dyi; Wed, 20 Dec 2023 15:56:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9Y6hOb7q2JEDjzqsWxFWjiwVbPt6KElToE4iWg6FmC43LkJbCCd+Vvr6z24bC0WJkgGKH X-Received: by 2002:a05:6a20:471b:b0:18c:432b:c075 with SMTP id ek27-20020a056a20471b00b0018c432bc075mr357234pzb.42.1703116601797; Wed, 20 Dec 2023 15:56:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116601; cv=none; d=google.com; s=arc-20160816; b=av/UCd7tBrtP8q+YlYHAoF6piFuWGsA9LT3P/FGCuiYDzaPAzTgupJV//8R9ZEUcbB AYoiYC1U8oQpFIcHokzzhBc80KXT2nIX+cl2cDTZTYQDM141RkMXJHAMNQWirefKjHNW k1N8yYiBoJ0RrEm4Y3WIRQQ4rrGa7HycALKnROM4vRO/xSqN0yJ0W++UUVxdVNizA59Y NvWkhCZbzIXPiTdkjDDycUyWNjD3uf2Hxf21FtjRJGj8jQwwGtETj9wFHJ/AftDd0A37 4Mdk8gXbTz1h52hDrjTXGplDaPHciVXHewGtQZR/WumoOmiAXdwomLwLCkqGidh/YK3Z f+UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=moVzHQYgk23qLvXFemqZkcgdvSUVJ85XUZMZayldchU=; fh=JMBLoU0YlyuA51AxlDzpFHMn7HjH2B7halhztABWMow=; b=V4VAgroQu0cIUsbpEiAg0r/qNlrEOkvXXB91iEUecw96B2mTEstMoUJlsqw9LtFHsH L5QFpJ+KzfGcuPDWMtVFd6nnPd7Smebd/u7wCUqA8cHaPOA+5ECgrlqlBJ3YchdGRuln SPPvzSe9N+j4qS1Fjdcxss6EoPnEE0XBxw846FR9ASmYGZFFcgb7J1Acc7UrkQIqQf1l aSxmUTkDGLwCzhWZyzmrnhZ3ar5f2+FE58ljTRMCAZA6AK8PhOsQ25Gb/dM7bPLi8kEf bMme1lYjl3DjIt8oMBw6+ZIOiGtHyNvxZw+VrEQQ1/kzSEXy/ftTIxMg11grZzRQbwbc G47g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eXZNoUFY; spf=pass (google.com: domain of linux-kernel+bounces-7656-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7656-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i4-20020a170902c94400b001d07b6a0ae9si381633pla.203.2023.12.20.15.56.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:56:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7656-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eXZNoUFY; spf=pass (google.com: domain of linux-kernel+bounces-7656-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7656-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8B5C8284CB3 for ; Wed, 20 Dec 2023 23:56:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62A234B5B3; Wed, 20 Dec 2023 23:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="eXZNoUFY" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72B784BAA6 for ; Wed, 20 Dec 2023 23:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-7b71e389fb2so9045539f.3 for ; Wed, 20 Dec 2023 15:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116511; x=1703721311; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=moVzHQYgk23qLvXFemqZkcgdvSUVJ85XUZMZayldchU=; b=eXZNoUFY5kGrDYszgBwIu+A0GPgmLRnEfb7PwYqw4ReaovROvnrJhwCdzSnZ4dSh4f MGempUz1PI4sZCdPzea8dLWFFpyM28LrhOX++nD3tzy03trbJDXFEcfbXMuTuaGC8EUL 1mA2QDFy0GojmZdaEB3V50Z0RIHfPhqscz0k8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116511; x=1703721311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=moVzHQYgk23qLvXFemqZkcgdvSUVJ85XUZMZayldchU=; b=ooQpIZy1EhDfRHmDzDuUoUthD0kPCe0/PmEMYwYZcFY2spGbGWg3BQ9TLXZn54CWFd c7XgiwG0yzc7BeRQ+7OrmJvNAsMaJM5ygkqP1q7BoEN3/sev0v4uO8oTNeld0K3Do+Nx Jr415GpSxDRQy7xyEfgwPbtjhgwdxTfHzPzs0O5/UcQ42CKVpOH2LaNzUXflnPCoZPu/ aTZS3L8qvEJN+BfLtHMfSPI1Ec5f9sW6jj4urAIp5ejTcxuLxtSku/XIbGq4B0Gx+3qf Y9f/qKvnpJFiTmiO01S7PFIEZLZ1pos3o5V18kdmLSYvYIvb4y9rWCP+Kh4+53Y8dhar 3FLw== X-Gm-Message-State: AOJu0Ywj9YCub84Lfrpgo2MVauzmStlZXsOLeTmdhPmJGLI7rLhAC5rd y6fEDcXPNoEzoqU5cuPU6Jy+eGhkBXiOfJ2k6ttcfQ== X-Received: by 2002:a6b:6e13:0:b0:7b7:f3f2:9a97 with SMTP id d19-20020a6b6e13000000b007b7f3f29a97mr3933437ioh.26.1703116511607; Wed, 20 Dec 2023 15:55:11 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:11 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Andre Przywara , Conor Dooley , Enric Balletbo i Serra , Jesper Nilsson , Jisheng Zhang , Jonathan Hunter , Krzysztof Kozlowski , Kunihiko Hayashi , Patrice Chotard , Rob Herring , Romain Perier , Thierry Reding , Wei Xu , devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 04/22] ARM: dts: tegra: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:18 -0700 Message-ID: <20231220165423.v2.4.Ia598792a1386cca61844068be03c3ccec9e81753@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847193895618547 X-GMAIL-MSGID: 1785847193895618547 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Split by arch/soc arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi | 1 + arch/arm/boot/dts/nvidia/tegra124-venice2.dts | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi b/arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi index a2ee371802004..8125c1b3e8d79 100644 --- a/arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi +++ b/arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi @@ -338,6 +338,7 @@ cros_ec: cros-ec@0 { interrupt-parent = <&gpio>; interrupts = ; reg = <0>; + wakeup-source; google,cros-ec-spi-msg-delay = <2000>; diff --git a/arch/arm/boot/dts/nvidia/tegra124-venice2.dts b/arch/arm/boot/dts/nvidia/tegra124-venice2.dts index 3924ee385dee0..df98dc2a67b85 100644 --- a/arch/arm/boot/dts/nvidia/tegra124-venice2.dts +++ b/arch/arm/boot/dts/nvidia/tegra124-venice2.dts @@ -857,6 +857,7 @@ cros_ec: cros-ec@0 { interrupt-parent = <&gpio>; interrupts = ; reg = <0>; + wakeup-source; google,cros-ec-spi-msg-delay = <2000>; From patchwork Wed Dec 20 23:54:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181909 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84436dyi; Wed, 20 Dec 2023 15:58:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGly+Q4+VymXcHNvU9NiyoNR5RxVm8/g1iZ56F0T21WE+DW3f2T4wz7cfsKXGTqrAZgPwjf X-Received: by 2002:a05:620a:4311:b0:780:f0a7:764f with SMTP id u17-20020a05620a431100b00780f0a7764fmr5621400qko.53.1703116692188; Wed, 20 Dec 2023 15:58:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116692; cv=none; d=google.com; s=arc-20160816; b=ofKqoDIWztWNQGZRsrAfS4hYm/BnYiTho8jJ8kTDWei1NtIfjm3WrCEn/hPwdc/7jN iWyxYLB47YGM9o5hL0yfSJPuDNXoFYUx68YucqmJ1CK1UYZT/9FtwVj32v4E7Hh7nyjx gDf5FPBsOFnKNeTZWteNfFHStSwHrOvauDusmkqR6+q3cpuOgpd7V6izGKvjbat1zXtT hIUbZvPVMDFQGcvSLX1iuDjdc+Pdl+vDM5fiWsi31Fndgqm6lB5nRtgxSiioh++sAmKS gnhuF75Xklq/Xr1lIVAHbFnkkPNtvZoeTDhy4KICiMLcZG9G1RGUvQ3wAggaMFUr3NZ/ 0FgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uCBYuSyv1htu4Z4UMY79JiCUyFE6xNOmu0NfxL7CL1o=; fh=YOxMtI6NFJiwbMPTUCT8bF29QhAvhcN7hHoyqERQ05w=; b=KaujIvOJui9N7uT4UHo/97oigNmyaK5jPQMGkdVqf0ZIRfC/RE2KN+BudEXqYojSC+ anbkWKpJECfwWXFS6635ZvlxJ0PB7rp/wlF/udyybn6OsqrKnPwnByQzFAWx4ZU/6qJT qdyE0RQfQp3RWgHlgpoH9kLOASNjXgBcJGMJXpGSDmEu07uSl1LOeDt7xMdYkdhdVzuV cRzuXHAayHphHkeLBYELZV7sRSVL1XbEABGkoZEa69ywMX6HOTIWqPHKXnxlxI48116B UCTHw9MYHA57HbAWYca7YLbKDSbNSYLny0yOav6nXLNfiQJbGJ0G35MjIssQ+iCC2oPf IXKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lJNijnIQ; spf=pass (google.com: domain of linux-kernel+bounces-7660-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7660-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y9-20020a05620a44c900b0077d706bc04dsi1012648qkp.675.2023.12.20.15.58.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:58:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7660-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lJNijnIQ; spf=pass (google.com: domain of linux-kernel+bounces-7660-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7660-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 F04161C240ED for ; Wed, 20 Dec 2023 23:58:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F40F4E62D; Wed, 20 Dec 2023 23:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lJNijnIQ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F8024C3D6 for ; Wed, 20 Dec 2023 23:55:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7b7fdde8b54so8829139f.1 for ; Wed, 20 Dec 2023 15:55:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116512; x=1703721312; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uCBYuSyv1htu4Z4UMY79JiCUyFE6xNOmu0NfxL7CL1o=; b=lJNijnIQqt6zUOSl4xal2gPN3JSGaAbShE86eaxXK1s+pzdkYO0ADji40tV9EEDyhB cbggHELnV5v2dCBlhDHg59hxqkWBMYigXmnoBJ35sFb6X5zqS2ywNsOeRDarxXec7355 qBIoEaeYpAZ2TijzBss38xJOkYZWAmiR1NxME= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116512; x=1703721312; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uCBYuSyv1htu4Z4UMY79JiCUyFE6xNOmu0NfxL7CL1o=; b=FLzDrhEdHvgI0HJfhExkLCkBUufBjo40onjX83R3Dql/iiPijTTEQhEayn3XyfU1kD Vv5wvtfq9dP2wfOGXIdS0FQRyl2y8WYuqYADmwo0lkM9loCVKZ/Fa0oDEjY+zTU2Svm7 5ZTYOaC7o3e2e9X6rPHYyySUHeuZHyVSaVnirk76mA1x72mpw9H73liGDcmYPPjeAg62 Uan/S7hoVJcwQJqFdYSg2ek+BuVflWn2baNn2MhxJ/yo6CWT4eI7g5jQikT7lLoL8fGD ddK7k53KWDB5rPIyGVNomhrItckFB8SaPifZ5KDPsprpinJ4ORoQWBJ+G+/7V1Akvv0D ERJw== X-Gm-Message-State: AOJu0Yyl0k2g7l2r8i5E+WFSCBmjGmIiRQuqJsVkmN4Hts6imyI936ur OYvk7OtYjCEOo4ifrY4useg0q6hQuyeKiw4TgEs= X-Received: by 2002:a6b:c8c8:0:b0:7b7:f971:8e75 with SMTP id y191-20020a6bc8c8000000b007b7f9718e75mr3226475iof.12.1703116512588; Wed, 20 Dec 2023 15:55:12 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:12 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Conor Dooley , Heiko Stuebner , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH v2 05/22] ARM: dts: rockchip: rk3288: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:19 -0700 Message-ID: <20231220165423.v2.5.I8249df4df0b7d12fb68ea1e69f84ca589c574bb1@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847288930074790 X-GMAIL-MSGID: 1785847288930074790 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Split by arch/soc arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi b/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi index 092316be67f74..1554fe36e60fe 100644 --- a/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi @@ -112,6 +112,7 @@ cros_ec: ec@0 { pinctrl-names = "default"; pinctrl-0 = <&ec_int>; spi-max-frequency = <3000000>; + wakeup-source; i2c_tunnel: i2c-tunnel { compatible = "google,cros-ec-i2c-tunnel"; From patchwork Wed Dec 20 23:54:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84092dyi; Wed, 20 Dec 2023 15:57:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwIPXD+3qN97Z2+2fXR0xRZLLm3tVjlHee3KBo1pcx/Wlvp/PI8zX2fwNc15R9Cn7q2VI9 X-Received: by 2002:a05:6a20:2a14:b0:193:fda5:8278 with SMTP id e20-20020a056a202a1400b00193fda58278mr598013pzh.16.1703116628009; Wed, 20 Dec 2023 15:57:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116627; cv=none; d=google.com; s=arc-20160816; b=n1hBYQpKMpj2TF4pWntcb+cJfeHUkhg4WTb1ExZWpKw2dO6ROjXV3JQSnwSazwN0pA 0Xd8IDsAHeM2/krXx2Z73Dwcl6Pc6k8d/Jfgp+cE+5Nzn82wxjrRKq5ydwN5yNKKn7IK gugEUDCqgkUUUn89bt+16UFv3lP0WYq3UKrUu9G/kCjYdhlhM1XNcALVvStigjpKfDZo gqI+m9mzHYImZzClEzEybm3UwWtYcuKgy2U8c1eSazs2WHEI4WgIhbPa6RpTdSbKtxF3 ZU3EpExBJd0WdEwbea/VaXb7kbdi71yINB99av2yYGkDm4ESvCs/AYGNyq2IobhBfFNz uXUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kZeDaLYJRo5zLa/L/bxhfuH9rT1XYjT6TiTC8Trsii8=; fh=t+x2+TgvRVQL6saRQSWsmRalfs8oQtSLKQQLcgmBj78=; b=UKyeZt6fPO4ipj0EryTTtAOAIonc1oKWAHwj2JzolnyBQpRUPjJ9ng6WODIEzzzn1r FYLDYXLa4NMIB97MoUzWfi41vuxjd2ja4EASw78EbQwuaHPyGKM2hk8SY2ooXUFYyLBU LIVqZDTiibrWP9jmmovxbRFEbd3gRBoaH5u3p9xOD0C62dQTF/nhlFFrYrxKmFQ+jBiX e/HzjrRHOno71Y24es00sfk2Whwl1zgHauBBUFU8M512OuPQKTwLX/ugpEXGnO/sqwv1 BQlWwbZgcz9D8ydYRyhCh7qJR1hqIuO6zEwplphiyrelIVi5xRWMkVG9rsOVZogcpGag pJSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=c1Or9FTp; spf=pass (google.com: domain of linux-kernel+bounces-7657-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7657-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f29-20020a63555d000000b005c65d0dd9a0si526237pgm.503.2023.12.20.15.57.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:57:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7657-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=c1Or9FTp; spf=pass (google.com: domain of linux-kernel+bounces-7657-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7657-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C3F0D2864AB for ; Wed, 20 Dec 2023 23:57:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60BED4D58D; Wed, 20 Dec 2023 23:55:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="c1Or9FTp" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FF364CB20 for ; Wed, 20 Dec 2023 23:55:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7b7fdde8b98so9328439f.1 for ; Wed, 20 Dec 2023 15:55:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116513; x=1703721313; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kZeDaLYJRo5zLa/L/bxhfuH9rT1XYjT6TiTC8Trsii8=; b=c1Or9FTptFd/J14gVUcRsVlsmwGZznif5GSbnzqdbbWzayd7SAhmqVt2uaXSZonXOx ba4XBfFBsDD78bhinCkcL+TLH+e4wiIjDAdbqu1xE/cZIpnfiMJusBnEnnU2z+IFoLDI JjH8vntTQsG0nx+LY68xNe+s/QtB5MdLnSkR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116513; x=1703721313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kZeDaLYJRo5zLa/L/bxhfuH9rT1XYjT6TiTC8Trsii8=; b=expDY0UPXTEzg7zlVNnXVeITeICqWfN8lfTcHghGSVwyrZISpKd5+EDnMoEzIT07Kl qv2Ly+cXQ8ZeqUr0Mh2+opRArzJL2WW+/Gil/FIHsUUvHbcNwqo9XM7tfsqPfZdRo4ni sQj4vRzd+GBZ8+B3ea54k2xF/4Z03C84TxHWVRde4X8KY20L+83JHrwdju8hNlDOwFC0 aL/9Ko11CcoF0/AyYJDvQkF8GkJlWyyqemICFdemalykVT3C1J1Xg5QHuT914yW3GYQt 9yW+ZM1t7Hi7HI8K46qCe+OsmdSKiPEWep+QkYkMCVbAj/AviWbXrGbi/D9Hsxgawc7n ZsyQ== X-Gm-Message-State: AOJu0YzQ+KBOFE++LplSyqqcgUItK3d3Qwhbu2w3+TgBKOT7TYlWG7R5 z6IOr5o2UdILFPwvwtbeAAtRKbegbIeYSK5Dcvc= X-Received: by 2002:a6b:c417:0:b0:7b7:d807:42bb with SMTP id y23-20020a6bc417000000b007b7d80742bbmr5876797ioa.41.1703116513408; Wed, 20 Dec 2023 15:55:13 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:13 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Alim Akhtar , Conor Dooley , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 06/22] ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:20 -0700 Message-ID: <20231220165423.v2.6.I06b059021de1bf6103e60a73211f078f2af75d17@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847221316628618 X-GMAIL-MSGID: 1785847221316628618 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Split by arch/soc arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts b/arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts index 4e757b6e28e1c..3759742d38cac 100644 --- a/arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts +++ b/arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts @@ -967,6 +967,7 @@ cros_ec: cros-ec@0 { reg = <0>; spi-max-frequency = <3125000>; google,has-vbc-nvram; + wakeup-source; controller-data { samsung,spi-feedback-delay = <1>; From patchwork Wed Dec 20 23:54:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181907 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84189dyi; Wed, 20 Dec 2023 15:57:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnULWZoo83yIKVkbrf2SXWSgcL//dgrv2ed8xWtIYyQxL0f52YJm1jLJtNOaj3SQxeezVH X-Received: by 2002:a17:906:116:b0:a26:a606:2972 with SMTP id 22-20020a170906011600b00a26a6062972mr7097eje.24.1703116645702; Wed, 20 Dec 2023 15:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116645; cv=none; d=google.com; s=arc-20160816; b=uW1weS3b7pkiPT0jwDP11n0bp/nEd6M76VI6MO/qJ2W2TNBYJcAS029fm+9QY6O7YQ Z9CEOnFi2CVL7LKjnosH/xHvnS6d2MqlpxjR+/8XWaaTsUPIR12Zq7IhPZwPr1zdo9Es JQ+xyLvKH6kndSaIvYRHhdYViVf4tHX2eo1xyitB65WdH03YSk9xsu6iZBBI+HSVWB+P mPpmbDJJ9UAOSr2MseW/AcVeZu0DVBSzDMHu6snKwJ+2/XYEU8qnmT4HaVD/gXe4Nxby 4WxOw+AbtuF6dQ2dKONHiQogYC5xFpztXiBIEUXxX1smTGM0mzKHKjuJUCsoHNZYoDiV KE2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=06i8yMe3unqllEnKE3Q0g5bmBjz7Qwg6DF0FrSTHOkw=; fh=t+x2+TgvRVQL6saRQSWsmRalfs8oQtSLKQQLcgmBj78=; b=qThQFftZ6/4AUse8fHBwNbSQuHCZKGN7V8chfn9Eu3CE1jiYasoH4Rd5FBut6tJlh6 hu8Zlawwb1xBZnGvhhTo2OwcXWiNw33t05qFC+6niTQVf7l8+62vahOVdhVDt8Ir0Z/x a/kxomZJOfk+TDYHPU6FL1wMqnprxqy2byd28/Ofj+8fmJ4vD8UIawghsjndKTXZn8/h +ilYHuFB1IsQk283PR/WmqhwX1CGrmsPqhhy8Uu8pm7T4aLjsgWnABOWVm4/PpIJ3ngI jFCbzg1kgd8/APcsntgn7GTrV4OdfVJkCYGdHyqOrHW1hC71IiWb2uZJuyvsziEF3uGU /jdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jY0oCY2Q; spf=pass (google.com: domain of linux-kernel+bounces-7658-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7658-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id zr13-20020a170907710d00b00a236b8004d2si279182ejb.193.2023.12.20.15.57.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:57:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7658-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jY0oCY2Q; spf=pass (google.com: domain of linux-kernel+bounces-7658-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7658-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1DC131F248D9 for ; Wed, 20 Dec 2023 23:57:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B9094D5B8; Wed, 20 Dec 2023 23:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jY0oCY2Q" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 416274CB55 for ; Wed, 20 Dec 2023 23:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-7b7f6caf047so7178939f.3 for ; Wed, 20 Dec 2023 15:55:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116514; x=1703721314; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=06i8yMe3unqllEnKE3Q0g5bmBjz7Qwg6DF0FrSTHOkw=; b=jY0oCY2QW6zKPDJqJpJOqXHd3PRfdue/GA6fECqXaBquJjPXOnp2KG3IDeRaDEOqcA 0LUz1TlyIn7Kl2GW4tyaE7Zt/ZQx8F6LYees8joXLw4CthNDOQ+wn5+xuf5HZ2Hr3+G4 oL0/U9/1YLZH4UlA2l4CkVqPxDv7pASHgwNzo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116514; x=1703721314; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=06i8yMe3unqllEnKE3Q0g5bmBjz7Qwg6DF0FrSTHOkw=; b=qG0N5AKcgNG6y03anHY+II0VMYSYHuC8smLA14Q0qHmlUI9ALBxkrL0Z48q4jEdLY7 lgxmVwIZrJpv8tR9WsWK4vaQZPrbBLvIXMhfNuVyYaMJJ1iAsr8xIGyRLUhj8UkHUYOm fhvy3zEdxdWqVEbawvoNgSJLcaaJ8RLGY24UCHnzYmKgDA/YHUw4SSRHkCtxrZiDKt4S XkEFI0MmH9OZ0JaxIAEi0r7W6WbvBpN25dGu7ZiS961puKLAF5sYivoxyeIWtj6EujLY 771EAaFDjgfCLeKcrdVMbv2uvl6OwocDz7tCPBQKjKqPn6v4tXi058NECrTaNu5xf8aw kfiQ== X-Gm-Message-State: AOJu0YwW6DdoLt2ljawPCvT1jVYiyPXSSm0xmeDsEX+mQFiG1sLBfE0D MOCZfnc2o2lyd6NROkaUmI+9Y3kCfoaRPqDzXIc= X-Received: by 2002:a5e:8b0d:0:b0:7ba:7de5:609f with SMTP id g13-20020a5e8b0d000000b007ba7de5609fmr1200517iok.38.1703116514370; Wed, 20 Dec 2023 15:55:14 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:14 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Alim Akhtar , Conor Dooley , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 07/22] ARM: dts: samsung: exynos5800: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:21 -0700 Message-ID: <20231220165423.v2.7.Idc995ce08a52ba4c5fde0685118ddf2873fc8acd@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847239930988852 X-GMAIL-MSGID: 1785847239930988852 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Split by arch/soc arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts b/arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts index f91bc4ae008e4..9bbbdce9103a6 100644 --- a/arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts +++ b/arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts @@ -949,6 +949,7 @@ cros_ec: cros-ec@0 { reg = <0>; spi-max-frequency = <3125000>; google,has-vbc-nvram; + wakeup-source; controller-data { samsung,spi-feedback-delay = <1>; From patchwork Wed Dec 20 23:54:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181908 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84282dyi; Wed, 20 Dec 2023 15:57:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3dYwpU0YXzEwUlk5Q0ZQTMaDBiSjvD76gY8GkR663JYaGhHuc27K5V8ov4v/bNeAI+RG6 X-Received: by 2002:a05:6a20:1387:b0:190:4daf:70b4 with SMTP id hn7-20020a056a20138700b001904daf70b4mr567465pzc.104.1703116665479; Wed, 20 Dec 2023 15:57:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116665; cv=none; d=google.com; s=arc-20160816; b=CJJ9k3MLCCEsSSAcDaUvIichl+TV94C/X+AXRoG+JW0pJ/irJnNkm2czlq5L/M4RpJ FTEBqidGfXnGFMp4tLg2HMtfnTBCDvYSFPjn1Zfj6MDqOWda1s758NQPWwmiv5UCyw6N SdUerTWj0YX/J5cBcrYuxr77BHrAnpDX28HQUc7FZPvX/KIBt+LB2O/FM966Um3wh37U fgS4baxmmO99KwHPuuceh2QxXa0umI3Jj6/iclPyrEqmRg2VHZYzaXXbOZ+GbPvuRhhM cuwXfB8mxNX4OxCTmImA69eHldoL/7ZWe/JnAGggEOaVZrz+UajQKK80eTvaUMCDRRnR Ms7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2yCVu6I1r+NRnz/AsvfCkzFQXXECY+E6K5qe+5haxTA=; fh=Ta0MkMbfI2bJVbu+oDLzChQr4nh1L7N9DJijZmyvFvY=; b=bIG0GfTqIkEpydDKnv5AiyG2E7SNu/uE2VBa/6e1I9uNEu3eC62VLXtLi/HsMuNJVk dYTfjkiDXW3z78CIfZ8F+ToQMTFO+Kk4VDuoE7twIV91iC0js9yQN2sQtrP6NDK/2GS9 EqfDO9iXWATJnPa+Gvm0oLhfxQWVxee2Xoxb8xgagiyR9lmyXqdm4mzG+drDKU02uMa5 KC9jd/Jp3+g+dvi8Wv4IpbpMPaOjTpZwCnMk+750JyC3TCIn1PoJt4zPHzjNO5p+j/BS /qLRSlf/K0Jva9BuLbJ9G4G8PRv8WaHKHEMUCyQce166ArwhlBHKWIy1MVnWxeUc2u9L JHVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=N1G5a8Pl; spf=pass (google.com: domain of linux-kernel+bounces-7659-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7659-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 80-20020a630253000000b005c690ba4078si541444pgc.410.2023.12.20.15.57.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:57:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7659-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=N1G5a8Pl; spf=pass (google.com: domain of linux-kernel+bounces-7659-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7659-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 43B642854F9 for ; Wed, 20 Dec 2023 23:57:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 081254E1D2; Wed, 20 Dec 2023 23:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="N1G5a8Pl" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CD984CDF5 for ; Wed, 20 Dec 2023 23:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7b7d55d7717so8989839f.2 for ; Wed, 20 Dec 2023 15:55:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116515; x=1703721315; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2yCVu6I1r+NRnz/AsvfCkzFQXXECY+E6K5qe+5haxTA=; b=N1G5a8Pl6WrTyomiUFQijWqyUJclivXFLDPuqXUm1qGjwe+tpjlB3yKLug1SDEc481 ADx1NDpa75czkVpX3jeLVK/8eqImK6UPIDc2k/8AsjZFtpaB8iT2SZsy6wBWt2rFpCSU bciLHt3/DKcpYfASHnvExdxyJRjgqbRah13cE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116515; x=1703721315; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2yCVu6I1r+NRnz/AsvfCkzFQXXECY+E6K5qe+5haxTA=; b=sFSQwkXnIYbmyCZwVX1MDUBNHEvyVJDih978z36DlJtTFAA8Mh7czjR3RNyUpzCjkX Qscgti2/Dsd2m9Z+8WVBoy+lUz/bK64YRIrDQvDOLYfpg71brSUWtdvE/valuAwOtWBq I3dIitHGQkM/fVeepJMmjZ422qCpr/tgfZw3ScgwZrDBRTp3KnjNfVG3bTnNFoe0QfGu Y4rbJjrzeEFnJibmoF9nFqsSciY6F7H8oT/M92PPRpTL27cMozBal5EkQNFL+zHR+Oea Nta1OaMdVYaXGmNIdBAZh86GE86SC//JgD8neCdIC6cc+VF4iIAhMP8j0b+cEa9G3BEd aYRw== X-Gm-Message-State: AOJu0YxcYpfN9CTHBTHdrUBXJosAWadvaKrNghwshpMuCBW66egF+wjv tapITlzJR/R/a+Ped6uYKSBeCnJQSaforQXuihU= X-Received: by 2002:a5e:de46:0:b0:7ba:8b76:6f65 with SMTP id e6-20020a5ede46000000b007ba8b766f65mr67557ioq.9.1703116515275; Wed, 20 Dec 2023 15:55:15 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:14 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Conor Dooley , Krzysztof Kozlowski , Matthias Brugger , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 08/22] arm64: dts: mediatek: mt8173: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:22 -0700 Message-ID: <20231220165423.v2.8.Ic09ebe116c18e83cc1161f4bb073fea8043f03f3@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847260826845881 X-GMAIL-MSGID: 1785847260826845881 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Split by arch/soc arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi index 111495622cacd..190a3ffd81471 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi @@ -1163,6 +1163,7 @@ cros_ec: ec@0 { interrupt-parent = <&pio>; interrupts = <0 IRQ_TYPE_LEVEL_LOW>; google,cros-ec-spi-msg-delay = <500>; + wakeup-source; i2c_tunnel: i2c-tunnel0 { compatible = "google,cros-ec-i2c-tunnel"; From patchwork Wed Dec 20 23:54:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181910 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84449dyi; Wed, 20 Dec 2023 15:58:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHV4ilup7Zj3jhNPTGqPpPyPm3iDmCaCl3iEwOvWx3zter84UEntbJYnmNPfjOQBsMvb9xJ X-Received: by 2002:a17:906:113:b0:a23:6e79:3916 with SMTP id 19-20020a170906011300b00a236e793916mr2323240eje.12.1703116693693; Wed, 20 Dec 2023 15:58:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116693; cv=none; d=google.com; s=arc-20160816; b=Qyx2a+u73VvaipeMiS7Y+gS+s0Gx7G3A8sdEOUoYL7DnAfnnfifXosgqHrfMjxXo8R q7KkMB2UFkX1vYjBZItYjflxuJ83nRgobiAcnHhrMTaKza16AuNY3nw2LjR2I/zyh3W+ QvfVqSxs/azllPNuNhoeK8ty3jh3iwFNZ2zzWtEcS7c0sOtHRFiB7aLvUeXrZa2kU3sQ OiSaiOSMgTBOH9FGZ3qAVt8rmP9+g9dk+/QLvznbGjIjIPpI/CoENu1Ch07OnEthSZp/ 8tJcy8hEacAv49I/9A/4gOLMogpwfSEq3rzHHJFNgCrDfUkGxd7hz6S5MlKL18VcAkx7 Yh7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+KIM4NQPVUw5XQPjNCJNZ+EzGM62sn2zFTK1BxHqm24=; fh=Ta0MkMbfI2bJVbu+oDLzChQr4nh1L7N9DJijZmyvFvY=; b=OasXoZvNDiig32KkBOGfRaKwQApIF2DjnEQI4QEqDsAdzG1gCGMQo9LkCfrQhLxGGB vMuJ+YvpC8LAZWyJeOWHYLrQKT/5Ul2yT6dMjLVZcdE0WQtNj+YJN3t/V9wnOkluxzov cVX04iaHIYvkvJgxomM5fa9LAQIJvt2CtzrjuOgNJjye32a3dCoLrTSy5CX73co3vD7f SOkmV/Dj2vhkrLg6KOnID1avaNv+bZRLbIS3MfxBOyUU0WNKP/Z1Fj4ar7fbxl6wkGWr js7rEmn60av83u4Y604q2ZtmQ+ovkfPGIQhWU/vH8Xj2rvs22fI6LxKMvT1tlzYs6jqB 1dXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Qo9MLcsk; spf=pass (google.com: domain of linux-kernel+bounces-7661-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7661-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i21-20020a1709064ed500b00a1e116ea80dsi280229ejv.453.2023.12.20.15.58.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:58:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7661-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Qo9MLcsk; spf=pass (google.com: domain of linux-kernel+bounces-7661-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7661-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 51C531F211DD for ; Wed, 20 Dec 2023 23:58:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 291C94E62F; Wed, 20 Dec 2023 23:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Qo9MLcsk" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 522194C630 for ; Wed, 20 Dec 2023 23:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-35fc1a21f60so1140645ab.0 for ; Wed, 20 Dec 2023 15:55:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116516; x=1703721316; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+KIM4NQPVUw5XQPjNCJNZ+EzGM62sn2zFTK1BxHqm24=; b=Qo9MLcskKcLDqgh9ODct1NaD2Sm83R1IYP/VUPLNG60Que+2w2mQjLI1zD8+Ti7FjF N6i7dy/6b76Yj8dvZz926CCHAEuQ39jNWcZA4ON95pXdcop1JolsE+MRE9mfkWAi3Jje mcz+Ocl6PEDflBJrnzFUlYT/otX+dm5ztsUAM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116516; x=1703721316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+KIM4NQPVUw5XQPjNCJNZ+EzGM62sn2zFTK1BxHqm24=; b=eieNPypqYWFSSSzktcbjwIqcjANOquMojZgwb1NgxU+nHo267n9UQLhLSbgDJ3yqDf PvgrcDnLHtbUhHpAhm4hHOU3TrQ6WWkX3oTTSxpo6Lx8FIdD844zSDDQ8nO4oSsb+WQx oZ3jICLuyKQIbDh/9C7surPEEjLbX+mXhz1ftKdvWicCbrWXUbMwBdHaCRNmItC9SNVe m2xXhBV1eAFn7HRlqtlyZuGIHrJyBUVLJpmVu8BZctxzRm73z76x+uS8m62BLQBLcRcW mBevwsp6TbFo8qbR8hpHiW230HtBVtBYnMeobYrOFMDRz46W0Own2gsEFImfbmp6u/PV VL8w== X-Gm-Message-State: AOJu0YyurzxkWKBhg14BsyyR9RknAXeglPfVWc3uEXilv2Mit/if1J4f KGDkdKZ6gWxkIVwIDtgw3GkIzbE5mupKlynNG3o= X-Received: by 2002:a05:6e02:3205:b0:35f:7db1:3f9a with SMTP id cd5-20020a056e02320500b0035f7db13f9amr10498168ilb.34.1703116516382; Wed, 20 Dec 2023 15:55:16 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:15 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Conor Dooley , Krzysztof Kozlowski , Matthias Brugger , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 09/22] arm64: dts: mediatek: mt8183: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:23 -0700 Message-ID: <20231220165423.v2.9.Iba4a8b7e908989e57f7838a80013a4062be5e614@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847290029345110 X-GMAIL-MSGID: 1785847290029345110 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Split by arch/soc arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi index 7881a27be0297..06cbf29d16215 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi @@ -922,6 +922,7 @@ cros_ec: cros-ec@0 { interrupts = <151 IRQ_TYPE_LEVEL_LOW>; pinctrl-names = "default"; pinctrl-0 = <&ec_ap_int_odl>; + wakeup-source; i2c_tunnel: i2c-tunnel { compatible = "google,cros-ec-i2c-tunnel"; From patchwork Wed Dec 20 23:54:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181911 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84553dyi; Wed, 20 Dec 2023 15:58:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpSnFO6VAa0ZkffnfRBWn414nbOobrZ0p5Degp1H+rMS0rcB2aM+z5ZAoF9uOIguOwiqQ1 X-Received: by 2002:ac8:5994:0:b0:423:ec7b:e628 with SMTP id e20-20020ac85994000000b00423ec7be628mr19941435qte.49.1703116710681; Wed, 20 Dec 2023 15:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116710; cv=none; d=google.com; s=arc-20160816; b=K1WQRv9JdnmAl2hyAoMSeJvceRWo0moCD1p2Qk+BmnacQ8Li/Qd0crN+jHYhLiAVg5 7kgPUVCzDSI5OLODOuEnmO1ZY7jDURM63eJjYD+d9+gobsmGSCGo+oV9aONd59iKc7ou 4GH1uRnNoB4m44K/YAP9VHwELAgMvc8Lzg3qZ7eqWj2CYVOgHcawp9LvUUbJWQ6Hwjfa R7HV178wyWUH2zfCI+SRWVW39hECBgT4KcjhJzbLezLGb9YdHe/a3TUIWiRvmpzL5k6Z 7emhABv11ESAa89F224ARKdAs+hKIMJZsNKCkazkCldRomBFj+FFjobsYmy1CLGQq6Gs OoZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MqwPaQqmenUw9eRcinVgTHm+ZDOG0CHY3aysuEWfhMk=; fh=Ta0MkMbfI2bJVbu+oDLzChQr4nh1L7N9DJijZmyvFvY=; b=St6AoCJ7s7opJ0hkjdDIHyZmEFJ5fLrupaLEg1fqrZNKnGuN+QrqQ3rYdSSXricmUL 5rjh7eCB+vwL80ShEeDqJWd7wiDJcV34SVN8rrKp8AqrMuY0eMw3lEcymJDT9vmSvXCH /yBwusaXuKeyLgLG3wv6rrbAEdo12THnK2q3KAJgBdPVUNSiSXGajUpjk+yQ3+wVC3ub hqFbe8pAeEEe2Lsip0RVczFRJlyHy1WdMInQTl6840Qs/0MDwdYS7UKfIGBo1dQW5G1g lsy2Ht8emTyw0+ZOskvK+MXFwDDEGo5RN265V0L9vMyqUMgr5kfY/PeELdtPgyg3zMCO 1Lzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UNa404fI; spf=pass (google.com: domain of linux-kernel+bounces-7663-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7663-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z8-20020ac87f88000000b0042581e4d6f6si875318qtj.547.2023.12.20.15.58.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:58:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7663-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UNa404fI; spf=pass (google.com: domain of linux-kernel+bounces-7663-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7663-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 782221C23E69 for ; Wed, 20 Dec 2023 23:58:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DAB74EB36; Wed, 20 Dec 2023 23:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UNa404fI" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 293134D585 for ; Wed, 20 Dec 2023 23:55:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7b3708b3eacso8400339f.2 for ; Wed, 20 Dec 2023 15:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116517; x=1703721317; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MqwPaQqmenUw9eRcinVgTHm+ZDOG0CHY3aysuEWfhMk=; b=UNa404fIZzDDmWKdork9ZDgJDqQTFPke4qm1NHcs+1ya96f2EeSE5qngsLKy1/pvQs E9MarPSrXP4GFc92aPf4MUE5VjUXJuj348EnqGhiWhZZIYWvF9nSqR2HlX3HdR7Qo5QZ NaLK8HQmzxq1IQW9IfemCVxbOXZbCE8yenykY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116517; x=1703721317; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MqwPaQqmenUw9eRcinVgTHm+ZDOG0CHY3aysuEWfhMk=; b=khijlnJR4Nc65S0A2E7fLOGxRrupmEgdNDrG0Vmvi4o2p3PjyxJ4+4mwhqloRIhKHR eyCTCpRkjRAbPSkD+IdhRdfwdAkPYDofczDd9LLbRAG6UVLZm8LeX2HiP2EVVCxyF4wS xTsL2OMSVmh62Zt/BB3udbMsvCT/5fyagxsmhBIne+hVVeqx5Od+L0MsQN72dEef081h ij3SbS0UwJMgFN0dBHdxj+aT2Yq8hOCwEJlXT2w/ddiH5AzY0PN1mg+eSzMYzXdsK5xp FjFsUHcE7z0R9yrlnHIERbmceTSh0Ik4u+wOiWs5i5xuX4yWpYDNVGpwOU7wTPEtGDOA PgQw== X-Gm-Message-State: AOJu0YzLDm3BORG/FmwXnJi1BrGKN7ZEEFKRJ1FrSjr1wOQ7+s+OVc43 ++G0Xi/1mS+ofDHQYZOt/KhqVbMjj6/kPg8MJfo= X-Received: by 2002:a5d:8c83:0:b0:7b7:fe6c:e6d3 with SMTP id g3-20020a5d8c83000000b007b7fe6ce6d3mr2659120ion.2.1703116517315; Wed, 20 Dec 2023 15:55:17 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:17 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Conor Dooley , Krzysztof Kozlowski , Matthias Brugger , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 10/22] arm64: dts: mediatek: mt8192: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:24 -0700 Message-ID: <20231220165423.v2.10.Ibd330d26a00f5e219a7e448452769124833a9762@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847307911147032 X-GMAIL-MSGID: 1785847307911147032 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Split by arch/soc arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi index f2281250ac35d..ab44d382f757e 100644 --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi @@ -1332,6 +1332,7 @@ cros_ec: ec@0 { spi-max-frequency = <3000000>; pinctrl-names = "default"; pinctrl-0 = <&cros_ec_int>; + wakeup-source; #address-cells = <1>; #size-cells = <0>; From patchwork Wed Dec 20 23:54:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181912 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84629dyi; Wed, 20 Dec 2023 15:58:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxhkWtSOmTwVGouNTFvIUEWtB5sVNiSl47tcZk56MbkhMfUmbThCw8d4Eh3uoa+Im20q0p X-Received: by 2002:a05:6808:1a86:b0:3b8:b063:6bc0 with SMTP id bm6-20020a0568081a8600b003b8b0636bc0mr20674066oib.111.1703116726625; Wed, 20 Dec 2023 15:58:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116726; cv=none; d=google.com; s=arc-20160816; b=GIP+9glX/zxWkGCmX2bZ+U1jeTN+/3Xz+xU7HXBL92tt7QTQL3CDcLxMBfA75NNSlM +kS8RRkE3RQZp9Z9Zk0m4FdU5RFXGFn/3O8KIgbsv8/6fLeDmS7udow/dzceD4sKC8o7 CeGjai1PZaiJTdyxJ/Xsn8xaR0LJQ7+EmSBS2zmbudsCN4AMdPjp60P3coAI/9Ayl7oZ /hb16anBJeMpXqiJoZhcVcLMHoCA4kDs8JGmrcXdPPWTIlM+lvWGmJu7vmLD3E+nQ+YC Wjf/174jNaBO7OpsrARMIZa2LUCik3CUcLd8MKf5hfNc05t+HsoZ+pstCtI2tM1Pywwy CPLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=QGItW2tX+Z99WO9rLTZWRRLNJGNHjPVu0HpOP7a3OKs=; fh=Ta0MkMbfI2bJVbu+oDLzChQr4nh1L7N9DJijZmyvFvY=; b=T1qQY3kkNDyP0xLhQDK37/Efm/GxkUyZyR9x6sxzMF1wjF1crTETfajQ+/G943QJVz M0UB5+O3ftfyW1SLBA+NTVstj6IGmMb9YG3hzUg0WCMTjE4sU1xAbHrZdEnVqcFxZACm cqXuxyvLsfpxIJyMNNE7B36RqBkg69SGSW0mCrj90yjjtJ3lfF2HViW59/J3dOvnjk0f ydlsyCvI93koq68s2crTd7syfJE5rNs6RTaZ5dDed7GCCCsWl+ohq++tIGMmnDjyIaOG YS3wxm3vFgODRw3jli4eeRe7XUYqiDnix+J8imeYF0Fo65qToiG5qhZs3Nx16WQyegIc lrTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cqCgo5MJ; spf=pass (google.com: domain of linux-kernel+bounces-7664-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7664-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f23-20020a635557000000b005cd78da57edsi523695pgm.485.2023.12.20.15.58.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:58:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7664-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cqCgo5MJ; spf=pass (google.com: domain of linux-kernel+bounces-7664-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7664-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5D0DC284A66 for ; Wed, 20 Dec 2023 23:58:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D48D34B142; Wed, 20 Dec 2023 23:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cqCgo5MJ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EEF2A4D5AD for ; Wed, 20 Dec 2023 23:55:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-35da160de2bso907215ab.1 for ; Wed, 20 Dec 2023 15:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116518; x=1703721318; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QGItW2tX+Z99WO9rLTZWRRLNJGNHjPVu0HpOP7a3OKs=; b=cqCgo5MJ+zQltH6gmsqAhQd4bBYDYD4ULm26qgJFLOYE+2YZbgxbNwmguh+wk27J02 DBvVHmleH5W96tR06KqERKOQcstAhANlSmRTntAYo/fd4lmNtzaNUGEsJCq0aTzALpfu pWLELdH++kpUjhZ/Y5H54SwLm4T9mCbemWhwg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116518; x=1703721318; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QGItW2tX+Z99WO9rLTZWRRLNJGNHjPVu0HpOP7a3OKs=; b=s7LxcEu4rZWLrL82KH3AY+sIi2MRm1F2PBOtMQ+9IWSUGz9l8xQ+qeb3d9KBADD50A nyU2ZkHfv6McARSxiNCDXjglc2IDVLOnIrbtqKFvcVLgnQuUFrjyMo/tieytR8pbN5/Y P369TB0OgcnSsnk31SM27iNPkhdc8z0NeqMiu2ltrg3kpWvP0A1g+8jyL/XKe0ZSorJH /MJXCvhzcTCclpC0N8w7HxN1UmMn56NCyovzXEPH4wJzZfbeJcbz0OpbGhGD/Y9t+BMf 16rCUVcHbuZbMq9bf9qdehttC4wHmxalqfhAWvvuviSwzc/37GAQNNWaobV6T3GanyTF 53gw== X-Gm-Message-State: AOJu0YzXeNZz3jCv2veB8GvxB5NWe+ysKgW/prJeXHQVoF4/QDv96Ddn Xx9oK7WMSuYtkT5ofo5RsfhVogA6gRxYy86sBXo= X-Received: by 2002:a05:6e02:3892:b0:35f:b4ef:ff2d with SMTP id cn18-20020a056e02389200b0035fb4efff2dmr5733161ilb.18.1703116518133; Wed, 20 Dec 2023 15:55:18 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:17 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Conor Dooley , Krzysztof Kozlowski , Matthias Brugger , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 11/22] arm64: dts: mediatek: mt8195: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:25 -0700 Message-ID: <20231220165423.v2.11.Iee33a7f1f991408cef372744199026f936bf54e2@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847324467717091 X-GMAIL-MSGID: 1785847324467717091 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Split by arch/soc arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi index 5a7cab489ff3a..4292b72566bcf 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi @@ -1067,6 +1067,7 @@ cros_ec: ec@0 { pinctrl-names = "default"; pinctrl-0 = <&cros_ec_int>; spi-max-frequency = <3000000>; + wakeup-source; keyboard-backlight { compatible = "google,cros-kbd-led-backlight"; From patchwork Wed Dec 20 23:54:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181913 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84812dyi; Wed, 20 Dec 2023 15:59:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYKj27EmebgxVmVaKAtJr3rvTOhIewIDlz85ndZ1IKU6oxX95glAJC55xKtThZTFviYFYg X-Received: by 2002:a17:906:17cb:b0:a23:1ffd:9315 with SMTP id u11-20020a17090617cb00b00a231ffd9315mr4708875eje.147.1703116762659; Wed, 20 Dec 2023 15:59:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116762; cv=none; d=google.com; s=arc-20160816; b=Lk8QBnMJp7INIT/siuC3+wtSSwWCsVVe5Dim0xpAp2wF4eq/MK6+JiawOgWbSTGisp rlUVvekZd+R6ap2Yb3zGDPnqNZaHu/0JPFhMPlcNlPvH+DdljX7tampJDD7jyCrj8cer 3QPoWEgMi1kXwFkIZWS8Cnf4tycE76ysiZQAQFP4J3zdUwX15U3jDqBbEHVp7bFrvzRU BuYcS49YH49xvqbpNt8N1zmmz681016GiXTLyLc55i6llh/fpWENmh8Bbf4Q6cBidQOM yTLZeTvHbsulI9j/e70yXBBaVFCXdZxMIc39xEHtgr9Pwxx4ig4sUnZ2ug3VO2QpdawC IENg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NsTh8joUVqMg5ezobFr/U/KJPW/QvWwfP5qstPNIFW4=; fh=7+INyRGQUaRenIQHeEv6pKc9UqybkCMxiZins2342SM=; b=lmUKGnFohC+MKGf0dmyaXTUHpxwMMffw3VCuJi3aw+wo+chTNKpGBWF3upZg1STVw8 skMKHwTeu1mJC0OTiyklpRoJ0CZwrM0FPENLxwBPTHnTemnxq6uxYT2TbV5MXaBcfHVh frCpBmWfD+bjbQBUObtMAwYB8ZEDsInlWIvak50qs3IdcaOAHpYPkzP2ZZbGcjkBRgIm 9/ZU8EeSQ4lFeYBsJQn18KKOV606fPTfVdUJ19yzUCJth57J9JuSXc0IMWwPU6VM9pPI GnPdvdkVub9ZQ/dmYuUUkTUUQa7NcL+6+L2N4LO+H5bAT+CO9KrMe7RGfCtUS7Dr/4bW 9nCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PhzhskKt; spf=pass (google.com: domain of linux-kernel+bounces-7666-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7666-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h15-20020a17090791cf00b00a2339255aeesi282994ejz.53.2023.12.20.15.59.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:59:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7666-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PhzhskKt; spf=pass (google.com: domain of linux-kernel+bounces-7666-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7666-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4892E1F21923 for ; Wed, 20 Dec 2023 23:59:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B84C44F60D; Wed, 20 Dec 2023 23:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="PhzhskKt" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED0444E1CB for ; Wed, 20 Dec 2023 23:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7b7f9fdc14dso12204939f.0 for ; Wed, 20 Dec 2023 15:55:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116519; x=1703721319; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NsTh8joUVqMg5ezobFr/U/KJPW/QvWwfP5qstPNIFW4=; b=PhzhskKtQnql6Cf6MBNgp3MbQUt4W7vUw1hDCxYygoVRAzjKYF7tudOUsnLhRQeOoX Uk0lpUNhqpkOvCrEwWpC0GZ/dUGxlAz8nVr+LBYGosS1kaittF95Nzz6OHoYpijigsUm 3gYfkyWL09zkUUJNCtl1TWpze0FGuSKQO0F/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116519; x=1703721319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NsTh8joUVqMg5ezobFr/U/KJPW/QvWwfP5qstPNIFW4=; b=gfZ07ACEPqWqMgGN3+nT48XKJe4suKR4z4trqKr89zYBTnWbFmuUtauxTZnp5Mdtmc 0n9dlACem99zyMNxhCkRGlNXL3zPC930u2dl6NunCycY1vHuSb3AdN6pVZsYZAYXq0RB iRfLLMnR94MP2WB812Rxte53Q9RneRslocGHr39u85zGTLA0IVru1goJzIkixbwVNn73 luB+rlaWvycs1f3FTEBfZKcn5+y9+10TpB2xrT55fkAbCfKFVpK2iw1a2dRq8jZ205SV mI878In5CGBSzUa39xXI+OupnGwIPsSh+2g7o0weSIN+G19mtVFLMDTNNn/ZWp1PK02Z JO/Q== X-Gm-Message-State: AOJu0YxXq+SYbBmFkjZwhuVJdovY7MnrnPsfx9vVb3C5acfOdfijAWum m08lg+/WTtlXKvhbwzmnW6zE69oANZGA608ACTQ= X-Received: by 2002:a05:6e02:2607:b0:35f:9920:1111 with SMTP id by7-20020a056e02260700b0035f99201111mr9605176ilb.129.1703116519155; Wed, 20 Dec 2023 15:55:19 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:18 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Conor Dooley , Jonathan Hunter , Krzysztof Kozlowski , Rob Herring , Thierry Reding , devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 12/22] arm64: dts: tegra: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:26 -0700 Message-ID: <20231220165423.v2.12.Ic12bf13efe60f9ffaa444126c55a35fbf6c521cc@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847362894719136 X-GMAIL-MSGID: 1785847362894719136 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Split by arch/soc arch/arm64/boot/dts/nvidia/tegra132-norrin.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts b/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts index bbc2e9bef08da..14d58859bb55c 100644 --- a/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts +++ b/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts @@ -762,6 +762,7 @@ ec: cros-ec@0 { interrupt-parent = <&gpio>; interrupts = ; reg = <0>; + wakeup-source; google,cros-ec-spi-msg-delay = <2000>; From patchwork Wed Dec 20 23:54:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181914 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84849dyi; Wed, 20 Dec 2023 15:59:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHzRR+iBQ5cm6m7pl9bi17O64yoB1jDJ7myscTSVsLyWIh5xgUtZq+3/hmkj4XNxoeBf8h X-Received: by 2002:a05:6358:7203:b0:174:6b47:c687 with SMTP id h3-20020a056358720300b001746b47c687mr688506rwa.6.1703116770438; Wed, 20 Dec 2023 15:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116770; cv=none; d=google.com; s=arc-20160816; b=bfOGBcJhGCbFdhwjzH7jkeGEE0LYnv9g2/LHHr3xFnx4RiiYC/bmVVphAm3cfFumpc S8NbhDe1bV9kPRoyaIkR+D981r4s1v/sGflnvezs3YLjj/wpSBiVQpdMYpZxZrb0HT4E SXxC+apUnhW0M/Qc1/23/P4Oen6kAQzVtmt2LjzA/xJdGQBwJOCrSpQ7n1uCZrQ/TnWi iEYoA1FUzxeUJ1TVQbb9cZD9rJ35Nr7ueAk7ScCAIB9sYalDtWPJOsUjYYgz6d1yOc8x uPtCPbi+kMwOXBkLgRaF8rSH86XJT43nCuxStGLTUxDx1rqRMb+gW6sLci7ExuNwuPrJ BzXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wJduS/1fJUByj83cmxVS/XQjbXOMlAAEnEEqFMZKGGY=; fh=DoMYUhl5tOTLVRet2nx3vQSkG+qPk5uG7MWTiNxxD1k=; b=tsrIj6LXqW1tSlpcf6UUZcuu/mgxvJ7GLwObiklNgnxiRtpLc3ECv7XvWkJ/712KIo GAHlb7SsQqnizPfmfYMHuJmOY51XCXo6IC++2uoB0T2a80Cf1UcHmQmXsbDQWkgjH4ZF RORk35mvi/n0QE1SZdsMBpndKg7nOOAIcXRFjG8b/PdISDZfuraGY82ticCSkBEi9NSF UYrKUcH8hDy3z9C6O7fqsjoFqS+8CrqR3/tgUKdzuT0NJzojMe/Oqjuul+QZezUwaJHf TaSqbymRiR+vx0vofwXWU2fe1ASS1O3K7dcD+2IVIY/0tAzg5LYtT1zaR2HLNzCpABPg h9JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m67xZNrj; spf=pass (google.com: domain of linux-kernel+bounces-7665-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7665-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y6-20020a17090a474600b0028baa7805c7si604405pjg.135.2023.12.20.15.59.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:59:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7665-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m67xZNrj; spf=pass (google.com: domain of linux-kernel+bounces-7665-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7665-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F083F283FDF for ; Wed, 20 Dec 2023 23:59:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A79EC4F605; Wed, 20 Dec 2023 23:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="m67xZNrj" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C37594E61D for ; Wed, 20 Dec 2023 23:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7b7fb34265fso9423539f.3 for ; Wed, 20 Dec 2023 15:55:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116520; x=1703721320; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wJduS/1fJUByj83cmxVS/XQjbXOMlAAEnEEqFMZKGGY=; b=m67xZNrj+bACUTayQ8vCk89bCG3aJ28wj3+AqWdfhb/qVO+YiEUYCVbWttmog6/dUg HBvQxuQO+CNyNoc4yCurTN7IgCziZZIwczOJmGTNJwYjCeA8UsJJSwwvt2z74jDeDdW8 4uiIE/nnmHJxzfBWYUAEQqrJmekZ923LqZHuE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116520; x=1703721320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wJduS/1fJUByj83cmxVS/XQjbXOMlAAEnEEqFMZKGGY=; b=qy05l5UQ0mCbzYj8AYI41P9ffhM6nPrreEjbeoXPiIB4vlWOUPRsXKjgP42yjCiyPG O0yDgOTZYswr7bEPVLerEhL9KdE269SRbTRbzdPKTa0WSoqCY6OWNL5Ngj2PAgvCGFQm aOl89XKhkNQn6lLKX70KAMyJpj0r0qH9at+yT7Wz5xqj4CpXK9l/BrekHkIpp3Tzbc3z FeK0ePzq8zrUA8yBM3JClenB1L6DxR6v38kYkPbHRLbZCvmjNzv8MAigwa9v7tMjqj7i U1e5tb9/Pi9F2l/KiWjp53EawCLzkKoxFjhaBZLSeV8qMf9xFYywZA2PnknzPRDWkAsz KRJg== X-Gm-Message-State: AOJu0Yx3WYtm8zGDPBM0wlpV8h9kMiJQ5c61hN/44PAUhxnyVvOT2y0r ZUyKMPjuDQ3jXzzh1Va87EIg0XNBWrxSwVEEHPs= X-Received: by 2002:a5e:8610:0:b0:7ba:753a:ed0a with SMTP id z16-20020a5e8610000000b007ba753aed0amr1782436ioj.16.1703116520055; Wed, 20 Dec 2023 15:55:20 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:19 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Bjorn Andersson , Conor Dooley , Krzysztof Kozlowski , Rob Herring , cros-qcom-dts-watchers@chromium.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v2 13/22] arm64: dts: qcom: sc7180: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:27 -0700 Message-ID: <20231220165423.v2.13.I2ee94aede9e25932f656c2bdb832be3199fa1291@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847370741586332 X-GMAIL-MSGID: 1785847370741586332 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer Reviewed-by: Douglas Anderson --- Changes in v2: -Split by arch/soc arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi index 46aaeba286047..f3a6da8b28901 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi @@ -649,6 +649,7 @@ cros_ec: ec@0 { pinctrl-names = "default"; pinctrl-0 = <&ap_ec_int_l>; spi-max-frequency = <3000000>; + wakeup-source; cros_ec_pwm: pwm { compatible = "google,cros-ec-pwm"; From patchwork Wed Dec 20 23:54:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181915 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp84911dyi; Wed, 20 Dec 2023 15:59:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IH++ecxql7wvZ3ALwF57iR7bniCDNQ+LwrYXP8mL4KMKI1GI4G5jKvUHXUXw5v28emWyezH X-Received: by 2002:a05:600c:68c8:b0:40d:28ce:e6d0 with SMTP id jd8-20020a05600c68c800b0040d28cee6d0mr113067wmb.335.1703116785446; Wed, 20 Dec 2023 15:59:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116785; cv=none; d=google.com; s=arc-20160816; b=jGbX2v1r5Rk1A0gPIZZgC5H2k3gzUKsPLNde/vl4xBM0OZ4uVqm6fPJ1fVrLG+T3F4 sxkFfh9ekvxiUpkfWqey1TVvlHC77Tan10O7pRAvLYC7jdGqWqI+hZYafGinJxPKpmkN 85vN55km5hTquBekGPM6G4wSqpQsrCeAf2BxlT2TwtGLKHp+ae+K/0MBnXn5sjB8nc6v nURg9xZxHiV/sX17aUtjlf/ED58JyIpcaxCpu5ssv8yZq/ul1t579/Q9HjIPr2J+Mljo PLSJplSmRn6J4pd3M0PmV5rYiydIfGEQxT+Xw6SlH/xnswr3JnuieGnWSX/DxOhpej1n pSCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bZuPqRxkPW8qurxjYx07gjm1CYO7d9uELmdtkiZRYco=; fh=DoMYUhl5tOTLVRet2nx3vQSkG+qPk5uG7MWTiNxxD1k=; b=Bo1GYt8veIC6Be4YuYst6kauu8bJA58TC0kjUbvA69A7N2VN6ZmsEfxNzsoFQ78AWv TQbOU4DtJMRHPK/0JAU5Q4AIZFDYxaMgdlk7pZ5OuOCdeO7Vkyct5Zcwusvfr20NlD7o EGhHeZRxlfYTMyBysp1moWoR7q5Tj5jkVVHU0lDCvATk8OsCAnsG5aRMk2kp03/TrCog j9sd6J+8LxihcGYBSl//WexHI11WV3SZcBSctMFn18zrt2JPHNXN5Eb5VS6BAKb8wc+5 d5fTb2o4WyHUGaj52ZtqFSkScjXzuBXkiDsXWR2JtjVR/fk8ynqxtJf8qOCJJIINud1I J8EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MnbpjDzK; spf=pass (google.com: domain of linux-kernel+bounces-7667-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7667-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a14-20020a1709065f8e00b00a235a6089d3si287340eju.885.2023.12.20.15.59.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:59:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7667-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MnbpjDzK; spf=pass (google.com: domain of linux-kernel+bounces-7667-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7667-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 165171F211DD for ; Wed, 20 Dec 2023 23:59:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A644B4F8AA; Wed, 20 Dec 2023 23:55:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MnbpjDzK" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7F104C3D6 for ; Wed, 20 Dec 2023 23:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7b7fe0ae57bso9904539f.0 for ; Wed, 20 Dec 2023 15:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116521; x=1703721321; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bZuPqRxkPW8qurxjYx07gjm1CYO7d9uELmdtkiZRYco=; b=MnbpjDzKOaN/BhBdGaCtMaiJ3xpNomM8j7iiMCSYgNHNCA14g3C3/pl1vTx3i/Xd4G O0n5Z+HAjQLECf/wNCBpzhNbPUts/tkrVXgKOiO2xfev8yiZtEGP/iAJVY1OnK5pYN1t PTvB3j+nNoIZIY4R4v2vFaCHx4LXB0tt65sd8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116521; x=1703721321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bZuPqRxkPW8qurxjYx07gjm1CYO7d9uELmdtkiZRYco=; b=OaHY5S6IC8Qka2kGTuo4Zp4FClObGMu9uij+ibLxoND6xBWqUfax9NXDERfDl6ym00 u97BQl3V8GWWaVm+6rC8imyGN4JPm3WQf4ZiAbQYxkqlgTVQgC2px5KDAejj+tsK7bhz uvlXPto9eeHdGYHzn2V3IAvfj5VYpUW8qYvlUWvYJTpbYJiLBqi1trObvC32qIuAfKbI /VS/pS89zbl2VNP/AzLpHMbGnNMFHK4JO6KYb0DGLLOfwsm8onR4vywg7WMVJSeKngci Zyi3lynAxhpb3blXXzKrqKv3Z060bNDQECTCCOyGErgcCSOQ829xMTerJSxlq7oqMU3l Tosg== X-Gm-Message-State: AOJu0Yzyu5BHaSxLER6tj7/JTbuQqE5ixttriA5Xm+mQVRhc2r40XdPB fMiPSJOLfYQKZLEi91w92UKVpljFTkNC+ogIviU= X-Received: by 2002:a05:6e02:1ba3:b0:35f:c678:9509 with SMTP id n3-20020a056e021ba300b0035fc6789509mr3542419ili.48.1703116520994; Wed, 20 Dec 2023 15:55:20 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:20 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Bjorn Andersson , Conor Dooley , Krzysztof Kozlowski , Rob Herring , cros-qcom-dts-watchers@chromium.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v2 14/22] arm64: dts: qcom: sc7280: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:28 -0700 Message-ID: <20231220165423.v2.14.I7ea3f53272c9b7cd77633adfd18058ba443eed96@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847386107998711 X-GMAIL-MSGID: 1785847386107998711 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer Reviewed-by: Douglas Anderson --- Changes in v2: -Split by arch/soc arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 1 + arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi index 9ea6636125ad9..2ba4ea60cb147 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi @@ -548,6 +548,7 @@ cros_ec: ec@0 { pinctrl-names = "default"; pinctrl-0 = <&ap_ec_int_l>; spi-max-frequency = <3000000>; + wakeup-source; cros_ec_pwm: pwm { compatible = "google,cros-ec-pwm"; diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi b/arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi index ebae545c587c4..fbfac7534d3c6 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi @@ -19,6 +19,7 @@ cros_ec: ec@0 { pinctrl-names = "default"; pinctrl-0 = <&ap_ec_int_l>; spi-max-frequency = <3000000>; + wakeup-source; cros_ec_pwm: pwm { compatible = "google,cros-ec-pwm"; From patchwork Wed Dec 20 23:54:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp85072dyi; Wed, 20 Dec 2023 16:00:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrY5k3LLfSvbnQQwRpxjBvTGJm0ZO4jITSzkOtr5XvDd0A38IGeaynITE5I9MiQPgw3TOI X-Received: by 2002:a05:620a:4385:b0:77f:9b2:ee9b with SMTP id a5-20020a05620a438500b0077f09b2ee9bmr19994307qkp.88.1703116805442; Wed, 20 Dec 2023 16:00:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116805; cv=none; d=google.com; s=arc-20160816; b=wsgcdn+6LbmJtZ6oCgQIG8CIvfbck4/TbSoq+w3ax4HSxGDF9c3PjHVzEnn5XNkdHv U/SfJ7bjwRsyQBLur1EPSxQAwX8qjmNv0UIp1xSj09KQ3daDz+odYYjiL7RuPg6JudUl jSjpPlOXxizOGkmHN9A/r1uXrc8uWc9dNazCA2ymCnzPRXrb0KjGv1g1ntARyE6XTUWt dtE0ocjsBxE5TLLj3FK7vv2+ppfLkmSIRwWHfLI6GSyRFpy8vYW3cgOAK+R0SMZSDjFb vbSg58Saj9G12BMNyTZwN8D9VEyQKAHqy/1xTXRJUxrnxV6LKwlAJrxs7ZeNNItDKj25 hi2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BjWQ8eHs2ceg5U4ktitsF8+YwQ1pARiSqNQDfBjNb6E=; fh=DoMYUhl5tOTLVRet2nx3vQSkG+qPk5uG7MWTiNxxD1k=; b=OxCifysp8ZbfRXvtKxpomjPbcj04AdURBc+XL117dxhYDPnSUrKUf8t8YMvgQXBGWp pdCIGc+Sl+TPNUGwnWI8nnAmlRrKEFO7Iw7gkblO4HMVBWSQLbN32nyqNN7+YMV5S29m Hu30uHbrp/mvIKFbvhbgdDNNJFxJ1a9nmVMxzAnwf/NeXrvIHRjxvcea4rcO59qNdiVu ynIgCPJZh85Be0rbQaC338TjQ8sadQYw4zK5ovgzUfMaSYLkrmKpwy7N6gZ57kEuOnzB eesJlF7ywJpYw4mWOmEKC+J7hPiuoS/Nzs+DMLuwLpdKwscEnc5QzjUCbUl/A9KpeWCJ s5xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hbJ9A2us; spf=pass (google.com: domain of linux-kernel+bounces-7668-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7668-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ea9-20020a05620a488900b0077f12a793bdsi958177qkb.594.2023.12.20.16.00.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 16:00:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7668-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hbJ9A2us; spf=pass (google.com: domain of linux-kernel+bounces-7668-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7668-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 3E8281C21BDF for ; Thu, 21 Dec 2023 00:00:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B56254BA8B; Wed, 20 Dec 2023 23:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hbJ9A2us" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E39EF4F1E0 for ; Wed, 20 Dec 2023 23:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-7ba7e8ba078so8263239f.3 for ; Wed, 20 Dec 2023 15:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116522; x=1703721322; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BjWQ8eHs2ceg5U4ktitsF8+YwQ1pARiSqNQDfBjNb6E=; b=hbJ9A2usGrH7IQvXrRk9FH5Jx/CipokbMBy80RejDGQy09ierB3oveknrICujQ5juw O/yKO3ezi+UriLtn5nCq1HXGjwgy6ufVJRLwmaCcR9uRKCZndrdPG7hLaH8TI2zQ0txO XJqVKAp8cSESzV7foeHH6SHLo/s0rBBhVCY44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116522; x=1703721322; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BjWQ8eHs2ceg5U4ktitsF8+YwQ1pARiSqNQDfBjNb6E=; b=R1ILaWsdvgvMdbqSa5SYfq9ClmZfDvpz+ZXKJFQU9RXwfHAeXzywYob4326Uyra4B4 bG8znlJ9Fx1aEaW954i660Ng3pqsMu87BwP9tXgqaEE2QFnUFoq6EMtf7D9qmofk6zsR 7YFKCUuF+/KPwR/3O3aY2MvrPD/WDXSakIuIKHb27zE1CjdL1jAXsZvrc3TVGOcAlz5V hoAIJd4WvC7uZIN+bDE6WPsLvWhVOdDKtZwBgiUkSFkh7Nxom/oxhRSW24x4uuCoWbxG +wV2XL3MjUv/1ZO2Ll0ai8hPXUicYTwuXk4wNEd2xJUI/THslXUBLxwpZ9uAAv2vFx3N UQpg== X-Gm-Message-State: AOJu0Yxwn5Pvt7xhj5y/SjhHss25PKiBIZRyA0MpPaxha2T8UsymwiJW 6sA9cDUjmeC6+hXyi4mfJyRFA6CNiiboPpyg6/s= X-Received: by 2002:a05:6602:2809:b0:7ba:80de:e3b9 with SMTP id d9-20020a056602280900b007ba80dee3b9mr786935ioe.11.1703116521985; Wed, 20 Dec 2023 15:55:21 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:21 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Bjorn Andersson , Conor Dooley , Krzysztof Kozlowski , Rob Herring , cros-qcom-dts-watchers@chromium.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v2 15/22] arm64: dts: qcom: sdm845: Enable cros-ec-spi as wake source Date: Wed, 20 Dec 2023 16:54:29 -0700 Message-ID: <20231220165423.v2.15.I870e2c3490e7fc27a8f6bc41dba23b3dfacd2d13@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847407532903394 X-GMAIL-MSGID: 1785847407532903394 The cros_ec driver currently assumes that cros-ec-spi compatible device nodes are a wakeup-source even though the wakeup-source property is not defined. Add the wakeup-source property to all cros-ec-spi compatible device nodes to match expected behavior. Signed-off-by: Mark Hasemeyer Reviewed-by: Douglas Anderson --- Changes in v2: -Split by arch/soc arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi index 0ab5e8f53ac9f..e8276db9eabb2 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi @@ -852,6 +852,7 @@ cros_ec: ec@0 { pinctrl-names = "default"; pinctrl-0 = <&ec_ap_int_l>; spi-max-frequency = <3000000>; + wakeup-source; cros_ec_pwm: pwm { compatible = "google,cros-ec-pwm"; From patchwork Wed Dec 20 23:54:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp85421dyi; Wed, 20 Dec 2023 16:00:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHL9b+L4IWWioC8KyKisaSCvzAbFsuQU6TDc/Xj0KDy3UpwJc3BF5dWisEqZZ7Z20DS3Yc X-Received: by 2002:a05:620a:4304:b0:77f:3cda:3eb6 with SMTP id u4-20020a05620a430400b0077f3cda3eb6mr5599994qko.34.1703116836320; Wed, 20 Dec 2023 16:00:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116836; cv=none; d=google.com; s=arc-20160816; b=luu1ky1ezQ5zM5oOP603M2qCD9I0KDYkwVRUzNIpHARF+UMdD7gmZM0zSVrJm+tXMQ t8tnMqZK+dWuYVCVcUhwOaNpM7QfA1d95QkRgFAF8VaoycjuhUpzqyjrvla07152rq20 RKknGgxpha9eYsr5UZJP2uMTG1i1HpdvUfY4rYrPUBnA/7fRvGwr8BSQiqsFQrHsJqnF rHClVdpdg1uZVC+xV+aPh8UfR0kB1Wk64YgJ6/3kGvXdYAW+gkyE0zjqpjIA5HgFeME/ KMQEcDVT608alYRY92boEMpuf+6PK7GYR2XW/GOgvD2JarhQvDZf9w+So2mu52OzjkXk yLqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZKh5FX4xH2A55TvaLBm+1lswVT7mH5LMvN7VXVfLl8c=; fh=v2Ht5y747k1l/Ai2xsaBh2LNlmR666WlTsnQ09U8XlM=; b=vjzScedlacArR2/AV1hJfJ3wQhN386bwzoTFuy7N+HAjjlC/pXgK6K5xlPKfc48eoG 6Y+TzKzXFxBMTISL21pUeAfNdk80FY6Z9rtemc7OG1sCgKcGtRXHFubN5Yrfk4bn3I3q +3L771MyddkGeUt2S2HccKvmU0HSYa+/lVAsdtgv91Ue/6TZ9R4bWT/wpP3ozSjgMtYA 921iUnEtI5DrvupRefvbEjSQzFB1Yf5eOCtJkzLxrLwpM3a1Ds+ENc3UspsDJr5iWIaF ohogv3x37OZPbiOZwVr4LpaMj5HailTSU4qHrQoCroY0dRPix9SDJ/5wIvtxddQyahwn 9vTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ieMQxj5w; spf=pass (google.com: domain of linux-kernel+bounces-7670-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7670-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id sq18-20020a05620a4ad200b007811ecd0405si56584qkn.684.2023.12.20.16.00.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 16:00:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7670-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ieMQxj5w; spf=pass (google.com: domain of linux-kernel+bounces-7670-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7670-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 2017F1C22B9D for ; Thu, 21 Dec 2023 00:00:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66D4B4F209; Wed, 20 Dec 2023 23:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ieMQxj5w" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C94C4F5FA for ; Wed, 20 Dec 2023 23:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-35fc6eb9075so619165ab.1 for ; Wed, 20 Dec 2023 15:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116523; x=1703721323; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZKh5FX4xH2A55TvaLBm+1lswVT7mH5LMvN7VXVfLl8c=; b=ieMQxj5wfYGB1TiYeOYZCbjVxOt4Rz94IXWdMs4OMMQukhyWpk8iRfK8F32s6INq3n nP40GVvM2bHStM/qkxPwfs8LybFBxzjdxyP+k6qvzJhCaY3nSyE9tjr2weZMiifFyjrC QltXU3YE+xn5zUxK+U3RA6KCXBGJ2/y4ge17c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116523; x=1703721323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZKh5FX4xH2A55TvaLBm+1lswVT7mH5LMvN7VXVfLl8c=; b=gNiCMIoyrWOv3BxpnxrCw5xBHUlyi/5hhjBjVsERQLh8DMTnkuvgNWlUim6eg6jDK2 eVK8w+UVZ9XJjMg6yelzW7cHJwjcy/t0nTbefsOQR3/aTz9Ylayk9f5YunSA+fnOLOrA 3+6ZnY36Ve6+ZEum91TFBFotzDsXtHL2xqc81XZCcWbZez8c9S0An0SeI+pWu9uLR7pE BRnVfYKKWCfH2rEZjDq0zwIm4z93NDFblYQ8Xw2pWCwAN7mYmM9cOgu7Tt9LXTC0iz2T O8WaX+K+uMqS0ThsnWxUm1XEt10mScZtf4Gw4XWsN+paiBOQwSfdFjI0trMFhNE+NXQI JgLw== X-Gm-Message-State: AOJu0YxXcVg/l900N2OpKgXYvUtk/gVWuPMzEuCY4pgG893bp86Mrah7 gWO5VKD42sxL0PlUdzsEfha0EiEJLiA6B/NaDBWIDxNjfQ== X-Received: by 2002:a05:6e02:1bc4:b0:35d:4463:5dd2 with SMTP id x4-20020a056e021bc400b0035d44635dd2mr2680020ilv.16.1703116523652; Wed, 20 Dec 2023 15:55:23 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:23 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Frank Rowand , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource() Date: Wed, 20 Dec 2023 16:54:31 -0700 Message-ID: <20231220165423.v2.17.I29b26a7f3b80fac0a618707446a10b6cc974fdaf@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847439420938070 X-GMAIL-MSGID: 1785847439420938070 Add wake capability information to the IRQ resource. Wake capability is assumed based on conventions provided in the devicetree wakeup-source binding documentation. An interrupt is considered wake capable if the following are true: 1. A wakeup-source property exits in the same device node as the interrupt. 2. The IRQ is marked as dedicated by setting its interrupt-name to "wakeup". The wakeup-source documentation states that dedicated interrupts can use device specific interrupt names and device drivers are still welcome to use their own naming schemes. This API is provided as a helper if one is willing to conform to the above conventions. The ACPI subsystems already provides similar APIs that allow one to query the wake capability of an IRQ. This brings closer feature parity to the devicetree. Signed-off-by: Mark Hasemeyer Reviewed-by: Rob Herring --- Changes in v2: -Update logic to return true only if wakeup-source property and "wakeup" interrupt-name are defined -irq->IRQ, api->API drivers/of/irq.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 174900072c18c..7583adf386220 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -383,11 +383,39 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar } EXPORT_SYMBOL_GPL(of_irq_parse_one); +/** + * __of_irq_wake_capable - Determine whether a given IRQ index is wake capable + * + * The IRQ is considered wake capable if the following are true: + * 1. wakeup-source property exists + * 2. provided IRQ index is labelled as a dedicated wakeirq + * + * This logic assumes the provided IRQ index is valid. + * + * @dev: pointer to device tree node + * @index: zero-based index of the IRQ + * Return: True if provided IRQ index for #dev is wake capable. False otherwise. + */ +static bool __of_irq_wake_capable(const struct device_node *dev, int index) +{ + int wakeindex; + + if (!of_property_read_bool(dev, "wakeup-source")) + return false; + + wakeindex = of_property_match_string(dev, "interrupt-names", "wakeup"); + return wakeindex >= 0 && wakeindex == index; +} + /** * of_irq_to_resource - Decode a node's IRQ and return it as a resource * @dev: pointer to device tree node - * @index: zero-based index of the irq + * @index: zero-based index of the IRQ * @r: pointer to resource structure to return result into. + * + * Return: Linux IRQ number on success, or 0 on the IRQ mapping failure, or + * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case + * of any other failure. */ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r) { @@ -411,6 +439,8 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r) r->start = r->end = irq; r->flags = IORESOURCE_IRQ | irqd_get_trigger_type(irq_get_irq_data(irq)); + if (__of_irq_wake_capable(dev, index)) + r->flags |= IORESOURCE_IRQ_WAKECAPABLE; r->name = name ? name : of_node_full_name(dev); } From patchwork Wed Dec 20 23:54:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181921 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp87213dyi; Wed, 20 Dec 2023 16:03:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeNJOecqVoV//udzEgnwrgIcHBF/UqROnfoFIetBp1+qUNK1tTNTLUhN+2pWU5/SM34TJy X-Received: by 2002:a05:6870:5693:b0:203:dcde:6e83 with SMTP id p19-20020a056870569300b00203dcde6e83mr637252oao.65.1703116992162; Wed, 20 Dec 2023 16:03:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116992; cv=none; d=google.com; s=arc-20160816; b=K9CpvjPYbdhD/EwvZEfrxzKfLyGtWK+F+ZFc1LD5oQCMsbnCVP/Q1zJQfrN5hexNLR cF4jeoW/rYilOwX1us16vKD1TpprujaVcVohixN77ctihQUP6P+7rg4hnjzUQP7xOZIS Rn1mZbV1x59DIfN0f8mT27tIwh7ktV9mCsE6ighwhrXb25lzf1n6lIISe5tQkFpDmUYa dARPLjI9/y9O7atAlT4+TtEstzv4S34sxSqB0XRY7VLaE5jDD26aYk+xJwoM0B03FY3F u9L2t9SseIDK4WkZVe/Xn5CRle5NomGXQWOHvHiYTlEoIDPggmufa65BvHwWM+ukx4tl VPVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tGuZXGW/tZ1AN0p557o5C5f/tYqgvv6aKKeuF8fEKW0=; fh=v2Ht5y747k1l/Ai2xsaBh2LNlmR666WlTsnQ09U8XlM=; b=0nM5E1etALUq1XXyVfo4lAMiftYF+C9JvOkWl5NsQrpivw582dhxfY31NGY14ljOkh qM1vX0+cD6Uq7oE5YvqHVSkeMz6pX7T3VcaRhPYautOkMZnHLJNecN+YrIAXezO5zUNK 1LRCM9x/r14sADqIkMREWv5cqgWOkHL4YSEiZrZ3VvnzgUhG/w1URKecbLsbimxL624R q41b+nK/Fo8R3AQzOLmHVCKfl3Oz7ghRiHzqtCXMWSJnMlX4X2omzgOAd+JMB6J561UB ETfv2iZNO3MgbN/Q5rYThiILtRANJZa/I5uwW4t5UvzYIV7cMMeqTLaZfNn5swKi9Ef5 XjRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RTult0R2; spf=pass (google.com: domain of linux-kernel+bounces-7671-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7671-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c66-20020a633545000000b005644a9be955si566792pga.179.2023.12.20.16.03.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 16:03:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7671-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RTult0R2; spf=pass (google.com: domain of linux-kernel+bounces-7671-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7671-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 4555BB24D7F for ; Thu, 21 Dec 2023 00:00:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DDC351C2F; Wed, 20 Dec 2023 23:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RTult0R2" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BEA94F892 for ; Wed, 20 Dec 2023 23:55:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7b7fbe3db16so8312739f.3 for ; Wed, 20 Dec 2023 15:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116524; x=1703721324; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tGuZXGW/tZ1AN0p557o5C5f/tYqgvv6aKKeuF8fEKW0=; b=RTult0R2kNN/Ah8ueZDjGp0VS3HMqdkRL4Yn56i2O4KqPkVI9buwRJFYTAzWF6kU5l GaM4S3MtRxWGfsrGfiW/a0b7YgCnBjx4sqbmrHECczjC5BG7w7onpDYatWzGs5W+1ACQ It9z4KD2cNV7srisn0btvOR1nbuAGs7t6Lm5g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116524; x=1703721324; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tGuZXGW/tZ1AN0p557o5C5f/tYqgvv6aKKeuF8fEKW0=; b=A/rqU4dj2Sz5Gc3urbyZtqun/BVGJNnYfGaW3QpwiBG1ctLlWekBtYn5PgwAYcB5mQ 21Gs6bQLyc1w1UCnKN12VCkpYcYYNPxMwHXg85iAsx/xGfE078tCdk9dXZKLjrxYWtY0 UmgEsnjErgxLEK2wYtoQiBPbda/KqkM3Xt6xOxdnCIYas3yiY9TBeTBNObH6rrTn4QJl mAZbopDiEeC9RUtitAUxAvGp7ZRMVnwCAuFgj6Ybk5FEi7c1IXpUBzJB+1u7uhvqfH+q QIiPMDMtvL8aSh9SbATA90wtwJ8nsYZ8SDXO3PIWFNACPcfDIjZjR4sOUAwDx9bHVItF 3GNg== X-Gm-Message-State: AOJu0YyAyFaawPeJAGu3f3NTjaDh5N43q0Xo7shRCnfj0F1vIR3Lja33 b1eYfgeP1+gDz2Fvd6hZjOQFQf9f1a+J3fTpuZM= X-Received: by 2002:a6b:7305:0:b0:7b9:c344:6e77 with SMTP id e5-20020a6b7305000000b007b9c3446e77mr2318247ioh.8.1703116524433; Wed, 20 Dec 2023 15:55:24 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:24 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Frank Rowand , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v2 18/22] of: irq: Add default implementation for of_irq_to_resource() Date: Wed, 20 Dec 2023 16:54:32 -0700 Message-ID: <20231220165423.v2.18.I31d4dd6a7e5a3e5eee05c87b358e63cd1aa0e467@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847603228943471 X-GMAIL-MSGID: 1785847603228943471 Similar to of_irq_to_resource_table(), add a default implementation of of_irq_to_resource() for systems that don't have CONFIG_OF_IRQ defined. Signed-off-by: Mark Hasemeyer Acked-by: Rob Herring --- Changes in v2: -None include/linux/of_irq.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index d6d3eae2f1452..0d73b2ca92d31 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -34,8 +34,6 @@ static inline int of_irq_parse_oldworld(const struct device_node *device, int in extern int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq); extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data); -extern int of_irq_to_resource(struct device_node *dev, int index, - struct resource *r); #ifdef CONFIG_OF_IRQ extern void of_irq_init(const struct of_device_id *matches); @@ -44,6 +42,7 @@ extern int of_irq_parse_one(struct device_node *device, int index, extern int of_irq_count(struct device_node *dev); extern int of_irq_get(struct device_node *dev, int index); extern int of_irq_get_byname(struct device_node *dev, const char *name); +extern int of_irq_to_resource(struct device_node *dev, int index, struct resource *r); extern int of_irq_to_resource_table(struct device_node *dev, struct resource *res, int nr_irqs); extern struct device_node *of_irq_find_parent(struct device_node *child); @@ -76,6 +75,11 @@ static inline int of_irq_get_byname(struct device_node *dev, const char *name) { return 0; } +static inline int of_irq_to_resource(struct device_node *dev, int index, + struct resource *r) +{ + return 0; +} static inline int of_irq_to_resource_table(struct device_node *dev, struct resource *res, int nr_irqs) { From patchwork Wed Dec 20 23:54:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181918 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp85786dyi; Wed, 20 Dec 2023 16:01:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHH2AQN99xM8f5D3m/wr6tfBg6qEKXdRm3bbobohGFUOPBuC23Zc2r25E44aVBYZUH6icVK X-Received: by 2002:a05:622a:14d2:b0:427:7f35:1c29 with SMTP id u18-20020a05622a14d200b004277f351c29mr3797169qtx.84.1703116869004; Wed, 20 Dec 2023 16:01:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116868; cv=none; d=google.com; s=arc-20160816; b=DO8lZvhb6jXXRyBVwpZfNRP4RmHLh20kDmy0jNSHT98JOUCBa3qFnvzwQfwNIwIKRf oyo2gqrrV+NpF8Hx5jXhWVKX8uD7UvPTbk0vJxFmjjH4RkYmHVPVnzXKE9tWl9mbwWqk 4JVUTApdggMQOmlprbmnbmQE8HDlMV+kBpd0MuMeoCpOT/4UFoBDfvfdrzOm+VYe2QRt Gl7nE/iaLg/uv19Z93Xw4dAzuJz49tgWrvODjvhuUhXfIGTzNdJsD3/6Zl79aufz3Ala nVzb0Cpoj0tiE6QE16/P1iw0hAo1PagdH+KOZ2hU0YUKNvKlR7FAx5yYM3nmnutoQ0mL 57KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/4vyd1tF7LY6LenXuoft53vwvHTu14aLUC8wddaElsk=; fh=v2Ht5y747k1l/Ai2xsaBh2LNlmR666WlTsnQ09U8XlM=; b=MQQ8PWyhOuZCk+BSj3B0SJikhOhvhv5/5Uz5lgGpf5+UPKE6kDvrWYtIgpc0lq31N/ p1O41glSyhvMlBIt2ex6HILfGzkXoZbdaaOHQfxkx+XV7UODZl+xBmLqBBtZgpGU0SUj emzmGT0ZGBKCoh8K3371yBK5vM8ICDQLkTYpnZwaqZCofhb297oyleRR+trKHfnjOE0W GElUId4uKwEMFHOkmgm6QANCDO8M+/IVjErYb3sijUWukUMab9zJ5IxBAGvE0C9z7toj YXPdm33wMocUcHMJBYFWcv6vXTkT4UfVHnr4EYa8R/hebkHjb2HZeXruzkKssTRcBexk TXbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="YsCoH7/Z"; spf=pass (google.com: domain of linux-kernel+bounces-7672-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7672-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b10-20020ac87fca000000b0042577976e8dsi868280qtk.456.2023.12.20.16.01.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 16:01:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7672-ouuuleilei=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=@chromium.org header.s=google header.b="YsCoH7/Z"; spf=pass (google.com: domain of linux-kernel+bounces-7672-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7672-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 ACBA21C23CFF for ; Thu, 21 Dec 2023 00:01:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 422EA51C53; Wed, 20 Dec 2023 23:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="YsCoH7/Z" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A9DD4FF65 for ; Wed, 20 Dec 2023 23:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7b35d476d61so9610539f.0 for ; Wed, 20 Dec 2023 15:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116525; x=1703721325; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/4vyd1tF7LY6LenXuoft53vwvHTu14aLUC8wddaElsk=; b=YsCoH7/ZbO+dsTFo1Nao4y3nEV+9+WrVNB+fkuNvqRrbjSylGI032V+UsAi2cdEJQw UVoxKCISQfLg7+tk0Qn9pb9oCKrImqgPzxdNjSi+ARpivTBNAYT1rx777OR5LaGAaFgD h6dtebRO0A199MwX/xATjW3l63rVBO2B/0lDc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116525; x=1703721325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/4vyd1tF7LY6LenXuoft53vwvHTu14aLUC8wddaElsk=; b=kadc8A4obHdCTweJ9l7H5XHsQS/f6dSfXArqu5G5byp4AF/rlbr8N0adQzQC1zNP0z IzhIKnMOSrmcs9ftmHfaM6yaXuonq5fU+crLBtpaj96UvI5vZMTU5NdK+ytps0wyqnRw Qa1fC+pXJORQOrHu3+Ug/DTUO0HiUfKeVPCIR/qL7bGtRiU3MN9FDgPIH9PCVyxMZiCQ 3kdIi471y65qa6O+qyr16huawwim3sPb04lj8FQ70MAvfKYR6VEUhfErrrU1uXyYwmG2 j7OF9XSO8T6uZK5/6OkK+OrjSReTo6BulqrdjD5BwIh9trac9fe6MN4xAgewiTxNOun1 h+qw== X-Gm-Message-State: AOJu0YyAB8GtTEdsLTy2VRtQfHDWOBtN5kZ55IRGtnVi/yzf1XYc70JM GyFNhOBWUtRrFY3cmPSuJC/sU1bqbHW3c02aEAI= X-Received: by 2002:a05:6e02:1a66:b0:35f:87ac:10d4 with SMTP id w6-20020a056e021a6600b0035f87ac10d4mr12175155ilv.5.1703116525358; Wed, 20 Dec 2023 15:55:25 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:24 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Frank Rowand , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v2 19/22] of: irq: Remove extern from function declarations Date: Wed, 20 Dec 2023 16:54:33 -0700 Message-ID: <20231220165423.v2.19.I319e781c11e6352eb5b6c408dc20bd54a720edbf@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847473697341690 X-GMAIL-MSGID: 1785847473697341690 The extern keyword is implicit for function declarations. Remove it where possible and adjust the line wrapping accordingly. Signed-off-by: Mark Hasemeyer Acked-by: Rob Herring --- Changes in v2: -New patch include/linux/of_irq.h | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 0d73b2ca92d31..a130dcbc4bb45 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -32,27 +32,26 @@ static inline int of_irq_parse_oldworld(const struct device_node *device, int in } #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ -extern int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq); -extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data); +int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq); +unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data); #ifdef CONFIG_OF_IRQ -extern void of_irq_init(const struct of_device_id *matches); -extern int of_irq_parse_one(struct device_node *device, int index, - struct of_phandle_args *out_irq); -extern int of_irq_count(struct device_node *dev); -extern int of_irq_get(struct device_node *dev, int index); -extern int of_irq_get_byname(struct device_node *dev, const char *name); -extern int of_irq_to_resource(struct device_node *dev, int index, struct resource *r); -extern int of_irq_to_resource_table(struct device_node *dev, - struct resource *res, int nr_irqs); -extern struct device_node *of_irq_find_parent(struct device_node *child); -extern struct irq_domain *of_msi_get_domain(struct device *dev, +void of_irq_init(const struct of_device_id *matches); +int of_irq_parse_one(struct device_node *device, int index, + struct of_phandle_args *out_irq); +int of_irq_count(struct device_node *dev); +int of_irq_get(struct device_node *dev, int index); +int of_irq_get_byname(struct device_node *dev, const char *name); +int of_irq_to_resource(struct device_node *dev, int index, struct resource *r); +int of_irq_to_resource_table(struct device_node *dev, struct resource *res, + int nr_irqs); +struct device_node *of_irq_find_parent(struct device_node *child); +struct irq_domain *of_msi_get_domain(struct device *dev, struct device_node *np, enum irq_domain_bus_token token); -extern struct irq_domain *of_msi_map_get_device_domain(struct device *dev, - u32 id, - u32 bus_token); -extern void of_msi_configure(struct device *dev, struct device_node *np); +struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 id, + u32 bus_token); +void of_msi_configure(struct device *dev, struct device_node *np); u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in); #else static inline void of_irq_init(const struct of_device_id *matches) @@ -117,7 +116,7 @@ static inline u32 of_msi_map_id(struct device *dev, * implements it differently. However, the prototype is the same for all, * so declare it here regardless of the CONFIG_OF_IRQ setting. */ -extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); +unsigned int irq_of_parse_and_map(struct device_node *node, int index); #else /* !CONFIG_OF && !CONFIG_SPARC */ static inline unsigned int irq_of_parse_and_map(struct device_node *dev, From patchwork Wed Dec 20 23:54:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181919 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp85958dyi; Wed, 20 Dec 2023 16:01:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuHe1wJnVyuVJcVqnZbn2qQLjCxQFTj/TDb+dQLVFLKUYZnQI4cuFBEG+cd+rfbv+Zl1Bd X-Received: by 2002:a2e:818d:0:b0:2cc:5fa4:abd5 with SMTP id e13-20020a2e818d000000b002cc5fa4abd5mr1956310ljg.32.1703116886067; Wed, 20 Dec 2023 16:01:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116886; cv=none; d=google.com; s=arc-20160816; b=qLkwGy7g6FZtmH9QcxWMeJGRJWhpLoPdd2lFy98tnkEz2UD3NAAp/KfvgTuP6Es+P7 s7dl9mGA8ottKwerFdQeZHYO1D3mye9qWaE2meVgsMm+pEIDO3ubif2B9DCwZ7s8ci/J 87jp1NMob2TMtxOITck5KBb2We4zeh+ScMk1nKzgC5Xl//H54YLFljASwbOE15k9QDRY 2D2p1r3yHoxdSHwZWj+IBlY/H81zigwlaXwnZO8YjRJrcelbOiM0jRIk7j+xygVdMGXY tcz1VdkAIi8Fhmh8gpWxRH2cnRnPcW4gzjNanTjA8ML/QyaikIDN0+S5wZBkmrT3SJk0 uqbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=AD3TjuZ8z4szpVAtqglArcudpEVksAT0HzSeLd2B1Dk=; fh=4ldvFzeVoazWT+o7Z0GkI84xUk46D2Tpp0XcMPaolAs=; b=V9CPGAfqn2LsquCvTbVasnA0jP5NHbvE1dAmo7AOy91lZt1woEm0jYkGGPAQQMeCv3 vpgx22ohSd+II+5SgtUSI3AXYSKopP+AQl/KFv0wZeliv6jIIZn8iP3iTqYcCPrUmdpU Z6pG4qENNW02wOhqN548M+aLuT0W524JbbTlvxpK/ljCW0qzG58yS5dP8h0bwVA3/ESz KMWWc++vj5UYlKX5l7MbqMLLkNRQkL/GWpPybaUZycJR2qKoJnBW7m1kSuFsQsv7mjxo lWgpirYKzIF86hmPm2J8biXczAWkIVXYNxb78sCBKC7TotwIjJebOqGVbL/gc6FDDASO U0zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DBrtxpTc; spf=pass (google.com: domain of linux-kernel+bounces-7673-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7673-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r27-20020a50d69b000000b0055337d0a87dsi281367edi.426.2023.12.20.16.01.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 16:01:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7673-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DBrtxpTc; spf=pass (google.com: domain of linux-kernel+bounces-7673-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7673-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 829C51F229AA for ; Thu, 21 Dec 2023 00:01:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 457E0524B4; Wed, 20 Dec 2023 23:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="DBrtxpTc" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CD915026B for ; Wed, 20 Dec 2023 23:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7b7a9f90ee9so9156839f.0 for ; Wed, 20 Dec 2023 15:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116526; x=1703721326; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AD3TjuZ8z4szpVAtqglArcudpEVksAT0HzSeLd2B1Dk=; b=DBrtxpTcnWV8jJoVK8EtiBjFz+EPD3xtKcLBwoTfNlBPWsK1A4Fzq9E18e5j7elPzU Zd6UA/5o/0m78Y/o+pP3RWuO8hJbT56ii+w98WnFABSYqxBP9/QaXc6P+GsTGSdlC+tm RnxxyvOCbJOwrrsH00wHPTj5aGMsYVYYvJIZ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116526; x=1703721326; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AD3TjuZ8z4szpVAtqglArcudpEVksAT0HzSeLd2B1Dk=; b=b0ALlXEJAv9glRMVg3uT2IM2wnJ4HK7nf+gb6/apelHljKHod7xWLfobg23LYzjtZ4 8EbK1Zti2z+doOHWPQcsT97NNOZBXGvDFhQ550rHp2gC6Ay8Ga98Q94WXASaEO1b93wH mTjN8Xq6Q0j4f2dxxNRMgC0buw4i27LbKnkcLkHqyh/iytSijmuLb8JWtbVLrkbz+QKz 58vzlVkrKzQffdrSw1+ILqB6VWTEL38Bcxecekz9zK3jZN06rPpVowTRMOiyyNazvDzn BcSrc29mE1vLrZv6gqYj5U5YyjQr6RPifklskWz47DuoiY7TzTmD3aqQ6GXzbk2PY8Bz ld6Q== X-Gm-Message-State: AOJu0YzKcU7RmqVRrHJTi6SIW8zqqNdvHvp9o+negcG1diCs9NphoH+S NclxPbdC3h/Wv8cUrRumrzMeWbeb32ki8EbmX3k= X-Received: by 2002:a5d:8c83:0:b0:7b7:fe6c:e6d3 with SMTP id g3-20020a5d8c83000000b007b7fe6ce6d3mr2659307ion.2.1703116526320; Wed, 20 Dec 2023 15:55:26 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:26 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Andy Shevchenko , Daniel Scally , Frank Rowand , Greg Kroah-Hartman , Heikki Krogerus , Len Brown , "Rafael J. Wysocki" , Rob Herring , Sakari Ailus , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource Date: Wed, 20 Dec 2023 16:54:34 -0700 Message-ID: <20231220165423.v2.20.I38ac58ab04985a404ed6551eb5813fa7841ef410@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847492244930845 X-GMAIL-MSGID: 1785847492244930845 The underlying ACPI and OF subsystems provide their own APIs which provide IRQ information as a struct resource. This allows callers to get more information about the IRQ by looking at the resource flags. For example, whether or not an IRQ is wake capable. Signed-off-by: Mark Hasemeyer Reviewed-by: Sakari Ailus --- Changes in v2: -New patch drivers/acpi/property.c | 11 +++++------ drivers/base/property.c | 24 +++++++++++++++++++++--- drivers/of/property.c | 8 ++++---- include/linux/fwnode.h | 8 +++++--- include/linux/property.h | 2 ++ 5 files changed, 37 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index a6ead5204046b..259869987ffff 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -1627,17 +1627,16 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode, return 0; } -static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode, - unsigned int index) +static int acpi_fwnode_irq_get_resource(const struct fwnode_handle *fwnode, + unsigned int index, struct resource *r) { - struct resource res; int ret; - ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), index, &res); + ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), index, r); if (ret) return ret; - return res.start; + return r->start; } #define DECLARE_ACPI_FWNODE_OPS(ops) \ @@ -1664,7 +1663,7 @@ static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode, acpi_graph_get_remote_endpoint, \ .graph_get_port_parent = acpi_fwnode_get_parent, \ .graph_parse_endpoint = acpi_fwnode_graph_parse_endpoint, \ - .irq_get = acpi_fwnode_irq_get, \ + .irq_get_resource = acpi_fwnode_irq_get_resource, \ }; \ EXPORT_SYMBOL_GPL(ops) diff --git a/drivers/base/property.c b/drivers/base/property.c index a1b01ab420528..4f5d5ab5ab8cf 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -1047,23 +1047,41 @@ void __iomem *fwnode_iomap(struct fwnode_handle *fwnode, int index) EXPORT_SYMBOL(fwnode_iomap); /** - * fwnode_irq_get - Get IRQ directly from a fwnode + * fwnode_irq_get_resource - Get IRQ directly from a fwnode and populate + * the resource struct * @fwnode: Pointer to the firmware node * @index: Zero-based index of the IRQ + * @r: Pointer to resource to populate with IRQ information. * * Return: Linux IRQ number on success. Negative errno on failure. */ -int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index) +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode, + unsigned int index, struct resource *r) { int ret; - ret = fwnode_call_int_op(fwnode, irq_get, index); + ret = fwnode_call_int_op(fwnode, irq_get_resource, index, r); /* We treat mapping errors as invalid case */ if (ret == 0) return -EINVAL; return ret; } +EXPORT_SYMBOL(fwnode_irq_get_resource); + +/** + * fwnode_irq_get - Get IRQ directly from a fwnode + * @fwnode: Pointer to the firmware node + * @index: Zero-based index of the IRQ + * + * Return: Linux IRQ number on success. Negative errno on failure. + */ +int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index) +{ + struct resource r; + + return fwnode_irq_get_resource(fwnode, index, &r); +} EXPORT_SYMBOL(fwnode_irq_get); /** diff --git a/drivers/of/property.c b/drivers/of/property.c index afdaefbd03f61..864ea5fa5702b 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1425,10 +1425,10 @@ static void __iomem *of_fwnode_iomap(struct fwnode_handle *fwnode, int index) #endif } -static int of_fwnode_irq_get(const struct fwnode_handle *fwnode, - unsigned int index) +static int of_fwnode_irq_get_resource(const struct fwnode_handle *fwnode, + unsigned int index, struct resource *r) { - return of_irq_get(to_of_node(fwnode), index); + return of_irq_to_resource(to_of_node(fwnode), index, r); } static int of_fwnode_add_links(struct fwnode_handle *fwnode) @@ -1469,7 +1469,7 @@ const struct fwnode_operations of_fwnode_ops = { .graph_get_port_parent = of_fwnode_graph_get_port_parent, .graph_parse_endpoint = of_fwnode_graph_parse_endpoint, .iomap = of_fwnode_iomap, - .irq_get = of_fwnode_irq_get, + .irq_get_resource = of_fwnode_irq_get_resource, .add_links = of_fwnode_add_links, }; EXPORT_SYMBOL_GPL(of_fwnode_ops); diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h index 2a72f55d26eb8..716ed863acde0 100644 --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h @@ -9,10 +9,11 @@ #ifndef _LINUX_FWNODE_H_ #define _LINUX_FWNODE_H_ -#include -#include #include #include +#include +#include +#include struct fwnode_operations; struct device; @@ -164,7 +165,8 @@ struct fwnode_operations { int (*graph_parse_endpoint)(const struct fwnode_handle *fwnode, struct fwnode_endpoint *endpoint); void __iomem *(*iomap)(struct fwnode_handle *fwnode, int index); - int (*irq_get)(const struct fwnode_handle *fwnode, unsigned int index); + int (*irq_get_resource)(const struct fwnode_handle *fwnode, + unsigned int index, struct resource *r); int (*add_links)(struct fwnode_handle *fwnode); }; diff --git a/include/linux/property.h b/include/linux/property.h index e6516d0b7d52a..685ba72a8ce9e 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -190,6 +190,8 @@ struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode); void fwnode_handle_put(struct fwnode_handle *fwnode); int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index); +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode, + unsigned int index, struct resource *r); int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name); unsigned int device_get_child_node_count(const struct device *dev); From patchwork Wed Dec 20 23:54:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp87762dyi; Wed, 20 Dec 2023 16:04:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHYg0MrgS7lyi96rKbnY40Eiae8zZTMBN4gv2fmiuaYjue+UcfxIciqUsTVIxqH/0eNuG7 X-Received: by 2002:a17:902:d4ca:b0:1d3:45c8:bc12 with SMTP id o10-20020a170902d4ca00b001d345c8bc12mr18507284plg.38.1703117044221; Wed, 20 Dec 2023 16:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703117044; cv=none; d=google.com; s=arc-20160816; b=s4k4ruTbOxMcukeBC1m1pBzUYUKSKntsNJvH1jSiJhr4Fioftk1I94609jQld89Zhw 1IUlPefvAAbvmIaA9eXvEJmNoblMdAA5vKns7hnFzbK1twlgJ0mMbAZpc29bp4rwTimU 2YA5gG90ScmNLqFMcjvdvyyoNm+24Rjm0r/E3XNRwu5B27ewzCSy8T2hfjNeGNhs6emE jcvDLYXvO2+fRsp16Le9lC7SZlPX+3RMfu4GnN8xYA+IGl9PspuCaka+YVLKMwNrgOFh VwgHAIjf2l8kS6E8WQdG5p4uGxZiBrMuViaJTCrIY/79TxfyIAcPZhvNIrk1OgghFK3c 5hXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Jtp1XFn63K+PU8VMmKC4HIoyuYSE41ytBO8LFSmozbo=; fh=3amWX/lWM8uqq3SVVdiBbl9m3cG8KtdALlGH4HH6Wq0=; b=jyueJSHLAPcS8AbjMjMkTskVqoheMyTIQqEdAVYq6xXekBbSZTwz+fSOCq20lSESTn Sv6yDO7e51uArKwwie5iEDQDPgVsQCnyuerMDKStrVYj5szcLdPP/LoVtI49lhdUQOo5 vFAblLzx/YX+Brl6JLX+xc3Pmz4rzxesoFCwZen1qcNJgwFh8fNXUIQWA2zZkiwM8Za1 xw/fsDqz1Bm+IPADaKdfeQc1U2LLKlxl+Xgg1aX94fQxQvn6jvFETlJdLuDP+CdOsMAi GyBnJ9n74qDoW8JjHYMFO8WgxI98Cx+vlp9f2TSmptJxdDkD+tcSkxIMpIFgXGt7H8ps d/lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CDBMRblI; spf=pass (google.com: domain of linux-kernel+bounces-7674-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7674-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id jd22-20020a170903261600b001cfa17ec30dsi441261plb.508.2023.12.20.16.04.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 16:04:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7674-ouuuleilei=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=@chromium.org header.s=google header.b=CDBMRblI; spf=pass (google.com: domain of linux-kernel+bounces-7674-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7674-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 A0C11B22101 for ; Thu, 21 Dec 2023 00:01:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28E74524D4; Wed, 20 Dec 2023 23:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="CDBMRblI" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E15E51013 for ; Wed, 20 Dec 2023 23:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7b7fd9e17d8so8882039f.3 for ; Wed, 20 Dec 2023 15:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116527; x=1703721327; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jtp1XFn63K+PU8VMmKC4HIoyuYSE41ytBO8LFSmozbo=; b=CDBMRblImIqmjF/lsOH/ZBxJ6FBTAtLOGyyBjPP1sEk/Qp6VWnUvU2kqDu4dm9bZ8S PYSvxyHKx2wPl/WcyPzs8Vj2MroB6mLt4Wj499MmA3IjKagfF6e3jBPtBg+kqwqWowXX BwG7/B8PqKArydf9XrNuBvMSpwbX0EZ+1SsWY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116527; x=1703721327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jtp1XFn63K+PU8VMmKC4HIoyuYSE41ytBO8LFSmozbo=; b=gpbKTnblJoUKaVBgHnvmGuJZpKNlvv3dp82BVy6g3GbOHeF15a1IcPO1of6DKSrRXR Ta+IK4MTqZwuerNouZc0xQ2tTITrqLDf3ya7BG6NzT4O6Vly0CyYdgzGnlUJdktAKs+S T7FHWFa4l/+FkjN8UJOkjhSt+SYI0ZLTMAzz6MYfBrM16O51mSEPPT8sOnyysTT2WwQB 2m3axhKlB9/xfJ218hChf67Q5Cxd/m8ZEtggCyxJhj5gQpiD9cFtKfZJKvQQ0MSvUWsF BosRVZMZCYslJYaK8y0+n+AJUp2VhvDMA6EYvQbdWAxKildxjx8NU3Kurs0S4MguZpi0 zdWQ== X-Gm-Message-State: AOJu0YyjzQeRGUs5f+yICdA0jI9AVIMlezX/OB2RRsymCbQ9RdTGtj26 6U6i4Ya0GzbD29bu/8kexJ0m+FZseTxrr8SZsBU= X-Received: by 2002:a6b:f108:0:b0:7ba:84bc:7438 with SMTP id e8-20020a6bf108000000b007ba84bc7438mr308808iog.12.1703116527121; Wed, 20 Dec 2023 15:55:27 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:26 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , David Gow , Greg Kroah-Hartman , Mark Brown , "Rafael J. Wysocki" , Takashi Iwai , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Subject: [PATCH v2 21/22] platform: Modify platform_get_irq_optional() to use resource Date: Wed, 20 Dec 2023 16:54:35 -0700 Message-ID: <20231220165423.v2.21.Ife9ebad2bbfbab3a05e90040f344d750aa0aac7e@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847657302221868 X-GMAIL-MSGID: 1785847657302221868 Unify handling of ACPI, GPIO, devictree, and platform resource interrupts in platform_get_irq_optional(). Each of these subsystems provide their own APIs which provide IRQ information as a struct resource. This simplifies the logic of the function and allows callers to get more information about the IRQ by looking at the resource flags. For example, whether or not an IRQ is wake capable. Signed-off-by: Mark Hasemeyer --- Changes in v2: -irq->IRQ -Remove cast to struct resource -Conform to get_optional() function naming -Revert move of irq_get_irq_data() -Add NULL check on struct resource* -Use fwnode to retrieve IRQ for DT/ACPI drivers/base/platform.c | 74 +++++++++++++++++++++++---------- include/linux/platform_device.h | 3 ++ 2 files changed, 54 insertions(+), 23 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 10c5779634182..3a556faddd40d 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -151,9 +151,11 @@ EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource_byname); #endif /* CONFIG_HAS_IOMEM */ /** - * platform_get_irq_optional - get an optional IRQ for a device + * platform_get_irq_resource_optional - get an optional IRQ for a device and + * populate the resource struct * @dev: platform device * @num: IRQ number index + * @r: pointer to resource to populate with IRQ information. * * Gets an IRQ for a platform device. Device drivers should check the return * value for errors so as to not pass a negative integer value to the @@ -162,47 +164,42 @@ EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource_byname); * * For example:: * - * int irq = platform_get_irq_optional(pdev, 0); + * int irq = platform_get_irq_resource_optional(pdev, 0, &res); * if (irq < 0) * return irq; * * Return: non-zero IRQ number on success, negative error number on failure. */ -int platform_get_irq_optional(struct platform_device *dev, unsigned int num) +int platform_get_irq_resource_optional(struct platform_device *dev, + unsigned int num, struct resource *r) { int ret; + if (IS_ERR_OR_NULL(r)) + return -EINVAL; #ifdef CONFIG_SPARC /* sparc does not have irqs represented as IORESOURCE_IRQ resources */ if (!dev || num >= dev->archdata.num_irqs) goto out_not_found; ret = dev->archdata.irqs[num]; + if (ret > 0) + *r = DEFINE_RES_IRQ(ret); goto out; #else struct fwnode_handle *fwnode = dev_fwnode(&dev->dev); - struct resource *r; + struct resource *platform_res; - if (is_of_node(fwnode)) { - ret = of_irq_get(to_of_node(fwnode), num); - if (ret > 0 || ret == -EPROBE_DEFER) - goto out; - } - - r = platform_get_resource(dev, IORESOURCE_IRQ, num); - if (is_acpi_device_node(fwnode)) { - if (r && r->flags & IORESOURCE_DISABLED) { - ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), num, r); - if (ret) - goto out; - } - } + ret = fwnode_irq_get_resource(fwnode, num, r); + if (ret > 0 || ret == -EPROBE_DEFER) + goto out; + platform_res = platform_get_resource(dev, IORESOURCE_IRQ, num); /* * The resources may pass trigger flags to the irqs that need * to be set up. It so happens that the trigger flags for * IORESOURCE_BITS correspond 1-to-1 to the IRQF_TRIGGER* * settings. */ - if (r && r->flags & IORESOURCE_BITS) { + if (platform_res && platform_res->flags & IORESOURCE_BITS) { struct irq_data *irqd; irqd = irq_get_irq_data(r->start); @@ -211,7 +208,8 @@ int platform_get_irq_optional(struct platform_device *dev, unsigned int num) irqd_set_trigger_type(irqd, r->flags & IORESOURCE_BITS); } - if (r) { + if (platform_res) { + *r = *platform_res; ret = r->start; goto out; } @@ -224,10 +222,12 @@ int platform_get_irq_optional(struct platform_device *dev, unsigned int num) * allows a common code path across either kind of resource. */ if (num == 0 && is_acpi_device_node(fwnode)) { - ret = acpi_dev_gpio_irq_get(to_acpi_device_node(fwnode), num); + ret = acpi_dev_get_gpio_irq_resource(to_acpi_device_node(fwnode), NULL, num, r); /* Our callers expect -ENXIO for missing IRQs. */ - if (ret >= 0 || ret == -EPROBE_DEFER) + if (!ret || ret == -EPROBE_DEFER) { + ret = ret ?: r->start; goto out; + } } #endif @@ -238,7 +238,8 @@ int platform_get_irq_optional(struct platform_device *dev, unsigned int num) return -EINVAL; return ret; } -EXPORT_SYMBOL_GPL(platform_get_irq_optional); +EXPORT_SYMBOL_GPL(platform_get_irq_resource_optional); + /** * platform_get_irq - get an IRQ for a device @@ -270,6 +271,33 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) } EXPORT_SYMBOL_GPL(platform_get_irq); + +/** + * platform_get_irq_optional - get an optional IRQ for a device + * @dev: platform device + * @num: IRQ number index + * + * Gets an IRQ for a platform device. Device drivers should check the return + * value for errors so as to not pass a negative integer value to the + * request_irq() APIs. This is the same as platform_get_irq(), except that it + * does not print an error message if an IRQ can not be obtained. + * + * For example:: + * + * int irq = platform_get_irq_optional(pdev, 0); + * if (irq < 0) + * return irq; + * + * Return: non-zero IRQ number on success, negative error number on failure. + */ +int platform_get_irq_optional(struct platform_device *dev, unsigned int num) +{ + struct resource r; + + return platform_get_irq_resource_optional(dev, num, &r); +} +EXPORT_SYMBOL_GPL(platform_get_irq_optional); + /** * platform_irq_count - Count the number of IRQs a platform device uses * @dev: platform device diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 7a41c72c19591..2117f817d9c9c 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -102,6 +102,9 @@ devm_platform_ioremap_resource_byname(struct platform_device *pdev, extern int platform_get_irq(struct platform_device *, unsigned int); extern int platform_get_irq_optional(struct platform_device *, unsigned int); +extern int platform_get_irq_resource_optional(struct platform_device *dev, + unsigned int num, + struct resource *r); extern int platform_irq_count(struct platform_device *); extern int devm_platform_get_irqs_affinity(struct platform_device *dev, struct irq_affinity *affd, From patchwork Wed Dec 20 23:54:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hasemeyer X-Patchwork-Id: 181920 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp86190dyi; Wed, 20 Dec 2023 16:01:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHh2p7rsnUUyvLykhmb2E4Crp3rl1oTapvDvdqTLaNAqZw8VGN5UyI39oKIrg5h24StpsHc X-Received: by 2002:a05:6a00:2fd7:b0:6d9:6b40:d2f6 with SMTP id fn23-20020a056a002fd700b006d96b40d2f6mr624388pfb.2.1703116906951; Wed, 20 Dec 2023 16:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703116906; cv=none; d=google.com; s=arc-20160816; b=oXRyio7tjmfrp+QgXE2rj9q1Y4Ig/nVQN4301LnIA4IyLsdPnsseMuZ112YRLlu/mn rYPj5xrcJyGFJN0OR+4Pw7EZ/PVC2Mb9U+OFVP5Y9c2zwOjusgETO58FO7GtDiKxtf7f tM0edn4DZnOlDInd3bIIKapuh1glxD5eQJMtofkRXnkDI+nqvrZnM8iET/KSpTS5zJ3z mfLLghVqU1Ql09Jo6P9DwESQ/zK0ExIFPa9x489yEaurMdMW+WRN4G3QoX0JTwwALbgt RtMEBpa0WRJiOSNHti4B0yREm6SiNaoxToaw+AJGnFKhcKAhvOHG77RTp7cUGzB/OORC G2yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=E4LntbTWAkvb3ubuXcE2yEZinwRXbecjdU87OrYLeRQ=; fh=pMoPBr7amBUjekZhqvhAtzGuhBZSNvGSZ+DVZY0JPqQ=; b=SUeapvim3k7o2UKYBou/s645jW+nmwBTkgkZkKoN0iBZ4sw+hWwnBwpA4DBBSK08Nm T0vVTgTjGtzPOJwZZmFbwkPBao5KbRfKaiuriuahHNpIumwCYf6Egl86KbTewQnAtRe3 xVQMe4Bt94XEa3dDDLNVy+p885s7akTlx3naT2ddTb8L81jqwcjgdkByAf1zSnqNSmCw w1JwgVEJmGqySf96KVBi3L0pPhUu9ETyVbk5gPFEiTbm0ISQW7KtKnEaym6akVfGVU76 PWq8Cyc6FSZ368GR/QINs9yjCPvg9GtVU3Fju9mqiDHeE1gFo5+1aHTos5ECLw2foX7u nl4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="A/KtLs3a"; spf=pass (google.com: domain of linux-kernel+bounces-7675-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7675-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id o25-20020a656159000000b005cd8ef5c71asi528852pgv.864.2023.12.20.16.01.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 16:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7675-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="A/KtLs3a"; spf=pass (google.com: domain of linux-kernel+bounces-7675-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7675-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 99BF1284BBE for ; Thu, 21 Dec 2023 00:01:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5329352F6C; Wed, 20 Dec 2023 23:55:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="A/KtLs3a" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2CAB50266 for ; Wed, 20 Dec 2023 23:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7b7fdde8b26so7348139f.1 for ; Wed, 20 Dec 2023 15:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703116528; x=1703721328; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E4LntbTWAkvb3ubuXcE2yEZinwRXbecjdU87OrYLeRQ=; b=A/KtLs3a+q5u2Z+kgFF4rdclXeigCtkHU8l7JKORaO1NCAr+ZxtHqfHnU9W3idaX/6 rxTJzNpS9gBeG+HBAR/+ETpJNKNkMO3wIaMHOsJDptSwaGPnCpLtw96y1CJsKfKf7GtN XX+YT0jrjPeO/jvZ8cFXSAHe/gw0KRoycOYm0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703116528; x=1703721328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E4LntbTWAkvb3ubuXcE2yEZinwRXbecjdU87OrYLeRQ=; b=DvB9wzFB9atVOAVZz+nTtCXvFMy4XjIVEX0NHMJiCEMbFF7+OXF8YEPvTdFHylYjLo IrulHbsfVgrCzCT2qfDmxE0sIzkZFGFvXXR9/jzuNA6s4BdF0qWWibZsLIJmq0bI8bgb a1sQQjP5Ja0vaZJtrELvQaJf8EYahe89W51DH7VpviZDuYkoxoZFbX/tmIwAkJDO67HU v9PbKnv2EzF75ifZciFO+DXo/O8DiFDWT/qSCgfMnVnCSBQHX4L9nCIJTIcS98/KOWZj RVE6BYjkT3YtRO5HZWwilaIh5nSbjVAQRbckx6YjTd5NSuNzdr+6cYixfDyqmNgl2IUm LqdA== X-Gm-Message-State: AOJu0YwOabgqfz7yvZNZ4BtPVprcf3OHLkLB7FgJWOJUH/BcALF/UIWU YOwXDvqmGB3wXRRBPq0V6BRE9rmbTkOg38ultWE= X-Received: by 2002:a6b:5f10:0:b0:7ba:8569:8b37 with SMTP id t16-20020a6b5f10000000b007ba85698b37mr298479iob.25.1703116528068; Wed, 20 Dec 2023 15:55:28 -0800 (PST) Received: from markhas1.lan (71-218-50-136.hlrn.qwest.net. [71.218.50.136]) by smtp.gmail.com with ESMTPSA id bp22-20020a056638441600b0046b39a6f404sm177805jab.17.2023.12.20.15.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:55:27 -0800 (PST) From: Mark Hasemeyer To: LKML Cc: AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Andy Shevchenko , Rob Herring , Sudeep Holla , Mark Hasemeyer , Benson Leung , Bhanu Prakash Maiya , Chen-Yu Tsai , Guenter Roeck , Lee Jones , Prashant Malani , Rob Barnes , Stephen Boyd , chrome-platform@lists.linux.dev Subject: [PATCH v2 22/22] platform/chrome: cros_ec: Use PM subsystem to manage wakeirq Date: Wed, 20 Dec 2023 16:54:36 -0700 Message-ID: <20231220165423.v2.22.Ieee574a0e94fbaae01fd6883ffe2ceeb98d7df28@changeid> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231220235459.2965548-1-markhas@chromium.org> References: <20231220235459.2965548-1-markhas@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785847513848089539 X-GMAIL-MSGID: 1785847513848089539 The cros ec driver is manually managing the wake IRQ by calling enable_irq_wake()/disable_irq_wake() during suspend/resume. Modify the driver to use the power management subsystem to manage the wakeirq. Rather than assuming that the IRQ is wake capable, use the underlying firmware/device tree to determine whether or not to enable it as a wake source. Some Chromebooks rely solely on the ec_sync pin to wake the AP but do not specify the interrupt as wake capable in the ACPI _CRS. For LPC/ACPI based systems a DMI quirk is introduced listing boards whose firmware should not be trusted to provide correct wake capable values. For device tree base systems, it is not an issue as the relevant device tree entries have been updated and DTS is built from source for each ChromeOS update. The IRQ wake logic was added on an interface basis (lpc, spi, uart) as opposed to adding it to cros_ec.c because the i2c subsystem already enables the wakirq (if applicable) on our behalf. Signed-off-by: Mark Hasemeyer --- Changes in v2: -Rebase on linux-next -Add cover letter -See each patch for patch specific changes -Look for 'wakeup-source' property in cros_ec_spi.c drivers/platform/chrome/cros_ec.c | 9 ---- drivers/platform/chrome/cros_ec_lpc.c | 52 +++++++++++++++++++-- drivers/platform/chrome/cros_ec_spi.c | 41 ++++++++++++---- drivers/platform/chrome/cros_ec_uart.c | 34 ++++++++++++-- include/linux/platform_data/cros_ec_proto.h | 2 - 5 files changed, 110 insertions(+), 28 deletions(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c index badc68bbae8cc..f24d2f2084399 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -353,12 +353,6 @@ EXPORT_SYMBOL(cros_ec_suspend_prepare); static void cros_ec_disable_irq(struct cros_ec_device *ec_dev) { - struct device *dev = ec_dev->dev; - if (device_may_wakeup(dev)) - ec_dev->wake_enabled = !enable_irq_wake(ec_dev->irq); - else - ec_dev->wake_enabled = false; - disable_irq(ec_dev->irq); ec_dev->suspended = true; } @@ -440,9 +434,6 @@ static void cros_ec_enable_irq(struct cros_ec_device *ec_dev) ec_dev->suspended = false; enable_irq(ec_dev->irq); - if (ec_dev->wake_enabled) - disable_irq_wake(ec_dev->irq); - /* * Let the mfd devices know about events that occur during * suspend. This way the clients know what to do with them. diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index f0f3d3d561572..fec5aefd6f177 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,28 @@ struct lpc_driver_ops { static struct lpc_driver_ops cros_ec_lpc_ops = { }; +static const struct dmi_system_id untrusted_fw_irq_wake_capable[] = { + { + .ident = "Brya", + .matches = { + DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Brya") + } + }, + { + .ident = "Brask", + .matches = { + DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Brask") + } + }, + { } +} +MODULE_DEVICE_TABLE(dmi, untrusted_fw_irq_wake_capable); + +static bool cros_ec_should_force_irq_wake_capable(void) +{ + return dmi_first_match(untrusted_fw_irq_wake_capable) != NULL; +} + /* * A generic instance of the read function of struct lpc_driver_ops, used for * the LPC EC. @@ -350,9 +373,11 @@ static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data) static int cros_ec_lpc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + bool irq_wake = false; struct acpi_device *adev; acpi_status status; struct cros_ec_device *ec_dev; + struct resource irqres; u8 buf[2] = {}; int irq, ret; @@ -428,20 +453,36 @@ static int cros_ec_lpc_probe(struct platform_device *pdev) * Some boards do not have an IRQ allotted for cros_ec_lpc, * which makes ENXIO an expected (and safe) scenario. */ - irq = platform_get_irq_optional(pdev, 0); - if (irq > 0) + irq = platform_get_irq_resource_optional(pdev, 0, &irqres); + if (irq > 0) { ec_dev->irq = irq; - else if (irq != -ENXIO) { + if (cros_ec_should_force_irq_wake_capable()) + irq_wake = true; + else + irq_wake = irqres.flags & IORESOURCE_IRQ_WAKECAPABLE; + dev_dbg(dev, "IRQ: %i, wake_capable: %i\n", irq, irq_wake); + } else if (irq != -ENXIO) { dev_err(dev, "couldn't retrieve IRQ number (%d)\n", irq); return irq; } ret = cros_ec_register(ec_dev); if (ret) { - dev_err(dev, "couldn't register ec_dev (%d)\n", ret); + dev_err_probe(dev, ret, "couldn't register ec_dev (%d)\n", ret); return ret; } + if (irq_wake) { + ret = device_init_wakeup(dev, true); + if (ret) { + dev_err_probe(dev, ret, "Failed to init device for wakeup"); + return ret; + } + ret = dev_pm_set_wake_irq(dev, irq); + if (ret) + return ret; + } + /* * Connect a notify handler to process MKBP messages if we have a * companion ACPI device. @@ -463,6 +504,7 @@ static int cros_ec_lpc_probe(struct platform_device *pdev) static void cros_ec_lpc_remove(struct platform_device *pdev) { struct cros_ec_device *ec_dev = platform_get_drvdata(pdev); + struct device *dev = ec_dev->dev; struct acpi_device *adev; adev = ACPI_COMPANION(&pdev->dev); @@ -470,6 +512,8 @@ static void cros_ec_lpc_remove(struct platform_device *pdev) acpi_remove_notify_handler(adev->handle, ACPI_ALL_NOTIFY, cros_ec_lpc_acpi_notify); + dev_pm_clear_wake_irq(dev); + device_init_wakeup(dev, false); cros_ec_unregister(ec_dev); } diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c index 3e88cc92e8192..0aad8b2f007f6 100644 --- a/drivers/platform/chrome/cros_ec_spi.c +++ b/drivers/platform/chrome/cros_ec_spi.c @@ -7,9 +7,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -70,6 +72,7 @@ * @end_of_msg_delay: used to set the delay_usecs on the spi_transfer that * is sent when we want to turn off CS at the end of a transaction. * @high_pri_worker: Used to schedule high priority work. + * @irq_wake: Whether or not irq assertion should wake the system. */ struct cros_ec_spi { struct spi_device *spi; @@ -77,6 +80,7 @@ struct cros_ec_spi { unsigned int start_of_msg_delay; unsigned int end_of_msg_delay; struct kthread_worker *high_pri_worker; + bool irq_wake; }; typedef int (*cros_ec_xfer_fn_t) (struct cros_ec_device *ec_dev, @@ -689,12 +693,16 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev, return cros_ec_xfer_high_pri(ec_dev, ec_msg, do_cros_ec_cmd_xfer_spi); } -static void cros_ec_spi_dt_probe(struct cros_ec_spi *ec_spi, struct device *dev) +static void cros_ec_spi_dt_probe(struct cros_ec_spi *ec_spi, struct spi_device *spi) { - struct device_node *np = dev->of_node; + struct cros_ec_device *ec_dev = spi_get_drvdata(spi); + struct device_node *np = spi->dev.of_node; u32 val; int ret; + if (!np) + return; + ret = of_property_read_u32(np, "google,cros-ec-spi-pre-delay", &val); if (!ret) ec_spi->start_of_msg_delay = val; @@ -702,6 +710,11 @@ static void cros_ec_spi_dt_probe(struct cros_ec_spi *ec_spi, struct device *dev) ret = of_property_read_u32(np, "google,cros-ec-spi-msg-delay", &val); if (!ret) ec_spi->end_of_msg_delay = val; + + if (ec_dev->irq > 0 && of_property_read_bool(np, "wakeup-source")) { + ec_spi->irq_wake = true; + dev_dbg(&spi->dev, "IRQ: %i, wake_capable: %i\n", ec_dev->irq, ec_spi->irq_wake); + } } static void cros_ec_spi_high_pri_release(void *worker) @@ -753,9 +766,6 @@ static int cros_ec_spi_probe(struct spi_device *spi) if (!ec_dev) return -ENOMEM; - /* Check for any DT properties */ - cros_ec_spi_dt_probe(ec_spi, dev); - spi_set_drvdata(spi, ec_dev); ec_dev->dev = dev; ec_dev->priv = ec_spi; @@ -768,6 +778,9 @@ static int cros_ec_spi_probe(struct spi_device *spi) sizeof(struct ec_response_get_protocol_info); ec_dev->dout_size = sizeof(struct ec_host_request); + /* Check for any DT properties */ + cros_ec_spi_dt_probe(ec_spi, spi); + ec_spi->last_transfer_ns = ktime_get_ns(); err = cros_ec_spi_devm_high_pri_alloc(dev, ec_spi); @@ -776,19 +789,31 @@ static int cros_ec_spi_probe(struct spi_device *spi) err = cros_ec_register(ec_dev); if (err) { - dev_err(dev, "cannot register EC\n"); + dev_err_probe(dev, err, "cannot register EC\n"); return err; } - device_init_wakeup(&spi->dev, true); + if (ec_spi->irq_wake) { + err = device_init_wakeup(dev, true); + if (err) { + dev_err_probe(dev, err, "Failed to init device for wakeup\n"); + return err; + } + err = dev_pm_set_wake_irq(dev, ec_dev->irq); + if (err) + dev_err_probe(dev, err, "Failed to set irq(%d) for wake\n", ec_dev->irq); + } - return 0; + return err; } static void cros_ec_spi_remove(struct spi_device *spi) { struct cros_ec_device *ec_dev = spi_get_drvdata(spi); + struct device *dev = ec_dev->dev; + dev_pm_clear_wake_irq(dev); + device_init_wakeup(dev, false); cros_ec_unregister(ec_dev); } diff --git a/drivers/platform/chrome/cros_ec_uart.c b/drivers/platform/chrome/cros_ec_uart.c index 68d80559fddc2..ced53bb40b2ef 100644 --- a/drivers/platform/chrome/cros_ec_uart.c +++ b/drivers/platform/chrome/cros_ec_uart.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ struct response_info { * @baudrate: UART baudrate of attached EC device. * @flowcontrol: UART flowcontrol of attached device. * @irq: Linux IRQ number of associated serial device. + * @irq_wake: Whether or not irq assertion should wake the system. * @response: Response info passing between cros_ec_uart_pkt_xfer() * and cros_ec_uart_rx_bytes() */ @@ -78,6 +80,7 @@ struct cros_ec_uart { u32 baudrate; u8 flowcontrol; u32 irq; + bool irq_wake; struct response_info response; }; @@ -224,8 +227,10 @@ static int cros_ec_uart_resource(struct acpi_resource *ares, void *data) static int cros_ec_uart_acpi_probe(struct cros_ec_uart *ec_uart) { int ret; + struct resource irqres; LIST_HEAD(resources); - struct acpi_device *adev = ACPI_COMPANION(&ec_uart->serdev->dev); + struct device *dev = &ec_uart->serdev->dev; + struct acpi_device *adev = ACPI_COMPANION(dev); ret = acpi_dev_get_resources(adev, &resources, cros_ec_uart_resource, ec_uart); if (ret < 0) @@ -234,12 +239,13 @@ static int cros_ec_uart_acpi_probe(struct cros_ec_uart *ec_uart) acpi_dev_free_resource_list(&resources); /* Retrieve GpioInt and translate it to Linux IRQ number */ - ret = acpi_dev_gpio_irq_get(adev, 0); + ret = acpi_dev_get_gpio_irq_resource(adev, NULL, 0, &irqres); if (ret < 0) return ret; - ec_uart->irq = ret; - dev_dbg(&ec_uart->serdev->dev, "IRQ number %d\n", ec_uart->irq); + ec_uart->irq = irqres.start; + ec_uart->irq_wake = irqres.flags & IORESOURCE_IRQ_WAKECAPABLE; + dev_dbg(dev, "IRQ: %i, wake_capable: %i\n", ec_uart->irq, ec_uart->irq_wake); return 0; } @@ -301,13 +307,31 @@ static int cros_ec_uart_probe(struct serdev_device *serdev) serdev_device_set_client_ops(serdev, &cros_ec_uart_client_ops); - return cros_ec_register(ec_dev); + /* Register a new cros_ec device */ + ret = cros_ec_register(ec_dev); + if (ret) { + dev_err(dev, "Couldn't register ec_dev (%d)\n", ret); + return ret; + } + + if (ec_uart->irq_wake) { + ret = device_init_wakeup(dev, true); + if (ret) { + dev_err_probe(dev, ret, "Failed to init device for wakeup"); + return ret; + } + ret = dev_pm_set_wake_irq(dev, ec_uart->irq); + } + return ret; } static void cros_ec_uart_remove(struct serdev_device *serdev) { struct cros_ec_device *ec_dev = serdev_device_get_drvdata(serdev); + struct device *dev = ec_dev->dev; + dev_pm_clear_wake_irq(dev); + device_init_wakeup(dev, false); cros_ec_unregister(ec_dev); }; diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h index 8865e350c12a5..91e32db4ef715 100644 --- a/include/linux/platform_data/cros_ec_proto.h +++ b/include/linux/platform_data/cros_ec_proto.h @@ -115,7 +115,6 @@ struct cros_ec_command { * performance advantage to using dword. * @din_size: Size of din buffer to allocate (zero to use static din). * @dout_size: Size of dout buffer to allocate (zero to use static dout). - * @wake_enabled: True if this device can wake the system from sleep. * @suspended: True if this device had been suspended. * @cmd_xfer: Send command to EC and get response. * Returns the number of bytes received if the communication @@ -173,7 +172,6 @@ struct cros_ec_device { u8 *dout; int din_size; int dout_size; - bool wake_enabled; bool suspended; int (*cmd_xfer)(struct cros_ec_device *ec, struct cros_ec_command *msg);