pcm1789-i2c.c (cdd38c5f1ce4398ec58fec95904b75824daab7b5) pcm1789-i2c.c (7f7d7214bb5208454aa4ce13780de326402e89c3)
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
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
15static int pcm1789_i2c_probe(struct i2c_client *client,
16 const struct i2c_device_id *id)
15static int pcm1789_i2c_probe(struct i2c_client *client)
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);

--- 23 unchanged lines hidden (view full) ---

48MODULE_DEVICE_TABLE(i2c, pcm1789_i2c_ids);
49
50static struct i2c_driver pcm1789_i2c_driver = {
51 .driver = {
52 .name = "pcm1789",
53 .of_match_table = of_match_ptr(pcm1789_of_match),
54 },
55 .id_table = pcm1789_i2c_ids,
16{
17 struct regmap *regmap;
18 int ret;
19
20 regmap = devm_regmap_init_i2c(client, &pcm1789_regmap_config);
21 if (IS_ERR(regmap)) {
22 ret = PTR_ERR(regmap);
23 dev_err(&client->dev, "Failed to allocate regmap: %d\n", ret);

--- 23 unchanged lines hidden (view full) ---

47MODULE_DEVICE_TABLE(i2c, pcm1789_i2c_ids);
48
49static struct i2c_driver pcm1789_i2c_driver = {
50 .driver = {
51 .name = "pcm1789",
52 .of_match_table = of_match_ptr(pcm1789_of_match),
53 },
54 .id_table = pcm1789_i2c_ids,
56 .probe = pcm1789_i2c_probe,
55 .probe_new = pcm1789_i2c_probe,
57 .remove = pcm1789_i2c_remove,
58};
59
60module_i2c_driver(pcm1789_i2c_driver);
61
62MODULE_DESCRIPTION("ASoC PCM1789 I2C driver");
63MODULE_AUTHOR("Mylène Josserand <mylene.josserand@bootlin.com>");
64MODULE_LICENSE("GPL");
56 .remove = pcm1789_i2c_remove,
57};
58
59module_i2c_driver(pcm1789_i2c_driver);
60
61MODULE_DESCRIPTION("ASoC PCM1789 I2C driver");
62MODULE_AUTHOR("Mylène Josserand <mylene.josserand@bootlin.com>");
63MODULE_LICENSE("GPL");