rtc-opal.c (58e16d792a6a8c6b750f637a4649967fcac853dc) | rtc-opal.c (1bf3e6cce8305638a859f6192635ad73af525d85) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * IBM OPAL RTC driver 4 * Copyright (C) 2014 IBM 5 */ 6 7#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 8 --- 219 unchanged lines hidden (view full) --- 228 .read_time = opal_get_rtc_time, 229 .set_time = opal_set_rtc_time, 230}; 231 232static int opal_rtc_probe(struct platform_device *pdev) 233{ 234 struct rtc_device *rtc; 235 | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * IBM OPAL RTC driver 4 * Copyright (C) 2014 IBM 5 */ 6 7#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 8 --- 219 unchanged lines hidden (view full) --- 228 .read_time = opal_get_rtc_time, 229 .set_time = opal_set_rtc_time, 230}; 231 232static int opal_rtc_probe(struct platform_device *pdev) 233{ 234 struct rtc_device *rtc; 235 |
236 rtc = devm_rtc_allocate_device(&pdev->dev); 237 if (IS_ERR(rtc)) 238 return PTR_ERR(rtc); 239 |
|
236 if (pdev->dev.of_node && 237 (of_property_read_bool(pdev->dev.of_node, "wakeup-source") || 238 of_property_read_bool(pdev->dev.of_node, "has-tpo")/* legacy */)) { 239 device_set_wakeup_capable(&pdev->dev, true); 240 opal_rtc_ops.read_alarm = opal_get_tpo_time; 241 opal_rtc_ops.set_alarm = opal_set_tpo_time; 242 opal_rtc_ops.alarm_irq_enable = opal_tpo_alarm_irq_enable; 243 } 244 | 240 if (pdev->dev.of_node && 241 (of_property_read_bool(pdev->dev.of_node, "wakeup-source") || 242 of_property_read_bool(pdev->dev.of_node, "has-tpo")/* legacy */)) { 243 device_set_wakeup_capable(&pdev->dev, true); 244 opal_rtc_ops.read_alarm = opal_get_tpo_time; 245 opal_rtc_ops.set_alarm = opal_set_tpo_time; 246 opal_rtc_ops.alarm_irq_enable = opal_tpo_alarm_irq_enable; 247 } 248 |
245 rtc = devm_rtc_device_register(&pdev->dev, DRVNAME, &opal_rtc_ops, 246 THIS_MODULE); 247 if (IS_ERR(rtc)) 248 return PTR_ERR(rtc); 249 | 249 rtc->ops = &opal_rtc_ops; 250 rtc->range_min = RTC_TIMESTAMP_BEGIN_0000; 251 rtc->range_max = RTC_TIMESTAMP_END_9999; |
250 rtc->uie_unsupported = 1; 251 | 252 rtc->uie_unsupported = 1; 253 |
252 return 0; | 254 return devm_rtc_register_device(rtc); |
253} 254 255static const struct of_device_id opal_rtc_match[] = { 256 { 257 .compatible = "ibm,opal-rtc", 258 }, 259 { } 260}; --- 38 unchanged lines hidden --- | 255} 256 257static const struct of_device_id opal_rtc_match[] = { 258 { 259 .compatible = "ibm,opal-rtc", 260 }, 261 { } 262}; --- 38 unchanged lines hidden --- |