Lines Matching +full:power +full:- +full:managed

1 // SPDX-License-Identifier: GPL-2.0
3 * device.h - generic, centralized driver model
5 * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
6 * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de>
7 * Copyright (c) 2008-2009 Novell Inc.
9 * See Documentation/driver-api/driver-model/ for more information.
51 * struct subsys_interface - interfaces to device functions
83 * This identifies the device type and carries type-specific
208 /* managed devm_k.alloc/kfree for device drivers */
271 * devm_alloc_percpu - Resource-managed alloc_percpu
272 * @dev: Device to allocate per-cpu memory for
273 * @type: Type to allocate per-cpu memory for
275 * Managed alloc_percpu. Per-cpu memory allocated with this function is
300 * enum device_link_state - Device link states.
309 DL_STATE_NONE = -1,
326 * MANAGED: The core tracks presence of supplier/consumer drivers (internal).
341 * enum dl_dev_state - Device driver presence tracking information.
355 * struct dev_links_info - Device data related to device links.
369 * struct device - The basic device structure
372 * controller. If parent is NULL, the device, is a top-level device,
376 * @kobj: A top-level, abstract class from which other classes are derived.
379 * This identifies the device type and carries type-specific
389 * to board-specific structures describing devices and how they
393 * minimizes board-specific #ifdefs in drivers.
396 * @power: For device power management.
397 * See Documentation/driver-api/pm/devices.rst for details.
400 * along with subsystem-level and driver-level callbacks.
403 * See Documentation/driver-api/pinctl.rst for details.
410 * hardware supports 64-bit addresses for consistent allocations
420 * @archdata: For arch-specific additions.
438 * @of_node_reused: Set if the device-tree node is shared with an ancestor
444 * architecture supports non-coherent devices.
446 * streaming DMA operations (->map_* / ->unmap_* / ->sync_*),
448 * for dma allocations. This flag is managed by the dma ops
449 * instance from ->dma_supported.
457 * a higher-level representation of the device.
483 struct dev_pm_info power; member
568 * struct device_link - Device link representation.
576 * @rpm_active: Whether or not the consumer device is runtime-PM-active.
607 * device_iommu_mapped - Returns true when the device DMA is translated
613 return (dev->iommu_group != NULL); in device_iommu_mapped()
622 if (dev->init_name) in dev_name()
623 return dev->init_name; in dev_name()
625 return kobject_name(&dev->kobj); in dev_name()
629 * dev_bus_name - Return a device's bus/class name, if at all possible
637 return dev->bus ? dev->bus->name : (dev->class ? dev->class->name : ""); in dev_bus_name()
645 return dev->numa_node; in dev_to_node()
649 dev->numa_node = node; in set_dev_node()
664 return dev->msi_domain; in dev_get_msi_domain()
673 dev->msi_domain = d; in dev_set_msi_domain()
679 return dev->driver_data; in dev_get_drvdata()
684 dev->driver_data = data; in dev_set_drvdata()
689 return dev ? dev->power.subsys_data : NULL; in dev_to_psd()
694 return dev->kobj.uevent_suppress; in dev_get_uevent_suppress()
699 dev->kobj.uevent_suppress = val; in dev_set_uevent_suppress()
704 return dev->kobj.state_in_sysfs; in device_is_registered()
709 if (!dev->power.is_prepared) in device_enable_async_suspend()
710 dev->power.async_suspend = true; in device_enable_async_suspend()
715 if (!dev->power.is_prepared) in device_disable_async_suspend()
716 dev->power.async_suspend = false; in device_disable_async_suspend()
721 return !!dev->power.async_suspend; in device_async_suspend_enabled()
726 return dev->power.no_pm; in device_pm_not_required()
731 dev->power.no_pm = true; in device_set_pm_not_required()
737 dev->power.syscore = val; in dev_pm_syscore_device()
743 dev->power.driver_flags = flags; in dev_pm_set_driver_flags()
748 return !!(dev->power.driver_flags & flags); in dev_pm_test_driver_flags()
753 mutex_lock(&dev->mutex); in device_lock()
758 return mutex_lock_interruptible(&dev->mutex); in device_lock_interruptible()
763 return mutex_trylock(&dev->mutex); in device_trylock()
768 mutex_unlock(&dev->mutex); in device_unlock()
773 lockdep_assert_held(&dev->mutex); in device_lock_assert()
780 return dev->of_node; in dev_of_node()
787 if (dev->driver && dev->driver->sync_state) in dev_has_sync_state()
789 if (dev->bus && dev->bus->sync_state) in dev_has_sync_state()
820 return dev->bus && dev->bus->offline && dev->bus->online; in device_supports_offline()
834 if (dev->bus && dev->bus->num_vf) in dev_num_vf()
835 return dev->bus->num_vf(dev); in dev_num_vf()
852 return dev->platform_data; in dev_get_platdata()
911 * Platform "fixup" functions - allow the platform to have their say
922 * get_device - atomically increment the reference count for the device.
935 /* drivers/base/power/shutdown.c */
954 MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
956 MODULE_ALIAS("char-major-" __stringify(major) "-*")