drivers/macintosh/ams/ams.h

Source file repositories/reference/linux-study-clean/drivers/macintosh/ams/ams.h

File Facts

System
Linux kernel
Corpus path
drivers/macintosh/ams/ams.h
Extension
.h
Size
1479 bytes
Lines
77
Domain
Driver Families
Bucket
drivers/macintosh
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 ams {
	/* Locks */
	spinlock_t irq_lock;
	struct mutex lock;

	/* General properties */
	struct device_node *of_node;
	struct platform_device *of_dev;
	char has_device;
	char vflag;
	u32 orient1;
	u32 orient2;

	/* Interrupt worker */
	struct work_struct worker;
	u8 worker_irqs;

	/* Implementation
	 *
	 * Only call these functions with the main lock held.
	 */
	void (*exit)(void);

	void (*get_xyz)(s8 *x, s8 *y, s8 *z);
	u8 (*get_vendor)(void);

	void (*clear_irq)(enum ams_irq reg);

#ifdef CONFIG_SENSORS_AMS_I2C
	/* I2C properties */
	struct i2c_client *i2c_client;
#endif

	/* Joystick emulation */
	struct input_dev *idev;
	__u16 bustype;

	/* calibrated null values */
	int xcalib, ycalib, zcalib;
};

extern struct ams ams_info;

extern void ams_sensors(s8 *x, s8 *y, s8 *z);
extern int ams_sensor_attach(void);
extern void ams_sensor_detach(void);

extern int ams_pmu_init(struct device_node *np);
extern int ams_i2c_init(struct device_node *np);

extern int ams_input_init(void);
extern void ams_input_exit(void);

#endif /* _AMS_H */

Annotation

Implementation Notes