From patchwork Wed Nov 6 19:30:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: simon@mungewell.org X-Patchwork-Id: 3148921 X-Patchwork-Delegate: jikos@jikos.cz 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 DBD6C9F3C4 for ; Wed, 6 Nov 2013 19:32:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD14820549 for ; Wed, 6 Nov 2013 19:32:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD0382050E for ; Wed, 6 Nov 2013 19:32:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755793Ab3KFTbx (ORCPT ); Wed, 6 Nov 2013 14:31:53 -0500 Received: from host171.canaca.com ([67.55.55.225]:50299 "EHLO host171.canaca.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755679Ab3KFTbH (ORCPT ); Wed, 6 Nov 2013 14:31:07 -0500 Received: from [208.118.126.162] (helo=simon-virtual-machine.TOPCON.COM) by host171.canaca.com with esmtpa (Exim 4.69) (envelope-from ) id 1Ve8ol-0000mo-4G; Wed, 06 Nov 2013 14:31:07 -0500 From: Simon Wood To: linux-input@vger.kernel.org Cc: Jiri Kosina , linux-kernel@vger.kernel.org, simon@mungewell.org, Elias Vanderstuyft , =?UTF-8?q?Michal=20Mal=C3=BD?= Subject: [PATCH 3/5] HID:hid-lg4ff: ensure ConstantForce is disabled when set to 0 Date: Wed, 6 Nov 2013 12:30:42 -0700 Message-Id: <1383766244-2336-3-git-send-email-simon@mungewell.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1383766244-2336-1-git-send-email-simon@mungewell.org> References: <1383766244-2336-1-git-send-email-simon@mungewell.org> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host171.canaca.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mungewell.org X-Source: X-Source-Args: X-Source-Dir: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 When 'Constant Force' is set to 0 it is not turned off completely, the wheel feels 'heavy'. This patch issues the '13 00..' command to ensure that the force in slot 1 (the Constant Force) is deactivated. Reported-by: Elias Vanderstuyft Signed-off-by: Simon Wood --- drivers/hid/hid-lg4ff.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 49f6cc0..5d140b7 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -196,6 +196,21 @@ static int hid_lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *e case FF_CONSTANT: x = effect->u.ramp.start_level + 0x80; /* 0x80 is no force */ CLAMP(x); + + if (x == 0x80) { + /* De-activate force in slot-1*/ + value[0] = 0x13; + value[1] = 0x00; + value[2] = 0x00; + value[3] = 0x00; + value[4] = 0x00; + value[5] = 0x00; + value[6] = 0x00; + + hid_hw_request(hid, report, HID_REQ_SET_REPORT); + return 0; + } + value[0] = 0x11; /* Slot 1 */ value[1] = 0x08; value[2] = x;