include/linux/platform_data/x86/int3472.h

Source file repositories/reference/linux-study-clean/include/linux/platform_data/x86/int3472.h

File Facts

System
Linux kernel
Corpus path
include/linux/platform_data/x86/int3472.h
Extension
.h
Size
5351 bytes
Lines
172
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct int3472_cldb {
	u8 version;
	/*
	 * control logic type
	 * 0: UNKNOWN
	 * 1: DISCRETE(CRD-D)
	 * 2: PMIC TPS68470
	 * 3: PMIC uP6641
	 */
	u8 control_logic_type;
	u8 control_logic_id;
	u8 sensor_card_sku;
	u8 reserved[10];
	u8 clock_source;
	u8 reserved2[17];
};

struct int3472_discrete_quirks {
	/* For models where AVDD GPIO is shared between sensors */
	const char *avdd_second_sensor;
};

struct int3472_gpio_regulator {
	/* SUPPLY_MAP_COUNT * 2 to make room for second sensor mappings */
	struct regulator_consumer_supply supply_map[GPIO_REGULATOR_SUPPLY_MAP_COUNT * 2];
	char supply_name_upper[GPIO_SUPPLY_NAME_LENGTH];
	char regulator_name[GPIO_REGULATOR_NAME_LENGTH];
	struct regulator_dev *rdev;
	struct regulator_desc rdesc;
};

struct int3472_discrete_device {
	struct acpi_device *adev;
	struct device *dev;
	struct acpi_device *sensor;
	const char *sensor_name;

	struct int3472_gpio_regulator regulators[INT3472_MAX_REGULATORS];

	struct int3472_clock {
		struct clk *clk;
		struct clk_hw clk_hw;
		struct clk_lookup *cl;
		struct gpio_desc *ena_gpio;
		u32 frequency;
		u8 imgclk_index;
	} clock;

	struct int3472_led {
		struct led_classdev classdev;
		struct led_lookup_data lookup;
		char name[INT3472_LED_MAX_NAME_LEN];
		struct gpio_desc *gpio;
	} leds[INT3472_MAX_LEDS];

	struct int3472_discrete_quirks quirks;

	unsigned int ngpios; /* how many GPIOs have we seen */
	unsigned int n_leds; /* how many LEDs have we registered */
	unsigned int n_sensor_gpios; /* how many have we mapped to sensor */
	unsigned int n_regulator_gpios; /* how many have we mapped to a regulator */
	struct gpiod_lookup_table gpios;
};

extern const struct dmi_system_id skl_int3472_discrete_quirks[];

union acpi_object *skl_int3472_get_acpi_buffer(struct acpi_device *adev,
					       char *id);
int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb);
int skl_int3472_get_sensor_adev_and_name(struct device *dev,
					 struct acpi_device **sensor_adev_ret,
					 const char **name_ret);

int int3472_discrete_parse_crs(struct int3472_discrete_device *int3472);
void int3472_discrete_cleanup(struct int3472_discrete_device *int3472);

int skl_int3472_register_gpio_clock(struct int3472_discrete_device *int3472,
				    struct gpio_desc *gpio);
int skl_int3472_register_dsm_clock(struct int3472_discrete_device *int3472);
void skl_int3472_unregister_clock(struct int3472_discrete_device *int3472);

int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
				   struct gpio_desc *gpio,
				   unsigned int enable_time,
				   const char *supply_name,
				   const char *second_sensor);
void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472);

int skl_int3472_register_led(struct int3472_discrete_device *int3472, struct gpio_desc *gpio,
			     const char *con_id);

Annotation

Implementation Notes