From patchwork Tue Sep 30 04:26:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 5000311 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B485D9F3D1 for ; Tue, 30 Sep 2014 04:26:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E01972016C for ; Tue, 30 Sep 2014 04:26:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44078201CE for ; Tue, 30 Sep 2014 04:26:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750906AbaI3EZv (ORCPT ); Tue, 30 Sep 2014 00:25:51 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:51840 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751196AbaI3EZt (ORCPT ); Tue, 30 Sep 2014 00:25:49 -0400 Received: by mail-pd0-f169.google.com with SMTP id p10so6500964pdj.28 for ; Mon, 29 Sep 2014 21:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+OZI9QnMKX+4LfW3/sAwAXdO1loGimZLFJSsyQlmZcw=; b=eQqA5gtUvZq+S+Zox7umbeeCYpJ76qrNjGJJsd2t7XQWBlw5I9+uE5zmmawHQHEuL2 HJSMa9kENs9uYP7A33rGvHmkJHN5Rs+iZyI76XYOrkYFWXAh6s+vV/Z5Cpya1lVpicR4 sYgH9RG2yTX32EdeM4gVuGV00aW/VG7tkvq1db0ZRtGTIuV71npar7AZVuJbTAM3VPO4 3PCdpK0pWqgedReBdhFe+zQPjmyzQpp3Nk2PXU29LbG6wCTx/WJmM0bV8ds6EumW9Q+a K7RASmUFbllAxMn5QH7QQoWdJiHGQ6UNBdxztgA4OavJtM9jO3Ei0D3rVD1rbJATu8XM kc5A== X-Received: by 10.66.140.8 with SMTP id rc8mr65061673pab.75.1412051148929; Mon, 29 Sep 2014 21:25:48 -0700 (PDT) Received: from niteshade.hsd1.or.comcast.net (c-50-186-57-65.hsd1.or.comcast.net. [50.186.57.65]) by mx.google.com with ESMTPSA id we3sm4409750pab.21.2014.09.29.21.25.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Sep 2014 21:25:48 -0700 (PDT) From: Matt Ranostay To: galak@codeaurora.org, dmitry.torokhov@gmail.com, zonque@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, Matt Ranostay Subject: [PATCH v4 3/3] cap11xx: support for irq-active-high option Date: Mon, 29 Sep 2014 21:26:29 -0700 Message-Id: <1412051189-22643-4-git-send-email-mranostay@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412051189-22643-1-git-send-email-mranostay@gmail.com> References: <1412051189-22643-1-git-send-email-mranostay@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 Some applications need to use the irq-active-high push-pull option. This allows it be enabled in the device tree child node. Signed-off-by: Matt Ranostay --- Documentation/devicetree/bindings/input/cap11xx.txt | 4 ++++ drivers/input/keyboard/cap11xx.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/input/cap11xx.txt b/Documentation/devicetree/bindings/input/cap11xx.txt index 8031aa5..57407be 100644 --- a/Documentation/devicetree/bindings/input/cap11xx.txt +++ b/Documentation/devicetree/bindings/input/cap11xx.txt @@ -28,6 +28,10 @@ Optional properties: Valid values are 1, 2, 4, and 8. By default, a gain of 1 is set. + microchip,irq-active-high: By default the interrupt pin is active low + open drain. This property allows using the active + high push-pull output. + linux,keycodes: Specifies an array of numeric keycode values to be used for the channels. If this property is omitted, KEY_A, KEY_B, etc are used as diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c index adb979e..02bedc1 100644 --- a/drivers/input/keyboard/cap11xx.c +++ b/drivers/input/keyboard/cap11xx.c @@ -45,6 +45,7 @@ #define CAP11XX_REG_STANDBY_SENSITIVITY 0x42 #define CAP11XX_REG_STANDBY_THRESH 0x43 #define CAP11XX_REG_CONFIG2 0x44 +#define CAP11XX_REG_CONFIG2_ALT_POL BIT(6) #define CAP11XX_REG_SENSOR_BASE_CNT(X) (0x50 + (X)) #define CAP11XX_REG_SENSOR_CALIB (0xb1 + (X)) #define CAP11XX_REG_SENSOR_CALIB_LSB1 0xb9 @@ -258,6 +259,13 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client, dev_err(dev, "Invalid sensor-gain value %d\n", gain32); } + if (of_property_read_bool(node, "microchip,irq-active-high")) { + error = regmap_update_bits(priv->regmap, CAP11XX_REG_CONFIG2, + CAP11XX_REG_CONFIG2_ALT_POL, 0); + if (error) + return error; + } + /* Provide some useful defaults */ for (i = 0; i < priv->num_channels; i++) priv->keycodes[i] = KEY_A + i;