From patchwork Wed Jul 5 20:42:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 13302921 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C501EB64DA for ; Wed, 5 Jul 2023 20:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=M3hS5u4J8P3vCN1jnTbbwqYFsF6tcXJWUCrWzb7NvTw=; b=PgJ4X8CkgyiIVp /5KQcvJuDU8Oo7h4FsBOE5cAvr/TkN9YyePySHrfaELU6zz05K2s4omMoGzklyGdGzHQAaHrCuhwi 9aojEZunOC4FoMlTpU5yFHA3wWtYazvIixMOfa+iZCpJUD/J53K7VqsiAMV6QV1jz5PV3Ubfioxwv lq65tJ/GpxcpzxMt9an02lTOpkkBETCz9gYYVvFkx5+2zQQvThWnI++/C6djHvyVyyei+EH4ZlkBu 0W21dR9y/IqLUEWQCnZhmhwpF2alYq8mdtELSD5Lhxt8nzDPpiDKrKGIr6wfLJu7yE6Fq4pEJvgd4 KKpTa8CKFSErRyYLL7Xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qH9Ld-00H2s7-0u; Wed, 05 Jul 2023 20:43:37 +0000 Received: from aposti.net ([89.234.176.197]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qH9La-00H2qU-03; Wed, 05 Jul 2023 20:43:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1688589809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=wyXkGZNGA5ysK2ltkve4RVlCutN+wjP1W2giIyjMZxk=; b=nScC7Am7eHbPkqLsb+E2gznpiUpMVyfzuF8FL3UiEEkgxgDebdCyG0lG4/LsIyuatJlX4p bLgSjmITOHNmgrkD8zSZN2pAMtILouf7m0vVi2R75j9CXCT1jpDBwzoRZP8oDzs/SSuMLd FF8hRZbcRQMFlzMf9jstb8q8Hg0pEdM= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Elie Morisse , Shyam Sundar S K , Ray Jui , Scott Branden , Kamal Dasu , Broadcom internal kernel review list , Florian Fainelli , Bartosz Golaszewski , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Jean Delvare , Qii Wang , Matthias Brugger , AngeloGioacchino Del Regno , Linus Walleij , Peter Korsgaard , Andrew Lunn , Vladimir Zapolskiy , Andy Gross , Bjorn Andersson , Konrad Dybcio , Wolfram Sang , Krzysztof Kozlowski , Alim Akhtar , Conghui Chen , Viresh Kumar , Peter Rosin , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH 00/23] i2c: Use new PM macros Date: Wed, 5 Jul 2023 22:42:51 +0200 Message-Id: <20230705204314.89800-1-paul@crapouillou.net> MIME-Version: 1.0 X-Spam: Yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230705_134334_211637_E768B025 X-CRM114-Status: GOOD ( 15.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Wolfram, This patchset converts the I2C subsystem to use the PM macros that were introduced in v5.17, which allow the dev_pm_ops and related callbacks to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. The point of this, is that all this code is now compiled independently of any Kconfig option, which makes bugs and regressions easier to catch. This continues the work that has been started in other subsystems (DRM, IIO, watchdog). As an added bonus, the diff is 71+/192-, that means less code you will have to maintain ;) The patches generally don't change the behaviour, with a few exceptions, that are documented in the corresponding patches. I would like to draw the attention to a few patches in particular: - [01/23] the driver most likely does something that it shouldn't do (use the same callbacks for runtime PM and system PM). The patch does not change this behaviour but I have questions. - [11/23] uses platform_driver.{suspend,resume} instead of the regular .driver.pm. I have no idea why it does that and I believe it doesn't really have to. - [18/23] I feel like the qup_i2c_suspend / qup_i2c_resume don't really need to exist, and the pm_runtime_force_suspend() / pm_runtime_force_resume() helpers should be used instead, using the DEFINE_RUNTIME_DEV_PM_OPS() macro. Cheers, -Paul Paul Cercueil (23): i2c: amd-mp2: Remove #ifdef guards for PM related functions i2c: au1550: Remove #ifdef guards for PM related functions i2c: iproc: Remove #ifdef guards for PM related functions i2c: brcmstb: Remove #ifdef guards for PM related functions i2c: davinci: Remove #ifdef guards for PM related functions i2c: designware: Remove #ifdef guards for PM related functions i2c: exynos5: Remove #ifdef guards for PM related functions i2c: hix5hd2: Remove #ifdef guards for PM related functions i2c: i801: Remove #ifdef guards for PM related functions i2c: img-scb: Remove #ifdef guards for PM related functions i2c: kempld: Remove #ifdef guards for PM related functions i2c: lpc2k: Remove #ifdef guards for PM related functions i2c: mt65xx: Remove #ifdef guards for PM related functions i2c: nomadik: Remove #ifdef guards for PM related functions i2c: ocores: Remove #ifdef guards for PM related functions i2c: pnx: Remove #ifdef guards for PM related functions i2c: pxa: Remove #ifdef guards for PM related functions i2c: qup: Remove #ifdef guards for PM related functions i2c: rcar: Remove #ifdef guards for PM related functions i2c: s3c2410: Remove #ifdef guards for PM related functions i2c: sh-mobile: Remove #ifdef guards for PM related functions i2c: virtio: Remove #ifdef guards for PM related functions i2c: mux: pca954x: Remove #ifdef guards for PM related functions drivers/i2c/busses/i2c-amd-mp2-pci.c | 14 +++++-------- drivers/i2c/busses/i2c-amd-mp2-plat.c | 8 ++------ drivers/i2c/busses/i2c-amd-mp2.h | 2 -- drivers/i2c/busses/i2c-au1550.c | 15 +++----------- drivers/i2c/busses/i2c-bcm-iproc.c | 10 +--------- drivers/i2c/busses/i2c-brcmstb.c | 8 +++----- drivers/i2c/busses/i2c-davinci.c | 12 +++-------- drivers/i2c/busses/i2c-designware-platdrv.c | 22 ++++++--------------- drivers/i2c/busses/i2c-exynos5.c | 8 +++----- drivers/i2c/busses/i2c-hix5hd2.c | 10 ++++------ drivers/i2c/busses/i2c-i801.c | 6 ++---- drivers/i2c/busses/i2c-img-scb.c | 13 ++++-------- drivers/i2c/busses/i2c-kempld.c | 9 ++------- drivers/i2c/busses/i2c-lpc2k.c | 8 +------- drivers/i2c/busses/i2c-mt65xx.c | 8 +++----- drivers/i2c/busses/i2c-nomadik.c | 14 +++++-------- drivers/i2c/busses/i2c-ocores.c | 10 +++------- drivers/i2c/busses/i2c-pnx.c | 12 ++++------- drivers/i2c/busses/i2c-pxa.c | 8 +------- drivers/i2c/busses/i2c-qup.c | 16 ++++----------- drivers/i2c/busses/i2c-rcar.c | 10 ++-------- drivers/i2c/busses/i2c-s3c2410.c | 14 +++---------- drivers/i2c/busses/i2c-sh_mobile.c | 12 +++-------- drivers/i2c/busses/i2c-virtio.c | 8 ++------ drivers/i2c/muxes/i2c-mux-pca954x.c | 6 ++---- 25 files changed, 71 insertions(+), 192 deletions(-)