drivers/platform/x86/intel/int3472/clk_and_regulator.c

Source file repositories/reference/linux-study-clean/drivers/platform/x86/intel/int3472/clk_and_regulator.c

File Facts

System
Linux kernel
Corpus path
drivers/platform/x86/intel/int3472/clk_and_regulator.c
Extension
.c
Size
7103 bytes
Lines
257
Domain
Driver Families
Bucket
drivers/platform
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 (second_sensor) {
			regulator->supply_map[j].supply = supply;
			regulator->supply_map[j].dev_name = second_sensor;
			j++;
		}
	}

	init_data.constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS;
	init_data.consumer_supplies = regulator->supply_map;
	init_data.num_consumer_supplies = j;

	snprintf(regulator->regulator_name, sizeof(regulator->regulator_name), "%s-%s",
		 acpi_dev_name(int3472->adev), supply_name);

	regulator->rdesc = INT3472_REGULATOR(regulator->regulator_name,
					     &int3472_gpio_regulator_ops,
					     enable_time, GPIO_REGULATOR_OFF_ON_DELAY);

	cfg.dev = &int3472->adev->dev;
	cfg.init_data = &init_data;
	cfg.ena_gpiod = gpio;

	regulator->rdev = regulator_register(int3472->dev, &regulator->rdesc, &cfg);
	if (IS_ERR(regulator->rdev))
		return PTR_ERR(regulator->rdev);

	int3472->n_regulator_gpios++;
	return 0;
}

void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472)
{
	for (int i = 0; i < int3472->n_regulator_gpios; i++)
		regulator_unregister(int3472->regulators[i].rdev);
}

Annotation

Implementation Notes