From patchwork Thu Apr 10 09:30:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 3961171 Return-Path: X-Original-To: patchwork-linux-input@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 1A29EBFF02 for ; Thu, 10 Apr 2014 09:49:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 53D7820625 for ; Thu, 10 Apr 2014 09:49:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C73E20513 for ; Thu, 10 Apr 2014 09:49:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934857AbaDJJgS (ORCPT ); Thu, 10 Apr 2014 05:36:18 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.162]:58807 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934852AbaDJJgQ convert rfc822-to-8bit (ORCPT ); Thu, 10 Apr 2014 05:36:16 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1397122575; l=1220; s=domk; d=dsitri.de; h=Mime-Version:To:Cc:Date:Subject:Content-Transfer-Encoding: Content-Type:From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=9hY6zGaK1bqiEMfcTFBxdUa43UY=; b=jsm9LW11zwfY8jMYPz8oVbOkRwy1W6DC+SezgsZW4scG6Cexf8cBXtbibp5uhCMdZUr Gw6jrm5KR65iUWWnZZMk8g37atM2visZjCSK0qFVxEz2MRtciaJEjUiuWv7ZWmlwCE6pD 1IICEbTSee0ibCPN60hvaAsYke23YeTZuFM= X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcKdUCnXG6JabOfSXKWrat4jNPvwo0= X-RZG-CLASS-ID: mo00 Received: from [192.168.2.104] (p57AE3112.dip0.t-ipconnect.de [87.174.49.18]) by post.strato.de (RZmta 32.33 DYNA|AUTH) with ESMTPA id 200980q3A9U275t; Thu, 10 Apr 2014 11:30:02 +0200 (CEST) From: "Dr. H. Nikolaus Schaller" Subject: [PATCH] bma150: extend chip detection for bma180 Date: Thu, 10 Apr 2014 11:30:02 +0200 Message-Id: Cc: Jingoo Han , Fugang Duan , linux-input@vger.kernel.org, LKML , Marek Belisko To: Dmitry Torokhov Mime-Version: 1.0 (Apple Message framework v1085) X-Mailer: Apple Mail (2.1085) 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.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,T_HK_NAME_DR, 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 This driver has been used while on the OpenPhoenux GTA04 with a BMA180. Signed-off-by: H. Nikolaus Schaller --- drivers/input/misc/bma150.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c index 52d3a9b..b36831c 100644 --- a/drivers/input/misc/bma150.c +++ b/drivers/input/misc/bma150.c @@ -70,6 +70,7 @@ #define BMA150_CFG_5_REG 0x11 #define BMA150_CHIP_ID 2 +#define BMA180_CHIP_ID 3 #define BMA150_CHIP_ID_REG BMA150_DATA_0_REG #define BMA150_ACC_X_LSB_REG BMA150_DATA_2_REG @@ -539,7 +540,7 @@ static int bma150_probe(struct i2c_client *client, } chip_id = i2c_smbus_read_byte_data(client, BMA150_CHIP_ID_REG); - if (chip_id != BMA150_CHIP_ID) { + if (chip_id != BMA150_CHIP_ID && chip_id != BMA180_CHIP_ID) { dev_err(&client->dev, "BMA150 chip id error: %d\n", chip_id); return -EINVAL; } @@ -643,6 +644,7 @@ static UNIVERSAL_DEV_PM_OPS(bma150_pm, bma150_suspend, bma150_resume, NULL); static const struct i2c_device_id bma150_id[] = { { "bma150", 0 }, + { "bma180", 0 }, { "smb380", 0 }, { "bma023", 0 }, { }