Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3106203imm; Tue, 29 May 2018 00:47:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoRVtHOn+hPzILwfQtWemksD4WWrXD5AUVgxEdBBfp6zYliJR+h6l9Dx+LFgJvERra6Kho4 X-Received: by 2002:a63:7247:: with SMTP id c7-v6mr13025876pgn.68.1527580039529; Tue, 29 May 2018 00:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527580039; cv=none; d=google.com; s=arc-20160816; b=EYlgO4xMfSUsEz1fNbHKSwbOQ+kS0iolYoj+glQXcgEUvXTzPkuilrUTBtWmkR9+t9 Mc3y7rMp9m1I/Cetze6IqkIN7XDTbBPTLwGnlcy16XxKULmX8Ds0cHMMb2EyOStWxw/D ReLbPqVLG9Csar3CmXv62N7+CoQPnj28QUCICjFespHXdekjsKtRW4xA1+2addaCVHGk 2XlAEerP3yI8K9/k+6xz5Dv5K7K8xP8MWm9rBhWyRmY1lsdA7aezhHE2YzgclbqWnNn8 PVAgBL7h4cMtqSCihZJ7lpM0DW/A+eTK0EZbWrtu1MWLT427DCuG6OsKyFOCAGjjRPh2 55lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=t/+tec6kGbAyOPORgXLp0JYM+ayLq7o2QryH0468Q3o=; b=bmEVpAdWTdpIQAWCNlGRADBrPzrp8UczfhtQ7ffHLPQxv7WYZ4DsSTFLgL/Rwl4aR3 0rqYbccR/kdm/EZ2nl5bR2kPClC9PCB8+/WIf/m1NzzM1ZWoZJDQXidCWqbUbHsAdXtD hM/5hSuoxbwOaU0pCv8Bpj1t2urWTVObq57gG2RGW/7e36oFz3NV6NoxNLAnHZcwPL9s 0KKDiqfbWizn7NQV13bXncxJNCrPc53SU9lXXear1AFbCqyINwqg6wAT2y1hicPkpvlJ Bs9kXjQDLp8YrmaareL7HQdl41i+Livp0TnrtEOCtX5GXOKgRSU81tV2SDMlBdlrXLpQ QDUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10-v6si31327400pfe.70.2018.05.29.00.47.05; Tue, 29 May 2018 00:47:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755069AbeE2Hqb (ORCPT + 99 others); Tue, 29 May 2018 03:46:31 -0400 Received: from zoot.epublica.de ([78.46.103.157]:40384 "EHLO zoot.epublica.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754920AbeE2Hq2 (ORCPT ); Tue, 29 May 2018 03:46:28 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by zoot.epublica.de (Postfix) with ESMTP id 267901840BE0; Tue, 29 May 2018 09:46:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zoot.epublica.de Received: from zoot.epublica.de ([127.0.0.1]) by localhost (zoot.epublica.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OYG3MzCQkPe4; Tue, 29 May 2018 09:46:25 +0200 (CEST) Received: from [10.1.0.41] (ip1f12a024.dynamic.kabel-deutschland.de [31.18.160.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zoot.epublica.de (Postfix) with ESMTPSA id 0B623184005B; Tue, 29 May 2018 09:46:24 +0200 (CEST) Subject: Re: [PATCH] HID: Add support for 146b:0902 Bigben Interactive Kids' gamepad To: Roderick Colenbrander Cc: Jiri Kosina , Benjamin Tissoires , linux-input , linux-kernel@vger.kernel.org References: <31245206-038e-4a5b-a1a1-8877463556a7@hanno.de> From: Hanno Zulla Message-ID: <729f18bc-65b7-9bfd-50ed-fbb1f168500d@hanno.de> Date: Tue, 29 May 2018 09:46:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Roderick, Hi Benjamin, thanks for the review! > In terms of code style, I noticed a lot of C++ style comments which> are not part of the kernel code style instead use C comments. To check> for potential other issues as well, run your patch through> 'scripts/checkpatch.pl'. Okay, will check with that. > I noticed you fixed up reported descriptors a bit to get axes remapped > in a different way. This is reasonable as the default mappings are > often not good. However, I would suggest use the mapping functions > instead (e.g. see hid-sony.c and other drivers). It also allows you to > properly remap buttons as well. I suspect the current button mapping > is all over the place as well. Make sure axis and button mapping > complies to the Linux gamepad spec (see > Documentation/input/gamepad.rst). The main reason for the fixup was to cleanup the output part of the descriptor, as the device's original descriptor seemed to use nonsensical/undefined "Usage" values. Those two axis remappings were the only two necessary. The rest of the mappings are fine and look okay when compared to other drivers that do not fully adhere to the gamepad spec (e.g. xpad.c also doesn't map my XBox-Controller's D-Pad to NORTH/EAST/SOUTH/WEST but instead to HAT0 in the same way as this device does). I had assumed that using a descriptor fixup and leaving the actual work to the standard driver was cleaner than meddling with the incoming data in a mapping function. Actually, I was researching if I could fix the descriptor so that no LED/FF-specific code is necessary, but my knowledge of HID was too limited to achieve that. > In addition to those comments, please also try to follow the > submission guidelines Ah, thank you. > Also, keep point 9 in mind ("Don't get discouraged - or impatient"). Nah. Don't worry! :-D Thanks & kind regards, Hanno