From: Mark Hasemeyer <markhas@chromium.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: "AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
"Tzung-Bi Shih" <tzungbi@kernel.org>,
"Raul Rangel" <rrangel@chromium.org>,
"Konrad Dybcio" <konrad.dybcio@linaro.org>,
"Andy Shevchenko" <andriy.shevchenko@intel.com>,
"Rob Herring" <robh@kernel.org>,
"Sudeep Holla" <sudeep.holla@arm.com>,
"Mark Hasemeyer" <markhas@chromium.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Andre Przywara" <andre.przywara@arm.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Benson Leung" <bleung@chromium.org>,
"Bhanu Prakash Maiya" <bhanumaiya@chromium.org>,
"Bjorn Andersson" <andersson@kernel.org>,
"Chen-Yu Tsai" <wenst@chromium.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Daniel Scally" <djrscally@gmail.com>,
"David Gow" <davidgow@google.com>,
"Enric Balletbo i Serra" <eballetbo@gmail.com>,
"Frank Rowand" <frowand.list@gmail.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Guenter Roeck" <groeck@chromium.org>,
"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
"Heiko Stuebner" <heiko@sntech.de>,
"Jesper Nilsson" <jesper.nilsson@axis.com>,
"Jisheng Zhang" <jszhang@kernel.org>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Kunihiko Hayashi" <hayashi.kunihiko@socionext.com>,
"Lee Jones" <lee@kernel.org>, "Len Brown" <lenb@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Mark Brown" <broonie@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Mika Westerberg" <mika.westerberg@linux.intel.com>,
"Patrice Chotard" <patrice.chotard@foss.st.com>,
"Prashant Malani" <pmalani@chromium.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Rob Barnes" <robbarnes@google.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Romain Perier" <romain.perier@gmail.com>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Stephen Boyd" <swboyd@chromium.org>,
"Takashi Iwai" <tiwai@suse.de>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Wei Xu" <xuwei5@hisilicon.com>, "Wolfram Sang" <wsa@kernel.org>,
chrome-platform@lists.linux.dev,
cros-qcom-dts-watchers@chromium.org, devicetree@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-i2c@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-rockchip@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it
Date: Wed, 20 Dec 2023 16:54:14 -0700 [thread overview]
Message-ID: <20231220235459.2965548-1-markhas@chromium.org> (raw)
Currently the cros_ec driver assumes that its associated interrupt is
wake capable. This is an incorrect assumption as some Chromebooks use a
separate wake pin, while others overload the interrupt for wake and IO.
This patch train updates the driver to query the underlying ACPI/DT data
to determine whether or not the IRQ should be enabled for wake.
Both the device tree and ACPI systems have methods for reporting IRQ
wake capability. In device tree based systems, a node can advertise
itself as a 'wakeup-source'. In ACPI based systems, GpioInt and
Interrupt resource descriptors can use the 'SharedAndWake' or
'ExclusiveAndWake' share types.
Some logic is added to the platform, ACPI, and DT subsystems to more
easily pipe wakeirq information up to the driver.
Changes in v2:
-Rebase on linux-next
-Add cover letter
-See each patch for patch specific changes
Mark Hasemeyer (22):
gpiolib: acpi: Modify acpi_dev_irq_wake_get_by() to use resource
i2c: acpi: Modify i2c_acpi_get_irq() to use resource
Documentation: devicetree: Clarify wording for wakeup-source property
ARM: dts: tegra: Enable cros-ec-spi as wake source
ARM: dts: rockchip: rk3288: Enable cros-ec-spi as wake source
ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
ARM: dts: samsung: exynos5800: Enable cros-ec-spi as wake source
arm64: dts: mediatek: mt8173: Enable cros-ec-spi as wake source
arm64: dts: mediatek: mt8183: Enable cros-ec-spi as wake source
arm64: dts: mediatek: mt8192: Enable cros-ec-spi as wake source
arm64: dts: mediatek: mt8195: Enable cros-ec-spi as wake source
arm64: dts: tegra: Enable cros-ec-spi as wake source
arm64: dts: qcom: sc7180: Enable cros-ec-spi as wake source
arm64: dts: qcom: sc7280: Enable cros-ec-spi as wake source
arm64: dts: qcom: sdm845: Enable cros-ec-spi as wake source
arm64: dts: rockchip: rk3399: Enable cros-ec-spi as wake source
of: irq: add wake capable bit to of_irq_resource()
of: irq: Add default implementation for of_irq_to_resource()
of: irq: Remove extern from function declarations
device property: Modify fwnode irq_get() to use resource
platform: Modify platform_get_irq_optional() to use resource
platform/chrome: cros_ec: Use PM subsystem to manage wakeirq
.../bindings/power/wakeup-source.txt | 18 +++--
arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi | 1 +
arch/arm/boot/dts/nvidia/tegra124-venice2.dts | 1 +
.../rockchip/rk3288-veyron-chromebook.dtsi | 1 +
.../boot/dts/samsung/exynos5420-peach-pit.dts | 1 +
.../boot/dts/samsung/exynos5800-peach-pi.dts | 1 +
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 1 +
.../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
.../boot/dts/mediatek/mt8192-asurada.dtsi | 1 +
.../boot/dts/mediatek/mt8195-cherry.dtsi | 1 +
.../arm64/boot/dts/nvidia/tegra132-norrin.dts | 1 +
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 1 +
.../arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 1 +
.../arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi | 1 +
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 1 +
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 1 +
drivers/acpi/property.c | 11 ++-
drivers/base/platform.c | 74 +++++++++++++------
drivers/base/property.c | 24 +++++-
drivers/gpio/gpiolib-acpi.c | 25 ++++---
drivers/i2c/i2c-core-acpi.c | 38 +++++-----
drivers/i2c/i2c-core-base.c | 6 +-
drivers/i2c/i2c-core.h | 4 +-
drivers/of/irq.c | 32 +++++++-
drivers/of/property.c | 8 +-
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/acpi.h | 23 +++---
include/linux/fwnode.h | 8 +-
include/linux/of_irq.h | 41 +++++-----
include/linux/platform_data/cros_ec_proto.h | 2 -
include/linux/platform_device.h | 3 +
include/linux/property.h | 2 +
35 files changed, 328 insertions(+), 142 deletions(-)
--
2.43.0.472.g3155946c3a-goog
next reply other threads:[~2023-12-20 23:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 23:54 Mark Hasemeyer [this message]
2023-12-20 23:54 ` [PATCH v2 22/22] platform/chrome: cros_ec: Use PM subsystem to manage wakeirq Mark Hasemeyer
2023-12-21 8:58 ` Tzung-Bi Shih
2023-12-22 22:19 ` Mark Hasemeyer
2023-12-21 15:45 ` Andy Shevchenko
2023-12-22 22:21 ` Mark Hasemeyer
2023-12-23 0:32 ` kernel test robot
2023-12-23 3:11 ` Mark Hasemeyer
2023-12-23 16:41 ` kernel test robot
2023-12-21 13:42 ` [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Andy Shevchenko
2023-12-22 22:30 ` Mark Hasemeyer
2023-12-27 16:01 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231220235459.2965548-1-markhas@chromium.org \
--to=markhas@chromium.org \
--cc=alim.akhtar@samsung.com \
--cc=andersson@kernel.org \
--cc=andre.przywara@arm.com \
--cc=andriy.shevchenko@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bhanumaiya@chromium.org \
--cc=bleung@chromium.org \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=chrome-platform@lists.linux.dev \
--cc=conor+dt@kernel.org \
--cc=cros-qcom-dts-watchers@chromium.org \
--cc=davidgow@google.com \
--cc=devicetree@vger.kernel.org \
--cc=djrscally@gmail.com \
--cc=eballetbo@gmail.com \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=groeck@chromium.org \
--cc=hayashi.kunihiko@socionext.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=heiko@sntech.de \
--cc=jesper.nilsson@axis.com \
--cc=jonathanh@nvidia.com \
--cc=jszhang@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lee@kernel.org \
--cc=lenb@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=mika.westerberg@linux.intel.com \
--cc=patrice.chotard@foss.st.com \
--cc=pmalani@chromium.org \
--cc=rafael@kernel.org \
--cc=robbarnes@google.com \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=romain.perier@gmail.com \
--cc=rrangel@chromium.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sudeep.holla@arm.com \
--cc=swboyd@chromium.org \
--cc=thierry.reding@gmail.com \
--cc=tiwai@suse.de \
--cc=tzungbi@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wenst@chromium.org \
--cc=wsa@kernel.org \
--cc=xuwei5@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).