#include #include #include #include static const struct regmap_config simple_regmap_config = { .max_register = 0x7f, .reg_bits = 8, .pad_bits = 8, .val_bits = 16, }; static int david_cds9k_probe(struct spi_device *spi) { const struct regmap_config *config; struct regmap *regmap; config = device_get_match_data(&spi->dev); if (!config) config = &simple_regmap_config; regmap = devm_regmap_init_spi(spi, config); if (IS_ERR(regmap)) return PTR_ERR(regmap); return devm_of_platform_populate(&spi->dev); } static const struct of_device_id david_cds9k_of_match[] = { { .compatible = "david,cds9k" }, {} }; MODULE_DEVICE_TABLE(of, david_cds9k_of_match); static struct spi_driver david_cds9k_spi_driver = { .probe = david_cds9k_probe, .driver = { .name = "david_cds9k", .of_match_table = david_cds9k_of_match, }, }; module_spi_driver(david_cds9k_spi_driver); MODULE_AUTHOR("David Phillips "); MODULE_DESCRIPTION("MFD driver for the CDS9K board controller"); MODULE_LICENSE("GPL v2");