forked from drath/libratbag
drivers: add a fallback for fetching the SVG name
In case the udev property is not present, we might want to query the driver for the SVG name. This is useful for driver-test as there is no udev device attached to it, and for hidpp20 as we have auto-detection. We should then be able to implement this in hidpp20 also so that the name gets automatically created. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -170,6 +170,13 @@ test_write_led(struct ratbag_led *led,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char* test_get_svg_name(const struct ratbag_device *device)
|
||||
{
|
||||
struct ratbag_test_device *d = ratbag_get_drv_data(device);
|
||||
|
||||
return d->svg;
|
||||
}
|
||||
|
||||
static int
|
||||
test_fake_probe(struct ratbag_device *device)
|
||||
{
|
||||
@@ -211,6 +218,7 @@ struct ratbag_driver test_driver = {
|
||||
.probe = test_fake_probe,
|
||||
.test_probe = test_probe,
|
||||
.remove = test_remove,
|
||||
.get_svg_name = test_get_svg_name,
|
||||
.read_profile = test_read_profile,
|
||||
.write_profile = test_write_profile,
|
||||
.set_active_profile = test_set_active_profile,
|
||||
|
||||
Reference in New Issue
Block a user