From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH v4 01/24] input: Add ff-memless-next module Date: Tue, 13 May 2014 23:38:06 -0700 Message-ID: <20140514063806.GC13621@core.coreip.homeip.net> References: <1398524543-15012-1-git-send-email-madcatxster@devoid-pointer.net> <1398524543-15012-2-git-send-email-madcatxster@devoid-pointer.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-pa0-f49.google.com ([209.85.220.49]:62723 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750716AbaENGiK (ORCPT ); Wed, 14 May 2014 02:38:10 -0400 Content-Disposition: inline In-Reply-To: <1398524543-15012-2-git-send-email-madcatxster@devoid-pointer.net> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Michal =?iso-8859-1?Q?Mal=FD?= Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, jkosina@suse.cz, elias.vds@gmail.com, anssi.hannula@iki.fi, simon@mungewell.org Hi Michal, On Sat, Apr 26, 2014 at 05:02:00PM +0200, Michal Mal=FD wrote: > + > +/** DEFINITION OF TERMS > + * > + * Combined effect - An effect whose force is a superposition of for= ces > + * generated by all effects that can be added toge= ther. > + * Only one combined effect can be playing at a ti= me. > + * Effects that can be added together to create a = combined > + * effect are FF_CONSTANT, FF_PERIODIC and FF_RAMP= =2E > + * Uncombinable effect - An effect that cannot be combined with anot= her effect. > + * All conditional effects - FF_DAMPER, FF_FRI= CTION, > + * FF_INERTIA and FF_SPRING are uncombinable. > + * Number of uncombinable effects playing simu= ltaneously > + * depends on the capabilities of the hardware= =2E > + * Rumble effect - An effect generated by device's rumble motors ins= tead of > + * force feedback actuators. > + * > + * > + * HANDLING OF UNCOMBINABLE EFFECTS > + * > + * Uncombinable effects cannot be combined together into just one ef= fect, at > + * least not in a clear and obvious manner. Therefore these effects = have to > + * be handled individually by ff-memless-next. Handling of these eff= ects is > + * left entirely to the hardware-specific driver, ff-memless-next me= rely > + * passes these effects to the hardware-specific driver at appropria= te time. > + * ff-memless-next provides the UPLOAD command to notify the hardwar= e-specific > + * driver that the userspace is about to request playback of an unco= mbinable > + * effect. The hardware-specific driver shall take all steps needed = to make > + * the device ready to play the effect when it receives the UPLOAD c= ommand. > + * The actual playback shall commence when START_UNCOMB command is r= eceived. > + * Opposite to the UPLOAD command is the ERASE command which tells > + * the hardware-specific driver that the playback has finished and t= hat > + * the effect will not be restarted. STOP_UNCOMB command tells > + * the hardware-specific driver that the playback shall stop but the= device > + * shall still be ready to resume the playback immediately. > + * > + * In case it is not possible to make the device ready to play an un= combinable > + * effect (all hardware effect slots are occupied), the hardware-spe= cific > + * driver may return an error when it receives an UPLOAD command. If= the This part concerns me. It seems to me that devices supporting "uncombinable" effects are in fact not memoryless devices and we should not be introducing this term here. If the goal is to work around limite= d number of effect slots in the devices by combining certain effects then it needs to be done at ff-core level as it will be potentially useful for all devices. > + * hardware-specific driver returns 0, the upload is considered succ= essful. > + * START_UNCOMB and STOP_UNCOMB commands cannot fail and the device = must always > + * start the playback of the requested effect if the UPLOAD command = of the > + * respective effect has been successful. ff-memless-next will never= send > + * a START/STOP_UNCOMB command for an effect that has not been uploa= ded > + * successfully, nor will it send an ERASE command for an effect tha= t is > + * playing (=3D has been started with START_UNCOMB command). > + */ > + > +enum mlnx_commands { > + /* Start or update a combined effect. This command is sent whenever > + * a FF_CONSTANT, FF_PERIODIC or FF_RAMP is started, stopped or > + * updated by userspace, when the applied envelopes are recalculate= d > + * or when periodic effects are recalculated. */ > + MLNX_START_COMBINED, > + /* Stop combined effect. This command is sent when all combinable > + * effects are stopped. */ > + MLNX_STOP_COMBINED, > + /* Start or update a rumble effect. This command is sent whenever > + * a FF_RUMBLE effect is started or when its magnitudes or directio= ns > + * change. */ > + MLNX_START_RUMBLE, > + /* Stop a rumble effect. This command is sent when all FF_RUMBLE > + * effects are stopped. */ > + MLNX_STOP_RUMBLE, > + /* Start or update an uncombinable effect. This command is sent > + * whenever an uncombinable effect is started or updated. */ Why do we have make a distinction between rumble and all other effects? --=20 Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html