mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
input/ff: add control operation to force feedback driver interface
adds a generic control operation to the FF driver interface. Signed-off-by: fangpeina <fangpeina@xiaomi.com>
This commit is contained in:
@@ -429,7 +429,15 @@ static int ff_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if (upper->lower->control)
|
||||||
|
{
|
||||||
|
ret = upper->lower->control(upper->lower, cmd, arg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ret = -ENOTTY;
|
ret = -ENOTTY;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -451,6 +451,17 @@ struct ff_lowerhalf_s
|
|||||||
CODE int (*calibrate)(FAR struct ff_lowerhalf_s *lower,
|
CODE int (*calibrate)(FAR struct ff_lowerhalf_s *lower,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
|
|
||||||
|
/* Called to set special configuration for the force feedback device,
|
||||||
|
* such as changing custom mode, setting custom resolution, reset, etc.
|
||||||
|
* All commands are parsed and implemented by lower half driver.
|
||||||
|
* Note: cmd - special command for device configuration, arg - parameters
|
||||||
|
* associated with the command. Returned value: Zero (OK) on success;
|
||||||
|
* -ENOTTY on failure.
|
||||||
|
*/
|
||||||
|
|
||||||
|
CODE int (*control)(FAR struct ff_lowerhalf_s *lower,
|
||||||
|
int cmd, unsigned long arg);
|
||||||
|
|
||||||
/* The bitmap of force feedback capabilities truly supported by device */
|
/* The bitmap of force feedback capabilities truly supported by device */
|
||||||
|
|
||||||
unsigned long ffbit[BITS_TO_LONGS(FF_CNT)];
|
unsigned long ffbit[BITS_TO_LONGS(FF_CNT)];
|
||||||
|
|||||||
Reference in New Issue
Block a user