drivers/platform/surface/aggregator/controller.h

Source file repositories/reference/linux-study-clean/drivers/platform/surface/aggregator/controller.h

File Facts

System
Linux kernel
Corpus path
drivers/platform/surface/aggregator/controller.h
Extension
.h
Size
8820 bytes
Lines
286
Domain
Driver Families
Bucket
drivers/platform
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 ssh_seq_counter {
	u8 value;
};

/**
 * struct ssh_rqid_counter - Safe counter for SSH request IDs.
 * @value: The current counter value.
 */
struct ssh_rqid_counter {
	u16 value;
};


/* -- Event/notification system. -------------------------------------------- */

/**
 * struct ssam_nf_head - Notifier head for SSAM events.
 * @srcu: The SRCU struct for synchronization.
 * @head: List-head for notifier blocks registered under this head.
 */
struct ssam_nf_head {
	struct srcu_struct srcu;
	struct list_head head;
};

/**
 * struct ssam_nf - Notifier callback- and activation-registry for SSAM events.
 * @lock:     Lock guarding (de-)registration of notifier blocks. Note: This
 *            lock does not need to be held for notifier calls, only
 *            registration and deregistration.
 * @refcount: The root of the RB-tree used for reference-counting enabled
 *            events/notifications.
 * @head:     The list of notifier heads for event/notification callbacks.
 */
struct ssam_nf {
	struct mutex lock;
	struct rb_root refcount;
	struct ssam_nf_head head[SSH_NUM_EVENTS];
};


/* -- Event/async request completion system. -------------------------------- */

struct ssam_cplt;

/**
 * struct ssam_event_item - Struct for event queuing and completion.
 * @node:     The node in the queue.
 * @rqid:     The request ID of the event.
 * @ops:      Instance specific functions.
 * @ops.free: Callback for freeing this event item.
 * @event:    Actual event data.
 */
struct ssam_event_item {
	struct list_head node;
	u16 rqid;

	struct {
		void (*free)(struct ssam_event_item *event);
	} ops;

	struct ssam_event event;	/* must be last */
};

/**
 * struct ssam_event_queue - Queue for completing received events.
 * @cplt: Reference to the completion system on which this queue is active.
 * @lock: The lock for any operation on the queue.
 * @head: The list-head of the queue.
 * @work: The &struct work_struct performing completion work for this queue.
 */
struct ssam_event_queue {
	struct ssam_cplt *cplt;

	spinlock_t lock;
	struct list_head head;
	struct work_struct work;
};

/**
 * struct ssam_event_target - Set of queues for a single SSH target ID.
 * @queue: The array of queues, one queue per event ID.
 */
struct ssam_event_target {
	struct ssam_event_queue queue[SSH_NUM_EVENTS];
};

/**
 * struct ssam_cplt - SSAM event/async request completion system.
 * @dev:          The device with which this system is associated. Only used

Annotation

Implementation Notes