+static int in_set_blocking(int is_blocking)
+{
+ int i, ret;
+
+ /* have_async_devs means we will have to do all reads async anyway.. */
+ if (!in_have_async_devs) {
+ for (i = 0; i < in_dev_count; i++) {
+ if (in_devices[i].probed)
+ DRV(in_devices[i].drv_id).set_config(in_devices[i].drv_data,
+ IN_CFG_BLOCKING, is_blocking);
+ }
+ }
+
+ menu_key_state = 0;
+
+ /* flush events */
+ do {
+ ret = in_update_keycode(NULL, NULL, 0);
+ } while (ret >= 0);
+
+ return 0;
+}
+
+int in_set_config(int dev_id, int what, const void *val, int size)
+{
+ const int *ival = val;
+ in_dev_t *dev;
+
+ if (what == IN_CFG_BLOCKING)
+ return in_set_blocking(*ival);
+
+ if (dev_id < 0 || dev_id >= IN_MAX_DEVS)
+ return -1;
+
+ dev = &in_devices[dev_id];
+ if (what == IN_CFG_KEY_NAMES) {
+ const char * const *names = val;
+ int count = size / sizeof(names[0]);
+
+ if (count < dev->key_count) {
+ lprintf("input: set_key_names: not enough keys\n");
+ return -1;
+ }
+
+ dev->key_names = names;
+ return 0;
+ }
+
+ return DRV(dev->drv_id).set_config(dev->drv_data, what, *ival);
+}
+