From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414AbcAWP5P (ORCPT ); Sat, 23 Jan 2016 10:57:15 -0500 Received: from gitweb.devoid-pointer.net ([31.31.77.140]:34710 "EHLO smtp.devoid-pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752626AbcAWP5J convert rfc822-to-8bit (ORCPT ); Sat, 23 Jan 2016 10:57:09 -0500 From: Michal =?ISO-8859-1?Q?Mal=FD?= To: =?ISO-8859-1?Q?Bj=F8rn?= Mork Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, jikos@kernel.org, elias.vds@gmail.com, edwin@velds.nl, simon@mungewell.org Subject: Re: [PATCH 0/2] Add a skeleton module to perform a basic initialization on certain USB devices Date: Sat, 23 Jan 2016 16:56:27 +0100 Message-ID: <6032606.IBdJ88hxWq@the-raza> User-Agent: KMail/5.1.1 (Linux/4.3.3-3-ARCH; KDE/5.18.0; x86_64; ; ) In-Reply-To: <87zivwbh07.fsf@nemi.mork.no> References: <1453545311-5721-1-git-send-email-madcatxster@devoid-pointer.net> <87zivwbh07.fsf@nemi.mork.no> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On sobota 23. ledna 2016 13:46:32 CET Bjørn Mork wrote: > Michal Malý writes: > > This mini series adds a simple skeleton module whose only purpose is to > > bring devices that at first appear as a generic USB device into another > > mode that can be handled by a more specific subsystem. > > > > This patch was originally requested by Dmitry, reasoning that loading the > > entire xpad module just to switch a Logitech G920 wheel into HID mode is > > excessive and does not make much sense. > > > > The module can be extended to handle any other USB device that might > > require such a switch. > > Can this switching be done in userspace? That's what we normally do, ref > usb_modeswitch. I briefly considered leaving the switch up to the userspace and handling the device in the kernel only once it's been switched. I am however uncertain how to advertise this to the users. Writing a tiny app that would currently handle just one device seems like an overkill, abusing usb_modeswitch seems counter- intuitive as it's purpose is to handle various USB modems. Having a tiny module in the kernel looks like the most straightforward thing to do as far as user experience is concerned. I would not object to deferring the switch to userspace as long as there is an easy way how to communicate the need for a small switching tool to the users. Michal