public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] efikamx: Configure the pins as GPIOs prior to using gpio_get_value.
Date: Mon, 21 Nov 2011 15:20:49 +0100	[thread overview]
Message-ID: <201111211520.49382.marek.vasut@gmail.com> (raw)
In-Reply-To: <1321884585-12501-1-git-send-email-fabio.estevam@freescale.com>

> Configure the pins as GPIOs prior to using gpio_get_value
> 
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  board/efikamx/efikamx.c |   13 +++++++++----
>  1 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c
> index 3d2cc1a..b911891 100644
> --- a/board/efikamx/efikamx.c
> +++ b/board/efikamx/efikamx.c
> @@ -308,10 +308,14 @@ struct fsl_esdhc_cfg esdhc_cfg[2] = {
> 
>  static inline uint32_t efika_mmc_cd(void)
>  {
> -	if (machine_is_efikamx())
> +	if (machine_is_efikamx()) {
> +		mxc_request_iomux(MX51_PIN_GPIO1_0, IOMUX_CONFIG_ALT1);
>  		return MX51_PIN_GPIO1_0;
> -	else
> +
> +	} else {
> +		mxc_request_iomux(MX51_PIN_EIM_CS2, IOMUX_CONFIG_ALT1);
>  		return MX51_PIN_EIM_CS2;
> +	}
>  }
> 
>  int board_mmc_getcd(u8 *absent, struct mmc *mmc)
> @@ -321,9 +325,10 @@ int board_mmc_getcd(u8 *absent, struct mmc *mmc)
> 
>  	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
>  		*absent = gpio_get_value(IOMUX_TO_GPIO(cd));
> -	else
> +	else {
> +		mxc_request_iomux(MX51_PIN_GPIO1_8, IOMUX_CONFIG_ALT0);
>  		*absent = gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8));
> -
> +	}
>  	return 0;
>  }

NAK. There should be some common function for setting up iomux of those pins. 
You souldn't set it in repeatedly called functions.

M

  parent reply	other threads:[~2011-11-21 14:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 14:09 [U-Boot] [PATCH 1/2] efikamx: Configure the pins as GPIOs prior to using gpio_get_value Fabio Estevam
2011-11-21 14:09 ` [U-Boot] [PATCH 2/2] vision2: " Fabio Estevam
2011-11-21 14:20 ` Marek Vasut [this message]
2011-11-21 18:53   ` [U-Boot] [PATCH 1/2] efikamx: " Mike Frysinger
2011-11-21 19:29     ` Marek Vasut
2011-11-21 20:14       ` Mike Frysinger
2011-11-21 20:53         ` Marek Vasut
2011-11-21 21:22           ` Mike Frysinger
2011-11-22  8:15             ` Stefano Babic
2011-11-22 21:07               ` Mike Frysinger
2011-11-23  7:02                 ` Igor Grinberg
2011-11-23 19:43                   ` Mike Frysinger
2011-11-23  8:19                 ` Stefano Babic
2011-11-23 19:44                   ` Mike Frysinger

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=201111211520.49382.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox