static DEVICE_ATTR(comp_preload, S_IRUGO, ep93xx_rtc_show_comp_preload, NULL);
#include <linux/module.h>
#include <linux/platform_device.h>
#define EP93XX_RTC_DATA 0x000
#define EP93XX_RTC_MATCH 0x004
#define EP93XX_RTC_STATUS 0x008
#define EP93XX_RTC_STATUS_INTR (1<<0)
#define EP93XX_RTC_LOAD 0x00C
#define EP93XX_RTC_CONTROL 0x010
#define EP93XX_RTC_CONTROL_MIE (1<<0)
#define EP93XX_RTC_SWCOMP 0x108
#define EP93XX_RTC_SWCOMP_DEL_MASK 0x001f0000
#define EP93XX_RTC_SWCOMP_DEL_SHIFT 16
#define EP93XX_RTC_SWCOMP_INT_MASK 0x0000ffff
#define EP93XX_RTC_SWCOMP_INT_SHIFT 0
static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload,
struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev);
comp = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_SWCOMP);
*preload = (comp & EP93XX_RTC_SWCOMP_INT_MASK)
>> EP93XX_RTC_SWCOMP_INT_SHIFT;
*delete = (comp & EP93XX_RTC_SWCOMP_DEL_MASK)
>> EP93XX_RTC_SWCOMP_DEL_SHIFT;
static int ep93xx_rtc_read_time(struct device *dev, struct rtc_time *tm)
struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev);