summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLijian Zhao <lijian.zhao@intel.com>2017-11-09 15:52:16 -0800
committerAaron Durbin <adurbin@chromium.org>2017-11-13 17:39:53 +0000
commite1f4d790e43e62f00edfe70602de0cf4da4b9e92 (patch)
treeb8eb60e15c323a8f9da367f77b2abe4855f32e5f
parentf3885618d91d47be8d6ffddeb4118d7027863c64 (diff)
soc/intel/common: Add error print in common i2c
Print error message when using common i2c without default clock defined. TEST=Do not define default clock in Kconfig, compile will stop for assertion. Change-Id: I803f97698b3928e6b64df0010e71a6ded1400f87 Signed-off-by: Lijian Zhao <lijian.zhao@intel.com> Reviewed-on: https://review.coreboot.org/22405 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
-rw-r--r--src/soc/intel/common/block/i2c/lpss_i2c.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/soc/intel/common/block/i2c/lpss_i2c.c b/src/soc/intel/common/block/i2c/lpss_i2c.c
index 7db3fe9668..34e04ecf1b 100644
--- a/src/soc/intel/common/block/i2c/lpss_i2c.c
+++ b/src/soc/intel/common/block/i2c/lpss_i2c.c
@@ -540,9 +540,8 @@ int lpss_i2c_gen_speed_config(struct lpss_i2c_regs *regs,
uint16_t hcnt_min, lcnt_min;
int i;
- /* Clock must be provided by Kconfig */
- if (!ic_clk)
- return -1;
+ _Static_assert(CONFIG_SOC_INTEL_COMMON_LPSS_CLOCK_MHZ != 0,
+ "SOC_INTEL_COMMON_LPSS_CLOCK_MHZ can't be zero!");
/* Apply board specific override for this speed if found */
for (i = 0; i < LPSS_I2C_SPEED_CONFIG_COUNT; i++) {