drivers/hid/wacom.h

Source file repositories/reference/linux-study-clean/drivers/hid/wacom.h

File Facts

System
Linux kernel
Corpus path
drivers/hid/wacom.h
Extension
.h
Size
8607 bytes
Lines
253
Domain
Driver Families
Bucket
drivers/hid
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 wacom_led {
	struct led_classdev cdev;
	struct led_trigger trigger;
	struct wacom *wacom;
	unsigned int group;
	unsigned int id;
	u8 llv;
	u8 hlv;
	bool held;
};

struct wacom_group_leds {
	u8 select; /* status led selector (0..3) */
	struct wacom_led *leds;
	unsigned int count;
	struct device *dev;
};

struct wacom_battery {
	struct wacom *wacom;
	struct power_supply_desc bat_desc;
	struct power_supply *battery;
	char bat_name[WACOM_NAME_MAX];
	int bat_status;
	int battery_capacity;
	int bat_charging;
	int bat_connected;
	int ps_connected;
};

struct wacom_remote {
	spinlock_t remote_lock;
	struct kfifo remote_fifo;
	struct kobject *remote_dir;
	struct {
		struct attribute_group group;
		u32 serial;
		struct input_dev *input;
		bool registered;
		struct wacom_battery battery;
		ktime_t active_time;
	} remotes[WACOM_MAX_REMOTES];
};

struct wacom {
	struct usb_device *usbdev;
	struct usb_interface *intf;
	struct wacom_wac wacom_wac;
	struct hid_device *hdev;
	struct mutex lock;
	struct work_struct wireless_work;
	struct work_struct battery_work;
	struct work_struct remote_work;
	struct delayed_work init_work;
	struct delayed_work aes_battery_work;
	struct wacom_remote *remote;
	struct work_struct mode_change_work;
	struct timer_list idleprox_timer;
	bool generic_has_leds;
	struct wacom_leds {
		struct wacom_group_leds *groups;
		unsigned int count;
		u8 llv;       /* status led brightness no button (1..127) */
		u8 hlv;       /* status led brightness button pressed (1..127) */
		u8 img_lum;   /* OLED matrix display brightness */
		u8 max_llv;   /* maximum brightness of LED (llv) */
		u8 max_hlv;   /* maximum brightness of LED (hlv) */
	} led;
	struct wacom_battery battery;
	bool resources;
};

static inline void wacom_schedule_work(struct wacom_wac *wacom_wac,
				       enum wacom_worker which)
{
	struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac);

	switch (which) {
	case WACOM_WORKER_WIRELESS:
		schedule_work(&wacom->wireless_work);
		break;
	case WACOM_WORKER_BATTERY:
		schedule_work(&wacom->battery_work);
		break;
	case WACOM_WORKER_REMOTE:
		schedule_work(&wacom->remote_work);
		break;
	case WACOM_WORKER_MODE_CHANGE:
		schedule_work(&wacom->mode_change_work);
		break;

Annotation

Implementation Notes