mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
hidpp10: convert get_led_status to a proper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -299,13 +299,14 @@ hidpp10_toggle_individual_feature(struct ratbag_device *device, struct hidpp10_d
|
||||
} \
|
||||
}
|
||||
|
||||
static int
|
||||
hidpp10_get_led_status(struct ratbag_device *device, struct hidpp10_device *dev)
|
||||
int
|
||||
hidpp10_get_led_status(struct ratbag_device *device,
|
||||
struct hidpp10_device *dev,
|
||||
bool led[4])
|
||||
{
|
||||
unsigned idx = dev->index;
|
||||
union hidpp10_message led_status = CMD_LED_STATUS(idx, GET_REGISTER_REQ);
|
||||
int res;
|
||||
int led[4];
|
||||
|
||||
res = hidpp10_request_command(device, &led_status);
|
||||
if (res)
|
||||
@@ -611,7 +612,7 @@ hidpp10_get_device_info(struct ratbag_device *device, struct hidpp10_device *dev
|
||||
hidpp10_get_hidpp_notifications(device, dev);
|
||||
|
||||
hidpp10_get_current_resolution(device, dev, &dev->xres, &dev->yres);
|
||||
hidpp10_get_led_status(device, dev);
|
||||
hidpp10_get_led_status(device, dev, dev->led);
|
||||
hidpp10_get_optical_sensor_settings(device, dev);
|
||||
hidpp10_get_usb_refresh_rate(device, dev);
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#define HIDPP_10_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "hidpp-generic.h"
|
||||
#include "libratbag.h"
|
||||
@@ -45,6 +46,7 @@ struct hidpp10_device {
|
||||
uint8_t build;
|
||||
uint16_t xres, yres;
|
||||
uint16_t refresh_rate;
|
||||
bool led[4];
|
||||
};
|
||||
|
||||
struct _hidpp10_message {
|
||||
@@ -71,6 +73,13 @@ int hidpp10_disconnect(struct ratbag_device *device, int idx);
|
||||
void hidpp10_list_devices(struct ratbag_device *device);
|
||||
int hidpp10_get_device_from_wpid(struct ratbag_device *device, uint16_t wpid, struct hidpp10_device *dev);
|
||||
int hidpp10_get_device_from_idx(struct ratbag_device *device, int idx, struct hidpp10_device *dev);
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* 0x51: LED Status */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int
|
||||
hidpp10_get_led_status(struct ratbag_device *device,
|
||||
struct hidpp10_device *dev,
|
||||
bool led[4]);
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* 0x63: Current Resolution */
|
||||
|
||||
Reference in New Issue
Block a user