18c2ecf20Sopenharmony_ciWhat: /sys/devices/.../state_synced 28c2ecf20Sopenharmony_ciDate: May 2020 38c2ecf20Sopenharmony_ciContact: Saravana Kannan <saravanak@google.com> 48c2ecf20Sopenharmony_ciDescription: 58c2ecf20Sopenharmony_ci The /sys/devices/.../state_synced attribute is only present for 68c2ecf20Sopenharmony_ci devices whose bus types or driver provides the .sync_state() 78c2ecf20Sopenharmony_ci callback. The number read from it (0 or 1) reflects the value 88c2ecf20Sopenharmony_ci of the device's 'state_synced' field. A value of 0 means the 98c2ecf20Sopenharmony_ci .sync_state() callback hasn't been called yet. A value of 1 108c2ecf20Sopenharmony_ci means the .sync_state() callback has been called. 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci Generally, if a device has sync_state() support and has some of 138c2ecf20Sopenharmony_ci the resources it provides enabled at the time the kernel starts 148c2ecf20Sopenharmony_ci (Eg: enabled by hardware reset or bootloader or anything that 158c2ecf20Sopenharmony_ci run before the kernel starts), then it'll keep those resources 168c2ecf20Sopenharmony_ci enabled and in a state that's compatible with the state they 178c2ecf20Sopenharmony_ci were in at the start of the kernel. The device will stop doing 188c2ecf20Sopenharmony_ci this only when the sync_state() callback has been called -- 198c2ecf20Sopenharmony_ci which happens only when all its consumer devices are registered 208c2ecf20Sopenharmony_ci and have probed successfully. Resources that were left disabled 218c2ecf20Sopenharmony_ci at the time the kernel starts are not affected or limited in 228c2ecf20Sopenharmony_ci any way by sync_state() callbacks. 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci 25