rtc: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Michal Simek <michal.simek@xilinx.com> (for zynqmp) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
36d91a4d40
commit
85368bb9de
|
@ -48,8 +48,7 @@ static void bq4802_write_mem(struct bq4802 *p, int off, u8 val)
|
||||||
|
|
||||||
static int bq4802_read_time(struct device *dev, struct rtc_time *tm)
|
static int bq4802_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct bq4802 *p = dev_get_drvdata(dev);
|
||||||
struct bq4802 *p = platform_get_drvdata(pdev);
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned int century;
|
unsigned int century;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
@ -91,8 +90,7 @@ static int bq4802_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
|
|
||||||
static int bq4802_set_time(struct device *dev, struct rtc_time *tm)
|
static int bq4802_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct bq4802 *p = dev_get_drvdata(dev);
|
||||||
struct bq4802 *p = platform_get_drvdata(pdev);
|
|
||||||
u8 sec, min, hrs, day, mon, yrs, century, val;
|
u8 sec, min, hrs, day, mon, yrs, century, val;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned int year;
|
unsigned int year;
|
||||||
|
|
|
@ -76,8 +76,7 @@ static void ds1216_switch_ds_to_clock(u8 __iomem *ioaddr)
|
||||||
|
|
||||||
static int ds1216_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int ds1216_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct ds1216_priv *priv = dev_get_drvdata(dev);
|
||||||
struct ds1216_priv *priv = platform_get_drvdata(pdev);
|
|
||||||
struct ds1216_regs regs;
|
struct ds1216_regs regs;
|
||||||
|
|
||||||
ds1216_switch_ds_to_clock(priv->ioaddr);
|
ds1216_switch_ds_to_clock(priv->ioaddr);
|
||||||
|
@ -104,8 +103,7 @@ static int ds1216_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
|
|
||||||
static int ds1216_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
static int ds1216_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct ds1216_priv *priv = dev_get_drvdata(dev);
|
||||||
struct ds1216_priv *priv = platform_get_drvdata(pdev);
|
|
||||||
struct ds1216_regs regs;
|
struct ds1216_regs regs;
|
||||||
|
|
||||||
ds1216_switch_ds_to_clock(priv->ioaddr);
|
ds1216_switch_ds_to_clock(priv->ioaddr);
|
||||||
|
|
|
@ -314,8 +314,7 @@ ds1511_rtc_update_alarm(struct rtc_plat_data *pdata)
|
||||||
static int
|
static int
|
||||||
ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (pdata->irq <= 0)
|
if (pdata->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -334,8 +333,7 @@ ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
static int
|
static int
|
||||||
ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (pdata->irq <= 0)
|
if (pdata->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -373,8 +371,7 @@ ds1511_interrupt(int irq, void *dev_id)
|
||||||
|
|
||||||
static int ds1511_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
static int ds1511_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (pdata->irq <= 0)
|
if (pdata->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
@ -73,8 +73,7 @@ struct rtc_plat_data {
|
||||||
|
|
||||||
static int ds1553_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
static int ds1553_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
u8 century;
|
u8 century;
|
||||||
|
|
||||||
|
@ -98,8 +97,7 @@ static int ds1553_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
|
|
||||||
static int ds1553_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int ds1553_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
unsigned int year, month, day, hour, minute, second, week;
|
unsigned int year, month, day, hour, minute, second, week;
|
||||||
unsigned int century;
|
unsigned int century;
|
||||||
|
@ -155,8 +153,7 @@ static void ds1553_rtc_update_alarm(struct rtc_plat_data *pdata)
|
||||||
|
|
||||||
static int ds1553_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int ds1553_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (pdata->irq <= 0)
|
if (pdata->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -172,8 +169,7 @@ static int ds1553_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
|
|
||||||
static int ds1553_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int ds1553_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (pdata->irq <= 0)
|
if (pdata->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -208,8 +204,7 @@ static irqreturn_t ds1553_rtc_interrupt(int irq, void *dev_id)
|
||||||
|
|
||||||
static int ds1553_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
static int ds1553_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (pdata->irq <= 0)
|
if (pdata->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
@ -267,8 +267,7 @@ ds1685_rtc_get_ssn(struct ds1685_priv *rtc, u8 *ssn)
|
||||||
static int
|
static int
|
||||||
ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct ds1685_priv *rtc = dev_get_drvdata(dev);
|
||||||
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
|
|
||||||
u8 ctrlb, century;
|
u8 ctrlb, century;
|
||||||
u8 seconds, minutes, hours, wday, mday, month, years;
|
u8 seconds, minutes, hours, wday, mday, month, years;
|
||||||
|
|
||||||
|
@ -317,8 +316,7 @@ ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
static int
|
static int
|
||||||
ds1685_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
ds1685_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct ds1685_priv *rtc = dev_get_drvdata(dev);
|
||||||
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
|
|
||||||
u8 ctrlb, seconds, minutes, hours, wday, mday, month, years, century;
|
u8 ctrlb, seconds, minutes, hours, wday, mday, month, years, century;
|
||||||
|
|
||||||
/* Fetch the time info from rtc_time. */
|
/* Fetch the time info from rtc_time. */
|
||||||
|
@ -394,8 +392,7 @@ ds1685_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
static int
|
static int
|
||||||
ds1685_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
ds1685_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct ds1685_priv *rtc = dev_get_drvdata(dev);
|
||||||
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
|
|
||||||
u8 seconds, minutes, hours, mday, ctrlb, ctrlc;
|
u8 seconds, minutes, hours, mday, ctrlb, ctrlc;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -453,8 +450,7 @@ ds1685_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
static int
|
static int
|
||||||
ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct ds1685_priv *rtc = dev_get_drvdata(dev);
|
||||||
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
|
|
||||||
u8 ctrlb, seconds, minutes, hours, mday;
|
u8 ctrlb, seconds, minutes, hours, mday;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -1119,8 +1115,7 @@ static ssize_t
|
||||||
ds1685_rtc_sysfs_battery_show(struct device *dev,
|
ds1685_rtc_sysfs_battery_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct ds1685_priv *rtc = dev_get_drvdata(dev);
|
||||||
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
|
|
||||||
u8 ctrld;
|
u8 ctrld;
|
||||||
|
|
||||||
ctrld = rtc->read(rtc, RTC_CTRL_D);
|
ctrld = rtc->read(rtc, RTC_CTRL_D);
|
||||||
|
@ -1140,8 +1135,7 @@ static ssize_t
|
||||||
ds1685_rtc_sysfs_auxbatt_show(struct device *dev,
|
ds1685_rtc_sysfs_auxbatt_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct ds1685_priv *rtc = dev_get_drvdata(dev);
|
||||||
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
|
|
||||||
u8 ctrl4a;
|
u8 ctrl4a;
|
||||||
|
|
||||||
ds1685_rtc_switch_to_bank1(rtc);
|
ds1685_rtc_switch_to_bank1(rtc);
|
||||||
|
@ -1163,8 +1157,7 @@ static ssize_t
|
||||||
ds1685_rtc_sysfs_serial_show(struct device *dev,
|
ds1685_rtc_sysfs_serial_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct ds1685_priv *rtc = dev_get_drvdata(dev);
|
||||||
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
|
|
||||||
u8 ssn[8];
|
u8 ssn[8];
|
||||||
|
|
||||||
ds1685_rtc_switch_to_bank1(rtc);
|
ds1685_rtc_switch_to_bank1(rtc);
|
||||||
|
|
|
@ -58,8 +58,7 @@ struct rtc_plat_data {
|
||||||
|
|
||||||
static int ds1742_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
static int ds1742_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr_rtc;
|
void __iomem *ioaddr = pdata->ioaddr_rtc;
|
||||||
u8 century;
|
u8 century;
|
||||||
|
|
||||||
|
@ -83,8 +82,7 @@ static int ds1742_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
|
|
||||||
static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr_rtc;
|
void __iomem *ioaddr = pdata->ioaddr_rtc;
|
||||||
unsigned int year, month, day, hour, minute, second, week;
|
unsigned int year, month, day, hour, minute, second, week;
|
||||||
unsigned int century;
|
unsigned int century;
|
||||||
|
|
|
@ -294,11 +294,10 @@ static int lpc32xx_rtc_remove(struct platform_device *pdev)
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static int lpc32xx_rtc_suspend(struct device *dev)
|
static int lpc32xx_rtc_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
|
||||||
struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (rtc->irq >= 0) {
|
if (rtc->irq >= 0) {
|
||||||
if (device_may_wakeup(&pdev->dev))
|
if (device_may_wakeup(dev))
|
||||||
enable_irq_wake(rtc->irq);
|
enable_irq_wake(rtc->irq);
|
||||||
else
|
else
|
||||||
disable_irq_wake(rtc->irq);
|
disable_irq_wake(rtc->irq);
|
||||||
|
@ -309,10 +308,9 @@ static int lpc32xx_rtc_suspend(struct device *dev)
|
||||||
|
|
||||||
static int lpc32xx_rtc_resume(struct device *dev)
|
static int lpc32xx_rtc_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
|
||||||
struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (rtc->irq >= 0 && device_may_wakeup(&pdev->dev))
|
if (rtc->irq >= 0 && device_may_wakeup(dev))
|
||||||
disable_irq_wake(rtc->irq);
|
disable_irq_wake(rtc->irq);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -321,8 +319,7 @@ static int lpc32xx_rtc_resume(struct device *dev)
|
||||||
/* Unconditionally disable the alarm */
|
/* Unconditionally disable the alarm */
|
||||||
static int lpc32xx_rtc_freeze(struct device *dev)
|
static int lpc32xx_rtc_freeze(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
|
||||||
struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
spin_lock_irq(&rtc->lock);
|
spin_lock_irq(&rtc->lock);
|
||||||
|
|
||||||
|
@ -337,8 +334,7 @@ static int lpc32xx_rtc_freeze(struct device *dev)
|
||||||
|
|
||||||
static int lpc32xx_rtc_thaw(struct device *dev)
|
static int lpc32xx_rtc_thaw(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
|
||||||
struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (rtc->alarm_enabled) {
|
if (rtc->alarm_enabled) {
|
||||||
spin_lock_irq(&rtc->lock);
|
spin_lock_irq(&rtc->lock);
|
||||||
|
|
|
@ -47,8 +47,7 @@ struct m48t59_private {
|
||||||
static void
|
static void
|
||||||
m48t59_mem_writeb(struct device *dev, u32 ofs, u8 val)
|
m48t59_mem_writeb(struct device *dev, u32 ofs, u8 val)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct m48t59_private *m48t59 = dev_get_drvdata(dev);
|
||||||
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
writeb(val, m48t59->ioaddr+ofs);
|
writeb(val, m48t59->ioaddr+ofs);
|
||||||
}
|
}
|
||||||
|
@ -56,8 +55,7 @@ m48t59_mem_writeb(struct device *dev, u32 ofs, u8 val)
|
||||||
static u8
|
static u8
|
||||||
m48t59_mem_readb(struct device *dev, u32 ofs)
|
m48t59_mem_readb(struct device *dev, u32 ofs)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct m48t59_private *m48t59 = dev_get_drvdata(dev);
|
||||||
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
return readb(m48t59->ioaddr+ofs);
|
return readb(m48t59->ioaddr+ofs);
|
||||||
}
|
}
|
||||||
|
@ -67,9 +65,8 @@ m48t59_mem_readb(struct device *dev, u32 ofs)
|
||||||
*/
|
*/
|
||||||
static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct m48t59_plat_data *pdata = dev_get_platdata(dev);
|
||||||
struct m48t59_plat_data *pdata = dev_get_platdata(&pdev->dev);
|
struct m48t59_private *m48t59 = dev_get_drvdata(dev);
|
||||||
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
|
||||||
|
@ -110,9 +107,8 @@ static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
|
|
||||||
static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct m48t59_plat_data *pdata = dev_get_platdata(dev);
|
||||||
struct m48t59_plat_data *pdata = dev_get_platdata(&pdev->dev);
|
struct m48t59_private *m48t59 = dev_get_drvdata(dev);
|
||||||
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u8 val = 0;
|
u8 val = 0;
|
||||||
int year = tm->tm_year;
|
int year = tm->tm_year;
|
||||||
|
@ -157,9 +153,8 @@ static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
*/
|
*/
|
||||||
static int m48t59_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int m48t59_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct m48t59_plat_data *pdata = dev_get_platdata(dev);
|
||||||
struct m48t59_plat_data *pdata = dev_get_platdata(&pdev->dev);
|
struct m48t59_private *m48t59 = dev_get_drvdata(dev);
|
||||||
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
|
|
||||||
struct rtc_time *tm = &alrm->time;
|
struct rtc_time *tm = &alrm->time;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
@ -204,9 +199,8 @@ static int m48t59_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
*/
|
*/
|
||||||
static int m48t59_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int m48t59_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct m48t59_plat_data *pdata = dev_get_platdata(dev);
|
||||||
struct m48t59_plat_data *pdata = dev_get_platdata(&pdev->dev);
|
struct m48t59_private *m48t59 = dev_get_drvdata(dev);
|
||||||
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
|
|
||||||
struct rtc_time *tm = &alrm->time;
|
struct rtc_time *tm = &alrm->time;
|
||||||
u8 mday, hour, min, sec;
|
u8 mday, hour, min, sec;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
@ -265,9 +259,8 @@ static int m48t59_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
*/
|
*/
|
||||||
static int m48t59_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
static int m48t59_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct m48t59_plat_data *pdata = dev_get_platdata(dev);
|
||||||
struct m48t59_plat_data *pdata = dev_get_platdata(&pdev->dev);
|
struct m48t59_private *m48t59 = dev_get_drvdata(dev);
|
||||||
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&m48t59->lock, flags);
|
spin_lock_irqsave(&m48t59->lock, flags);
|
||||||
|
@ -282,9 +275,8 @@ static int m48t59_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
||||||
|
|
||||||
static int m48t59_rtc_proc(struct device *dev, struct seq_file *seq)
|
static int m48t59_rtc_proc(struct device *dev, struct seq_file *seq)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct m48t59_plat_data *pdata = dev_get_platdata(dev);
|
||||||
struct m48t59_plat_data *pdata = dev_get_platdata(&pdev->dev);
|
struct m48t59_private *m48t59 = dev_get_drvdata(dev);
|
||||||
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
|
||||||
|
@ -303,9 +295,8 @@ static int m48t59_rtc_proc(struct device *dev, struct seq_file *seq)
|
||||||
static irqreturn_t m48t59_rtc_interrupt(int irq, void *dev_id)
|
static irqreturn_t m48t59_rtc_interrupt(int irq, void *dev_id)
|
||||||
{
|
{
|
||||||
struct device *dev = (struct device *)dev_id;
|
struct device *dev = (struct device *)dev_id;
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct m48t59_plat_data *pdata = dev_get_platdata(dev);
|
||||||
struct m48t59_plat_data *pdata = dev_get_platdata(&pdev->dev);
|
struct m48t59_private *m48t59 = dev_get_drvdata(dev);
|
||||||
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
|
|
||||||
u8 event;
|
u8 event;
|
||||||
|
|
||||||
spin_lock(&m48t59->lock);
|
spin_lock(&m48t59->lock);
|
||||||
|
|
|
@ -176,8 +176,7 @@ static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
|
||||||
|
|
||||||
static int mv_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
static int mv_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
|
|
||||||
if (pdata->irq < 0)
|
if (pdata->irq < 0)
|
||||||
|
|
|
@ -109,8 +109,7 @@ static inline int is_imx1_rtc(struct rtc_plat_data *data)
|
||||||
*/
|
*/
|
||||||
static time64_t get_alarm_or_time(struct device *dev, int time_alarm)
|
static time64_t get_alarm_or_time(struct device *dev, int time_alarm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
u32 day = 0, hr = 0, min = 0, sec = 0, hr_min = 0;
|
u32 day = 0, hr = 0, min = 0, sec = 0, hr_min = 0;
|
||||||
|
|
||||||
|
@ -139,8 +138,7 @@ static time64_t get_alarm_or_time(struct device *dev, int time_alarm)
|
||||||
static void set_alarm_or_time(struct device *dev, int time_alarm, time64_t time)
|
static void set_alarm_or_time(struct device *dev, int time_alarm, time64_t time)
|
||||||
{
|
{
|
||||||
u32 tod, day, hr, min, sec, temp;
|
u32 tod, day, hr, min, sec, temp;
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
|
|
||||||
day = div_s64_rem(time, 86400, &tod);
|
day = div_s64_rem(time, 86400, &tod);
|
||||||
|
@ -176,8 +174,7 @@ static void set_alarm_or_time(struct device *dev, int time_alarm, time64_t time)
|
||||||
static void rtc_update_alarm(struct device *dev, struct rtc_time *alrm)
|
static void rtc_update_alarm(struct device *dev, struct rtc_time *alrm)
|
||||||
{
|
{
|
||||||
time64_t time;
|
time64_t time;
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
|
|
||||||
time = rtc_tm_to_time64(alrm);
|
time = rtc_tm_to_time64(alrm);
|
||||||
|
@ -190,8 +187,7 @@ static void rtc_update_alarm(struct device *dev, struct rtc_time *alrm)
|
||||||
static void mxc_rtc_irq_enable(struct device *dev, unsigned int bit,
|
static void mxc_rtc_irq_enable(struct device *dev, unsigned int bit,
|
||||||
unsigned int enabled)
|
unsigned int enabled)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
u32 reg;
|
u32 reg;
|
||||||
|
|
||||||
|
@ -266,8 +262,7 @@ static int mxc_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
*/
|
*/
|
||||||
static int mxc_rtc_set_mmss(struct device *dev, time64_t time)
|
static int mxc_rtc_set_mmss(struct device *dev, time64_t time)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TTC_DAYR register is 9-bit in MX1 SoC, save time and day of year only
|
* TTC_DAYR register is 9-bit in MX1 SoC, save time and day of year only
|
||||||
|
@ -295,8 +290,7 @@ static int mxc_rtc_set_mmss(struct device *dev, time64_t time)
|
||||||
*/
|
*/
|
||||||
static int mxc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
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 = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
|
|
||||||
rtc_time64_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time);
|
rtc_time64_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time);
|
||||||
|
@ -310,8 +304,7 @@ static int mxc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
*/
|
*/
|
||||||
static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
rtc_update_alarm(dev, &alrm->time);
|
rtc_update_alarm(dev, &alrm->time);
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,7 @@ static irqreturn_t pcap_rtc_irq(int irq, void *_pcap_rtc)
|
||||||
|
|
||||||
static int pcap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int pcap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
|
||||||
struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev);
|
|
||||||
struct rtc_time *tm = &alrm->time;
|
struct rtc_time *tm = &alrm->time;
|
||||||
unsigned long secs;
|
unsigned long secs;
|
||||||
u32 tod; /* time of day, seconds since midnight */
|
u32 tod; /* time of day, seconds since midnight */
|
||||||
|
@ -63,8 +62,7 @@ static int pcap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
|
|
||||||
static int pcap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int pcap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
|
||||||
struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev);
|
|
||||||
struct rtc_time *tm = &alrm->time;
|
struct rtc_time *tm = &alrm->time;
|
||||||
unsigned long secs;
|
unsigned long secs;
|
||||||
u32 tod, days;
|
u32 tod, days;
|
||||||
|
@ -82,8 +80,7 @@ static int pcap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
|
|
||||||
static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
|
||||||
struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev);
|
|
||||||
unsigned long secs;
|
unsigned long secs;
|
||||||
u32 tod, days;
|
u32 tod, days;
|
||||||
|
|
||||||
|
@ -100,8 +97,7 @@ static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
|
|
||||||
static int pcap_rtc_set_mmss(struct device *dev, unsigned long secs)
|
static int pcap_rtc_set_mmss(struct device *dev, unsigned long secs)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
|
||||||
struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev);
|
|
||||||
u32 tod, days;
|
u32 tod, days;
|
||||||
|
|
||||||
tod = secs % SEC_PER_DAY;
|
tod = secs % SEC_PER_DAY;
|
||||||
|
@ -115,8 +111,7 @@ static int pcap_rtc_set_mmss(struct device *dev, unsigned long secs)
|
||||||
|
|
||||||
static int pcap_rtc_irq_enable(struct device *dev, int pirq, unsigned int en)
|
static int pcap_rtc_irq_enable(struct device *dev, int pirq, unsigned int en)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
|
||||||
struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (en)
|
if (en)
|
||||||
enable_irq(pcap_to_irq(pcap_rtc->pcap, pirq));
|
enable_irq(pcap_to_irq(pcap_rtc->pcap, pirq));
|
||||||
|
|
|
@ -359,8 +359,7 @@ static int sh_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
||||||
|
|
||||||
static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct sh_rtc *rtc = dev_get_drvdata(dev);
|
||||||
struct sh_rtc *rtc = platform_get_drvdata(pdev);
|
|
||||||
unsigned int sec128, sec2, yr, yr100, cf_bit;
|
unsigned int sec128, sec2, yr, yr100, cf_bit;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -419,8 +418,7 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
|
|
||||||
static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct sh_rtc *rtc = dev_get_drvdata(dev);
|
||||||
struct sh_rtc *rtc = platform_get_drvdata(pdev);
|
|
||||||
unsigned int tmp;
|
unsigned int tmp;
|
||||||
int year;
|
int year;
|
||||||
|
|
||||||
|
@ -475,8 +473,7 @@ static inline int sh_rtc_read_alarm_value(struct sh_rtc *rtc, int reg_off)
|
||||||
|
|
||||||
static int sh_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
|
static int sh_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct sh_rtc *rtc = dev_get_drvdata(dev);
|
||||||
struct sh_rtc *rtc = platform_get_drvdata(pdev);
|
|
||||||
struct rtc_time *tm = &wkalrm->time;
|
struct rtc_time *tm = &wkalrm->time;
|
||||||
|
|
||||||
spin_lock_irq(&rtc->lock);
|
spin_lock_irq(&rtc->lock);
|
||||||
|
@ -509,8 +506,7 @@ static inline void sh_rtc_write_alarm_value(struct sh_rtc *rtc,
|
||||||
|
|
||||||
static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
|
static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct sh_rtc *rtc = dev_get_drvdata(dev);
|
||||||
struct sh_rtc *rtc = platform_get_drvdata(pdev);
|
|
||||||
unsigned int rcr1;
|
unsigned int rcr1;
|
||||||
struct rtc_time *tm = &wkalrm->time;
|
struct rtc_time *tm = &wkalrm->time;
|
||||||
int mon;
|
int mon;
|
||||||
|
@ -723,8 +719,7 @@ static int __exit sh_rtc_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
static void sh_rtc_set_irq_wake(struct device *dev, int enabled)
|
static void sh_rtc_set_irq_wake(struct device *dev, int enabled)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct sh_rtc *rtc = dev_get_drvdata(dev);
|
||||||
struct sh_rtc *rtc = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
irq_set_irq_wake(rtc->periodic_irq, enabled);
|
irq_set_irq_wake(rtc->periodic_irq, enabled);
|
||||||
|
|
||||||
|
|
|
@ -74,8 +74,7 @@ struct rtc_plat_data {
|
||||||
|
|
||||||
static int stk17ta8_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
static int stk17ta8_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
u8 flags;
|
u8 flags;
|
||||||
|
|
||||||
|
@ -97,8 +96,7 @@ static int stk17ta8_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||||
|
|
||||||
static int stk17ta8_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int stk17ta8_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
void __iomem *ioaddr = pdata->ioaddr;
|
void __iomem *ioaddr = pdata->ioaddr;
|
||||||
unsigned int year, month, day, hour, minute, second, week;
|
unsigned int year, month, day, hour, minute, second, week;
|
||||||
unsigned int century;
|
unsigned int century;
|
||||||
|
@ -163,8 +161,7 @@ static void stk17ta8_rtc_update_alarm(struct rtc_plat_data *pdata)
|
||||||
|
|
||||||
static int stk17ta8_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int stk17ta8_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (pdata->irq <= 0)
|
if (pdata->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -180,8 +177,7 @@ static int stk17ta8_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
|
|
||||||
static int stk17ta8_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
static int stk17ta8_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (pdata->irq <= 0)
|
if (pdata->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -217,8 +213,7 @@ static irqreturn_t stk17ta8_rtc_interrupt(int irq, void *dev_id)
|
||||||
static int stk17ta8_rtc_alarm_irq_enable(struct device *dev,
|
static int stk17ta8_rtc_alarm_irq_enable(struct device *dev,
|
||||||
unsigned int enabled)
|
unsigned int enabled)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
|
||||||
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (pdata->irq <= 0)
|
if (pdata->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
@ -84,8 +84,7 @@ static ssize_t test_irq_store(struct device *dev,
|
||||||
const char *buf, size_t count)
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
struct platform_device *plat_dev = to_platform_device(dev);
|
struct rtc_device *rtc = dev_get_drvdata(dev);
|
||||||
struct rtc_device *rtc = platform_get_drvdata(plat_dev);
|
|
||||||
|
|
||||||
retval = count;
|
retval = count;
|
||||||
if (strncmp(buf, "tick", 4) == 0 && rtc->pie_enabled)
|
if (strncmp(buf, "tick", 4) == 0 && rtc->pie_enabled)
|
||||||
|
|
|
@ -278,10 +278,9 @@ static int xlnx_rtc_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
static int __maybe_unused xlnx_rtc_suspend(struct device *dev)
|
static int __maybe_unused xlnx_rtc_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
|
||||||
struct xlnx_rtc_dev *xrtcdev = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (device_may_wakeup(&pdev->dev))
|
if (device_may_wakeup(dev))
|
||||||
enable_irq_wake(xrtcdev->alarm_irq);
|
enable_irq_wake(xrtcdev->alarm_irq);
|
||||||
else
|
else
|
||||||
xlnx_rtc_alarm_irq_enable(dev, 0);
|
xlnx_rtc_alarm_irq_enable(dev, 0);
|
||||||
|
@ -291,10 +290,9 @@ static int __maybe_unused xlnx_rtc_suspend(struct device *dev)
|
||||||
|
|
||||||
static int __maybe_unused xlnx_rtc_resume(struct device *dev)
|
static int __maybe_unused xlnx_rtc_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
|
||||||
struct xlnx_rtc_dev *xrtcdev = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (device_may_wakeup(&pdev->dev))
|
if (device_may_wakeup(dev))
|
||||||
disable_irq_wake(xrtcdev->alarm_irq);
|
disable_irq_wake(xrtcdev->alarm_irq);
|
||||||
else
|
else
|
||||||
xlnx_rtc_alarm_irq_enable(dev, 1);
|
xlnx_rtc_alarm_irq_enable(dev, 1);
|
||||||
|
|
Loading…
Reference in a new issue