~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/codecs/wm8731-i2c.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*
  3  * wm8731-i2c.c  --  WM8731 ALSA SoC Audio driver I2C code
  4  *
  5  * Copyright 2005 Openedhand Ltd.
  6  * Copyright 2006-12 Wolfson Microelectronics, plc
  7  *
  8  * Author: Richard Purdie <richard@openedhand.com>
  9  *
 10  * Based on wm8753.c by Liam Girdwood
 11  */
 12 
 13 #include <linux/i2c.h>
 14 #include <linux/mod_devicetable.h>
 15 #include <linux/module.h>
 16 
 17 #include "wm8731.h"
 18 
 19 
 20 static const struct of_device_id wm8731_of_match[] = {
 21         { .compatible = "wlf,wm8731", },
 22         { }
 23 };
 24 MODULE_DEVICE_TABLE(of, wm8731_of_match);
 25 
 26 static int wm8731_i2c_probe(struct i2c_client *i2c)
 27 {
 28         struct wm8731_priv *wm8731;
 29         int ret;
 30 
 31         wm8731 = devm_kzalloc(&i2c->dev, sizeof(struct wm8731_priv),
 32                               GFP_KERNEL);
 33         if (wm8731 == NULL)
 34                 return -ENOMEM;
 35 
 36         i2c_set_clientdata(i2c, wm8731);
 37 
 38         wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap);
 39         if (IS_ERR(wm8731->regmap)) {
 40                 ret = PTR_ERR(wm8731->regmap);
 41                 dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
 42                         ret);
 43                 return ret;
 44         }
 45 
 46         return wm8731_init(&i2c->dev, wm8731);
 47 }
 48 
 49 static const struct i2c_device_id wm8731_i2c_id[] = {
 50         { "wm8731" },
 51         { }
 52 };
 53 MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id);
 54 
 55 static struct i2c_driver wm8731_i2c_driver = {
 56         .driver = {
 57                 .name = "wm8731",
 58                 .of_match_table = wm8731_of_match,
 59         },
 60         .probe = wm8731_i2c_probe,
 61         .id_table = wm8731_i2c_id,
 62 };
 63 
 64 module_i2c_driver(wm8731_i2c_driver);
 65 
 66 MODULE_DESCRIPTION("ASoC WM8731 driver - I2C");
 67 MODULE_AUTHOR("Richard Purdie");
 68 MODULE_LICENSE("GPL");
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php