Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4223313rwb; Tue, 6 Sep 2022 04:38:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR7YbPNmkGpuPtZ3UbRudVcfTpY0pqQ5NhI2EEQnNWNE1bUsAM/HriVqP5iunEPAEm47HNpS X-Received: by 2002:a17:906:6a8d:b0:741:6a3b:536e with SMTP id p13-20020a1709066a8d00b007416a3b536emr30536811ejr.11.1662464315880; Tue, 06 Sep 2022 04:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662464315; cv=none; d=google.com; s=arc-20160816; b=ogzzYUjO8bNjFG36SrabOgUPXaxpmfHs/TdoqCHSy/0y8CVY9sRRgnOHS7bWvkInde MfAdFPSRM1WJFRvIgPRJDF3NqBzIMj4+sJ/gaFHYcHtRG8H4EH/HOl0mHJDfqAM1htB0 rSghuHtVW7Jn3DtmPUrwuf7StodDtfBDYetWxYw7Ewqf4KMozEWyD7qShV7fz6Z28cBJ 3/sx+7ohdwgdyAy+lBDfj304KwULXJ0DJDvRJAml57D3yXHMNJ0HQmonjQUJ9z6s98HT CN97OKzyMHLeKoaatfRnckUgFtX8Z8MC6Li6EkHFhSw1J4Fc+84znvGpQfcX7sqj1dEs 1cxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0o1tY9dVWdJP36p3gtqsT82NnbORe2Hc16ozMO9F78k=; b=Wg/mvOhKze3hLxE65E7beCCWvWo3H5WcwMSmnlts0btq6tsmEjdOOmM+D7YoyqyGZ0 xgVnZGRplAL3n3SpI5ysokqgJQzOc7HpMYJ9HPJuL80wArafrMQTkPGtqGiGy9radvAl QZ14I72+zqGGQHJphakuq31IsJ5Ujr5AHxGnVEO2ZjkA0r1AhcNMt0PoY8KbhHBmziQt hjQlZBPpQr4dCyzXSRu7rMUjM7FZwxbSvagcVHGH0pirbrPL8u9KDv54SySSt/rwCm2e VI1WFeYCVUbQg0IxHktntyvZNWxLCMt3lp/fAwaPOolM0Wx6aJ+jNPrT5hvF4Z0Cai0w rB5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YQfJVAtF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r9-20020a05640251c900b0044ab2ba4d09si2073064edd.231.2022.09.06.04.38.08; Tue, 06 Sep 2022 04:38:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YQfJVAtF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239833AbiIFKzn (ORCPT + 99 others); Tue, 6 Sep 2022 06:55:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239633AbiIFKzN (ORCPT ); Tue, 6 Sep 2022 06:55:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A42F047BA2; Tue, 6 Sep 2022 03:54:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5EFBEB815F8; Tue, 6 Sep 2022 10:54:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA4B1C433C1; Tue, 6 Sep 2022 10:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662461688; bh=DBwxOa1Zlh2oN+id33M55VnDAs5ntEKgyYkHtRclC/I=; h=From:To:Cc:Subject:Date:From; b=YQfJVAtFajSz7Fe0h05Gg+AxHzvzqYGJBC20iuxu5UkpmO7Tk/9sG1F14t7JZ/Cki fdnTGsgr3Yz5qJ/YbUZiV89gtugaxFIqPkjor3nwakKm24Hyffcb7W1Ch6lMQA9NDh XdUWNQFXZoMDdBLsG+cdc2Cthkc6I/9Fnti6idXgr+Yp4MPzWGmYnGo5HJVzvQFuQ2 Fc5X0VEIF7M2NQ/31BX2s09rdke7XSyWHOrEf9zJu7OqRWzEi3w+EbQEcu9QDBHLsw jpZy89+S9aWlJ7+gYmKLmfRB7X2YIedxAry35OInGEIkrb1GBAQ4brTsImv1MzHQID 0mycDoDSDDAng== Received: by pali.im (Postfix) id 1E93472A; Tue, 6 Sep 2022 12:54:45 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Linus Walleij , Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in mpc85xx Date: Tue, 6 Sep 2022 12:54:31 +0200 Message-Id: <20220906105431.30911-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit e39d5ef67804 ("powerpc/5xxx: extend mpc8xxx_gpio driver to support mpc512x gpios") implemented support for IRQ_TYPE_LEVEL_LOW flow type in mpc512x via falling edge type. Do same for mpc85xx which support was added in commit 345e5c8a1cc3 ("powerpc: Add interrupt support to mpc8xxx_gpio"). Fixes probing of lm90 hwmon driver on mpc85xx based board which use level interrupt. Without it kernel prints error and refuse lm90 to work: [ 15.258370] genirq: Setting trigger mode 8 for irq 49 failed (mpc8xxx_irq_set_type+0x0/0xf8) [ 15.267168] lm90 0-004c: cannot request IRQ 49 [ 15.272708] lm90: probe of 0-004c failed with error -22 Fixes: 345e5c8a1cc3 ("powerpc: Add interrupt support to mpc8xxx_gpio") Signed-off-by: Pali Rohár --- drivers/gpio/gpio-mpc8xxx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index a964e25ea620..763256efddc2 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c @@ -172,6 +172,7 @@ static int mpc8xxx_irq_set_type(struct irq_data *d, unsigned int flow_type) switch (flow_type) { case IRQ_TYPE_EDGE_FALLING: + case IRQ_TYPE_LEVEL_LOW: raw_spin_lock_irqsave(&mpc8xxx_gc->lock, flags); gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) -- 2.20.1