All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuanhua Han <chuanhua.han@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/7] drivers: i2c: mxc: Solve the compiler error when using i2c dm mode
Date: Thu, 23 May 2019 17:22:05 +0800	[thread overview]
Message-ID: <20190523092207.41906-5-chuanhua.han@nxp.com> (raw)
In-Reply-To: <20190523092207.41906-1-chuanhua.han@nxp.com>

This patch solved the following compilation error:

1.Remove the definition of CONFIG_SYS_I2C to solve the following
compilation issue:
In file included from include/config.h:8:0,
                 from include/common.h:20:
include/config_fallbacks.h:51:4: error: #error "Cannot define
CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
 #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
    ^~~~~
In file included from include/config.h:8:0,
                 from include/common.h:20:
include/config_fallbacks.h:51:4: error: #error "Cannot define
CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
 #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
    ^~~~~

2.Remove the definition of CONFIG_SYS_I2C_EARLY_INIT to solve the
following compilation issue:
board/freescale/lx2160a/lx2160a.c: In function 'board_early_init_f':
board/freescale/lx2160a/lx2160a.c:108:2: warning: implicit declaration
of function 'i2c_early_init_f'; did you mean 'arch_early_init_r'?
[-Wimplicit-function-declaration]
  i2c_early_init_f();
  ^~~~~~~~~~~~~~~~
  arch_early_init_r

3.Move the enable_i2c_clk function definition to resolve the following
compilation issues:
  drivers/i2c/mxc_i2c.c: In function 'mxc_i2c_probe':
  drivers/i2c/mxc_i2c.c:824:8: warning: implicit declaration of function
'enable_i2c_clk';
  did you mean 'enable_irq_wake'? [-Wimplicit-function-declaration]
  ret = enable_i2c_clk(1, bus->seq);
        ^~~~~~~~~~~~~~
        enable_irq_wake

Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
---
 arch/arm/include/asm/arch-fsl-layerscape/config.h |  2 --
 drivers/i2c/mxc_i2c.c                             | 15 ++++++++-------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/arm/include/asm/arch-fsl-layerscape/config.h b/arch/arm/include/asm/arch-fsl-layerscape/config.h
index eb21c09e01..5f87499980 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/config.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/config.h
@@ -178,8 +178,6 @@
 #elif defined(CONFIG_ARCH_LX2160A)
 #define TZPC_BASE				0x02200000
 #define TZPCDECPROT_0_SET_BASE			(TZPC_BASE + 0x804)
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_EARLY_INIT
 #define SRDS_MAX_LANES  8
 #ifndef L1_CACHE_BYTES
 #define L1_CACHE_SHIFT		6
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index f3811eb0c5..241367bac8 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -558,6 +558,14 @@ static int i2c_read_data(struct mxc_i2c_bus *i2c_bus, uchar chip, uchar *buf,
 	return 0;
 }
 
+int __enable_i2c_clk(unsigned char enable, unsigned int i2c_num)
+{
+	return 1;
+}
+
+int enable_i2c_clk(unsigned char enable, unsigned int i2c_num)
+	__attribute__((weak, alias("__enable_i2c_clk")));
+
 #ifndef CONFIG_DM_I2C
 /*
  * Read data from I2C device
@@ -723,13 +731,6 @@ static int mxc_i2c_probe(struct i2c_adapter *adap, uint8_t chip)
 	return bus_i2c_write(i2c_get_base(adap), chip, 0, 0, NULL, 0);
 }
 
-int __enable_i2c_clk(unsigned char enable, unsigned i2c_num)
-{
-	return 1;
-}
-int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
-	__attribute__((weak, alias("__enable_i2c_clk")));
-
 void bus_i2c_init(int index, int speed, int unused,
 		  int (*idle_bus_fn)(void *p), void *idle_bus_data)
 {
-- 
2.17.1

  parent reply	other threads:[~2019-05-23  9:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23  9:22 [U-Boot] [PATCH 1/7] armv8: lx2160a: The lx2160a platform supports the I2C driver model Chuanhua Han
2019-05-23  9:22 ` [U-Boot] [PATCH 2/7] configs: lx2160a: enable DM support for pcf2127 rtc Chuanhua Han
2019-05-23  9:22 ` [U-Boot] [PATCH 3/7] armv8: dts: fsl-lx2160a: add i2c controller and gpio DT nodes Chuanhua Han
2019-05-24  4:50   ` Heiko Schocher
2019-05-23  9:22 ` [U-Boot] [PATCH 4/7] armv8: lx2160ardb : Add pcf2127 node Chuanhua Han
2019-05-24  4:52   ` Heiko Schocher
2019-05-23  9:22 ` Chuanhua Han [this message]
2019-05-24  4:58   ` [U-Boot] [PATCH 5/7] drivers: i2c: mxc: Solve the compiler error when using i2c dm mode Heiko Schocher
2019-05-30  3:44     ` [U-Boot] [EXT] " Chuanhua Han
2019-05-23  9:22 ` [U-Boot] [PATCH 6/7] gpio: do not include <asm/arch/gpio.h> on ARCH_LX2160A Chuanhua Han
2019-05-24  5:01   ` Heiko Schocher
2019-05-30  3:39     ` [U-Boot] [EXT] " Chuanhua Han
2019-05-23  9:22 ` [U-Boot] [PATCH 7/7] armv8: lx2160ardb : Add slave nodes under the i2c0 controller Chuanhua Han
2019-05-24  5:03   ` Heiko Schocher
2019-05-30  3:18     ` [U-Boot] [EXT] " Chuanhua Han
2019-05-24  4:48 ` [U-Boot] [PATCH 1/7] armv8: lx2160a: The lx2160a platform supports the I2C driver model Heiko Schocher
2019-05-30  3:46   ` [U-Boot] [EXT] " Chuanhua Han

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190523092207.41906-5-chuanhua.han@nxp.com \
    --to=chuanhua.han@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.