Lines Matching refs:dev
20 static int install_force_release(sd_device *dev, const unsigned *release, unsigned release_count) { in install_force_release() argument
29 assert(dev); in install_force_release()
32 r = sd_device_get_parent_with_subsystem_devtype(dev, "serio", NULL, &atkbd); in install_force_release()
34 return log_device_error_errno(dev, r, "Failed to get serio parent: %m"); in install_force_release()
58 static int map_keycode(sd_device *dev, int fd, int scancode, const char *keycode) { in map_keycode() argument
75 … return log_device_error_errno(dev, r, "Failed to parse key identifier '%s': %m", keycode); in map_keycode()
81 log_device_debug(dev, "keyboard: mapping scan code %d (0x%x) to key code %d (0x%x)", in map_keycode()
85 …return log_device_error_errno(dev, errno, "Failed to call EVIOCSKEYCODE with scan code 0x%x, and k… in map_keycode()
110 static int override_abs(sd_device *dev, int fd, unsigned evcode, const char *value) { in override_abs() argument
115 return log_device_error_errno(dev, errno, "Failed to call EVIOCGABS"); in override_abs()
123 return log_device_error_errno(dev, SYNTHETIC_ERRNO(EINVAL), in override_abs()
126 …log_device_debug(dev, "keyboard: %x overridden with %"PRIi32"/%"PRIi32"/%"PRIi32"/%"PRIi32"/%"PRIi… in override_abs()
129 return log_device_error_errno(dev, errno, "Failed to call EVIOCSABS"); in override_abs()
134 static int set_trackpoint_sensitivity(sd_device *dev, const char *value) { in set_trackpoint_sensitivity() argument
139 assert(dev); in set_trackpoint_sensitivity()
143 r = sd_device_get_parent_with_subsystem_devtype(dev, "serio", NULL, &pdev); in set_trackpoint_sensitivity()
145 return log_device_error_errno(dev, r, "Failed to get serio parent: %m"); in set_trackpoint_sensitivity()
149 …return log_device_error_errno(dev, r, "Failed to parse POINTINGSTICK_SENSITIVITY '%s': %m", value); in set_trackpoint_sensitivity()
151 …return log_device_error_errno(dev, SYNTHETIC_ERRNO(ERANGE), "POINTINGSTICK_SENSITIVITY %d outside … in set_trackpoint_sensitivity()
157 … return log_device_error_errno(dev, r, "Failed to write 'sensitivity' attribute: %m"); in set_trackpoint_sensitivity()
162 static int builtin_keyboard(sd_device *dev, sd_netlink **rtnl, int argc, char *argv[], bool test) { in builtin_keyboard() argument
169 r = sd_device_get_devname(dev, &node); in builtin_keyboard()
171 return log_device_error_errno(dev, r, "Failed to get device name: %m"); in builtin_keyboard()
173 FOREACH_DEVICE_PROPERTY(dev, key, value) in builtin_keyboard()
181 … log_device_warning_errno(dev, r, "Failed to parse scan code from \"%s\", ignoring: %m", key); in builtin_keyboard()
198 fd = sd_device_open(dev, O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY); in builtin_keyboard()
200 … return log_device_error_errno(dev, fd, "Failed to open device '%s': %m", node); in builtin_keyboard()
203 (void) map_keycode(dev, fd, scancode, keycode); in builtin_keyboard()
210 … log_device_warning_errno(dev, r, "Failed to parse EV_ABS code from \"%s\", ignoring: %m", key); in builtin_keyboard()
215 fd = sd_device_open(dev, O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY); in builtin_keyboard()
217 … return log_device_error_errno(dev, fd, "Failed to open device '%s': %m", node); in builtin_keyboard()
226 … return log_device_error_errno(dev, errno, "Failed to set EVIOCGBIT"); in builtin_keyboard()
230 … log_device_warning(dev, "EVDEV_ABS override set but no EV_ABS present on device"); in builtin_keyboard()
236 (void) override_abs(dev, fd, evcode, value); in builtin_keyboard()
238 (void) set_trackpoint_sensitivity(dev, value); in builtin_keyboard()
242 (void) install_force_release(dev, release, release_count); in builtin_keyboard()