From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2568C5519A for ; Mon, 27 Apr 2020 17:49:28 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BAB84217BA for ; Mon, 27 Apr 2020 17:49:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lU612WTl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=walle.cc header.i=@walle.cc header.b="daZ1yQbt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAB84217BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AvJCW08t3nZnEFYF7FBxzKoSdh/M3XgeLUPqhDYOkgo=; b=lU612WTlINuLP04Ql8RiRjFBL IfKcxqVo/drwan6WgWHh8UO0CxLtlVubG3LzbnZLqaNZVv3EsgmjPRsqXqqW4iqnPJtK7L2KKVim6 ygjDTeATz9x42RNilhqdkwq5MM1FXBxBOrGvdxRxfyIh+HX3PyiOfvSN0/hMU5D9SZ9qwCJcrbXT4 s15xeaKODNH7hPY+umYIsNUcGbk2FerCdXPgsDe6amvxx89huNrr6sXejKKLKy2ounO1bW9IfSMux CmQFGIJslSshmPe8FrvEpd27WTDRATEHpxSGPUZ5egiK9ru9pllTlDZF82j1goSa1/YqO2nG7zi8s MXqZarzLg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT7sl-0005ms-I2; Mon, 27 Apr 2020 17:49:27 +0000 Received: from ssl.serverraum.org ([176.9.125.105]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT7sj-0005m8-6m for linux-arm-kernel@lists.infradead.org; Mon, 27 Apr 2020 17:49:26 +0000 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id AAEB72305C; Mon, 27 Apr 2020 19:49:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1588009761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uIPaAmEQWo9UFG1wdCdYNeEuiFocSYDqyKIO62bAJso=; b=daZ1yQbt+ly5oR4B23djB/+U8nDAtnXWozzanckjgsxqNTdrrDaqv34hlVayGoqj6wvrCn lZ7cJuj41ddvRap8LThkKzVCsf0BhUEWdgnuLK7CWaxscOMUAMPxKJGTC7MHCqeoDAmplb t/DjgF9AP9YXkde3zaURA5KQJxay3oM= MIME-Version: 1.0 Date: Mon, 27 Apr 2020 19:49:21 +0200 From: Michael Walle To: Thomas Gleixner Subject: Re: [PATCH v3 09/16] gpiolib: Introduce gpiochip_irqchip_add_domain() In-Reply-To: <87mu6xqhny.fsf@nanos.tec.linutronix.de> References: <20200423174543.17161-1-michael@walle.cc> <20200423174543.17161-10-michael@walle.cc> <87mu6xqhny.fsf@nanos.tec.linutronix.de> Message-ID: <43af0bff6fee64687ac4e0d1ded14c4d@walle.cc> X-Sender: michael@walle.cc User-Agent: Roundcube Webmail/1.3.10 X-Spamd-Bar: + X-Rspamd-Server: web X-Rspamd-Queue-Id: AAEB72305C X-Spamd-Result: default: False [1.40 / 15.00]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[dt]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[]; RCPT_COUNT_TWELVE(0.00)[24]; NEURAL_HAM(-0.00)[-0.777]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[linux.intel.com,vger.kernel.org,lists.infradead.org,linaro.org,baylibre.com,kernel.org,suse.com,roeck-us.net,gmail.com,pengutronix.de,linux-watchdog.org,nxp.com,lakedaemon.net,linuxfoundation.org]; MID_RHS_MATCH_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200427_104925_395322_5950E81B X-CRM114-Status: GOOD ( 13.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Linus Walleij , Thierry Reding , Lee Jones , Jason Cooper , Andy Shevchenko , Marc Zyngier , Bartosz Golaszewski , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Guenter Roeck , linux-pwm@vger.kernel.org, Jean Delvare , linux-watchdog@vger.kernel.org, linux-gpio@vger.kernel.org, Mark Brown , Wim Van Sebroeck , linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Li Yang , Rob Herring , Shawn Guo Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am 2020-04-27 13:42, schrieb Thomas Gleixner: > Michael Walle writes: >> This connects an IRQ domain to a gpiochip and reuses >> gpiochip_to_irq(). > > A little bit more context and explanation why this function is useful > would be appreciated. Ok I'll try to be a bit more elaborate the in the next version, (if this function is still there). For now: gpiochip_irqchip_add_domain() allows to use reqmap-irq, which exports an irqdomain, with gpiolib while reusing gpiochip_to_irq(). Both gpiochip_irqchip_* and regmap_irq partially provides the same functionality. The new function will help to connect just the minimal functionality of the gpiochip_irqchip which is needed to work together with regmap-irq. > >> Signed-off-by: Michael Walle >> --- >> drivers/gpio/gpiolib.c | 20 ++++++++++++++++++++ >> include/linux/gpio/driver.h | 3 +++ >> 2 files changed, 23 insertions(+) >> >> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c >> index 40f2d7f69be2..7b3d7f496b9a 100644 >> --- a/drivers/gpio/gpiolib.c >> +++ b/drivers/gpio/gpiolib.c >> @@ -2722,6 +2722,26 @@ int gpiochip_irqchip_add_key(struct gpio_chip >> *gc, >> } >> EXPORT_SYMBOL_GPL(gpiochip_irqchip_add_key); >> >> +/** >> + * gpiochip_irqchip_add_key() - adds an irqdomain to a gpiochip > > Copy & paste is wonderful whoops. -michael > >> + * @gc: the gpiochip to add the irqchip to >> + * @domain: the irqdomain to add to the gpiochip >> + * >> + * This function adds an IRQ domain to the gpiochip. >> + */ >> +int gpiochip_irqchip_add_domain(struct gpio_chip *gc, >> + struct irq_domain *domain) >> +{ >> + if (!domain) >> + return -EINVAL; >> + >> + gc->to_irq = gpiochip_to_irq; >> + gc->irq.domain = domain; >> + >> + return 0; >> +} > > Thanks, > > tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel