diff --git a/ratbagd/ratbagd-device.c b/ratbagd/ratbagd-device.c index b025b7f1..15d457ff 100644 --- a/ratbagd/ratbagd-device.c +++ b/ratbagd/ratbagd-device.c @@ -248,7 +248,6 @@ ratbagd_device_get_capabilities(sd_bus *bus, RATBAG_DEVICE_CAP_QUERY_CONFIGURATION, RATBAG_DEVICE_CAP_RESOLUTION, RATBAG_DEVICE_CAP_PROFILE, - RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE, RATBAG_DEVICE_CAP_BUTTON, RATBAG_DEVICE_CAP_BUTTON_KEY, RATBAG_DEVICE_CAP_BUTTON_MACROS, diff --git a/src/driver-hidpp10.c b/src/driver-hidpp10.c index 64d0712d..d84f87b1 100644 --- a/src/driver-hidpp10.c +++ b/src/driver-hidpp10.c @@ -504,7 +504,6 @@ hidpp10drv_fill_from_profile(struct ratbag_device *device, struct hidpp10_device if (dev->profile_type != HIDPP10_PROFILE_UNKNOWN) { ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE); - ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_KEY); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_MACROS); diff --git a/src/driver-logitech-g300.c b/src/driver-logitech-g300.c index 4de4a9b8..1c25986b 100644 --- a/src/driver-logitech-g300.c +++ b/src/driver-logitech-g300.c @@ -500,7 +500,6 @@ logitech_g300_probe(struct ratbag_device *device) ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE); - ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_KEY); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_MACROS); diff --git a/src/driver-logitech-g600.c b/src/driver-logitech-g600.c index 18a0c869..6d8f6a84 100644 --- a/src/driver-logitech-g600.c +++ b/src/driver-logitech-g600.c @@ -497,7 +497,6 @@ logitech_g600_probe(struct ratbag_device *device) ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE); - ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_KEY); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_MACROS); diff --git a/src/libratbag-enums.h b/src/libratbag-enums.h index 0e5510dc..0feaae0b 100644 --- a/src/libratbag-enums.h +++ b/src/libratbag-enums.h @@ -110,15 +110,6 @@ enum ratbag_device_capability { */ RATBAG_DEVICE_CAP_PROFILE = 200, - /** - * The device can switch between hardware profiles. - * A device with this capability can store multiple profiles in the - * hardware and provides the ability to switch between the profiles, - * possibly with a button. - * Devices without this capability will only have a single profile. - */ - RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE, - /** * The device provides read and/or write access to one or more * buttons. diff --git a/src/libratbag.c b/src/libratbag.c index 2d7cd052..58227ee9 100644 --- a/src/libratbag.c +++ b/src/libratbag.c @@ -720,7 +720,6 @@ ratbag_device_init_profiles(struct ratbag_device *device, if (num_profiles > 1) { ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE); - ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE); /* having more than one profile means we can remap the buttons * at least */ @@ -1001,8 +1000,8 @@ ratbag_profile_set_active(struct ratbag_profile *profile) struct ratbag_profile *p; int rc; - if (!ratbag_device_has_capability(device, RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE)) - return RATBAG_ERROR_CAPABILITY; + if (device->num_profiles == 1) + return RATBAG_SUCCESS; assert(device->driver->set_active_profile); rc = device->driver->set_active_profile(device, profile->index); diff --git a/src/libratbag.h b/src/libratbag.h index f4395938..3bc5f49f 100644 --- a/src/libratbag.h +++ b/src/libratbag.h @@ -95,8 +95,7 @@ struct ratbag_device; * @ingroup profile * @struct ratbag_profile * - * A handle to a profile context on devices with the @ref - * RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE capability. + * A handle to a profile context on devices. * This struct is refcounted, use ratbag_profile_ref() and * ratbag_profile_unref(). */ diff --git a/tools/ratbagctl.in b/tools/ratbagctl.in index 24b2b614..f9f933bc 100755 --- a/tools/ratbagctl.in +++ b/tools/ratbagctl.in @@ -258,7 +258,6 @@ def print_device(d, level): caps = {RatbagdDevice.CAP_RESOLUTION: "resolution", RatbagdDevice.CAP_PROFILE: "profile", RatbagdDevice.CAP_BUTTON: "button", - RatbagdDevice.CAP_PROFILE_SWITCHABLE: "switchable-profile", RatbagdDevice.CAP_BUTTON_KEY: "button-keys", RatbagdDevice.CAP_BUTTON_MACROS: "button-macros", RatbagdDevice.CAP_QUERY_CONFIGURATION: "query-configuration", diff --git a/tools/ratbagd.py b/tools/ratbagd.py index 36ed0b4c..71814df3 100644 --- a/tools/ratbagd.py +++ b/tools/ratbagd.py @@ -321,7 +321,6 @@ class RatbagdDevice(_RatbagdDBus): CAP_QUERY_CONFIGURATION = 1 CAP_RESOLUTION = 100 CAP_PROFILE = 200 - CAP_PROFILE_SWITCHABLE = 201 CAP_BUTTON = 300 CAP_BUTTON_KEY = 301 CAP_BUTTON_MACROS = 302