+
     Gi  c                   s    ^RI Ht ^RI5 ^ RIt^ RIHt ^ RIt^ RIt]P                  P                  4       t ! R R]P                  4      tR# )i   )base)Z*N)commandsc                   s   a  ] tR t^
t o RtR tR t]R 4       tR t	R t
R t]! RR	R
7      R 4       t]! R4      RR l4       tRtV tR# )	USBPlugina  
Sets autosuspend timeout of USB devices to the value specified by the
[option]`autosuspend` option in seconds. If the [option]`devices`
option is specified, the [option]`autosuspend` option applies to only
the USB devices specified, otherwise it applies to all USB devices.

The value `0` means that autosuspend is disabled.

.Turn off USB autosuspend for USB devices `1-1` and `1-2`
====
----
[usb]
devices=1-1,1-2
autosuspend=0
----
====
c                s   R V n         \        4       V n        \        4       V n        V P                  P                  R4      P                  RR4       F(  pV P                  P                  VP                  4       K*  	  \        4       V n
        R# )TusbZDEVTYPEZ
usb_deviceN)_devices_supportedZset_free_devices_assigned_devices_hardware_inventoryZget_devicesZmatch_propertyZaddZsys_namer   _cmdselfdevices   & =/usr/lib/python3.14/site-packages/tuned/plugins/plugin_usb.py_init_devicesZUSBPlugin._init_devices   sk     $u$5$((44U;JJ9Vbcf&//* d j$)    c                sb    V Uu. uF  q P                   P                  R V4      NK   	  up# u upi )r   )r   Z
get_device)r
   ZdevicesZxs   && r   _get_device_objectsZUSBPlugin._get_device_objects'   s+    AH	IA
"
"
-
-eQ
7	II	Is   $,c                s
    R R/# )autosuspendN )r
   s   &r   _get_config_optionsZUSBPlugin._get_config_options*   s     4
 r   c                s"    R Vn         RVn        R# )TFN)Z_has_static_tuningZ_has_dynamic_tuningr
   instance   &&r   _instance_initZUSBPlugin._instance_init0   s     $(!&(r   c                s    R # )Nr   r   r   r   _instance_cleanupZUSBPlugin._instance_cleanup4   s    r   c                s    R V,          # )z)/sys/bus/usb/devices/%s/power/autosuspendr   r	   r   r   _autosuspend_sysfileZUSBPlugin._autosuspend_sysfile7   s    	4v	==r   r   T)Z
per_devicec                s    V P                  V4      pVf   R # V'       d   RMRpV'       gH   V P                  V4      pV P                  P                  YV'       d   \        P
                  .MRR7       V# )NZ1Z0FZno_error)Z_option_boolr   r   Zwrite_to_fileerrnoZENOENT)	r
   Zvaluer   r   ZsimZremoveZenableZvalsys_files	   &&&&&&   r   _set_autosuspendZUSBPlugin._set_autosuspend:   sa    U#&^
3#	''/8998!'~U  4	*r   c                sx    V P                  V4      pV P                  P                  WCR 7      P                  4       # )r   )r   r   Z	read_fileZstrip)r
   r   r   Zignore_missingr   s   &&&& r   _get_autosuspendZUSBPlugin._get_autosuspendG   s3    &&v.(			X		?	E	E	GGr   )r   r   r   r   N)F)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   r   Zclassmethodr   r   r   r   Zcommand_setr   Zcommand_getr   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r   
   sn     $J  
'> m-
 .
 mH Hr   r   )Z r    Z
decoratorsZ
tuned.logsZtunedZtuned.utils.commandsr   Zglobr   ZlogsZgetZlogZPluginr   r   r   r   <module>r      s;       )  jjnn@H @Hr   