drivers/regulator/max8893.c

Source file repositories/reference/linux-study-clean/drivers/regulator/max8893.c

File Facts

System
Linux kernel
Corpus path
drivers/regulator/max8893.c
Extension
.c
Size
4327 bytes
Lines
185
Domain
Driver Families
Bucket
drivers/regulator
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

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");

Annotation

Implementation Notes