diff options
| author | Jiri Kosina <jkosina@suse.com> | 2026-04-16 21:07:13 +0200 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2026-04-16 21:07:13 +0200 |
| commit | 51cc1c427461d6c989126971d2fd5ef70216ade3 (patch) | |
| tree | e553d04667977040ea70f1bd183e5c75954af6c6 /include/linux | |
| parent | a3922c8393290da840d4a5dd7313a7e44d918b08 (diff) | |
| parent | 19acad732afbfb23bd0d4d5830d7553889e739f8 (diff) | |
Merge branch 'for-7.1/lenovo-v2' into for-linus
- new driver for Lenovo Legion Go / S devices (Derek J. Clark)
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/device.h | 46 | ||||
| -rw-r--r-- | include/linux/hid.h | 1 |
2 files changed, 47 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index e65d564f01cd..d2e6d340f6e3 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -190,6 +190,22 @@ ssize_t device_show_string(struct device *dev, struct device_attribute *attr, struct device_attribute dev_attr_##_name = __ATTR_RW_MODE(_name, 0600) /** + * DEVICE_ATTR_RW_NAMED - Define a read-write device attribute with a sysfs name + * that differs from the function name. + * @_name: Attribute function preface + * @_attrname: Attribute name as it wil be exposed in the sysfs. + * + * Like DEVICE_ATTR_RW(), but allows for reusing names under separate paths in + * the same driver. + */ +#define DEVICE_ATTR_RW_NAMED(_name, _attrname) \ + struct device_attribute dev_attr_##_name = { \ + .attr = { .name = _attrname, .mode = 0644 }, \ + .show = _name##_show, \ + .store = _name##_store, \ + } + +/** * DEVICE_ATTR_RO - Define a readable device attribute. * @_name: Attribute name. * @@ -208,6 +224,21 @@ ssize_t device_show_string(struct device *dev, struct device_attribute *attr, struct device_attribute dev_attr_##_name = __ATTR_RO_MODE(_name, 0400) /** + * DEVICE_ATTR_RO_NAMED - Define a read-only device attribute with a sysfs name + * that differs from the function name. + * @_name: Attribute function preface + * @_attrname: Attribute name as it wil be exposed in the sysfs. + * + * Like DEVICE_ATTR_RO(), but allows for reusing names under separate paths in + * the same driver. + */ +#define DEVICE_ATTR_RO_NAMED(_name, _attrname) \ + struct device_attribute dev_attr_##_name = { \ + .attr = { .name = _attrname, .mode = 0444 }, \ + .show = _name##_show, \ + } + +/** * DEVICE_ATTR_WO - Define an admin-only writable device attribute. * @_name: Attribute name. * @@ -217,6 +248,21 @@ ssize_t device_show_string(struct device *dev, struct device_attribute *attr, struct device_attribute dev_attr_##_name = __ATTR_WO(_name) /** + * DEVICE_ATTR_WO_NAMED - Define a read-only device attribute with a sysfs name + * that differs from the function name. + * @_name: Attribute function preface + * @_attrname: Attribute name as it wil be exposed in the sysfs. + * + * Like DEVICE_ATTR_WO(), but allows for reusing names under separate paths in + * the same driver. + */ +#define DEVICE_ATTR_WO_NAMED(_name, _attrname) \ + struct device_attribute dev_attr_##_name = { \ + .attr = { .name = _attrname, .mode = 0200 }, \ + .store = _name##_store, \ + } + +/** * DEVICE_ULONG_ATTR - Define a device attribute backed by an unsigned long. * @_name: Attribute name. * @_mode: File mode. diff --git a/include/linux/hid.h b/include/linux/hid.h index fb1a3f3ad9fa..442a80d79e89 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -721,6 +721,7 @@ struct hid_device { char name[128]; /* Device name */ char phys[64]; /* Device physical location */ char uniq[64]; /* Device unique identifier (serial #) */ + u64 firmware_version; /* Firmware version */ void *driver_data; |
