All of lore.kernel.org
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 8/8] driver/i2c/mxc: Add I2C3 and I2C4 for LS2085A
Date: Fri, 20 Mar 2015 09:09:21 -0700	[thread overview]
Message-ID: <550C4631.3080306@freescale.com> (raw)
In-Reply-To: <550BB0AF.3000800@denx.de>

On 03/19/2015 10:31 PM, Heiko Schocher wrote:
> Hello Yrok,
> 
> Am 19.03.2015 17:20, schrieb York Sun:
>> LS2085A uses mxc I2C driver and has four I2C buses.
>>
>> Signed-off-by: York Sun <yorksun@freescale.com>
>> CC: Heiko Schocher <hs@denx.de>
>> ---
>>   drivers/i2c/mxc_i2c.c |   16 +++++++++++++++-
>>   1 file changed, 15 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
>> index fc5ee35..02a173e 100644
>> --- a/drivers/i2c/mxc_i2c.c
>> +++ b/drivers/i2c/mxc_i2c.c
>> @@ -114,6 +114,9 @@ static u16 i2c_clk_div[50][2] = {
>>   #ifndef CONFIG_SYS_MXC_I2C3_SPEED
>>   #define CONFIG_SYS_MXC_I2C3_SPEED 100000
>>   #endif
>> +#ifndef CONFIG_SYS_MXC_I2C4_SPEED
>> +#define CONFIG_SYS_MXC_I2C4_SPEED 100000
>> +#endif
>>
>>   #ifndef CONFIG_SYS_MXC_I2C1_SLAVE
>>   #define CONFIG_SYS_MXC_I2C1_SLAVE 0
>> @@ -124,6 +127,9 @@ static u16 i2c_clk_div[50][2] = {
>>   #ifndef CONFIG_SYS_MXC_I2C3_SLAVE
>>   #define CONFIG_SYS_MXC_I2C3_SLAVE 0
>>   #endif
>> +#ifndef CONFIG_SYS_MXC_I2C4_SLAVE
>> +#define CONFIG_SYS_MXC_I2C4_SLAVE 0
>> +#endif
>>
>>
>>   /*
>> @@ -545,10 +551,18 @@ U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe,
>>   			 CONFIG_SYS_MXC_I2C2_SLAVE, 1)
>>   #if defined(CONFIG_MX31) || defined(CONFIG_MX35) ||\
>>   	defined(CONFIG_MX51) || defined(CONFIG_MX53) ||\
>> -	defined(CONFIG_MX6) || defined(CONFIG_LS102XA)
>> +	defined(CONFIG_MX6) || defined(CONFIG_LS102XA) ||\
>> +	defined(CONFIG_LS2085A)
>>   U_BOOT_I2C_ADAP_COMPLETE(mxc2, mxc_i2c_init, mxc_i2c_probe,
>>   			 mxc_i2c_read, mxc_i2c_write,
>>   			 mxc_i2c_set_bus_speed,
>>   			 CONFIG_SYS_MXC_I2C3_SPEED,
>>   			 CONFIG_SYS_MXC_I2C3_SLAVE, 2)
>>   #endif
>> +#ifdef CONFIG_LS2085A
>> +U_BOOT_I2C_ADAP_COMPLETE(mxc3, mxc_i2c_init, mxc_i2c_probe,
>> +			 mxc_i2c_read, mxc_i2c_write,
>> +			 mxc_i2c_set_bus_speed,
>> +			 CONFIG_SYS_MXC_I2C4_SPEED,
>> +			 CONFIG_SYS_MXC_I2C4_SLAVE, 3)
>> +#endif
> 
> Dummy question ... CONFIG_LS2085A (and CONFIG_LS102XA) are
> board spezific defines, right?
> 
> If so, I do not want them in driver specific code... because
> every board which uses this driver has to add here more defines.
> 
> Could you introduce a SoC or at least a driver specific define
> here? Maybe CONFIG_SYS_I2C_MXC_I2C4 if no SoC specific code
> is possible ...
> 

Agree. Will fix in next version. Thanks.

York

  reply	other threads:[~2015-03-20 16:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 16:20 [U-Boot] [PATCH 1/8] armv8/fsl-lsch3: Add Freescale Debug Server driver York Sun
2015-03-19 16:20 ` [U-Boot] [PATCH 2/8] fsl-ch3/README: Add description for NOR flash layout (firmware images) York Sun
2015-03-19 16:20 ` [U-Boot] [PATCH 3/8] driver/fsl-mc: Add support of MC Flibs York Sun
2015-03-19 16:20 ` [U-Boot] [PATCH 4/8] driver/ldpaa_eth: Add LDPAA Ethernet driver York Sun
2015-03-19 16:20 ` [U-Boot] [PATCH 5/8] board/ls2085_common: Increase malloc length York Sun
2015-03-19 16:20 ` [U-Boot] [PATCH 6/8] driver/fsl_ifc: Add support to finalize CS1, CS3 address binding York Sun
2015-03-19 16:20 ` [U-Boot] [PATCH 7/8] nand/fsl_ifc: Increase eccstat[] for IFC 2.0 York Sun
2015-03-19 16:20 ` [U-Boot] [PATCH 8/8] driver/i2c/mxc: Add I2C3 and I2C4 for LS2085A York Sun
2015-03-20  5:31   ` Heiko Schocher
2015-03-20 16:09     ` York Sun [this message]
2015-04-23 23:36 ` [U-Boot] [PATCH 1/8] armv8/fsl-lsch3: Add Freescale Debug Server driver York Sun

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=550C4631.3080306@freescale.com \
    --to=yorksun@freescale.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.