Skip to contentSkip to conversation

soft_i2c.c compiler/linker error

PATCH New Jens Scharsig 3 participants 10 messages Mar 27, 2009 – Mar 31, 2009 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soft_i2c.c compiler/linker error

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef

---

drivers/i2c/soft_i2c.c +2 -1
index ed5f5b2..68b267f 100644
@@ -246,6 +246,7 @@ int i2c_set_bus_num(unsigned int bus)
 #endif
 	return 0;
 }
+#endif
 
 /* TODO: add 100/400k switching */
 unsigned int i2c_get_bus_speed(void)
@@ -260,7 +261,7 @@ int i2c_set_bus_speed(unsigned int speed)
 
 	return 0;
 }
-#endif
+
 
 /*-----------------------------------------------------------------------
  * if ack == I2C_ACK, ACK the byte so can continue reading, else
#1 lore raw

PATCH 1/1 soft_i2c.c compiler/linker error

Quoted 8 lines · Jens Scharsig

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef

NACK

you must implement it

Best Regards,
J.

#2 lore raw

PATCH 1/1 soft_i2c.c compiler/linker error

Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · Jens Scharsig

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

Quoted 6 lines
Quoted 3 lines

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef

NACK

you must implement it

Pleace a liltle bit more informations

What exactly must I implement?

I2C_MULTI_BUS or i2c_get_bus_speed / i2c_set_bus_speed

Is the driver (soft_i2c.c) not the right pleace for i2c_set/get_bus_speed?

Best Regards,
Jens Scharsig

#5 lore raw

PATCH 1/1 soft_i2c.c compiler/linker error

In reply to Jens Scharsig

Hello Jens,

Quoted 23 lines · Jens Scharsig

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef

---

drivers/i2c/soft_i2c.c +1 -0
index ed5f5b2..68b267f 100644
@@ -246,6 +246,7 @@ int i2c_set_bus_num(unsigned int bus)
 #endif
 	return 0;
 }
+#endif
 
 /* TODO: add 100/400k switching */
 unsigned int i2c_get_bus_speed(void)

drivers/i2c/soft_i2c.c int i2c_set_bus_speed(unsigned int speed) · line 265

Quoted 6 lines
drivers/i2c/soft_i2c.c +1 -1
@@ -260,7 +261,7 @@ int i2c_set_bus_speed(unsigned int speed)
 
 	return 0;
 }
-#endif
+
 

no need to add an empty line.

[...]

thanks for catching
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany 
#3 lore raw

PATCH 1/1 soft_i2c.c compiler/linker error

In reply to Jean-Christophe PLAGNIOL-VILLARD

Hello Jean-Christophe

Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · Jens Scharsig

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

Quoted 8 lines
Quoted 4 lines

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef

NACK

you must implement it

It is implemented in the driver, but not activated, because wrong define order ... I think this patch is OK.

bye
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany 
#6 lore raw

PATCH v2 1/1 soft_i2c.c compiler/linker error

In reply to Jens Scharsig

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef (wrong define order)

and

removes additional empty lines

---

drivers/i2c/soft_i2c.c +1 -5
index ed5f5b2..185634d 100644
@@ -51,14 +51,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
-
 /*-----------------------------------------------------------------------
  * Definitions
  */
 
 #define RETRIES		0
 
-
 #define I2C_ACK		0		/* PD_SDA level to ack a byte */
 #define I2C_NOACK	1		/* PD_SDA level to noack a byte */
 
@@ -154,7 +152,6 @@ static void send_stop(void)
 	I2C_TRISTATE;
 }
 
-
 /*-----------------------------------------------------------------------
  * ack should be I2C_ACK or I2C_NOACK
  */
@@ -174,7 +171,6 @@ static void send_ack(int ack)
 	I2C_DELAY;
 }
 
-
 /*-----------------------------------------------------------------------
  * Send 8 bits and look for an acknowledgement.
  */
@@ -246,6 +242,7 @@ int i2c_set_bus_num(unsigned int bus)
 #endif
 	return 0;
 }
+#endif
 
 /* TODO: add 100/400k switching */
 unsigned int i2c_get_bus_speed(void)
@@ -260,7 +257,6 @@ int i2c_set_bus_speed(unsigned int speed)
 
 	return 0;
 }
-#endif
 
 /*-----------------------------------------------------------------------
  * if ack == I2C_ACK, ACK the byte so can continue reading, else
#4 lore raw

PATCH 1/1 soft_i2c.c compiler/linker error

In reply to Heiko Schocher
Quoted 16 lines · Heiko Schocher

Hello Jean-Christophe

Quoted 13 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Jens Scharsig

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef

NACK

Quoted 9 lines
Quoted 2 lines

you must implement it

It is implemented in the driver, but not activated, because wrong define order ... I think this patch is OK.

bye
Heiko

Thanks for the confirmation. That was my thought. Only my description was bad or not completely.

regards Jens

#8 lore raw

PATCH 1/1 soft_i2c.c compiler/linker error

In reply to Heiko Schocher

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef (wrong define order)

and

removes additional empty lines

---

drivers/i2c/soft_i2c.c +1 -5
index ed5f5b2..185634d 100644
@@ -51,14 +51,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
-
 /*-----------------------------------------------------------------------
  * Definitions
  */
 
 #define RETRIES		0
 
-
 #define I2C_ACK		0		/* PD_SDA level to ack a byte */
 #define I2C_NOACK	1		/* PD_SDA level to noack a byte */
 
@@ -154,7 +152,6 @@ static void send_stop(void)
 	I2C_TRISTATE;
 }
 
-
 /*-----------------------------------------------------------------------
  * ack should be I2C_ACK or I2C_NOACK
  */
@@ -174,7 +171,6 @@ static void send_ack(int ack)
 	I2C_DELAY;
 }
 
-
 /*-----------------------------------------------------------------------
  * Send 8 bits and look for an acknowledgement.
  */
@@ -246,6 +242,7 @@ int i2c_set_bus_num(unsigned int bus)
 #endif
 	return 0;
 }
+#endif
 
 /* TODO: add 100/400k switching */
 unsigned int i2c_get_bus_speed(void)
@@ -260,7 +257,6 @@ int i2c_set_bus_speed(unsigned int speed)
 
 	return 0;
 }
-#endif
 
 /*-----------------------------------------------------------------------
  * if ack == I2C_ACK, ACK the byte so can continue reading, else
#7 lore raw

PATCH v2 1/1 soft_i2c.c compiler/linker error

In reply to Jens Scharsig

Hello Jens,

Quoted 6 lines · Jens Scharsig

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef (wrong define order)

This line is too long also s/uesd/used should be done ... I fix this, when apply this patch (or you send me a new one)

bye
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#9 lore raw

PATCH 1/1 soft_i2c.c compiler/linker error

In reply to Jens Scharsig

Hello Jens,

Quoted 5 lines · Jens Scharsig

This patch fix the compiler/linker errors

common/cmd_i2c.c:1252: undefined reference to i2c_get_bus_speed' common/cmd_i2c.c:1256: undefined reference to i2c_set_bus_speed'

Quoted 8 lines

if board use CONFIG_I2C_CMD_TREE and CONFIG_I2C_MULTI_BUS is not uesd/undef (wrong define order)

and

removes additional empty lines

Applied to u-boot-i2c.git

thanks
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany