drivers/hid/hid-picolcd.h

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

File Facts

System
Linux kernel
Corpus path
drivers/hid/hid-picolcd.h
Extension
.h
Size
9136 bytes
Lines
300
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 picolcd_pending {
	struct hid_report *out_report;
	struct hid_report *in_report;
	struct completion ready;
	int raw_size;
	u8 raw_data[64];
};


#define PICOLCD_KEYS 17

/* Per device data structure */
struct picolcd_data {
	struct hid_device *hdev;
#ifdef CONFIG_DEBUG_FS
	struct dentry *debug_reset;
	struct dentry *debug_eeprom;
	struct dentry *debug_flash;
	struct mutex mutex_flash;
	int addr_sz;
#endif
	u8 version[2];
	unsigned short opmode_delay;
	/* input stuff */
	u8 pressed_keys[2];
	struct input_dev *input_keys;
#ifdef CONFIG_HID_PICOLCD_CIR
	struct rc_dev *rc_dev;
#endif
	unsigned short keycode[PICOLCD_KEYS];

#ifdef CONFIG_HID_PICOLCD_FB
	/* Framebuffer stuff */
	struct fb_info *fb_info;
#endif /* CONFIG_HID_PICOLCD_FB */
#ifdef CONFIG_HID_PICOLCD_LCD
	struct lcd_device *lcd;
	u8 lcd_contrast;
#endif /* CONFIG_HID_PICOLCD_LCD */
#ifdef CONFIG_HID_PICOLCD_BACKLIGHT
	struct backlight_device *backlight;
	u8 lcd_brightness;
	u8 lcd_power;
#endif /* CONFIG_HID_PICOLCD_BACKLIGHT */
#ifdef CONFIG_HID_PICOLCD_LEDS
	/* LED stuff */
	u8 led_state;
	struct led_classdev *led[8];
#endif /* CONFIG_HID_PICOLCD_LEDS */

	/* Housekeeping stuff */
	spinlock_t lock;
	struct mutex mutex;
	struct picolcd_pending *pending;
	int status;
#define PICOLCD_BOOTLOADER 1
#define PICOLCD_FAILED 2
#define PICOLCD_CIR_SHUN 4
};

#ifdef CONFIG_HID_PICOLCD_FB
struct picolcd_fb_data {
	/* Framebuffer stuff */
	spinlock_t lock;
	struct picolcd_data *picolcd;
	u8 update_rate;
	u8 bpp;
	u8 force;
	u8 ready;
	u8 *vbitmap;		/* local copy of what was sent to PicoLCD */
	u8 *bitmap;		/* framebuffer */
};
#endif /* CONFIG_HID_PICOLCD_FB */

/* Find a given report */
#define picolcd_in_report(id, dev) picolcd_report(id, dev, HID_INPUT_REPORT)
#define picolcd_out_report(id, dev) picolcd_report(id, dev, HID_OUTPUT_REPORT)

struct hid_report *picolcd_report(int id, struct hid_device *hdev, int dir);

#ifdef CONFIG_DEBUG_FS
void picolcd_debug_out_report(struct picolcd_data *data,
		struct hid_device *hdev, struct hid_report *report);
#define hid_hw_request(a, b, c) \
	do { \
		picolcd_debug_out_report(hid_get_drvdata(a), a, b); \
		hid_hw_request(a, b, c); \
	} while (0)

void picolcd_debug_raw_event(struct picolcd_data *data,

Annotation

Implementation Notes