Patchwork [U-Boot,05/13] I2c: add missing i2c_set_bus_num to mxc_i2c

login
register
mail settings
Submitter Stefano Babic
Date Oct. 8, 2011, 4:36 p.m.
Message ID <1318091769-30979-6-git-send-email-sbabic@denx.de>
Download mbox | patch
Permalink /patch/118553/
State Changes Requested
Headers show

Comments

Stefano Babic - Oct. 8, 2011, 4:36 p.m.
The function i2c_set_bus_num() is used on most SOCs.
The driver does not support multiple I2C busses, and
an empty function is added to be compatible with general code
(example: PMIC driver).

Signed-off-by: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
---
 drivers/i2c/mxc_i2c.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Heiko Schocher - Oct. 10, 2011, 8:50 a.m.
Hello Stefano,

Stefano Babic wrote:
> The function i2c_set_bus_num() is used on most SOCs.
> The driver does not support multiple I2C busses, and
> an empty function is added to be compatible with general code
> (example: PMIC driver).
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>  drivers/i2c/mxc_i2c.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

Hmm... it would be better to add a weak function in
u-boot/common/cmd_i2c.c ... as it is done for i2c_set_bus_speed()
and i2c_get_bus_speed() functions.

bye,
Heiko
Stefano Babic - Oct. 10, 2011, 9:30 a.m.
On 10/10/2011 10:50 AM, Heiko Schocher wrote:
> Hello Stefano,
> 
> Stefano Babic wrote:
>> The function i2c_set_bus_num() is used on most SOCs.
>> The driver does not support multiple I2C busses, and
>> an empty function is added to be compatible with general code
>> (example: PMIC driver).
>>
>> Signed-off-by: Stefano Babic <sbabic@denx.de>
>> Cc: Heiko Schocher <hs@denx.de>
>> ---
>>  drivers/i2c/mxc_i2c.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> Hmm... it would be better to add a weak function in
> u-boot/common/cmd_i2c.c ... as it is done for i2c_set_bus_speed()
> and i2c_get_bus_speed() functions.

Good idea, I missed it..changed in V2.

Stefano

Patch

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 2869d7c..de878ce 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -450,4 +450,9 @@  int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
 
 	return ret;
 }
+
+int i2c_set_bus_num(unsigned int bus)
+{
+	return 0;
+}
 #endif /* CONFIG_HARD_I2C */