drivers/net/wwan/iosm/iosm_ipc_pm.h

Source file repositories/reference/linux-study-clean/drivers/net/wwan/iosm/iosm_ipc_pm.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wwan/iosm/iosm_ipc_pm.h
Extension
.h
Size
6991 bytes
Lines
208
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct iosm_pm {
	struct iosm_pcie *pcie;
	struct device *dev;
	enum ipc_mem_host_pm_state host_pm_state;
	unsigned long host_sleep_pend;
	struct completion host_sleep_complete;
	union ipc_pm_cond pm_cond;
	enum ipc_mem_dev_pm_state ap_state;
	enum ipc_mem_dev_pm_state cp_state;
	u32 device_sleep_notification;
	u8 pending_hpda_update:1;
};

/**
 * enum ipc_pm_unit - Power management units.
 * @IPC_PM_UNIT_IRQ:	IRQ towards CP
 * @IPC_PM_UNIT_HS:	Host Sleep for converged protocol
 * @IPC_PM_UNIT_LINK:	Link state controlled by CP.
 */
enum ipc_pm_unit {
	IPC_PM_UNIT_IRQ,
	IPC_PM_UNIT_HS,
	IPC_PM_UNIT_LINK,
};

/**
 * ipc_pm_init - Allocate power management component
 * @ipc_protocol:	Pointer to iosm_protocol structure
 */
void ipc_pm_init(struct iosm_protocol *ipc_protocol);

/**
 * ipc_pm_deinit - Free power management component, invalidating its pointer.
 * @ipc_protocol:	Pointer to iosm_protocol structure
 */
void ipc_pm_deinit(struct iosm_protocol *ipc_protocol);

/**
 * ipc_pm_dev_slp_notification - Handle a sleep notification message from the
 *				 device. This can be called from interrupt state
 *				 This function handles Host Sleep requests too
 *				 if the Host Sleep protocol is register based.
 * @ipc_pm:			Pointer to power management component
 * @sleep_notification:		Actual notification from device
 *
 * Returns: true if dev sleep state has to be checked, false otherwise.
 */
bool ipc_pm_dev_slp_notification(struct iosm_pm *ipc_pm,
				 u32 sleep_notification);

/**
 * ipc_pm_set_s2idle_sleep - Set PM variables to sleep/active
 * @ipc_pm:	Pointer to power management component
 * @sleep:	true to enter sleep/false to exit sleep
 */
void ipc_pm_set_s2idle_sleep(struct iosm_pm *ipc_pm, bool sleep);

/**
 * ipc_pm_prepare_host_sleep - Prepare the PM for sleep by entering
 *			       IPC_MEM_HOST_PM_SLEEP_WAIT_D3 state.
 * @ipc_pm:	Pointer to power management component
 *
 * Returns: true on success, false if the host was not active.
 */
bool ipc_pm_prepare_host_sleep(struct iosm_pm *ipc_pm);

/**
 * ipc_pm_prepare_host_active - Prepare the PM for wakeup by entering
 *				IPC_MEM_HOST_PM_ACTIVE_WAIT state.
 * @ipc_pm:	Pointer to power management component
 *
 * Returns: true on success, false if the host was not sleeping.
 */
bool ipc_pm_prepare_host_active(struct iosm_pm *ipc_pm);

/**
 * ipc_pm_wait_for_device_active - Wait up to IPC_PM_ACTIVE_TIMEOUT_MS ms
 *				   for the device to reach active state
 * @ipc_pm:	Pointer to power management component
 *
 * Returns: true if device is active, false on timeout
 */
bool ipc_pm_wait_for_device_active(struct iosm_pm *ipc_pm);

/**
 * ipc_pm_signal_hpda_doorbell - Wake up the device if it is in low power mode
 *				 and trigger a head pointer update interrupt.
 * @ipc_pm:		Pointer to power management component
 * @identifier:		specifies what component triggered hpda update irq
 * @host_slp_check:	if set to true then Host Sleep state machine check will

Annotation

Implementation Notes