From patchwork Thu Sep 25 05:24:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 4973091 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 0D9E89F1D4 for ; Thu, 25 Sep 2014 05:24:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2ACF320270 for ; Thu, 25 Sep 2014 05:24:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 403E320274 for ; Thu, 25 Sep 2014 05:24:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750808AbaIYFYC (ORCPT ); Thu, 25 Sep 2014 01:24:02 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:35828 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbaIYFXq (ORCPT ); Thu, 25 Sep 2014 01:23:46 -0400 Received: by mail-pd0-f179.google.com with SMTP id ft15so9995291pdb.38 for ; Wed, 24 Sep 2014 22:23:46 -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=Emudr97VLyNTFxuw+JxjfmyEYIsXySZNhLZZaVgzbHQ=; b=vhrjFqfZVQz9K4Q7hUM7k+e9gaGg9We7xAVCxA+a93Q89k5vKaL4oo7cQynrp3inxD U+3ZMDBWAOJ1Ebb6WUVW9PbtkhZtD5arNATi5L1Yj46+iaXjZ9M6oszs/12lPQEEQ5XL g501IbygTH5VrOlDCIhInLNOoifjBdMye2IvNtArPWXqPELW62V1qkB9XtkSipKi3BDo b90Qeq7RbuK3zz11RUNNXqgJubeaeBHgq8jR4lbdpoUfIR2rbDKdhUPX2OwUfGMwtq6A +c2/5nLSaOdmesaGtOj0Ou3LgJedjNiR6P5chrrZDKH+HGlnO+RBAbq+T7Uh5He0HFtW g2bA== X-Received: by 10.68.202.225 with SMTP id kl1mr14928623pbc.21.1411622626026; Wed, 24 Sep 2014 22:23:46 -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 f12sm867951pdl.94.2014.09.24.22.23.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Sep 2014 22:23:45 -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 v3 3/3] cap11xx: support for irq-active-high option Date: Wed, 24 Sep 2014 22:24:22 -0700 Message-Id: <1411622662-16581-4-git-send-email-mranostay@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411622662-16581-1-git-send-email-mranostay@gmail.com> References: <1411622662-16581-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 a8fe806..b4fc9f6 100644 --- a/drivers/input/keyboard/cap11xx.c +++ b/drivers/input/keyboard/cap11xx.c @@ -46,6 +46,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 @@ -259,6 +260,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;