October 2017
Intermediate to advanced
586 pages
14h 8m
English
To achieve our goal, let's first describe a fake SPI device for which we can write a driver:
The following is a fake skeleton:
/* mandatory for regmap */ #include <linux/regmap.h> /* Depending on your need you should include other files */ static struct private_struct { /* Feel free to add whatever you want here */ struct regmap *map; int foo; }; static const struct regmap_range wr_rd_range[] = { { .range_min = 0x20, .range_max = 0x4F, },{ .range_min = 0x60, .range_max = 0x7F }, }; struct regmap_access_table drv_wr_table = { .yes_ranges = wr_rd_range, ...