rtc-opal.c (045c6fdd37a01d950c0f5ca64733b53b184fe91b) rtc-opal.c (f4a2eecb3ff9f51b179b213e7cc3766f920f2dc5)
1/*
2 * IBM OPAL RTC driver
3 * Copyright (C) 2014 IBM
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 176 unchanged lines hidden (view full) ---

185 if (rc != OPAL_SUCCESS)
186 rc = -EIO;
187
188exit:
189 opal_async_release_token(token);
190 return rc;
191}
192
1/*
2 * IBM OPAL RTC driver
3 * Copyright (C) 2014 IBM
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 176 unchanged lines hidden (view full) ---

185 if (rc != OPAL_SUCCESS)
186 rc = -EIO;
187
188exit:
189 opal_async_release_token(token);
190 return rc;
191}
192
193static const struct rtc_class_ops opal_rtc_ops = {
193static struct rtc_class_ops opal_rtc_ops = {
194 .read_time = opal_get_rtc_time,
195 .set_time = opal_set_rtc_time,
194 .read_time = opal_get_rtc_time,
195 .set_time = opal_set_rtc_time,
196 .read_alarm = opal_get_tpo_time,
197 .set_alarm = opal_set_tpo_time,
198};
199
200static int opal_rtc_probe(struct platform_device *pdev)
201{
202 struct rtc_device *rtc;
203
204 if (pdev->dev.of_node && of_get_property(pdev->dev.of_node, "has-tpo",
196};
197
198static int opal_rtc_probe(struct platform_device *pdev)
199{
200 struct rtc_device *rtc;
201
202 if (pdev->dev.of_node && of_get_property(pdev->dev.of_node, "has-tpo",
205 NULL))
203 NULL)) {
206 device_set_wakeup_capable(&pdev->dev, true);
204 device_set_wakeup_capable(&pdev->dev, true);
205 opal_rtc_ops.read_alarm = opal_get_tpo_time;
206 opal_rtc_ops.set_alarm = opal_set_tpo_time;
207 }
207
208 rtc = devm_rtc_device_register(&pdev->dev, DRVNAME, &opal_rtc_ops,
209 THIS_MODULE);
210 if (IS_ERR(rtc))
211 return PTR_ERR(rtc);
212
213 rtc->uie_unsupported = 1;
214

--- 47 unchanged lines hidden ---
208
209 rtc = devm_rtc_device_register(&pdev->dev, DRVNAME, &opal_rtc_ops,
210 THIS_MODULE);
211 if (IS_ERR(rtc))
212 return PTR_ERR(rtc);
213
214 rtc->uie_unsupported = 1;
215

--- 47 unchanged lines hidden ---