/* This function reads the current alarm value into the passed in 'alrm' argument. It updates the alrm's pending field value based on the whether an alarm interrupt occurs or not.  */
static int mxc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
/* This function reads the current alarm value into the passed in 'alrm' argument. It updates the alrm's pending field value based on the whether an alarm interrupt occurs or not.  */
static int mxc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
	void __iomem *ioaddr = pdata->ioaddr;
	rtc_time_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time);
	alrm->pending = ((readw(ioaddr + RTC_RTCISR) & RTC_ALM_BIT)) ? 1 : 0;
	return 0;
}