From patchwork Thu Feb 27 20:51:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 3735711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 54767BF13A for ; Thu, 27 Feb 2014 20:53:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72A6120255 for ; Thu, 27 Feb 2014 20:53:23 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F8E12022D for ; Thu, 27 Feb 2014 20:53:22 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJ7wR-0006VQ-VC; Thu, 27 Feb 2014 20:52:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJ7wG-0003CO-8T; Thu, 27 Feb 2014 20:52:16 +0000 Received: from avon.wwwdotorg.org ([70.85.31.133]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJ7vt-00038W-GE for linux-arm-kernel@lists.infradead.org; Thu, 27 Feb 2014 20:51:55 +0000 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 44E076339; Thu, 27 Feb 2014 13:51:29 -0700 (MST) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 4DC3FE40F4; Thu, 27 Feb 2014 13:51:08 -0700 (MST) From: Stephen Warren To: Samuel Ortiz , Lee Jones Subject: [PATCH V2 1/3] dt: palmas: support IRQ inversion at the board level Date: Thu, 27 Feb 2014 13:51:19 -0700 Message-Id: <1393534281-30759-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.8.1.5 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.8 at avon.wwwdotorg.org X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140227_155153_645313_2077B218 X-CRM114-Status: GOOD ( 12.68 ) X-Spam-Score: 1.2 (+) Cc: Mark Rutland , devicetree@vger.kernel.org, Stephen Warren , Pawel Moll , Ian Campbell , J Keerthy , Ian Lartey , Rob Herring , Kumar Gala , linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Stephen Warren Some boards or SoCs have an inverter between the PMIC IRQ output pin and the IRQ controller input signal. The IRQ specifier in DT is meant to represent the IRQ flags at the input to the IRQ controller. The Palmas HW's IRQ output has configurable polarity. Software needs to know which polarity to choose for the IRQ output. Software may be tempted to extract the IRQ polarity from the IRQ specifier in order to make this choice. That approach works fine if the IRQ signal is routed directly from the PMIC to the IRQ controller with no intervening logic. However, if the signal is inverted between the two, this approach gets the wrong answer. Add an additional optional DT property which indicates that such an inversion occurs. This allows DT to give complete information about the desired IRQ output polarity to software. An alternative would have been to add a new non-optional DT parameter to indicate the exact desired output polarity. However, this would have been an incompatible change to the DT binding. Signed-off-by: Stephen Warren Acked-by: Laxman Dewangan Acked-by: Lee Jones --- v2: Split V1's patch 1/2 into separate patches 1/3 and 2/3. --- Documentation/devicetree/bindings/mfd/palmas.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/palmas.txt b/Documentation/devicetree/bindings/mfd/palmas.txt index e5f0f8303461..76ec509d5f87 100644 --- a/Documentation/devicetree/bindings/mfd/palmas.txt +++ b/Documentation/devicetree/bindings/mfd/palmas.txt @@ -18,6 +18,12 @@ Required properties: ti,tps659038 and also the generic series names ti,palmas +- interrupts : Should contain a single entry for the IRQ output. +- ti,irq-externally-inverted : If missing, the polarity of the Palmas IRQ + output should be set to the opposite of the polarity indicated by the IRQ + specifier in the interrupts property. If absent, the polarity should be + configured to match. This allows the representation of an inverter between + the Palmas IRQ output and the interrupt parent's IRQ input. - interrupt-controller : palmas has its own internal IRQs - #interrupt-cells : should be set to 2 for IRQ number and flags The first cell is the IRQ number.