Re: [v2] input: drv260x: Add TI drv260x haptics driver

From: Murphy, Dan
Date: Mon Jul 28 2014 - 17:21:45 EST


Dmitry

On 07/28/2014 12:59 PM, simon@xxxxxxxxxxxxx wrote:
>
>>> The initial driver supports the devices
>>> real time playback mode. But the device
>>> has additional wave patterns in ROM.
>>
>> As it presented the device appears to be a memoryless device, however
>> you present it to the rest of the system as if it can support playback
>> of multiple effects simultaneously, which is incorrect.
>>
>> My guess that you need to engage the memoryless input library to schedule
>> handling multiple effects for your device, including ramping up, ramping
>> down, stopping playback when effects runs out, etc.
>
> Hi Dan,
> Elias and Michal (cc'ed) are working on a kernel/userland library to
> handle sending multiple force feedback signals to 'simple' devices,
> perhaps you should engage with them.
>
> Simon
>
>

OK I looked at the memless devices and got it to work.
Don't know why replay.length is always 0 but at least I got the
magnitude. It seems that the input framework expects the user space
to manage the on/off of the vibrator in RUMBLE mode. Unless
I missed something while going through the code.

This family of devices has the ability to do real time playback,
play an index in a pre-programmed library and have feedback waveforms programmed
into the device to be played.

The RTP mode is covered in this patch set. But I am also interested in
setting the pre-programmed libraries as well as setting my own custom waveform.

I believe the custom is handled via the FF_PERIODIC with the waveform being FF_CUSTOM.
I am not really a big fan of mixing the FF_CUSTOM in the periodic. This could be broken
out so that the driver can handle the custom waveforms.

But I am not sure with the existing framework we can set a library or index of the
library. (Short of adding sysfs nodes which I don't want to do)

My thought would be to add FF_LIBRARY as a force feedback type and create a structure like

struct ff_library {
__u16 library;
__u16 index;
};

to be able to program the driver to play a certain library/index combo when play is called.
Of course the driver would have to set the max libraries and max indices within the library.

Let me know if this is something we can add and I can RFC a patch for it.

Dan

P.S. Got the P.S. will use devm as suggested.

--
------------------
Dan Murphy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/