From patchwork Mon May 23 07:40:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axe Yang X-Patchwork-Id: 575900 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 275FAC433F5 for ; Mon, 23 May 2022 07:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbiEWHkg (ORCPT ); Mon, 23 May 2022 03:40:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbiEWHk3 (ORCPT ); Mon, 23 May 2022 03:40:29 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FC1D1DA76; Mon, 23 May 2022 00:40:27 -0700 (PDT) X-UUID: 3dbf19b913384bed9b8a3bd1374da173-20220523 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.5, REQID:f2b6f353-5a53-44be-b617-f9af90596dbb, OB:0, LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,RULE:Release_Ham,ACT ION:release,TS:95 X-CID-INFO: VERSION:1.1.5, REQID:f2b6f353-5a53-44be-b617-f9af90596dbb, OB:0, LOB: 0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,RULE:Spam_GS981B3D,ACT ION:quarantine,TS:95 X-CID-META: VersionHash:2a19b09, CLOUDID:11cf32e3-edbf-4bd4-8a34-dfc5f7bb086d, C OID:fa6b6e866b65,Recheck:0,SF:28|17|19|48,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,QS:0,BEC:nil X-UUID: 3dbf19b913384bed9b8a3bd1374da173-20220523 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1476798705; Mon, 23 May 2022 15:40:21 +0800 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Mon, 23 May 2022 15:40:20 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 23 May 2022 15:40:20 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.3 via Frontend Transport; Mon, 23 May 2022 15:40:19 +0800 From: Axe Yang To: Ulf Hansson , Rob Herring , Chaotian Jing , Matthias Brugger , Adrian Hunter CC: Yoshihiro Shimoda , Satya Tangirala , Andy Shevchenko , Wolfram Sang , Axe Yang , Lucas Stach , Eric Biggers , Andrew Jeffery , Stephen Boyd , Kiwoong Kim , Yue Hu , Tian Tao , , , , , , , Subject: [PATCH v11 0/3] mmc: mediatek: add support for SDIO async IRQ Date: Mon, 23 May 2022 15:40:14 +0800 Message-ID: <20220523074017.12649-1-axe.yang@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Changes in v11: - remove '_irq' suffix in interrupts-names property - fix yaml example build error - refactor msdc_enable_sdio_irq(), free pins_eint if async irq is not supported Changes in v10: - add sample node for SDIO host which support wakeup interrupt in yaml - skip MMC_PM_WAKE_SDIO_IRQ check before enable SDIO async interrupt - add MMC_PM_KEEP_POWER check before SDIO eint pinstate parsing - use dev_pm_set_dedicated_wake_irq_reverse() to correct irq control sequence - set dedicated irq in msdc_enable_sdio_irq() rather than msdc_drv_probe() - remove unnecessary wake irq control, rpm/dpm system shall manage that - move wake irq/msdc irq control back to system suspend phase, use rpm_suspend and rpm_resume to ensure irq control sequence: disable msdc irq -> enable wake irq -> disable wake irq -> enable msdc irq - simplify variables, check pins_eint to know whether wakeup settings are managed Changes in v9: - remove pinctrl "state_dat1" Changes in v8: - remove maxItems property under pinctrl-names property Changes in v7: - add device_init_wakeup() to register SDIO host as wakeup source Changes in v6: - abandon cap-sdio-async-irq flag, use wakeup-source flag instead - extend interrupts and pinctrls in mediatek mmc host controller DT documents - add mmc_card_enable_async_irq() to access enable_async_irq flag - simplify wakeup irq implementation with dedicate wake up irq related interface Changes in v5: - resort variables to reversed xmas tree order - restore old copyright year range and add current year back Changes in v4: - add MMC_CAP2_SDIO_ASYNC_IRQ judge before lookup eint pinctrl - replace spin_lock_irqsave() variant with spin_lock() in eint irq handler Changes in v3: - correct abbreviations with capital letters in commit message - replace copyright year with 2022 in mtk-sd.c - remove unnessary pointer casting - adjust variable order to reversed xmas tree - remove a redundant blank line - refine if statement, following standard pattern Changes in v2: - change flag name from 'cap-sdio-async-int' to 'cap-sdio-async-irq' - change corresponding macro names from xxx_INT to xxx_IRQ - resort new member in msdc_host structure - refine function msdc_request_dat1_eint_irq() - rename msdc_{suspend,resume} function names, add suffix '_noirq' - add MMC_CAP2_NO_SDIO judgement before parse eint related pin setting Axe Yang (3): dt-bindings: mmc: mtk-sd: extend interrupts and pinctrls properties mmc: core: Add support for SDIO wakeup interrupt mmc: mediatek: add support for SDIO eint wakup IRQ .../devicetree/bindings/mmc/mtk-sd.yaml | 50 +++++++++++- drivers/mmc/core/sdio.c | 14 ++++ drivers/mmc/host/mtk-sd.c | 80 +++++++++++++++++-- include/linux/mmc/card.h | 8 +- include/linux/mmc/sdio.h | 5 ++ 5 files changed, 149 insertions(+), 8 deletions(-)