Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2957693imm; Mon, 28 May 2018 20:56:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoWPP4Lwyae/5WOfYtMEW/qUHLaBVBKlzRtRA3qbi/71DzYCdtu9ga10uESIj2k1xEo+SLe X-Received: by 2002:a63:31d4:: with SMTP id x203-v6mr12057561pgx.389.1527566186165; Mon, 28 May 2018 20:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527566186; cv=none; d=google.com; s=arc-20160816; b=XAN6JaBbeU5NbEiQE2O5z7F9a45NkAc4UsMaprTGF4xbwVhcjGaKKgVLrGJVWJYLHE 2zVpVVdbCuLR86uGKPWOlckO28vWNS+rYlgYTpwxBpECQQ9UU6ZsKuWTUUhTfr4OOLOh b/J1GZ7e3/PLvlDLpCUAY+h9DxRQ4CKC6jQ2c4tx/81vljKJGlpGvknRRGn+0sC2AgEw DJ1ywMSblm9Yrjiaxs9xZjXdNNXZS+ey5wFj429eyQIP8/kFwuqhz2hw3wHT0nod+W5S V5MdPJpQrpjrqq51r8Mgu1cb4j3XEaO21cGUn8Bki9T+oND+e66sgMKpBxWCngn8ePAv TCaQ== 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:dkim-signature :arc-authentication-results; bh=eUh5IgqQ9F+hlf1kV1apGJ/JZh7tdyCtuMLX01nMuLI=; b=HZxKUvwdQsKlZDAqr92GDRUwsbH20JMzh1fq/KwYeCaGokAe+aOHZyriKjYjD+vkzW zs0RIsWebLlxDNxhVCIjca71ZUJAVm+GSFKsx2tj2MSts3Xln9oYLUtddCPJhsxmw6MI ng0j1j8/mIDITy1AzhRS4bO4jNWsNdTBT/+saDBLILZyyg0TZH4V6qpmXxjsX8p8GM/2 CqOpEfWSl7lYScc0PwWPldHavh5NmA2AfbrMb3OmQKp4q2BFuPsNPtoKXmcsnV/o4EFs OmyBDe/3cp3kdQngzetyArCuO0ST6zFUgMMybg2a/zP3Ej24sHoUju0URRT36NxXyfBJ uExA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s5rc3i7e; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7-v6si31605492pfg.264.2018.05.28.20.56.11; Mon, 28 May 2018 20:56:26 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s5rc3i7e; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934859AbeE1W6B (ORCPT + 99 others); Mon, 28 May 2018 18:58:01 -0400 Received: from mail-yw0-f195.google.com ([209.85.161.195]:45791 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934027AbeE1W56 (ORCPT ); Mon, 28 May 2018 18:57:58 -0400 Received: by mail-yw0-f195.google.com with SMTP id v190-v6so1876251ywa.12; Mon, 28 May 2018 15:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eUh5IgqQ9F+hlf1kV1apGJ/JZh7tdyCtuMLX01nMuLI=; b=s5rc3i7eB/sPRJR5SrN2FxWtnZ+XrWkrE3ScO8Ksd49gFAKt0tZDPIB0PtgJPdLegt s4YCEwbZmVyPhphPf9NwN2KXyGYMz+zC9CBojVR5r/Qg3uhte8M28CXtdj+csrwq/oPm l5MGi+BK1ZbhwyqVz9me/D0558kyn4u76dnQGUGJRBnaYPKzcokmGgcomRxv5IvJCtlO EKjmb9E742NsaUKlvsCz6S2LUMQ20N1iXZ4o1lJS4EWk6qzjSkSMASigvLTxHC8hmDf3 eJr49sZo3K1chPRZnwOcRqmJ/d0ov789HsY9bWn1sKugQWSq/jnbmljHdHxsjUKZY60A GT2Q== 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=eUh5IgqQ9F+hlf1kV1apGJ/JZh7tdyCtuMLX01nMuLI=; b=kNM732SjWHuMcsejHNWQ8eH8hrdjH9FzTDHZKNP2jWOy3O6Fkmsz+NvP6QwIrQM6Ga kf4Y8cqDW2951Oxuz/EPNXOQVmvcbWJfPoKdRxAjZ1LxFX6r5TdXMLI3Fomt8i54NI+B iK/hCpQGirNhlnJP3kHn8FWZfLit2s069un7QxnALMf+Z5TMci/jDUEHdqwn5d09Cr9A TtLkIBQMiG6V7mP7zl2wlUtZFTHP1DPpMtmAr0mX0emqmMLINfjJ672B5EFg1jOvcet1 e+/A83RBc5NvixYI/no7Hqn/51B8nLYwti6TKhfKK3AmNRfeMaaxSt9vOKz58WmRDyME kh4g== X-Gm-Message-State: ALKqPwf0O5ghSAZxLzCgjSCZ0k5RjLzCDUhXnTF41tQa7nyFvrhmcoNU jTMPkXYYTEMnXdon4ML+eEdOnLRSlpwv0uEGkio= X-Received: by 2002:a81:2403:: with SMTP id k3-v6mr8131776ywk.337.1527548277325; Mon, 28 May 2018 15:57:57 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:9808:0:0:0:0:0 with HTTP; Mon, 28 May 2018 15:57:56 -0700 (PDT) In-Reply-To: <31245206-038e-4a5b-a1a1-8877463556a7@hanno.de> References: <31245206-038e-4a5b-a1a1-8877463556a7@hanno.de> From: Roderick Colenbrander Date: Mon, 28 May 2018 15:57:56 -0700 Message-ID: Subject: Re: [PATCH] HID: Add support for 146b:0902 Bigben Interactive Kids' gamepad To: Hanno Zulla Cc: Jiri Kosina , Benjamin Tissoires , linux-input , linux-kernel@vger.kernel.org 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 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, 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]