rtc: opal: Enable alarms only when opal supports tpo
rtc: opal: Enable alarms only when opal supports tpo

rtc-opal driver provides support for rtc alarms via
timed-power-on(tpo). However some Power platforms like BML use a fake
rtc clock and don't support tpo. Such platforms are indicated by the
missing 'has-tpo' property in the device tree.

Current implementation however enables callback for
rtc_class_ops.read/set alarm irrespective of the tpo support from the
platform. This results in a failed opal call when kernel tries to read
an existing alarms via opal_get_tpo_time during rtc device registration.

This patch fixes this issue by setting opal_rtc_ops.read/set_alarm
callback pointers only when tpo is supported.

Acked-by: Michael Neuling <7b0ab45a730e48a69239010b5b8fe5fa4e8eaac6@neuling.org>
Acked-by: Neelesh Gupta <0c847490c0192d1430997c36c35afbb478c33ca8@linux.vnet.ibm.com>
Signed-off-by: Vaibhav Jain <e78384dfaa97bf0f3945c4da4075af8ac33ade0a@linux.vnet.ibm.com>
Acked-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.vnet.ibm.com>
Signed-off-by: Alexandre Belloni <a7228e626ecf0022ac91fc1cd8db88e71d0e5e0e@free-electrons.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs