diff options
author | Pedro Perez de Heredia <pedro.perez@digi.com> | 2012-02-17 12:34:35 +0100 |
---|---|---|
committer | Pedro Perez de Heredia <pedro.perez@digi.com> | 2012-02-18 20:44:23 +0100 |
commit | f8e87995d1baaf51983188a065d7fc9245376df2 (patch) | |
tree | a16ff523d7db9b76c741f5137af6fca9de28ad40 | |
parent | 4c81d3c2923c64a987c7c9be2c4022effd0bad81 (diff) |
ccxmx5x: add configuration options to set i2c speed
Signed-off-by: Pedro Perez de Heredia <pedro.perez@digi.com>
-rw-r--r-- | arch/arm/configs/imx5_ccwmx53js_defconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-mx5/Kconfig | 35 | ||||
-rw-r--r-- | arch/arm/mach-mx5/devices.c | 15 | ||||
-rwxr-xr-x | arch/arm/mach-mx5/devices_ccxmx5x.h | 17 |
4 files changed, 68 insertions, 7 deletions
diff --git a/arch/arm/configs/imx5_ccwmx53js_defconfig b/arch/arm/configs/imx5_ccwmx53js_defconfig index 9aced203974e..a1339c59de79 100644 --- a/arch/arm/configs/imx5_ccwmx53js_defconfig +++ b/arch/arm/configs/imx5_ccwmx53js_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.35.14 -# Sun Feb 5 14:05:52 2012 +# Fri Feb 17 11:33:26 2012 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -342,8 +342,14 @@ CONFIG_SPI_MXC_SELECT1=y # # I2C Interface options # +# CONFIG_CONFIG_MXC_I2C1_STANDARD is not set +CONFIG_CONFIG_MXC_I2C1_FAST=y # CONFIG_I2C_MX_SELECT2 is not set +# CONFIG_CONFIG_MXC_I2C2_STANDARD is not set +CONFIG_CONFIG_MXC_I2C2_FAST=y CONFIG_I2C_MX_SELECT3=y +# CONFIG_CONFIG_MXC_I2C3_STANDARD is not set +CONFIG_CONFIG_MXC_I2C3_FAST=y # # CAN Port Options diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index 5ba1e259ed2d..8759cca99c94 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig @@ -564,6 +564,17 @@ config I2C_MX_SELECT1 depends on !MODULE_CCXMX5X help Enable MX51/MX53 I2C1 module. +choice + prompt "I2C1 speed" + default CONFIG_MXC_I2C1_FAST + depends on I2C_MXC || I2C_IMX + +config CONFIG_MXC_I2C1_STANDARD + bool "Standard (100 KHz)" + +config CONFIG_MXC_I2C1_FAST + bool "Fast (400 KHz)" +endchoice config I2C_MX_SELECT2 bool "Enable I2C2 module" @@ -572,6 +583,18 @@ config I2C_MX_SELECT2 help Enable MX51/MX53 I2C2 module. +choice + prompt "I2C2 speed" + default CONFIG_MXC_I2C2_FAST + depends on I2C_MXC || I2C_IMX + +config CONFIG_MXC_I2C2_STANDARD + bool "Standard (100 KHz)" + +config CONFIG_MXC_I2C2_FAST + bool "Fast (400 KHz)" +endchoice + config I2C_MX_SELECT3 bool "Enable I2C3 module" default n @@ -579,6 +602,18 @@ config I2C_MX_SELECT3 help Enable MX51/MX53 I2C3 module. +choice + prompt "I2C3 speed" + default CONFIG_MXC_I2C3_FAST + depends on I2C_MXC || I2C_IMX + +config CONFIG_MXC_I2C3_STANDARD + bool "Standard (100 KHz)" + +config CONFIG_MXC_I2C3_FAST + bool "Fast (400 KHz)" +endchoice + endmenu menu "CAN Port Options" diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c index 6b0f6598ca04..f18e4a85be48 100644 --- a/arch/arm/mach-mx5/devices.c +++ b/arch/arm/mach-mx5/devices.c @@ -39,6 +39,9 @@ #ifdef CONFIG_MODULE_CCXMX53 #include "devices_ccwmx53.h" #endif +#ifdef CONFIG_MODULE_CCXMX5X +#include "devices_ccxmx5x.h" +#endif #include "crm_regs.h" #include <linux/fec.h> @@ -744,29 +747,29 @@ static struct resource mxci2c3_resources[] = { #if defined(CONFIG_I2C_MXC) || defined(CONFIG_I2C_MXC_MODULE) struct mxc_i2c_platform_data mxci2c1_data = { - .i2c_clk = 400000, + .i2c_clk = MXC_I2C1_BITRATE, }; struct mxc_i2c_platform_data mxci2c2_data = { - .i2c_clk = 400000, + .i2c_clk = MXC_I2C2_BITRATE, }; struct mxc_i2c_platform_data mxci2c3_data = { - .i2c_clk = 400000, + .i2c_clk = MXC_I2C3_BITRATE, }; #elif defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE) struct imxi2c_platform_data mxci2c1_data = { - .bitrate = 100000, + .bitrate = MXC_I2C1_BITRATE, }; struct imxi2c_platform_data mxci2c2_data = { - .bitrate = 100000, + .bitrate = MXC_I2C2_BITRATE, }; struct imxi2c_platform_data mxci2c3_data = { - .bitrate = 100000, + .bitrate = MXC_I2C3_BITRATE, }; #endif diff --git a/arch/arm/mach-mx5/devices_ccxmx5x.h b/arch/arm/mach-mx5/devices_ccxmx5x.h index a9eb4b31d5f5..39511d248426 100755 --- a/arch/arm/mach-mx5/devices_ccxmx5x.h +++ b/arch/arm/mach-mx5/devices_ccxmx5x.h @@ -28,4 +28,21 @@ extern int ccxmx5x_create_sysfs_entries(void); #include "board-ccwmx53.h" #endif +/* I2C interrfaces configuration */ +#ifdef CONFIG_MXC_I2C1_FAST +#define MXC_I2C1_BITRATE 400000 +#else +#define MXC_I2C1_BITRATE 100000 +#endif +#ifdef CONFIG_MXC_I2C2_FAST +#define MXC_I2C2_BITRATE 400000 +#else +#define MXC_I2C2_BITRATE 100000 +#endif +#ifdef CONFIG_MXC_I2C3_FAST +#define MXC_I2C3_BITRATE 400000 +#else +#define MXC_I2C3_BITRATE 100000 +#endif + #endif /* __DEVICES_CCXMX5X_H_ */ |