| .. | .. |
|---|
| 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 |
|---|
| 13 | 5 | |
|---|
| 14 | 6 | #include <linux/module.h> |
|---|
| 15 | 7 | #include <linux/moduleparam.h> |
|---|
| .. | .. |
|---|
| 36 | 28 | #include <linux/regmap.h> |
|---|
| 37 | 29 | |
|---|
| 38 | 30 | 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", }, |
|---|
| 46 | 34 | }; |
|---|
| 47 | 35 | |
|---|
| 48 | 36 | 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", }, |
|---|
| 56 | 40 | }; |
|---|
| 57 | 41 | |
|---|
| 58 | 42 | static const struct mfd_cell s5m8767_devs[] = { |
|---|
| 43 | + { .name = "s5m8767-pmic", }, |
|---|
| 44 | + { .name = "s5m-rtc", }, |
|---|
| 59 | 45 | { |
|---|
| 60 | | - .name = "s5m8767-pmic", |
|---|
| 61 | | - }, { |
|---|
| 62 | | - .name = "s5m-rtc", |
|---|
| 63 | | - }, { |
|---|
| 64 | 46 | .name = "s5m8767-clk", |
|---|
| 65 | 47 | .of_compatible = "samsung,s5m8767-clk", |
|---|
| 66 | | - } |
|---|
| 48 | + }, |
|---|
| 67 | 49 | }; |
|---|
| 68 | 50 | |
|---|
| 69 | 51 | static const struct mfd_cell s2mps11_devs[] = { |
|---|
| 52 | + { .name = "s2mps11-regulator", }, |
|---|
| 53 | + { .name = "s2mps14-rtc", }, |
|---|
| 70 | 54 | { |
|---|
| 71 | | - .name = "s2mps11-regulator", |
|---|
| 72 | | - }, { |
|---|
| 73 | | - .name = "s2mps14-rtc", |
|---|
| 74 | | - }, { |
|---|
| 75 | 55 | .name = "s2mps11-clk", |
|---|
| 76 | 56 | .of_compatible = "samsung,s2mps11-clk", |
|---|
| 77 | | - } |
|---|
| 57 | + }, |
|---|
| 78 | 58 | }; |
|---|
| 79 | 59 | |
|---|
| 80 | 60 | static const struct mfd_cell s2mps13_devs[] = { |
|---|
| .. | .. |
|---|
| 87 | 67 | }; |
|---|
| 88 | 68 | |
|---|
| 89 | 69 | static const struct mfd_cell s2mps14_devs[] = { |
|---|
| 70 | + { .name = "s2mps14-regulator", }, |
|---|
| 71 | + { .name = "s2mps14-rtc", }, |
|---|
| 90 | 72 | { |
|---|
| 91 | | - .name = "s2mps14-regulator", |
|---|
| 92 | | - }, { |
|---|
| 93 | | - .name = "s2mps14-rtc", |
|---|
| 94 | | - }, { |
|---|
| 95 | 73 | .name = "s2mps14-clk", |
|---|
| 96 | 74 | .of_compatible = "samsung,s2mps14-clk", |
|---|
| 97 | | - } |
|---|
| 75 | + }, |
|---|
| 98 | 76 | }; |
|---|
| 99 | 77 | |
|---|
| 100 | 78 | static const struct mfd_cell s2mps15_devs[] = { |
|---|
| 79 | + { .name = "s2mps15-regulator", }, |
|---|
| 80 | + { .name = "s2mps15-rtc", }, |
|---|
| 101 | 81 | { |
|---|
| 102 | | - .name = "s2mps15-regulator", |
|---|
| 103 | | - }, { |
|---|
| 104 | | - .name = "s2mps15-rtc", |
|---|
| 105 | | - }, { |
|---|
| 106 | 82 | .name = "s2mps13-clk", |
|---|
| 107 | 83 | .of_compatible = "samsung,s2mps13-clk", |
|---|
| 108 | 84 | }, |
|---|
| 109 | 85 | }; |
|---|
| 110 | 86 | |
|---|
| 111 | 87 | static const struct mfd_cell s2mpa01_devs[] = { |
|---|
| 112 | | - { |
|---|
| 113 | | - .name = "s2mpa01-pmic", |
|---|
| 114 | | - }, |
|---|
| 88 | + { .name = "s2mpa01-pmic", }, |
|---|
| 89 | + { .name = "s2mps14-rtc", }, |
|---|
| 115 | 90 | }; |
|---|
| 116 | 91 | |
|---|
| 117 | 92 | static const struct mfd_cell s2mpu02_devs[] = { |
|---|
| 118 | | - { |
|---|
| 119 | | - .name = "s2mpu02-regulator", |
|---|
| 120 | | - }, |
|---|
| 93 | + { .name = "s2mpu02-regulator", }, |
|---|
| 121 | 94 | }; |
|---|
| 122 | 95 | |
|---|
| 123 | 96 | #ifdef CONFIG_OF |
|---|
| 124 | 97 | static const struct of_device_id sec_dt_match[] = { |
|---|
| 125 | | - { .compatible = "samsung,s5m8767-pmic", |
|---|
| 98 | + { |
|---|
| 99 | + .compatible = "samsung,s5m8767-pmic", |
|---|
| 126 | 100 | .data = (void *)S5M8767X, |
|---|
| 127 | 101 | }, { |
|---|
| 128 | 102 | .compatible = "samsung,s2mps11-pmic", |
|---|
| .. | .. |
|---|
| 317 | 291 | * the sub-modules need not instantiate another instance while parsing their |
|---|
| 318 | 292 | * platform data. |
|---|
| 319 | 293 | */ |
|---|
| 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) |
|---|
| 322 | 296 | { |
|---|
| 323 | 297 | struct sec_platform_data *pd; |
|---|
| 324 | 298 | |
|---|
| .. | .. |
|---|
| 339 | 313 | return pd; |
|---|
| 340 | 314 | } |
|---|
| 341 | 315 | #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) |
|---|
| 344 | 318 | { |
|---|
| 345 | 319 | return NULL; |
|---|
| 346 | 320 | } |
|---|
| .. | .. |
|---|
| 479 | 453 | num_sec_devs = ARRAY_SIZE(s2mpu02_devs); |
|---|
| 480 | 454 | break; |
|---|
| 481 | 455 | 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; |
|---|
| 484 | 459 | } |
|---|
| 485 | 460 | ret = devm_mfd_add_devices(sec_pmic->dev, -1, sec_devs, num_sec_devs, |
|---|
| 486 | 461 | NULL, 0, NULL); |
|---|