hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/sec-core.c
....@@ -1,15 +1,7 @@
1
-/*
2
- * sec-core.c
3
- *
4
- * Copyright (c) 2012 Samsung Electronics Co., Ltd
5
- * http://www.samsung.com
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms of the GNU General Public License as published by the
9
- * Free Software Foundation; either version 2 of the License, or (at your
10
- * option) any later version.
11
- *
12
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// Copyright (c) 2012 Samsung Electronics Co., Ltd
4
+// http://www.samsung.com
135
146 #include <linux/module.h>
157 #include <linux/moduleparam.h>
....@@ -36,45 +28,33 @@
3628 #include <linux/regmap.h>
3729
3830 static const struct mfd_cell s5m8751_devs[] = {
39
- {
40
- .name = "s5m8751-pmic",
41
- }, {
42
- .name = "s5m-charger",
43
- }, {
44
- .name = "s5m8751-codec",
45
- },
31
+ { .name = "s5m8751-pmic", },
32
+ { .name = "s5m-charger", },
33
+ { .name = "s5m8751-codec", },
4634 };
4735
4836 static const struct mfd_cell s5m8763_devs[] = {
49
- {
50
- .name = "s5m8763-pmic",
51
- }, {
52
- .name = "s5m-rtc",
53
- }, {
54
- .name = "s5m-charger",
55
- },
37
+ { .name = "s5m8763-pmic", },
38
+ { .name = "s5m-rtc", },
39
+ { .name = "s5m-charger", },
5640 };
5741
5842 static const struct mfd_cell s5m8767_devs[] = {
43
+ { .name = "s5m8767-pmic", },
44
+ { .name = "s5m-rtc", },
5945 {
60
- .name = "s5m8767-pmic",
61
- }, {
62
- .name = "s5m-rtc",
63
- }, {
6446 .name = "s5m8767-clk",
6547 .of_compatible = "samsung,s5m8767-clk",
66
- }
48
+ },
6749 };
6850
6951 static const struct mfd_cell s2mps11_devs[] = {
52
+ { .name = "s2mps11-regulator", },
53
+ { .name = "s2mps14-rtc", },
7054 {
71
- .name = "s2mps11-regulator",
72
- }, {
73
- .name = "s2mps14-rtc",
74
- }, {
7555 .name = "s2mps11-clk",
7656 .of_compatible = "samsung,s2mps11-clk",
77
- }
57
+ },
7858 };
7959
8060 static const struct mfd_cell s2mps13_devs[] = {
....@@ -87,42 +67,36 @@
8767 };
8868
8969 static const struct mfd_cell s2mps14_devs[] = {
70
+ { .name = "s2mps14-regulator", },
71
+ { .name = "s2mps14-rtc", },
9072 {
91
- .name = "s2mps14-regulator",
92
- }, {
93
- .name = "s2mps14-rtc",
94
- }, {
9573 .name = "s2mps14-clk",
9674 .of_compatible = "samsung,s2mps14-clk",
97
- }
75
+ },
9876 };
9977
10078 static const struct mfd_cell s2mps15_devs[] = {
79
+ { .name = "s2mps15-regulator", },
80
+ { .name = "s2mps15-rtc", },
10181 {
102
- .name = "s2mps15-regulator",
103
- }, {
104
- .name = "s2mps15-rtc",
105
- }, {
10682 .name = "s2mps13-clk",
10783 .of_compatible = "samsung,s2mps13-clk",
10884 },
10985 };
11086
11187 static const struct mfd_cell s2mpa01_devs[] = {
112
- {
113
- .name = "s2mpa01-pmic",
114
- },
88
+ { .name = "s2mpa01-pmic", },
89
+ { .name = "s2mps14-rtc", },
11590 };
11691
11792 static const struct mfd_cell s2mpu02_devs[] = {
118
- {
119
- .name = "s2mpu02-regulator",
120
- },
93
+ { .name = "s2mpu02-regulator", },
12194 };
12295
12396 #ifdef CONFIG_OF
12497 static const struct of_device_id sec_dt_match[] = {
125
- { .compatible = "samsung,s5m8767-pmic",
98
+ {
99
+ .compatible = "samsung,s5m8767-pmic",
126100 .data = (void *)S5M8767X,
127101 }, {
128102 .compatible = "samsung,s2mps11-pmic",
....@@ -317,8 +291,8 @@
317291 * the sub-modules need not instantiate another instance while parsing their
318292 * platform data.
319293 */
320
-static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
321
- struct device *dev)
294
+static struct sec_platform_data *
295
+sec_pmic_i2c_parse_dt_pdata(struct device *dev)
322296 {
323297 struct sec_platform_data *pd;
324298
....@@ -339,8 +313,8 @@
339313 return pd;
340314 }
341315 #else
342
-static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
343
- struct device *dev)
316
+static struct sec_platform_data *
317
+sec_pmic_i2c_parse_dt_pdata(struct device *dev)
344318 {
345319 return NULL;
346320 }
....@@ -479,8 +453,9 @@
479453 num_sec_devs = ARRAY_SIZE(s2mpu02_devs);
480454 break;
481455 default:
482
- /* If this happens the probe function is problem */
483
- BUG();
456
+ dev_err(&i2c->dev, "Unsupported device type (%lu)\n",
457
+ sec_pmic->device_type);
458
+ return -ENODEV;
484459 }
485460 ret = devm_mfd_add_devices(sec_pmic->dev, -1, sec_devs, num_sec_devs,
486461 NULL, 0, NULL);