drivers/regulator/raa215300.c

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

File Facts

System
Linux kernel
Corpus path
drivers/regulator/raa215300.c
Extension
.c
Size
5580 bytes
Lines
193
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 (np) {
			int i;

			i = of_property_match_string(np, "reg-names", "rtc");
			if (i >= 0)
				of_property_read_u32_index(np, "reg", i, &addr);
		}

		info.addr = addr;
		if (client->irq > 0)
			info.irq = client->irq;

		size = strscpy(info.type, name, sizeof(info.type));
		if (size < 0)
			return dev_err_probe(dev, size,
					     "Invalid device name: %s\n", name);

		/* Enable RTC block */
		regmap_update_bits(regmap, RAA215300_REG_BLOCK_EN,
				   RAA215300_REG_BLOCK_EN_RTC_EN,
				   RAA215300_REG_BLOCK_EN_RTC_EN);

		rtc_client = i2c_new_client_device(client->adapter, &info);
		if (IS_ERR(rtc_client))
			return PTR_ERR(rtc_client);

		ret = devm_add_action_or_reset(dev,
					       raa215300_rtc_unregister_device,
					       rtc_client);
		if (ret < 0)
			return ret;
	}

	return 0;
}

static const struct of_device_id raa215300_dt_match[] = {
	{ .compatible = "renesas,raa215300" },
	{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, raa215300_dt_match);

static struct i2c_driver raa215300_i2c_driver = {
	.driver = {
		.name = "raa215300",
		.of_match_table = raa215300_dt_match,
	},
	.probe = raa215300_i2c_probe,
};
module_i2c_driver(raa215300_i2c_driver);

MODULE_DESCRIPTION("Renesas RAA215300 PMIC driver");
MODULE_AUTHOR("Fabrizio Castro <fabrizio.castro.jz@renesas.com>");
MODULE_AUTHOR("Biju Das <biju.das.jz@bp.renesas.com>");
MODULE_LICENSE("GPL");

Annotation

Implementation Notes