0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/module.h>
0009 #include <linux/spi/spi.h>
0010 #include <linux/regmap.h>
0011 #include <sound/soc.h>
0012 #include "cs4271.h"
0013
0014 static int cs4271_spi_probe(struct spi_device *spi)
0015 {
0016 struct regmap_config config;
0017
0018 config = cs4271_regmap_config;
0019 config.reg_bits = 16;
0020 config.val_bits = 8;
0021 config.read_flag_mask = 0x21;
0022 config.write_flag_mask = 0x20;
0023
0024 return cs4271_probe(&spi->dev, devm_regmap_init_spi(spi, &config));
0025 }
0026
0027 static struct spi_driver cs4271_spi_driver = {
0028 .driver = {
0029 .name = "cs4271",
0030 .of_match_table = of_match_ptr(cs4271_dt_ids),
0031 },
0032 .probe = cs4271_spi_probe,
0033 };
0034 module_spi_driver(cs4271_spi_driver);
0035
0036 MODULE_DESCRIPTION("ASoC CS4271 SPI Driver");
0037 MODULE_AUTHOR("Alexander Sverdlin <subaparts@yandex.ru>");
0038 MODULE_LICENSE("GPL");