Skip to content

Commit fcb6cb8

Browse files
flukejonesKyleGospo
authored andcommitted
[FOR-UPSTREAM] hid-asus-ally: mcu_version attribute
Add the mcu_version sysfs attribute so that userspace has a way to check the MCU FW version. Signed-off-by: Luke Jones <luke@ljones.dev>
1 parent 36f57a0 commit fcb6cb8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/hid/hid-asus-ally.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ static struct ally_drvdata {
377377
struct ally_gamepad_cfg *gamepad_cfg;
378378
struct ally_rgb_dev *led_rgb_dev;
379379
struct ally_rgb_data led_rgb_data;
380+
uint mcu_version;
380381
} drvdata;
381382

382383
/**
@@ -1192,13 +1193,21 @@ static ssize_t gamepad_mode_store(struct device *dev, struct device_attribute *a
11921193

11931194
DEVICE_ATTR_RW(gamepad_mode);
11941195

1196+
static ssize_t mcu_version_show(struct device *dev, struct device_attribute *attr, char *buf)
1197+
{
1198+
return sysfs_emit(buf, "%d\n", drvdata.mcu_version);
1199+
}
1200+
1201+
DEVICE_ATTR_RO(mcu_version);
1202+
11951203
/* ROOT LEVEL ATTRS *******************************************************************************/
11961204
static struct attribute *gamepad_device_attrs[] = {
11971205
&dev_attr_btn_mapping_reset.attr,
11981206
&dev_attr_gamepad_mode.attr,
11991207
&dev_attr_gamepad_apply_all.attr,
12001208
&dev_attr_gamepad_vibration_intensity.attr,
12011209
&dev_attr_gamepad_vibration_intensity_index.attr,
1210+
&dev_attr_mcu_version.attr,
12021211
NULL
12031212
};
12041213

0 commit comments

Comments
 (0)