From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Mon, 22 Oct 2012 18:05:54 +0200 Subject: [U-Boot] [PATCH v2 3/5] pmic_fsl: Introduce CONFIG_SYS_FSL_PMIC_I2C_LENGTH In-Reply-To: References: <1350343930-15648-1-git-send-email-festevam@gmail.com> <1350343930-15648-3-git-send-email-festevam@gmail.com> <507D71A6.60803@denx.de> Message-ID: <20121022180554.56e15db7@amdc308.digital.local> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Fabio, > On Tue, Oct 16, 2012 at 11:39 AM, Stefano Babic > wrote: > > >> --- a/drivers/misc/pmic_fsl.c > >> +++ b/drivers/misc/pmic_fsl.c > >> @@ -53,7 +53,7 @@ int pmic_init(void) > >> #elif defined(CONFIG_PMIC_I2C) > >> p->interface = PMIC_I2C; > >> p->hw.i2c.addr = CONFIG_SYS_FSL_PMIC_I2C_ADDR; > >> - p->hw.i2c.tx_num = 3; > >> + p->hw.i2c.tx_num = CONFIG_SYS_FSL_PMIC_I2C_LENGTH; > > > > The bad thing with it is that it seems that each board can have a > > different value. However, this is bound to the selected pmic and > > not to the board. So IMHO it should not go into the board > > configuration file, but in the pmic specific initialization. > > Ok, understood. > > What about putting CONFIG_SYS_FSL_PMIC_I2C_LENGTH inside the PMIC > include file, such as > include/dialog_pmic.h > include/mc13783.h > include/mc13892.h ? > I totally agree. This definition looks like PMIC device specific and shall be defined at proper *.h file (as you proposed). Moreover the p->hw.i2c.tx_num = CONFIG_SYS_FSL_PMIC_I2C_LENGTH; shall be assigned at per pmic instantiation: int pmic_init(bus) { ... p->hw.i2c.tx_num = CONFIG_SYS_FSL_PMIC_I2C_LENGTH; ... } This should solve your problem. -- Best regards, Lukasz Majewski Samsung Poland R&D Center | Linux Platform Group