Revert "unicode: Don't special case ignorable code points"
[linux.git] / drivers / mfd / atc260x-i2c.c
blobfb53b0432a317a8b05022d4535bbfb0444fb7ea8
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * I2C bus interface for ATC260x PMICs
5 * Copyright (C) 2019 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
6 * Copyright (C) 2020 Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
7 */
9 #include <linux/i2c.h>
10 #include <linux/mfd/atc260x/core.h>
11 #include <linux/module.h>
12 #include <linux/of.h>
13 #include <linux/regmap.h>
15 static int atc260x_i2c_probe(struct i2c_client *client)
17 struct atc260x *atc260x;
18 struct regmap_config regmap_cfg;
19 int ret;
21 atc260x = devm_kzalloc(&client->dev, sizeof(*atc260x), GFP_KERNEL);
22 if (!atc260x)
23 return -ENOMEM;
25 atc260x->dev = &client->dev;
26 atc260x->irq = client->irq;
28 ret = atc260x_match_device(atc260x, &regmap_cfg);
29 if (ret)
30 return ret;
32 i2c_set_clientdata(client, atc260x);
34 atc260x->regmap = devm_regmap_init_i2c(client, &regmap_cfg);
35 if (IS_ERR(atc260x->regmap)) {
36 ret = PTR_ERR(atc260x->regmap);
37 dev_err(&client->dev, "failed to init regmap: %d\n", ret);
38 return ret;
41 return atc260x_device_probe(atc260x);
44 static const struct of_device_id atc260x_i2c_of_match[] = {
45 { .compatible = "actions,atc2603c", .data = (void *)ATC2603C },
46 { .compatible = "actions,atc2609a", .data = (void *)ATC2609A },
47 { }
49 MODULE_DEVICE_TABLE(of, atc260x_i2c_of_match);
51 static struct i2c_driver atc260x_i2c_driver = {
52 .driver = {
53 .name = "atc260x",
54 .of_match_table = atc260x_i2c_of_match,
56 .probe = atc260x_i2c_probe,
58 module_i2c_driver(atc260x_i2c_driver);
60 MODULE_DESCRIPTION("ATC260x PMICs I2C bus interface");
61 MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>");
62 MODULE_AUTHOR("Cristian Ciocaltea <cristian.ciocaltea@gmail.com>");
63 MODULE_LICENSE("GPL");