From patchwork Tue Feb 14 21:41:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13140920 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 A0C29C61DA4 for ; Tue, 14 Feb 2023 21:45:43 +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:In-Reply-To:References:Cc:To:From: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iOMSOU0wCkqxKbS1WApOnQjr0t7VkprpswkRhBHSm7g=; b=eE9IU5ZNZ4wOna eN0dBRdGGS230CPQ/yo5wgP7moQgdOHqeqKosEJmGlXQ8qIK0OvdMgkSvbVbv+kusGcA7UJhnmETl A+V6bIMiLJq33bQMQ1XgEI5GQe6uZX4EkmidVGNukcJPBkRip3oQ3+dsQkK7kCKy+dhlVBLnn+q+o TSKDDZycNOqGxOvv6tTec4rD4vaxj7aQqExx29wwE6VBLj+/9erBgBTvKnlQh7co6iIdMbieufMqt biy60bVGDzaAwdhIw0Pqfc2bbmErVMPVlmwgeeww7Wab1llxBGM3mCDDT1u6Ajht5SiwvANKeoL2W H+g5g5WBmYQo2S6p/20g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pS366-003eQu-MW; Tue, 14 Feb 2023 21:44:25 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pS360-003eNs-TG; Tue, 14 Feb 2023 21:44:18 +0000 Received: by mail-ej1-x62a.google.com with SMTP id k16so11946980ejv.10; Tue, 14 Feb 2023 13:44:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6BIfz99riEO+C0c4evMHPspzVHbaE2cc0ey+M44tW6k=; b=pSoLA/FHrOhJh6EPr92JseA5V/Jc+lfvCdTbkaQQ2inTHx7KHtOkqlVTUYNQVnRqF3 0tGS08tpOdKONsn+GZ05zOujHC0Di2IJ//kO7dIJ0ltgQ0WQF+Tlt5/jXn4ZaSLWBYcL tpw6kQxcMcvx9dOpIz7w/mAdrFds7v+Yjs0QMaEQw9FsA2m+0T2rkUZok4YPWG+nqX+G 6UeqSqMg5DBArfueJ0Fh9aukoXRfHTSFbKKZarGv+xiJDwWWOiYRtjNihO3dmLqMEkp3 gvS72fqASMYhqU0yPcIQ9/jBbqX00FSggC+w6JOb3rn+7tjuRnsAwLTT4TMZyFQraS5L cnpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6BIfz99riEO+C0c4evMHPspzVHbaE2cc0ey+M44tW6k=; b=HN60wOw8K/Wfovd6ERQBRDun+9aydsAabGpzFiJoAM+/6lPuIZ/CNCFjY+s7tNLOct 9rKfAlPIDH+TpWSMdBmQbSGeY96H9E4DNnqpHRyvwmdKCb3EjsIzJNURa00QvPgNnIfR N2oO4Lo38D1cX0fb0lMl5RXpmMfE1akHJs6KM4Jx55N8YwTYFLOCeOX2T56ino2swBZm yGUN2v5HDtse7JgcPB462ssgVlvfc2Md1T9FuEz/8+GQfhPADLWJqfXjH/CZCuIYpynE TiDXtsOqPc4c9zaehx6d4lVTRStPuOS1CJby2NVd/VFgdRuos1iNkAu23MPZQVKZBUGG uxRw== X-Gm-Message-State: AO0yUKVyKK5vLyvqPTNtjj24cBaST+ZZBSTetI3D480T48kGGHG/cdr0 yb+RyeoblPlDAmwoZEf9FWI= X-Google-Smtp-Source: AK7set+ItZXr1gbL0Bkw184xQW8mS3DVV4Kc6GhdErI/smY1OAbxoR/8UgxLWioNqlYnDeR9Dqm6zw== X-Received: by 2002:a17:906:8699:b0:890:4731:d1bc with SMTP id g25-20020a170906869900b008904731d1bcmr4077934ejx.38.1676411053926; Tue, 14 Feb 2023 13:44:13 -0800 (PST) Received: from ?IPV6:2a01:c22:7234:f800:b56b:f43d:948c:eede? (dynamic-2a01-0c22-7234-f800-b56b-f43d-948c-eede.c22.pool.telefonica.de. [2a01:c22:7234:f800:b56b:f43d:948c:eede]) by smtp.googlemail.com with ESMTPSA id f20-20020a170906c09400b00872c0bccab2sm8715145ejz.35.2023.02.14.13.44.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Feb 2023 13:44:13 -0800 (PST) Message-ID: <5777f38b-465f-ce48-a87f-5eb8b3c57b0a@gmail.com> Date: Tue, 14 Feb 2023 22:41:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH v2 1/3] mmc: core: support setting card detect interrupt from drivers Content-Language: en-US From: Heiner Kallweit To: Rob Herring , Ulf Hansson , Krzysztof Kozlowski , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: "linux-mmc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Amlogic Meson..." , "devicetree@vger.kernel.org" References: <15df9ef0-9b73-ca5a-d3cf-0585cd135bc5@gmail.com> In-Reply-To: <15df9ef0-9b73-ca5a-d3cf-0585cd135bc5@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230214_134417_021551_4AC9C3BE X-CRM114-Status: GOOD ( 18.02 ) 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 On certain platforms like Amlogic Meson gpiod_to_irq() isn't supported due to the design of gpio / interrupt controller. Therefore provide an option for drivers to pass the card detect interrupt number (retrieved e.g. from device tree) to mmc core. Suggested-by refers to the mechanism to pass and store the interrupt. Suggested-by: Ulf Hansson Signed-off-by: Heiner Kallweit --- v2: - use another mechanism for passing and storing the cd interrupt --- drivers/mmc/core/slot-gpio.c | 17 ++++++++++++++++- include/linux/mmc/slot-gpio.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index dd2a4b6ab..2a2d949a9 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -23,6 +23,7 @@ struct mmc_gpio { char *ro_label; char *cd_label; u32 cd_debounce_delay_ms; + int cd_irq; }; static irqreturn_t mmc_gpio_cd_irqt(int irq, void *dev_id) @@ -53,12 +54,24 @@ int mmc_gpio_alloc(struct mmc_host *host) ctx->ro_label = devm_kasprintf(host->parent, GFP_KERNEL, "%s ro", devname); if (!ctx->ro_label) return -ENOMEM; + ctx->cd_irq = -EINVAL; host->slot.handler_priv = ctx; host->slot.cd_irq = -EINVAL; return 0; } +void mmc_gpio_set_cd_irq(struct mmc_host *host, int irq) +{ + struct mmc_gpio *ctx = host->slot.handler_priv; + + if (!ctx || irq < 0) + return; + + ctx->cd_irq = irq; +} +EXPORT_SYMBOL(mmc_gpio_set_cd_irq); + int mmc_gpio_get_ro(struct mmc_host *host) { struct mmc_gpio *ctx = host->slot.handler_priv; @@ -98,7 +111,9 @@ void mmc_gpiod_request_cd_irq(struct mmc_host *host) * Do not use IRQ if the platform prefers to poll, e.g., because that * IRQ number is already used by another unit and cannot be shared. */ - if (!(host->caps & MMC_CAP_NEEDS_POLL)) + if (ctx->cd_irq >= 0) + irq = ctx->cd_irq; + else if (!(host->caps & MMC_CAP_NEEDS_POLL)) irq = gpiod_to_irq(ctx->cd_gpio); if (irq >= 0) { diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h index 4ae2f2908..5d3d15e97 100644 --- a/include/linux/mmc/slot-gpio.h +++ b/include/linux/mmc/slot-gpio.h @@ -15,6 +15,7 @@ struct mmc_host; int mmc_gpio_get_ro(struct mmc_host *host); int mmc_gpio_get_cd(struct mmc_host *host); +void mmc_gpio_set_cd_irq(struct mmc_host *host, int irq); int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, unsigned int idx, bool override_active_level, unsigned int debounce); From patchwork Tue Feb 14 21:42:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13140922 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 355EAC61DA4 for ; Tue, 14 Feb 2023 21:46:58 +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:In-Reply-To:References:Cc:To:From: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hoJ/FR77+oEqk+tjhI3/HfEURqNii1Kh5Oi4w90YBfE=; b=nB2zwDC67tNVkm 4/73f9jWsqZYOPmLdN71kqZ88QHuwDpaKzIciWcAz9IeIMIfSEvy5UPQtm7PIm+/YjZtSBNfafW7u z5u5hYP8QjPjncgPMeYr6gBWpVltZDAFyXEYwrlVkdSmr+mrRRiDj7r+X2M912GTDLHmSXD+MumFA IQ/ut9RAjbcvHXMF5DSASX/V6nzZl15/loJOugURcVtabkCKSp/dqnFfvTI5SIaebBSD1iDCxGQVa UVnobC/zd7dCs2/h0ydXzUZHiue9n+dSjYElfFfdZRgarnDR8WTB/9+/jOF5pK8m/9e+1Xa4C/HCK Rp0t11Tqb2gvphZ8AZ/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pS37S-003ew5-On; Tue, 14 Feb 2023 21:45:47 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pS362-003eOZ-RA; Tue, 14 Feb 2023 21:44:20 +0000 Received: by mail-ej1-x632.google.com with SMTP id lf10so11612087ejc.5; Tue, 14 Feb 2023 13:44:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=qbHCaVpympgD+rZ3HviBrecm2Nox2/uMHYu24H65DxI=; b=UWDRUL4uC/fLxhAO2XHD/9ZST4q+AwrnyiErvFgyKNTV2alU7YC82XKLePKM1LG565 aznqOd355jQ0Z4/3Ho9S3fdo2Pz78sNR9HZRQWUPgS3yXfezP+BEvzONzJ8WJ8E88El6 n+oZFBE8wDcoqoKEiJlGmiOwkH6wGscgcFnQj7cssLX313YweR5qBWUfr7omY5IwGVMp iS3o+gYGZgd7+x083fHdgl/PkzSd+FxWMeWNN5ZJbs/8bYQjDTNd3g12mO/pXJFmgseV /qnoT0LPbVX3tyPwaWWEwv03yILFXd7eWjTxE6PbDDHbX9B2N6uZn5ahax59gdB11u8M Ydcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qbHCaVpympgD+rZ3HviBrecm2Nox2/uMHYu24H65DxI=; b=1uPGG+GUMuIWGB+SddXIXExiuMdN8YS3clY5VpLB2d5BOPfe/OVGGAPhtHiJnDqaJS DKPvbYa59u9YNgEq3bjw+3lmKGnoLOmn/uoukoIWga3wHcxxqw4vmHq1cw2btQcw0z7f yyYc2wQae2tkYYHH0wQh08xVZyvxsMJZecdf6U7FcQlzHDNM/54LOi8gLlAR/u5qJJoG BTFiuC46S/4hZoO2VXWAdSmtGKD/z9X+meTHCnCvDtdz6uHxqf/VbjAkT27RBcv1f0rO Xd9T/aInhroZceDmUXKCo2UZ346BWasesKtvlUNEG4KZT7zcwqFuc7z6Y77lTy57f8da Pi3g== X-Gm-Message-State: AO0yUKWBeNvXq1wPvL00O4DAfem4pbo3PZQbCYZp8clx9rdIvkE7LeeB Dp0ElcqOTgb7/iEu81qHXMU= X-Google-Smtp-Source: AK7set/r5p4+TIUHGxGEziaM2ujswam5/RjYE31PKNOauB2KjuV5YXikWQOIKF15RK44rueEFZGcRw== X-Received: by 2002:a17:907:10d4:b0:844:79b1:ab36 with SMTP id rv20-20020a17090710d400b0084479b1ab36mr410828ejb.25.1676411055609; Tue, 14 Feb 2023 13:44:15 -0800 (PST) Received: from ?IPV6:2a01:c22:7234:f800:b56b:f43d:948c:eede? (dynamic-2a01-0c22-7234-f800-b56b-f43d-948c-eede.c22.pool.telefonica.de. [2a01:c22:7234:f800:b56b:f43d:948c:eede]) by smtp.googlemail.com with ESMTPSA id bl4-20020a170906c24400b00880dbd4b6d4sm8749475ejb.136.2023.02.14.13.44.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Feb 2023 13:44:15 -0800 (PST) Message-ID: <1c5996a5-491f-39d6-b120-bbef86473729@gmail.com> Date: Tue, 14 Feb 2023 22:42:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH v2 2/3] dt-bindings: mmc: meson-gx: support specifying cd interrupt Content-Language: en-US From: Heiner Kallweit To: Rob Herring , Ulf Hansson , Krzysztof Kozlowski , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: "linux-mmc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Amlogic Meson..." , "devicetree@vger.kernel.org" References: <15df9ef0-9b73-ca5a-d3cf-0585cd135bc5@gmail.com> In-Reply-To: <15df9ef0-9b73-ca5a-d3cf-0585cd135bc5@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230214_134418_927140_D12B1C3F X-CRM114-Status: UNSURE ( 8.70 ) X-CRM114-Notice: Please train this message. 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 Support passing a second interrupt as card detect interrupt. Signed-off-by: Heiner Kallweit --- Documentation/devicetree/bindings/mmc/amlogic,meson-gx-mmc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mmc/amlogic,meson-gx-mmc.yaml b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx-mmc.yaml index 46e235bf2..c8c30300d 100644 --- a/Documentation/devicetree/bindings/mmc/amlogic,meson-gx-mmc.yaml +++ b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx-mmc.yaml @@ -28,7 +28,7 @@ properties: maxItems: 1 interrupts: - maxItems: 1 + maxItems: 2 clocks: maxItems: 3 From patchwork Tue Feb 14 21:44:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13140921 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 E64B0C6379F for ; Tue, 14 Feb 2023 21:46:12 +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:In-Reply-To:References:Cc:To:From: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JMiu4NlNqhHh2EIilE5zqiN45RvjUF9xtIhbsY5azvs=; b=UqBFeEpWAZhvxW 7VA80CAVh7oRkXVMLbdEJOmw5si14wvujqlraWzf0OtV8iPGtTAAYT9MG0HoV4MSR1jdA2Q7JyGBx AXWpoIoJjaaPLkbCNcZ6n5xZ2eNchzYdV42shYxlqiHteBrno+BJHWJ4O4Kd8YntWbthZFJtmhd0d EZqJgEO5GXSunXVlJG7AutyPsg4nVohExOd0rpqGB59YeREWxK53fGsMUURJ7nw86bTb8cPvYLLpX a+/jmPkVKlxCD/+hn1jjjAO3PoAJgPxLtPDQp/sPVAjaf8beeM2mkBj3/3yadKPGX4WBYNBuvLi0R hFDQq5k9rqClAvuzcU1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pS36j-003eeS-PK; Tue, 14 Feb 2023 21:45:02 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pS363-003ePO-Hw; Tue, 14 Feb 2023 21:44:20 +0000 Received: by mail-ej1-x631.google.com with SMTP id ml19so43650387ejb.0; Tue, 14 Feb 2023 13:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9LqJXdxxFstKfYubhTeoAWTHHu54RXhCthHqvhTdxVw=; b=qPz+gKBIC/R8A6gtUZ8ceyazI706kmMBJgDlbAJ55QeqC9llqy5M4oPP92aAhOMmdL LWY84jGU18KQFjObsGNOtO9LD3yECwJaNZ9tntFSoQxhfFbKthtGafSoJ8Vc/tRRAuVw C+OnZB1r39zbuG4pRsxyCwgqSqpMe8icb2wC+5xnMYb7fYePk7BmGXqDqPJQ+1CqdVti IcB3RdfDuHOg078AU//wVFbsi6L5L4YJROes2Dpqxn2wB3PK8QE2aZKEUR2/K3QeG6jL /19hR3kD4Ey35+eK9Y+E3iMXIoN1TmWkJ2f8Ukuf8veCGBcwsDD0h6i+zgrobOOPxWIs MX8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9LqJXdxxFstKfYubhTeoAWTHHu54RXhCthHqvhTdxVw=; b=lSVMNJvkng0u7ZOwsZj+vceu7gK+rPmDljpQt1P6ZReiHSZqG9vHtDxtOD9J+puf+e vHm9AqmNTImPTMuS1jpmlTSIyR+QNs08S03FaLMCyhIE7Ei4cbEfQvTJBjllpejSgXqt EPtSuDF/U3X0Vc7mOdJr7fqCNExWdw+PH7LUcrtZ9YWqxS59yXGTxa3dhVAJBkrz1bsk eGXqUPUbGZZpVDSlGT5oljdHMQkGcY+AdHyFtQzs0OAJwkDzumTYsaQpJ+Qj7lDhVFlp hbNnLrMVA39teI50dSYidttOBFdhpHfbHe33xEZhwE9XrWNJTxpXK4v3qF/hQR+CFprf xWGQ== X-Gm-Message-State: AO0yUKUU7MtgJsWlP9kuHWv9bk1hzx0b+y0pLSlIS2Fg6rFO5fQjU32h G9bb7b72WOYGJByOdiyXOjM= X-Google-Smtp-Source: AK7set/az3JscyAMvJVE9MKuOV/yeIlPmFr6p9Be9W8jefOVLPXcDrovvENpnkqW2DXiWXUtMV9sPA== X-Received: by 2002:a17:906:850e:b0:7c1:765:9cfc with SMTP id i14-20020a170906850e00b007c107659cfcmr328840ejx.34.1676411056936; Tue, 14 Feb 2023 13:44:16 -0800 (PST) Received: from ?IPV6:2a01:c22:7234:f800:b56b:f43d:948c:eede? (dynamic-2a01-0c22-7234-f800-b56b-f43d-948c-eede.c22.pool.telefonica.de. [2a01:c22:7234:f800:b56b:f43d:948c:eede]) by smtp.googlemail.com with ESMTPSA id j9-20020a1709066dc900b008b1294f7f63sm1669820ejt.221.2023.02.14.13.44.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Feb 2023 13:44:16 -0800 (PST) Message-ID: <2bb70611-5dea-1144-51bd-93c46b455392@gmail.com> Date: Tue, 14 Feb 2023 22:44:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH v2 3/3] mmc: meson-gx: support platform interrupt as card detect interrupt Content-Language: en-US From: Heiner Kallweit To: Rob Herring , Ulf Hansson , Krzysztof Kozlowski , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: "linux-mmc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Amlogic Meson..." , "devicetree@vger.kernel.org" References: <15df9ef0-9b73-ca5a-d3cf-0585cd135bc5@gmail.com> In-Reply-To: <15df9ef0-9b73-ca5a-d3cf-0585cd135bc5@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230214_134419_646164_B41E8CD9 X-CRM114-Status: GOOD ( 12.74 ) 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 Use a new mmc core feature and support specifying the card detect gpio interrupt in device tree. Signed-off-by: Heiner Kallweit --- v2: - adopt the changed way to pass the cd interrupt number --- drivers/mmc/host/meson-gx-mmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index f4b50793e..079c52dbe 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -1166,7 +1166,7 @@ static int meson_mmc_probe(struct platform_device *pdev) struct resource *res; struct meson_host *host; struct mmc_host *mmc; - int ret; + int cd_irq, ret; mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(struct meson_host)); if (!mmc) @@ -1213,6 +1213,9 @@ static int meson_mmc_probe(struct platform_device *pdev) if (host->irq <= 0) return -EINVAL; + cd_irq = platform_get_irq_optional(pdev, 1); + mmc_gpio_set_cd_irq(mmc, cd_irq); + host->pinctrl = devm_pinctrl_get(&pdev->dev); if (IS_ERR(host->pinctrl)) return PTR_ERR(host->pinctrl);