public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: kishore kadiyala <kishore.kadiyala@ti.com>
Cc: linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org,
	tony@atomide.com, akpm@linux-foundation.org, madhu.cr@ti.com,
	adrian.hunter@nokia.com
Subject: Re: [PATCH 1/3] omap4 hsmmc : Adding card detect support for MMC1
Date: Tue, 31 Aug 2010 06:55:52 +0100	[thread overview]
Message-ID: <20100831055552.GA7847@console-pimps.org> (raw)
In-Reply-To: <23529.10.24.255.18.1283190503.squirrel@dbdmail.itg.ti.com>

On Mon, Aug 30, 2010 at 11:18:23PM +0530, kishore kadiyala wrote:
> Adding card detect callback function and card detect configuration
> function for MMC1 Controller.
> 
> Card detect configuration function does initial configuration of the
> MMC Control & PullUp-PullDown registers of Phoenix.
> 
> For MMC1 Controller, Card detect interrupt source is
> twl6030 and the card detect call back function provides card present/absent
> status by reading MMC Control register.
> 
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Adrian Hunter <adrian.hunter@nokia.com>
> Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>

[...]

> @@ -223,6 +224,81 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset)
>  }
>  EXPORT_SYMBOL(twl6030_interrupt_mask);
> 
> +int twl6030_mmc_card_detect_config(void)
> +{
> +	int ret;
> +	u8 reg_val = 0;
> +
> +	/* Unmasking the Card detect Interrupt line for MMC1 from Phoenix */
> +	if (twl_class_is_6030()) {
> +		twl6030_interrupt_unmask(TWL6030_MMCDETECT_INT_MASK,
> +							REG_INT_MSK_LINE_B);
> +		twl6030_interrupt_unmask(TWL6030_MMCDETECT_INT_MASK,
> +							REG_INT_MSK_STS_B);
> +	}
> +
> +	/*
> +	 * Intially Configuring MMC_CTRL for receving interrupts &
> +	 * Card status on TWL6030 for MMC1
> +	 */
> +	ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, &reg_val, TWL6030_MMCCTRL);
> +	if (ret < 0) {
> +		pr_err("twl6030: Failed to read MMCCTRL, error %d\n", ret);
> +		return ret;
> +	}
> +	reg_val &= ~VMMC_AUTO_OFF;
> +	reg_val |= SW_FC;
> +	ret = twl_i2c_write_u8(TWL6030_MODULE_ID0, reg_val, TWL6030_MMCCTRL);
> +	if (ret < 0) {
> +		return ret;
> +		pr_err("twl6030: Failed to write MMCCTRL, error %d\n", ret);
> +	}

Shouldn't this be

		pr_err("twl6030: Failed to write MMCCTRL, error %d\n", ret);
		return ret;

?

> +
> +	/* Configuring PullUp-PullDown register */
> +	ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, &reg_val,
> +						TWL6030_CFG_INPUT_PUPD3);
> +	if (ret < 0) {
> +		return ret;
> +		pr_err("twl6030: Failed to read CFG_INPUT_PUPD3, error %d\n",
> +									ret);

Shouldn't this be,

		pr_err("twl6030: Failed to read CFG_INPUT_PUPD3, error %d\n",
									ret);
		return ret;
?

  reply	other threads:[~2010-08-31  5:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 17:48 [PATCH 1/3] omap4 hsmmc : Adding card detect support for MMC1 kishore kadiyala
2010-08-31  5:55 ` Matt Fleming [this message]
2010-08-31  6:23   ` kishore kadiyala

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=20100831055552.GA7847@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=adrian.hunter@nokia.com \
    --cc=akpm@linux-foundation.org \
    --cc=kishore.kadiyala@ti.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=madhu.cr@ti.com \
    --cc=tony@atomide.com \
    /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