From patchwork Sat Oct 11 05:06:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 5068301 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 7DE7B9F2F1 for ; Sat, 11 Oct 2014 05:06:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6A082201F2 for ; Sat, 11 Oct 2014 05:06:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C32E020204 for ; Sat, 11 Oct 2014 05:06:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244AbaJKFGK (ORCPT ); Sat, 11 Oct 2014 01:06:10 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:47129 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750825AbaJKFGI (ORCPT ); Sat, 11 Oct 2014 01:06:08 -0400 Received: by mail-pa0-f46.google.com with SMTP id fa1so2869162pad.19 for ; Fri, 10 Oct 2014 22:06:07 -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=rayHDLBUqg/kDcKB2Jyy92sXEsz8tRi49l1eU4IgUzc=; b=NK/aq0nRTgeO11AEDWPRmwF2GXQbdANTEkcnkhZEY+EqXOYd5HWTeQu6ncGu99Ff/t P2FO3Ls4LJm7tdG8/WlV7bfKhU4F/wwstWONNYrJSVc0VIDUaVWeCQ4NC91JzqwOLhyv sJN1SrqERHOjSkHwad105d5XUMJ9xqi9aAtBCf7wp9IRxZzwivp1/bGwZHIsVk+Ue58M oOWWR0uhk3o7sR99hMCp1kM04wBOtAUHzBgqpw5me0hTDmv5M4e7Z01jXwFSbw2vM5c1 Yk0Tpq5Nr1E+Zv6wp4r1HI0GOkxZ+bIuFO29gx3uUw42wLDakNq7cuNEKkSrCcISn2J2 nWFg== X-Received: by 10.70.103.162 with SMTP id fx2mr9824094pdb.42.1413003967849; Fri, 10 Oct 2014 22:06:07 -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 nx6sm5052533pab.46.2014.10.10.22.06.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Oct 2014 22:06:07 -0700 (PDT) From: Matt Ranostay To: dmitry.torokhov@gmail.com, galak@codeaurora.org, zonque@gmail.com Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Matt Ranostay Subject: [PATCH v6 3/3] cap11xx: support for irq-active-high option Date: Fri, 10 Oct 2014 22:06:54 -0700 Message-Id: <1413004014-23807-4-git-send-email-mranostay@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413004014-23807-1-git-send-email-mranostay@gmail.com> References: <1413004014-23807-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.8 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=ham 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 91effe5..0ae7d2f 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 @@ -253,6 +254,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 < cap->num_channels; i++) priv->keycodes[i] = KEY_A + i;