From patchwork Tue Sep 6 10:54:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 603197 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 79960ECAAD5 for ; Tue, 6 Sep 2022 10:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239807AbiIFKzm (ORCPT ); Tue, 6 Sep 2022 06:55:42 -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_Roh=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 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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)