From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Grinberg Date: Thu, 18 Sep 2014 10:23:44 +0300 Subject: [U-Boot] [PATCH v2 08/11] dm: imx: Use gpio_request() to request GPIOs In-Reply-To: References: <1410925884-8767-1-git-send-email-sjg@chromium.org> <1410925884-8767-9-git-send-email-sjg@chromium.org> <54197AED.8030304@compulab.co.il> <54199B41.1020702@compulab.co.il> Message-ID: <541A8880.2090305@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/17/14 17:34, Simon Glass wrote: > Hi Igor, > > On 17 September 2014 08:31, Igor Grinberg > wrote: > > On 09/17/14 17:00, Simon Glass wrote: > > Hi Igor, > > > > On 17 September 2014 06:13, Igor Grinberg >> wrote: > > > > Hi Simon, > > > > On 09/17/14 06:51, Simon Glass wrote: > > > GPIOs should be requested before use. Without this, driver model will not > > > permit the GPIO to be used. > > > > > > Signed-off-by: Simon Glass >> > > > --- > > > > > > Changes in v2: > > > - Check return values of gpio_request() > > > > > > arch/arm/imx-common/i2c-mxv7.c | 24 ++++++++++++++++++++++++ > > > board/compulab/cm_fx6/cm_fx6.c | 15 +++++++++++++++ > > > board/compulab/cm_fx6/common.c | 7 +++++++ > > > 3 files changed, 46 insertions(+) > > > > > [...] > > > > diff --git a/board/compulab/cm_fx6/common.c b/board/compulab/cm_fx6/common.c > > > index 1f39679..e4d7e2e 100644 > > > --- a/board/compulab/cm_fx6/common.c > > > +++ b/board/compulab/cm_fx6/common.c > > > @@ -79,6 +79,13 @@ void cm_fx6_set_ecspi_iomux(void) > > > > > > int board_spi_cs_gpio(unsigned bus, unsigned cs) > > > { > > > +#ifndef CONFIG_SPL_BUILD > > > + int ret; > > > + > > > + ret = gpio_request(CM_FX6_ECSPI_BUS0_CS0, "ecspi_bus0_cs0"); > > > + if (ret) > > > + return ret; > > > +#endif > > > > Is there a reason for excluding this request from spl builds? > > We do build with CONFIG_SPL_GPIO_SUPPORT and we don't have a > > problem with spl size. > > So, if there is no strong reason to exclude it from spl build, > > I'd like to remove the #ifndef. > > > > > > It isn't supported by DM yet. > > AFAICS, gpio_request() is available for SPL. > So in such case the non-DM version will be used and > I can't see any problem with this (unless it does not work for some reason). > > > I suggest that if you wanted the gpio_request() in the non-DM case you would already have added it? I would thought so too... Unfortunately, it has slipped through... > > I would prefer not to have an #ifdef CONFIG_DM_GPIO here also. Can we revisit when DM supports SPL? Yes, no problem. -- Regards, Igor.