--- zzzz-none-000/linux-5.15.111/drivers/usb/storage/scsiglue.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/drivers/usb/storage/scsiglue.c 2024-02-07 10:23:22.000000000 +0000 @@ -588,8 +588,37 @@ } static DEVICE_ATTR_RW(max_sectors); +#if defined (CONFIG_AVM_USB_PM) +/* Output routine for the sysfs max_spinup_ms file */ +static ssize_t max_spinup_ms_show(struct device *dev, struct device_attribute *attr, char *buf) +{ + struct us_data *us = host_to_us(dev_to_shost(dev)); + + return sprintf(buf, "%u\n", us->max_spinup_ms); +} + +/* Input routine for the sysfs max_sectors file */ +static ssize_t max_spinup_ms_store(struct device *dev, struct device_attribute *attr, const char *buf, + size_t count) +{ + struct us_data *us = host_to_us(dev_to_shost(dev)); + unsigned int ms; + + if (sscanf(buf, "%u", &ms) > 0) { + us->max_spinup_ms = ms; + return count; + } + return -EINVAL; +} + +static DEVICE_ATTR_RW(max_spinup_ms); +#endif + static struct device_attribute *sysfs_device_attr_list[] = { &dev_attr_max_sectors, +#if defined (CONFIG_AVM_USB_PM) + &dev_attr_max_spinup_ms, +#endif NULL, };