HID device initiated reset and need for device reconfiguration in linux driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dmitry, Hi Benjamin,

I am wondering if there is some mechanism already present in the linux
kernel that would trigger
some (re)configration process once a (device initiated?) reset has
been detected for a HID device.

My precise scenario is a case in which a haptic device decides to
reset itself for some reason
after it has been already probed. The default device mode is autonomous mode.
However, since I would like to add kernel support, the driver itself
would believe the device is
in manual mode, and either it would generate output reports itself or
would allow the user space
to do so.
This might result in doubled haptic feedback (from the device itself
and the kernel/user initiated one).

I can see that in drivers/hid/i2c-hid/i2c-hid-core.c that there is a
point where we realise that a reset
has happened (interrupt handler case where response size is actually
0). I would guess it could
be a good place to issue some callback that would trigger all
necessary reconfiguration (in my case
it would be putting the device back into manual mode).
I suppose we could add something like 'int (*reset)(struct hid_device
*hdev)' to 'struct hid_driver'
definition, then set it if applicable in a relevant hid-* driver, so
that we could issue it in case of reset,
specifically the device initiated reset.

It does not seem a problem specific to haptic devices, so I am
wondering if that would be a good
approach, or, perhaps, there is some kind of already existing
workaround for such situations.

Any advice would be welcome :)

Regards,
Angela



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux