cs4271-i2c.c 1000 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * CS4271 I2C audio driver
  4. *
  5. * Copyright (c) 2010 Alexander Sverdlin <[email protected]>
  6. */
  7. #include <linux/module.h>
  8. #include <linux/i2c.h>
  9. #include <linux/regmap.h>
  10. #include <sound/soc.h>
  11. #include "cs4271.h"
  12. static int cs4271_i2c_probe(struct i2c_client *client)
  13. {
  14. struct regmap_config config;
  15. config = cs4271_regmap_config;
  16. config.reg_bits = 8;
  17. config.val_bits = 8;
  18. return cs4271_probe(&client->dev,
  19. devm_regmap_init_i2c(client, &config));
  20. }
  21. static const struct i2c_device_id cs4271_i2c_id[] = {
  22. { "cs4271", 0 },
  23. { }
  24. };
  25. MODULE_DEVICE_TABLE(i2c, cs4271_i2c_id);
  26. static struct i2c_driver cs4271_i2c_driver = {
  27. .driver = {
  28. .name = "cs4271",
  29. .of_match_table = of_match_ptr(cs4271_dt_ids),
  30. },
  31. .probe_new = cs4271_i2c_probe,
  32. .id_table = cs4271_i2c_id,
  33. };
  34. module_i2c_driver(cs4271_i2c_driver);
  35. MODULE_DESCRIPTION("ASoC CS4271 I2C Driver");
  36. MODULE_AUTHOR("Alexander Sverdlin <[email protected]>");
  37. MODULE_LICENSE("GPL");