summaryrefslogtreecommitdiff
path: root/src/soc/intel/skylake
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/skylake')
-rw-r--r--src/soc/intel/skylake/bootblock/i2c.c14
-rw-r--r--src/soc/intel/skylake/chip.h2
-rw-r--r--src/soc/intel/skylake/i2c.c18
3 files changed, 5 insertions, 29 deletions
diff --git a/src/soc/intel/skylake/bootblock/i2c.c b/src/soc/intel/skylake/bootblock/i2c.c
index 64b1fb57e7..92ca861dcb 100644
--- a/src/soc/intel/skylake/bootblock/i2c.c
+++ b/src/soc/intel/skylake/bootblock/i2c.c
@@ -46,8 +46,6 @@ static void i2c_early_init_bus(unsigned bus)
{
ROMSTAGE_CONST struct soc_intel_skylake_config *config;
ROMSTAGE_CONST struct device *tree_dev;
- const struct lpss_i2c_speed_config *sptr;
- enum i2c_speed speed;
pci_devfn_t dev;
int devfn;
uintptr_t base;
@@ -86,17 +84,7 @@ static void i2c_early_init_bus(unsigned bus)
write32(reg, value);
/* Initialize the controller */
- 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 (value = 0; value < LPSS_I2C_SPEED_CONFIG_COUNT; value++) {
- sptr = &config->i2c[bus].speed_config[value];
- if (sptr->speed == speed) {
- lpss_i2c_set_speed_config(bus, sptr);
- break;
- }
- }
+ lpss_i2c_init(bus, &config->i2c[bus]);
}
void i2c_early_init(void)
diff --git a/src/soc/intel/skylake/chip.h b/src/soc/intel/skylake/chip.h
index a141a34916..1b699520ac 100644
--- a/src/soc/intel/skylake/chip.h
+++ b/src/soc/intel/skylake/chip.h
@@ -201,7 +201,7 @@ struct soc_intel_skylake_config {
/* I2C */
/* Bus voltage level, default is 3.3V */
enum skylake_i2c_voltage i2c_voltage[SKYLAKE_I2C_DEV_MAX];
- struct skylake_i2c_config i2c[SKYLAKE_I2C_DEV_MAX];
+ struct lpss_i2c_bus_config i2c[SKYLAKE_I2C_DEV_MAX];
/* Camera */
u8 Cio2Enable;
diff --git a/src/soc/intel/skylake/i2c.c b/src/soc/intel/skylake/i2c.c
index d37c290079..c8f02943d1 100644
--- a/src/soc/intel/skylake/i2c.c
+++ b/src/soc/intel/skylake/i2c.c
@@ -56,24 +56,12 @@ static int i2c_dev_to_bus(struct device *dev)
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);
+ int 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;
- }
- }
+ lpss_i2c_init(bus, &config->i2c[bus]);
}
/* Generate ACPI I2C device objects */
@@ -86,7 +74,7 @@ static void i2c_fill_ssdt(struct device *dev)
return;
acpigen_write_scope(acpi_device_path(dev));
- lpss_i2c_acpi_fill_ssdt(config->i2c[bus].speed_config);
+ lpss_i2c_acpi_fill_ssdt(&config->i2c[bus]);
acpigen_pop_len();
}