forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/cs42l51-i2c.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * cs42l56.c -- CS42L51 ALSA SoC I2C audio driver
34 *
45 * Copyright 2014 CirrusLogic, Inc.
56 *
67 * Author: Brian Austin <brian.austin@cirrus.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
11
- *
128 */
139
1410 #include <linux/i2c.h>
....@@ -23,24 +19,39 @@
2319 };
2420 MODULE_DEVICE_TABLE(i2c, cs42l51_i2c_id);
2521
22
+const struct of_device_id cs42l51_of_match[] = {
23
+ { .compatible = "cirrus,cs42l51", },
24
+ { }
25
+};
26
+MODULE_DEVICE_TABLE(of, cs42l51_of_match);
27
+
2628 static int cs42l51_i2c_probe(struct i2c_client *i2c,
2729 const struct i2c_device_id *id)
2830 {
2931 struct regmap_config config;
3032
3133 config = cs42l51_regmap;
32
- config.val_bits = 8;
33
- config.reg_bits = 8;
3434
3535 return cs42l51_probe(&i2c->dev, devm_regmap_init_i2c(i2c, &config));
3636 }
37
+
38
+static int cs42l51_i2c_remove(struct i2c_client *i2c)
39
+{
40
+ return cs42l51_remove(&i2c->dev);
41
+}
42
+
43
+static const struct dev_pm_ops cs42l51_pm_ops = {
44
+ SET_SYSTEM_SLEEP_PM_OPS(cs42l51_suspend, cs42l51_resume)
45
+};
3746
3847 static struct i2c_driver cs42l51_i2c_driver = {
3948 .driver = {
4049 .name = "cs42l51",
4150 .of_match_table = cs42l51_of_match,
51
+ .pm = &cs42l51_pm_ops,
4252 },
4353 .probe = cs42l51_i2c_probe,
54
+ .remove = cs42l51_i2c_remove,
4455 .id_table = cs42l51_i2c_id,
4556 };
4657