changeset 3876:0f0878646852

efm32/board: Add I2C slave device declaration to STK3x00 board
author Nicolas Pouillon <nipo@ssji.net>
date Mon, 16 Apr 2018 22:13:19 +0200
parents 505ae09f1a45
children 17707fd0e782
files arch/efm32/boards/stk3x00_678.c
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/arch/efm32/boards/stk3x00_678.c	Sun Apr 15 10:39:57 2018 +0200
+++ b/arch/efm32/boards/stk3x00_678.c	Mon Apr 16 22:13:19 2018 +0200
@@ -303,6 +303,26 @@
 
 #endif
 
+#ifdef CONFIG_DRIVER_EFM32_I2C_SLAVE
+
+DEV_DECLARE_STATIC(i2c_dev, "i2cs0", 0, efm32_i2c_slave_drv,
+                   DEV_STATIC_RES_MEM(0x4000a400, 0x4000a800),
+# ifdef CONFIG_DEVICE_CLOCK
+                   DEV_STATIC_RES_CLK_SRC("/recmu", EFM32_CLOCK_I2C1, 0),
+# else
+                   DEV_STATIC_RES_FREQ(14000000, 1),
+# endif
+                   DEV_STATIC_RES_DEV_ICU("/cpu"),
+                   DEV_STATIC_RES_IRQ(0, EFM32_IRQ_I2C1, DEV_IRQ_SENSE_RISING_EDGE, 0, 1),
+
+                   DEV_STATIC_RES_DEV_IOMUX("/gpio"),
+
+                   DEV_STATIC_RES_IOMUX("scl", EFM32_LOC0, EFM32_PC5, 0, 0),
+                   DEV_STATIC_RES_IOMUX("sda", EFM32_LOC0, EFM32_PC4, 0, 0)
+                   );
+
+#endif
+
 #ifdef CONFIG_DRIVER_EFM32_PWM
 
 DEV_DECLARE_STATIC(pwm_dev, "pwm3", 0, efm32_pwm_drv,