#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/rtc/ds1286.h>
static inline u8 ds1286_rtc_read(struct ds1286_priv *priv, int reg)
return __raw_readl(&priv->rtcregs[reg]) & 0xff;
static inline void ds1286_rtc_write(struct ds1286_priv *priv, u8 data, int reg)
__raw_writel(data, &priv->rtcregs[reg]);
static int ds1286_alarm_irq_enable(struct device *dev, unsigned int enabled)
struct ds1286_priv *priv = dev_get_drvdata(dev);
spin_lock_irqsave(&priv->lock, flags);
val = ds1286_rtc_read(priv, RTC_CMD);
ds1286_rtc_write(priv, val, RTC_CMD);
spin_unlock_irqrestore(&priv->lock, flags);
#ifdef CONFIG_RTC_INTF_DEV
static int ds1286_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
struct ds1286_priv *priv = dev_get_drvdata(dev);