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

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

Version: ~ [ linux-5.11-rc3 ] ~ [ linux-5.10.7 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.89 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.167 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.215 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.251 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.251 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 // Audio driver for PCM1789 I2C
  3 // Copyright (C) 2018 Bootlin
  4 // Mylène Josserand <mylene.josserand@bootlin.com>
  5 
  6 #include <linux/clk.h>
  7 #include <linux/delay.h>
  8 #include <linux/i2c.h>
  9 #include <linux/module.h>
 10 #include <linux/of.h>
 11 #include <linux/regmap.h>
 12 
 13 #include "pcm1789.h"
 14 
 15 static int pcm1789_i2c_probe(struct i2c_client *client,
 16                              const struct i2c_device_id *id)
 17 {
 18         struct regmap *regmap;
 19         int ret;
 20 
 21         regmap = devm_regmap_init_i2c(client, &pcm1789_regmap_config);
 22         if (IS_ERR(regmap)) {
 23                 ret = PTR_ERR(regmap);
 24                 dev_err(&client->dev, "Failed to allocate regmap: %d\n", ret);
 25                 return ret;
 26         }
 27 
 28         return pcm1789_common_init(&client->dev, regmap);
 29 }
 30 
 31 static int pcm1789_i2c_remove(struct i2c_client *client)
 32 {
 33         return pcm1789_common_exit(&client->dev);
 34 }
 35 
 36 static const struct of_device_id pcm1789_of_match[] = {
 37         { .compatible = "ti,pcm1789", },
 38         { }
 39 };
 40 MODULE_DEVICE_TABLE(of, pcm1789_of_match);
 41 
 42 static const struct i2c_device_id pcm1789_i2c_ids[] = {
 43         { "pcm1789", 0 },
 44         { }
 45 };
 46 MODULE_DEVICE_TABLE(i2c, pcm1789_i2c_ids);
 47 
 48 static struct i2c_driver pcm1789_i2c_driver = {
 49         .driver = {
 50                 .name   = "pcm1789",
 51                 .of_match_table = of_match_ptr(pcm1789_of_match),
 52         },
 53         .id_table       = pcm1789_i2c_ids,
 54         .probe          = pcm1789_i2c_probe,
 55         .remove = pcm1789_i2c_remove,
 56 };
 57 
 58 module_i2c_driver(pcm1789_i2c_driver);
 59 
 60 MODULE_DESCRIPTION("ASoC PCM1789 I2C driver");
 61 MODULE_AUTHOR("Mylène Josserand <mylene.josserand@bootlin.com>");
 62 MODULE_LICENSE("GPL");
 63 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp