Lines Matching +full:sig +full:- +full:dir
1 // SPDX-License-Identifier: GPL-2.0-only
6 * - a resolution (-r) of 3600 will report 3600 "ticks" in one full rotation
8 * - any other resolution will report N "ticks" in a full rotation with haptic
42 static void int_exit(int sig) in int_exit() argument
53 " -r N\t set the given resolution to the device (number of ticks per 360°)\n\n", in usage()
58 "- a resolution (-r) of 3600 will report 3600 'ticks' in one full rotation\n" in usage()
60 "- any other resolution will report N 'ticks' in a full rotation with haptic\n" in usage()
69 const char *str_id, *dir; in get_hid_id() local
74 snprintf(uevent, sizeof(uevent) - 1, "%s/uevent", path); in get_hid_id()
78 return -ENOENT; in get_hid_id()
82 dir = basename((char *)path); in get_hid_id()
84 str_id = dir + sizeof("0003:0001:0A37."); in get_hid_id()
92 .retval = -1, in set_haptic()
100 haptic_fd = bpf_program__fd(skel->progs.set_haptic); in set_haptic()
123 while ((opt = getopt(argc, argv, optstr)) != -1) { in main()
128 long l = -1; in main()
133 l = -1; in main()
138 "invalid r option %s - expecting a number\n", in main()
166 return -1; in main()
175 skel->struct_ops.surface_dial->hid_id = hid_id; in main()
179 fprintf(stderr, "can not load HID-BPF program: %m\n"); in main()
183 skel->data->resolution = resolution; in main()
184 skel->data->physical = (int)(resolution / 72); in main()
186 link = bpf_map__attach_struct_ops(skel->maps.surface_dial); in main()
188 fprintf(stderr, "can not attach HID-BPF program: %m\n"); in main()