From patchwork Fri Aug 22 14:11:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 35856 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CB3662057E for ; Fri, 22 Aug 2014 14:12:06 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id y10sf82849945pdj.8 for ; Fri, 22 Aug 2014 07:12:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=5AxJZADR224eWYRMn12W6LDASROvAISx3NxYIM6xWmM=; b=M438J1M7SXPPXk9WtDHbG3ZgqcRffabv8tmLFxwezXvO0t7fFMh+/In3XjRohn4jvv x98a5uvQhLd5iMGbOZlxXG4q5hcB/7jU1yZX2FmLgFjpGtLmrD106K5xe4jC1S3EWsuz u0OeXhjrDqU+e3KkCacJtemc32/3hVDrXIagAt8TDh311H0Mt5Rr7EOK7qRbTCdOoWUK EcxNSKZgEdB2UJ7ypzeCX6C0KdrWCgvq/7Qsg7BtzlPt4BXKlNb3BuY3cpGOa6ijCkXY 73R/aucKGmWqA9uJqF8mirHH54GKQ89luWE6LSG5L8wQ4FbIX2vy9z+ZjH362bVhiEro yRLQ== X-Gm-Message-State: ALoCoQl/AWJR5qd5TeMqL+X8U0clvXRFTNfuFSDXpt5GcyVfg1jVmz0yHhMWIym2zKbG5Cng/nDK X-Received: by 10.66.196.70 with SMTP id ik6mr3519016pac.44.1408716726155; Fri, 22 Aug 2014 07:12:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.134 with SMTP id x6ls1153071qgx.45.gmail; Fri, 22 Aug 2014 07:12:05 -0700 (PDT) X-Received: by 10.52.149.209 with SMTP id uc17mr184428vdb.65.1408716725930; Fri, 22 Aug 2014 07:12:05 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id zy4si13641881vdc.60.2014.08.22.07.12.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Aug 2014 07:12:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so12193555vcb.23 for ; Fri, 22 Aug 2014 07:12:05 -0700 (PDT) X-Received: by 10.53.12.225 with SMTP id et1mr3462773vdd.5.1408716725818; Fri, 22 Aug 2014 07:12:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp20256vcb; Fri, 22 Aug 2014 07:12:05 -0700 (PDT) X-Received: by 10.68.139.74 with SMTP id qw10mr6816919pbb.100.1408716724957; Fri, 22 Aug 2014 07:12:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si40932619pbw.196.2014.08.22.07.12.04 for ; Fri, 22 Aug 2014 07:12:04 -0700 (PDT) Received-SPF: none (google.com: linux-input-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932167AbaHVOMC (ORCPT ); Fri, 22 Aug 2014 10:12:02 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:59204 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932112AbaHVOMB (ORCPT ); Fri, 22 Aug 2014 10:12:01 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s7MEBcTM015608; Fri, 22 Aug 2014 09:11:38 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7MEBcCv030314; Fri, 22 Aug 2014 09:11:38 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 22 Aug 2014 09:11:37 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7MEBbDZ030902; Fri, 22 Aug 2014 09:11:37 -0500 Received: from localhost (j-172-22-73-212.vpn.ti.com [172.22.73.212]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id s7MEBbt13896; Fri, 22 Aug 2014 09:11:37 -0500 (CDT) From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH] input: misc: drv260x: add check for ERM mode and LRA Libraries Date: Fri, 22 Aug 2014 09:11:36 -0500 Message-ID: <1408716696-1126-1-git-send-email-dmurphy@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dmurphy@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add a check to ensure that LRA libraries are not mixed with the ERM mode. If ERM mode and the Library is empty "OR" the LRA library then exit. As the LRA and empty libraries are not applicable for the ERM actuator. Signed-off-by: Dan Murphy --- drivers/input/misc/drv260x.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c index a7a19e6..d6a26a7 100644 --- a/drivers/input/misc/drv260x.c +++ b/drivers/input/misc/drv260x.c @@ -564,6 +564,14 @@ static int drv260x_probe(struct i2c_client *client, return -EINVAL; } + if (haptics->mode == DRV260X_ERM_MODE && + haptics->library == DRV260X_LIB_EMPTY || + haptics->library == DRV260X_LIB_LRA) { + dev_err(&client->dev, + "ERM Mode with LRA Library mismatch\n"); + return -EINVAL; + } + haptics->regulator = devm_regulator_get(&client->dev, "vbat"); if (IS_ERR(haptics->regulator)) { error = PTR_ERR(haptics->regulator);