Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3083075imm; Tue, 29 May 2018 00:13:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIgW/Be4kbOyUtJVunk6+Equtu3c4W2a+TaKeMqLwg0wO20WgogwcE+VWHDMCb1D7SmmR1B X-Received: by 2002:a62:a0c:: with SMTP id s12-v6mr11730826pfi.33.1527577993340; Tue, 29 May 2018 00:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527577993; cv=none; d=google.com; s=arc-20160816; b=Jj5ZMmjoYqYoc7L/sNjUUFuGbOC/ACBSayLdrAYkrBWb3m2rWqJu1YFlUgc6d8ucBN HGa9EEbdL+C9s89Hmpptt7tDKU9djq1M/fWpX2uSCnAb0FYi1pCBBtNXPJKqkVoyw2Un 2MzWr+9dbp8r1bHh+cX0JKhFVihvTj2xd6GRbub7JhT2Cyj7UBUOSgpM/aRvVe04LcVz dRz3IiLG5V2pUkP/lB5bUEXM3RAVG+gG0flcZ1zQMxkhG83BSVBcOeqQIq5l5ROa2Zjs RnFVYKMhFvLprP5HFWBM8nTbT7Lr8ajFkrOGgdOZDd8D4EUTWDwRVqSRtcvxtEnACpvz THwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=JSrShkenOdQOnsPtpEHTb6rKJvO5/NU74IrsPPzVjC4=; b=g3a72rHKLo6hKN5cenKbc1F3eIqGtA5MqOx6ODgpVC5vthpH8edqMjz9Nvv77mSx7K zikhRPaI7pESEHF9UooBUT+eFuESLQHNhT/SylNIxe6lpmgqYvuna8DcucElRE/JRvQI 2paecjhhozJQgFlGX+sJWn/+/N86fTtNak2se2SsMWiGQbIK80LzSbDD5HvWWMb/NgUT balmzteLqFlBKsTtYmFyEM7Jyju9dntH6Ve/q9bXmStArgWxMOQq0ciTB/tIANKsqzt0 8Dl5z+jCpkX1PMYaMe1B1t7JZECT7qS/sWZNArixdT8UyM/gp/NkAjvNaW5qT1lm8+Tp tG3Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14-v6si11476736pge.71.2018.05.29.00.12.59; Tue, 29 May 2018 00:13:13 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754839AbeE2HMh (ORCPT + 99 others); Tue, 29 May 2018 03:12:37 -0400 Received: from mail-qt0-f172.google.com ([209.85.216.172]:33756 "EHLO mail-qt0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754709AbeE2HMe (ORCPT ); Tue, 29 May 2018 03:12:34 -0400 Received: by mail-qt0-f172.google.com with SMTP id e8-v6so17460239qth.0 for ; Tue, 29 May 2018 00:12:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JSrShkenOdQOnsPtpEHTb6rKJvO5/NU74IrsPPzVjC4=; b=QWkGT3q0m/WBrl7L5cxj86OM6KqJKi3uymxNYIR+6nRaWx8vZ2pFlYblmwXX+5gKgK MwsriUalCopZJul8H6N+ytZ8k4bB3u9EiqSlYpxksCEaBv0p5GOTtHQDJ1AhwVJvpKsc a82Zy4/GPixlq/IbcB1KSUm0FI8ARAbkAKlJse92YCAVVFGVnNsrq+xQ0IX36sbHdoiq nMhicefqiHZ3W1fHDKuH9GCsRem9i/sfQmQajvc/LmrLyQeJrl+BXCI7JEi/PGwQMIp2 tZk28DfqKQ9haLx7QR7EuFRgE2f+Q9xwsVdXKJL7F2d8HMjXmTVlMRgIMKGN/U5c1dcN pzdA== X-Gm-Message-State: ALKqPwe1mxEq9ZLLhhPrTxeR1DHizznos1LgClhJj1MVI/2K8ihjMDTl O7dChAz+eCk41+v/fCIm3feITS7bQB8DVUEo9GxMDA== X-Received: by 2002:a0c:9d45:: with SMTP id n5-v6mr14827041qvf.44.1527577953481; Tue, 29 May 2018 00:12:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2bc7:0:0:0:0:0 with HTTP; Tue, 29 May 2018 00:12:33 -0700 (PDT) In-Reply-To: References: <31245206-038e-4a5b-a1a1-8877463556a7@hanno.de> From: Benjamin Tissoires Date: Tue, 29 May 2018 09:12:33 +0200 Message-ID: Subject: Re: [PATCH] HID: Add support for 146b:0902 Bigben Interactive Kids' gamepad To: Roderick Colenbrander Cc: Hanno Zulla , Jiri Kosina , linux-input , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 29, 2018 at 12:57 AM, Roderick Colenbrander wrote: > Hi Hanno, > > A few suggestions for your patch based on a quick review (had limited time). > > 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'. > > 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). Thanks a lot Roderick for the review. In addition to those comments, please also try to follow the submission guidelines (point 6 of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst). It's easier for us to share comments if your patch is inlined in the email, so we can directly pinpoint which line is in trouble. Also, keep point 9 in mind ("Don't get discouraged - or impatient"). For the first submissions, it's usual to have several revisions of the same series. Cheers, Benjamin > > Thanks, > Roderick > > On Wed, May 23, 2018 at 8:57 AM, Hanno Zulla wrote: >> Hello, >> >> this is a driver for the "BigBen Interactive Kid-friendly Wired >> Controller PS3OFMINIPAD SONY" [1] with USB id 146b:0902. It was >> originally sold as a PS3 accessory and serves as a very nice gamepad for >> Retropie. >> >> With the help of serialusb [2], it was possible to analyze the protocol >> used by the gamepad and fix the missing entries for the descriptor. >> >> >> This is my *first* driver, so please review accordingly. >> >> >> Three things where I'm not sure and hope to hear from you about: >> >> - is that the correct use of hid_validate_values() in bigben_probe()? >> >> - is the error handling in bigben_probe() correct? >> >> - how do I properly test possible suspend/resume scenarios? >> >> Thanks, >> >> Hanno >> >> >> [1] >> >> >> [2]