Re: [PATCH 1/3] omap4 hsmmc : Adding card detect support for MMC1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> Cc: Madhusudhan Chikkature <madhu.cr@xxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@xxxxxx>

[...]

> @@ -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;
?
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux