From patchwork Wed Apr 9 05:51:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: simon@mungewell.org X-Patchwork-Id: 3952491 X-Patchwork-Delegate: jikos@jikos.cz 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 AA698BFF02 for ; Wed, 9 Apr 2014 05:51:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6A462073F for ; Wed, 9 Apr 2014 05:51:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E77B820715 for ; Wed, 9 Apr 2014 05:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750814AbaDIFv0 (ORCPT ); Wed, 9 Apr 2014 01:51:26 -0400 Received: from host171.canaca.com ([67.55.55.225]:58094 "EHLO host171.canaca.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750809AbaDIFvZ (ORCPT ); Wed, 9 Apr 2014 01:51:25 -0400 Received: from localhost ([127.0.0.1] helo=mungewell.org) by host171.canaca.com with esmtpa (Exim 4.69) (envelope-from ) id 1WXlPu-0002M1-Qc; Wed, 09 Apr 2014 01:51:23 -0400 Received: from 70.72.56.65 ([70.72.56.65]) (SquirrelMail authenticated user simon@mungewell.org) by mungewell.org with HTTP; Wed, 9 Apr 2014 01:51:23 -0400 Message-ID: <5ab597fe6a7cc937a8d41df6df7adc47.squirrel@mungewell.org> In-Reply-To: <533EBE48.5010100@oh.rr.com> References: <1396456285-23755-1-git-send-email-frank.praznik@oh.rr.com> <1396456285-23755-8-git-send-email-frank.praznik@oh.rr.com> <533EBE48.5010100@oh.rr.com> Date: Wed, 9 Apr 2014 01:51:23 -0400 Subject: Re: [PATCH v4 7/7] HID: sony: Add blink support to the Sixaxis and DualShock 4 LEDs From: simon@mungewell.org To: "Frank Praznik" Cc: "HID CORE LAYER" , "Jiri Kosina" , "Frank Praznik" User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal 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=-5.8 required=5.0 tests=BAYES_05, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, 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 Unfortunately I was unable to find the 'led chaining' code I mentioned. I guess it has been lost to the sands of time.... >> 3rd Party Intec - Was unable to get any controlled blinking. As >> previously >> mentioned all leds flash (automatic, as if first plugged in) whenever >> all >> leds are turned off. >> I can control all leds in a static on/off mode, but can't set any >> blinking/timer behaviour > > It sounds like this controller just doesn't implement all of the > behavior of the official controller. I'm not sure how to fix it if it's > not obeying the instructions in valid output reports and I don't have > one to test personally. Do the lights flash properly when the > controller is used with a PS3? I was able to patch the code so that I could turn all LEDs off my Intec controller, see attached. Tested this against the Intec and the SixAxis. I was not able to make the LEDs flash in a controlled fashion, so you might be right about the controller not working properly - although my comments in python script suggests I did have something going.... must be missing a snippet of info. I also found that on the SixAxis, when I reported that I had to set 1st LED off before I could set it on.... this only applies when the controller was off and then plugged into USB. At this point the LEDs are slow flashing, and the 'brightness' reports as 1 (driver code only writes to device if value is changed). If the device was already on (LEDs flashing) then only the 1st LED is set on plug in, and I can turn LEDs off/on straight away. Cheers, Simon From a0597309d26ddecb5d4662d9e3bcb4d2689b7ed5 Mon Sep 17 00:00:00 2001 From: Simon Wood Date: Tue, 8 Apr 2014 21:39:59 -0600 Subject: [PATCH] HID: hid-sony - allow 3rd party INTEC controller to turn off all leds Without this patch the 3rd party INTEC (PS3) controller will blink all leds when user turns them off, it appears to require an extra flag set. Signed-off-by: Simon Wood --- drivers/hid/hid-sony.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index aa5ece5..45cb8b6 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -1423,6 +1423,10 @@ static void sixaxis_state_worker(struct work_struct *work) report.data.leds_bitmap |= sc->led_state[2] << 3; report.data.leds_bitmap |= sc->led_state[3] << 4; + /* Set flag for all leds off, required for 3rd party INTEC controller */ + if ((report.data.leds_bitmap & 0x1E) == 0) + report.data.leds_bitmap |= 0x20; + /* * The LEDs in the report are indexed in reverse order to their * corresponding light on the controller. -- 1.8.1.2