From patchwork Sat Sep 8 09:23:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 967586 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xs4all.nl Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 426pl74Nqnz9s3C for ; Sat, 8 Sep 2018 19:23:31 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726341AbeIHOIb (ORCPT ); Sat, 8 Sep 2018 10:08:31 -0400 Received: from lb3-smtp-cloud9.xs4all.net ([194.109.24.30]:32937 "EHLO lb3-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726315AbeIHOIb (ORCPT ); Sat, 8 Sep 2018 10:08:31 -0400 Received: from tschai.fritz.box ([212.251.195.8]) by smtp-cloud9.xs4all.net with ESMTPA id yZSZf0zAxMsEFyZSff6TGk; Sat, 08 Sep 2018 11:23:25 +0200 From: Hans Verkuil To: linux-gpio@vger.kernel.org Cc: Linus Walleij , ilina@codeaurora.org, Marc Zyngier , Thomas Gleixner , Hans Verkuil Subject: [PATCHv2 5/6] gpio/driver.rst: document gpiochip_disable/enable_irq() Date: Sat, 8 Sep 2018 11:23:18 +0200 Message-Id: <20180908092319.43900-6-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180908092319.43900-1-hverkuil@xs4all.nl> References: <20180908092319.43900-1-hverkuil@xs4all.nl> X-CMAE-Envelope: MS4wfEZPC397w2DJFn/JQRCbOYlQ0QVeCH0/pgr0ucHfq/ADRVKZxYtJx79nQBxpWCwFhn15W473YnUOdS18tOh8L12N+tBKVEzrCbIyPLWiyAa5kSVLTpIf wu1J1jc5tBji7ns6p5GGn9iSRy0+d6lwkD8pk7mi4q8YHdYHfs/1juamh5QL6JliyrtoKR6ii1Z8sygauAQ9M2yBCETNxYZPr3XctjxN/shlYqU/3Iq288jq PHPbfF7NEmRJeBQ1xKARy4WH+yFOqMxiCAqCSxgYi/KJXTfdyDan80wp1O11MKUZ0akDtOvp5VrDC+7RlOojLr6R2N37AwVaFKlMA32a1OKQKl2OyZQf5CPN oyHX4hl2 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Hans Verkuil Document these new functions. Signed-off-by: Hans Verkuil --- Documentation/driver-api/gpio/driver.rst | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Documentation/driver-api/gpio/driver.rst b/Documentation/driver-api/gpio/driver.rst index cbe0242842d1..a6c14ff0c54f 100644 --- a/Documentation/driver-api/gpio/driver.rst +++ b/Documentation/driver-api/gpio/driver.rst @@ -374,7 +374,28 @@ When implementing an irqchip inside a GPIO driver, these two functions should typically be called in the .startup() and .shutdown() callbacks from the irqchip. -When using the gpiolib irqchip helpers, these callback are automatically +When using the gpiolib irqchip helpers, these callbacks are automatically +assigned. + + +Disabling and enabling IRQs +--------------------------- +When a GPIO is used as an IRQ signal, then gpiolib also needs to know if +the IRQ is enabled or disabled. In order to inform gpiolib about this, +a driver should call:: + + void gpiochip_disable_irq(struct gpio_chip *chip, unsigned int offset) + +This allows drivers to drive the GPIO as an output while the IRQ is +disabled. When the IRQ is enabled again, a driver should call:: + + void gpiochip_enable_irq(struct gpio_chip *chip, unsigned int offset) + +When implementing an irqchip inside a GPIO driver, these two functions should +typically be called in the .irq_disable() and .irq_enable() callbacks from the +irqchip. + +When using the gpiolib irqchip helpers, these callbacks are automatically assigned. Real-Time compliance for GPIO IRQ chips