[U-Boot] [PATCH 1/7] armv8: lx2160a: The lx2160a platform supports the I2C driver model.
Heiko Schocher
hs at denx.de
Fri May 24 04:48:51 UTC 2019
Hello Chuanhua Han,
Am 23.05.2019 um 11:22 schrieb Chuanhua Han:
> DM_I2C_COMPAT is a compatibility layer that allows using the non-DM I2C
> API when DM_I2C is used.When DM_I2C_COMPAT is not enabled for
> compilation, a compilation error will be generated. This patch solves
> the problem that the i2c-related api of the lx2160a platform does not
> support dm.
>
> Signed-off-by: Chuanhua Han <chuanhua.han at nxp.com>
> ---
> arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 8 ---
> board/freescale/common/emc2305.c | 21 ++++++
> board/freescale/common/qixis.c | 17 +++++
> board/freescale/common/sys_eeprom.c | 84 +++++++++++++++++++++--
> board/freescale/common/vid.c | 84 +++++++++++++++++++++++
> board/freescale/lx2160a/lx2160a.c | 8 +++
> drivers/ddr/fsl/main.c | 36 +++++++++-
> 7 files changed, 245 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> index a843c1eb65..f3eaab960b 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> @@ -234,14 +234,6 @@ config ARCH_LX2160A
> select ARCH_EARLY_INIT_R
> select BOARD_EARLY_INIT_F
> select SYS_I2C_MXC
> - select SYS_I2C_MXC_I2C1
> - select SYS_I2C_MXC_I2C2
> - select SYS_I2C_MXC_I2C3
> - select SYS_I2C_MXC_I2C4
> - select SYS_I2C_MXC_I2C5
> - select SYS_I2C_MXC_I2C6
> - select SYS_I2C_MXC_I2C7
> - select SYS_I2C_MXC_I2C8
> imply DISTRO_DEFAULTS
> imply PANIC_HANG
> imply SCSI
> diff --git a/board/freescale/common/emc2305.c b/board/freescale/common/emc2305.c
> index 8523084da9..b1ca051db2 100644
> --- a/board/freescale/common/emc2305.c
> +++ b/board/freescale/common/emc2305.c
> @@ -24,10 +24,22 @@ void set_fan_speed(u8 data)
> I2C_EMC2305_FAN5};
>
> for (index = 0; index < NUM_OF_FANS; index++) {
> +#ifndef CONFIG_DM_I2C
> if (i2c_write(I2C_EMC2305_ADDR, Fan[index], 1, &data, 1) != 0) {
> printf("Error: failed to change fan speed @%x\n",
> Fan[index]);
> }
As you switch to DM_I2C, please remove the none DM_I2C case.
Or is there a reason to support the none DM_I2C case?
bye,
Heiko
--
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs at denx.de
More information about the U-Boot
mailing list