drivers/iio/accel/kxcjk-1013.c

Source file repositories/reference/linux-study-clean/drivers/iio/accel/kxcjk-1013.c

File Facts

System
Linux kernel
Corpus path
drivers/iio/accel/kxcjk-1013.c
Extension
.c
Size
42996 bytes
Lines
1686
Domain
Driver Families
Bucket
drivers/iio
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 kx_odr_start_up_time {
	int odr_bits;
	int usec;
};

/* KXCJK-1013 */
static const struct kx_odr_start_up_time kxcjk1013_odr_start_up_times[] = {
	{ 0x08, 100000 },
	{ 0x09, 100000 },
	{ 0x0A, 100000 },
	{ 0x0B, 100000 },
	{ 0x00, 80000 },
	{ 0x01, 41000 },
	{ 0x02, 21000 },
	{ 0x03, 11000 },
	{ 0x04, 6400 },
	{ 0x05, 3900 },
	{ 0x06, 2700 },
	{ 0x07, 2100 },
	{ }
};

/* KXCTJ2-1009 */
static const struct kx_odr_start_up_time kxtj21009_odr_start_up_times[] = {
	{ 0x08, 1240000 },
	{ 0x09, 621000 },
	{ 0x0A, 309000 },
	{ 0x0B, 151000 },
	{ 0x00, 80000 },
	{ 0x01, 41000 },
	{ 0x02, 21000 },
	{ 0x03, 11000 },
	{ 0x04, 6000 },
	{ 0x05, 4000 },
	{ 0x06, 3000 },
	{ 0x07, 2000 },
	{ }
};

/* KXTF9 */
static const struct kx_odr_start_up_time kxtf9_odr_start_up_times[] = {
	{ 0x01, 81000 },
	{ 0x02, 41000 },
	{ 0x03, 21000 },
	{ 0x04, 11000 },
	{ 0x05, 5100 },
	{ 0x06, 2700 },
	{ }
};

/* KX023-1025 */
static const struct kx_odr_start_up_time kx0231025_odr_start_up_times[] = {
	/* First 4 are not in datasheet, taken from KXCTJ2-1009 */
	{ 0x08, 1240000 },
	{ 0x09, 621000 },
	{ 0x0A, 309000 },
	{ 0x0B, 151000 },
	{ 0x00, 81000 },
	{ 0x01, 40000 },
	{ 0x02, 22000 },
	{ 0x03, 12000 },
	{ 0x04, 7000 },
	{ 0x05, 4400 },
	{ 0x06, 3000 },
	{ 0x07, 3000 },
	{ }
};

enum kx_acpi_type {
	ACPI_GENERIC,
	ACPI_SMO8500,
	ACPI_KIOX010A,
};

struct kx_chipset_regs {
	u8 int_src1;
	u8 int_src2;
	u8 int_rel;
	u8 ctrl1;
	u8 wuf_ctrl;
	u8 int_ctrl1;
	u8 data_ctrl;
	u8 wake_timer;
	u8 wake_thres;
};

static const struct kx_chipset_regs kxcjk1013_regs = {
	.int_src1	= KXCJK1013_REG_INT_SRC1,
	.int_src2	= KXCJK1013_REG_INT_SRC2,
	.int_rel	= KXCJK1013_REG_INT_REL,

Annotation

Implementation Notes