// SPDX-License-Identifier: GPL-2.0+
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>

static const struct regulator_ops max8893_ops = {
	.is_enabled		= regulator_is_enabled_regmap,
	.enable			= regulator_enable_regmap,
	.disable		= regulator_disable_regmap,
	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
	.list_voltage		= regulator_list_voltage_linear,
	.map_voltage		= regulator_map_voltage_linear,
};

static const struct regulator_desc max8893_regulators[] = {
	{
		.name = "BUCK",
		.supply_name = "in-buck",
		.of_match = of_match_ptr("buck"),
		.regulators_node = of_match_ptr("regulators"),
		.n_voltages = 0x11,
		.id = 6,
		.ops = &max8893_ops,
		.type = REGULATOR_VOLTAGE,
		.owner = THIS_MODULE,
		.min_uV = 800000,
		.uV_step = 100000,
		.vsel_reg = 0x4,
		.vsel_mask = 0x1f,
		.enable_reg = 0x0,
		.enable_mask = BIT(7),
	},
	{
		.name = "LDO1",
		.supply_name = "in-ldo1",
		.of_match = of_match_ptr("ldo1"),
		.regulators_node = of_match_ptr("regulators"),
		.n_voltages = 0x12,
		.id = 1,
		.ops = &max8893_ops,
		.type = REGULATOR_VOLTAGE,
		.owner = THIS_MODULE,
		.min_uV = 1600000,
		.uV_step = 100000,
		.vsel_reg = 0x5,
		.vsel_mask = 0x1f,
		.enable_reg = 0x0,
		.enable_mask = BIT(5),
	},
	{
		.name = "LDO2",
		.supply_name = "in-ldo2",
		.of_match = of_match_ptr("ldo2"),
		.regulators_node = of_match_ptr("regulators"),
		.n_voltages = 0x16,
		.id = 2,
		.ops = &max8893_ops,
		.type = REGULATOR_VOLTAGE,
		.owner = THIS_MODULE,
		.min_uV = 1200000,
		.uV_step = 100000,
		.vsel_reg = 0x6,
		.vsel_mask = 0x1f,
		.enable_reg = 0x0,
		.enable_mask = BIT(4),
	},
	{
		.name = "LDO3",
		.supply_name = "in-ldo3",
		.of_match = of_match_ptr("ldo3"),
		.regulators_node = of_match_ptr("regulators"),
		.n_voltages = 0x12,
		.id = 3,
		.ops = &max8893_ops,
		.type = REGULATOR_VOLTAGE,
		.owner = THIS_MODULE,
		.min_uV = 1600000,
		.uV_step = 100000,
		.vsel_reg = 0x7,
		.vsel_mask = 0x1f,
		.enable_reg = 0x0,
		.enable_mask = BIT(3),
	},
	{
		.name = "LDO4",
		.supply_name = "in-ldo4",
		.of_match = of_match_ptr("ldo4"),
		.regulators_node = of_match_ptr("regulators"),
		.n_voltages = 0x1a,
		.id = 4,
		.ops = &max8893_ops,
		.type = REGULATOR_VOLTAGE,
		.owner = THIS_MODULE,
		.min_uV = 800000,
		.uV_step = 100000,
		.vsel_reg = 0x8,
		.vsel_mask = 0x1f,
		.enable_reg = 0x0,
		.enable_mask = BIT(2),
	},
	{
		.name = "LDO5",
		.supply_name = "in-ldo5",
		.of_match = of_match_ptr("ldo5"),
		.regulators_node = of_match_ptr("regulators"),
		.n_voltages = 0x1a,
		.id = 5,
		.ops = &max8893_ops,
		.type = REGULATOR_VOLTAGE,
		.owner = THIS_MODULE,
		.min_uV = 800000,
		.uV_step = 100000,
		.vsel_reg = 0x9,
		.vsel_mask = 0x1f,
		.enable_reg = 0x0,
		.enable_mask = BIT(1),
	}
};

static const struct regmap_config max8893_regmap = {
	.reg_bits = 8,
	.val_bits = 8,
};

static int max8893_probe(struct i2c_client *i2c)
{
	int id, ret;
	struct regulator_config config = {.dev = &i2c->dev};
	struct regmap *regmap = devm_regmap_init_i2c(i2c, &max8893_regmap);

	if (IS_ERR(regmap)) {
		ret = PTR_ERR(regmap);
		dev_err(&i2c->dev, "regmap init failed: %d\n", ret);
		return ret;
	}

	for (id = 0; id < ARRAY_SIZE(max8893_regulators); id++) {
		struct regulator_dev *rdev;
		rdev = devm_regulator_register(&i2c->dev,
					       &max8893_regulators[id],
					       &config);
		if (IS_ERR(rdev)) {
			ret = PTR_ERR(rdev);
			dev_err(&i2c->dev, "failed to register %s: %d\n",
				max8893_regulators[id].name, ret);
			return ret;
		}
	}

	return 0;
}

#ifdef CONFIG_OF
static const struct of_device_id max8893_dt_match[] = {
	{ .compatible = "maxim,max8893" },
	{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, max8893_dt_match);
#endif

static const struct i2c_device_id max8893_ids[] = {
	{ "max8893" },
	{ }
};
MODULE_DEVICE_TABLE(i2c, max8893_ids);

static struct i2c_driver max8893_driver = {
	.probe		= max8893_probe,
	.driver		= {
		.name	= "max8893",
		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
		.of_match_table = of_match_ptr(max8893_dt_match),
	},
	.id_table	= max8893_ids,
};

module_i2c_driver(max8893_driver);

MODULE_DESCRIPTION("Maxim MAX8893 PMIC driver");
MODULE_AUTHOR("Sergey Larin <cerg2010cerg2010@mail.ru>");
MODULE_LICENSE("GPL");
