Beispiel #1
0
/*
 * The device should already be enabled and out of reset,
 * either from early init in coreboot or SiliconInit in FSP.
 */
static void i2c_dev_init(struct device *dev)
{
	struct soc_intel_skylake_config *config = dev->chip_info;
	int bus = i2c_dev_to_bus(dev);

	if (!config || bus < 0)
		return;

	lpss_i2c_init(bus, &config->i2c[bus]);
}
Beispiel #2
0
/* Generate ACPI I2C device objects */
static void i2c_fill_ssdt(struct device *dev)
{
	struct soc_intel_skylake_config *config = dev->chip_info;
	int bus = i2c_dev_to_bus(dev);

	if (!config || bus < 0)
		return;

	acpigen_write_scope(acpi_device_path(dev));
	lpss_i2c_acpi_fill_ssdt(bus, &config->i2c[bus]);
	acpigen_pop_len();
}
Beispiel #3
0
/*
 * The device should already be enabled and out of reset,
 * either from early init in coreboot or SiliconInit in FSP.
 */
static void i2c_dev_init(struct device *dev)
{
	struct soc_intel_skylake_config *config = dev->chip_info;
	const struct lpss_i2c_speed_config *sptr;
	enum i2c_speed speed;
	int i, bus = i2c_dev_to_bus(dev);

	if (!config || bus < 0)
		return;

	speed = config->i2c[bus].speed ? : I2C_SPEED_FAST;
	lpss_i2c_init(bus, speed);

	/* Apply custom speed config if it has been set by the board */
	for (i = 0; i < LPSS_I2C_SPEED_CONFIG_COUNT; i++) {
		sptr = &config->i2c[bus].speed_config[i];
		if (sptr->speed == speed) {
			lpss_i2c_set_speed_config(bus, sptr);
			break;
		}
	}
}