1 // SPDX-License-Identifier: GPL-2.0-only 1 2 /* 3 * wm8731.c -- WM8731 ALSA SoC Audio driver 4 * 5 * Copyright 2005 Openedhand Ltd. 6 * Copyright 2006-12 Wolfson Microelectronics, 7 * 8 * Author: Richard Purdie <richard@openedhand. 9 * 10 * Based on wm8753.c by Liam Girdwood 11 */ 12 13 #include <linux/spi/spi.h> 14 #include <linux/mod_devicetable.h> 15 #include <linux/module.h> 16 17 #include "wm8731.h" 18 19 static const struct of_device_id wm8731_of_mat 20 { .compatible = "wlf,wm8731", }, 21 { } 22 }; 23 MODULE_DEVICE_TABLE(of, wm8731_of_match); 24 25 static int wm8731_spi_probe(struct spi_device 26 { 27 struct wm8731_priv *wm8731; 28 int ret; 29 30 wm8731 = devm_kzalloc(&spi->dev, sizeo 31 if (wm8731 == NULL) 32 return -ENOMEM; 33 34 spi_set_drvdata(spi, wm8731); 35 36 wm8731->regmap = devm_regmap_init_spi( 37 if (IS_ERR(wm8731->regmap)) { 38 ret = PTR_ERR(wm8731->regmap); 39 dev_err(&spi->dev, "Failed to 40 ret); 41 return ret; 42 } 43 44 return wm8731_init(&spi->dev, wm8731); 45 } 46 47 static struct spi_driver wm8731_spi_driver = { 48 .driver = { 49 .name = "wm8731", 50 .of_match_table = wm8731_of_ma 51 }, 52 .probe = wm8731_spi_probe, 53 }; 54 55 module_spi_driver(wm8731_spi_driver); 56 57 MODULE_DESCRIPTION("ASoC WM8731 driver - SPI") 58 MODULE_AUTHOR("Richard Purdie"); 59 MODULE_LICENSE("GPL"); 60
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.