Revert "unicode: Don't special case ignorable code points"
[linux.git] / drivers / mfd / hi6421-spmi-pmic.c
blobc9c0c3d7011f95ebfda47c2916885d903ecfecc8
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Device driver for regulators in HISI PMIC IC
5 * Copyright (c) 2013 Linaro Ltd.
6 * Copyright (c) 2011 Hisilicon.
7 * Copyright (c) 2020-2021 Huawei Technologies Co., Ltd.
8 */
10 #include <linux/mfd/core.h>
11 #include <linux/module.h>
12 #include <linux/platform_device.h>
13 #include <linux/regmap.h>
14 #include <linux/slab.h>
15 #include <linux/spmi.h>
17 static const struct mfd_cell hi6421v600_devs[] = {
18 { .name = "hi6421v600-irq", },
19 { .name = "hi6421v600-regulator", },
22 static const struct regmap_config regmap_config = {
23 .reg_bits = 16,
24 .val_bits = BITS_PER_BYTE,
25 .max_register = 0xffff,
26 .fast_io = true
29 static int hi6421_spmi_pmic_probe(struct spmi_device *sdev)
31 struct device *dev = &sdev->dev;
32 struct regmap *regmap;
33 int ret;
35 regmap = devm_regmap_init_spmi_ext(sdev, &regmap_config);
36 if (IS_ERR(regmap))
37 return PTR_ERR(regmap);
39 dev_set_drvdata(&sdev->dev, regmap);
41 ret = devm_mfd_add_devices(&sdev->dev, PLATFORM_DEVID_NONE,
42 hi6421v600_devs, ARRAY_SIZE(hi6421v600_devs),
43 NULL, 0, NULL);
44 if (ret < 0)
45 dev_err(dev, "Failed to add child devices: %d\n", ret);
47 return ret;
50 static const struct of_device_id pmic_spmi_id_table[] = {
51 { .compatible = "hisilicon,hi6421-spmi" },
52 { }
54 MODULE_DEVICE_TABLE(of, pmic_spmi_id_table);
56 static struct spmi_driver hi6421_spmi_pmic_driver = {
57 .driver = {
58 .name = "hi6421-spmi-pmic",
59 .of_match_table = pmic_spmi_id_table,
61 .probe = hi6421_spmi_pmic_probe,
63 module_spmi_driver(hi6421_spmi_pmic_driver);
65 MODULE_DESCRIPTION("HiSilicon Hi6421v600 SPMI PMIC driver");
66 MODULE_LICENSE("GPL v2");