rtc: isl12057: enable support for the standard "wakeup-source" property

Though the isl12057 rtc driver should and will continue to support the
legacy "isil,irq2-can-wakeup-machine" property to enable RTC as the
wakeup source, we need to add support for the new standard property
"wakeup-source".

This patch adds support for "wakeup-source" property in addition to the
existing "isil,irq2-can-wakeup-machine" property.

Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: rtc-linux@googlegroups.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
This commit is contained in:
Sudeep Holla 2015-10-21 11:10:01 +01:00 коммит произвёл Alexandre Belloni
Родитель 347e40f030
Коммит f4b6722248
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -466,9 +466,8 @@ static int isl12057_check_rtc_status(struct device *dev, struct regmap *regmap)
* is for instance the case on ReadyNAS 102, 104 and 2120. On those * is for instance the case on ReadyNAS 102, 104 and 2120. On those
* devices with no IRQ driectly connected to the SoC, the RTC chip * devices with no IRQ driectly connected to the SoC, the RTC chip
* can be forced as a wakeup source by stating that explicitly in * can be forced as a wakeup source by stating that explicitly in
* the device's .dts file using the "isil,irq2-can-wakeup-machine" * the device's .dts file using the "wakeup-source" boolean property.
* boolean property. This will guarantee 'wakealarm' sysfs entry is * This will guarantee 'wakealarm' sysfs entry is available on the device.
* available on the device.
* *
* The function below returns 1, i.e. the capability of the chip to * The function below returns 1, i.e. the capability of the chip to
* wakeup the device, based on IRQ availability or if the boolean * wakeup the device, based on IRQ availability or if the boolean
@ -479,8 +478,9 @@ static bool isl12057_can_wakeup_machine(struct device *dev)
{ {
struct isl12057_rtc_data *data = dev_get_drvdata(dev); struct isl12057_rtc_data *data = dev_get_drvdata(dev);
return (data->irq || of_property_read_bool(dev->of_node, return data->irq || of_property_read_bool(dev->of_node, "wakeup-source")
"isil,irq2-can-wakeup-machine")); || of_property_read_bool(dev->of_node, /* legacy */
"isil,irq2-can-wakeup-machine");
} }
#else #else
static bool isl12057_can_wakeup_machine(struct device *dev) static bool isl12057_can_wakeup_machine(struct device *dev)