From patchwork Wed Oct 21 10:10:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 55356 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id 914C02303B for ; Wed, 21 Oct 2015 10:10:59 +0000 (UTC) Received: by lbbms9 with SMTP id ms9sf15766657lbb.3 for ; Wed, 21 Oct 2015 03:10:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=BU5lmffOXVn7tXZQ4uiAjVDwC7wUMygFW5VZXxilQ+4=; b=LJHtnBliYxbTUa/4tz3Z5Y9uqtEZ4HujEHcz3c0EqT51ZRlOZGWZnwdpXjVqWc3aj3 AzzBo/zetrghSe7zbrRSRVpot5+hRmEhVQmYbFproZBbdvzkw2cCo1VoALCgoEpPoCSV n0NkFNFLWNiSDqMbIR4XLUhcghfhvVkhANqFCRe2LALcb0hG+e0EUQxNKMQdurIUFiOH Ed1TCqQgTEvrUxQsW6WYv/q+lM+MRgRDskITF5dyK9Fi7eDT9dp8AXeB65brFA00WVAC R8NpTi7KRRaUYfxy2bborrmK9eNK6X3RhKvohgdFQK70lm8zAPBQsKNEXxyKgIdYdw/X /yzw== X-Gm-Message-State: ALoCoQneewEUkbQg4fWH+8+buVX5/mOdIBvz91UNIV/8dgAfKhfuaTCqjJebEHI7naIdfs7l4NS6 X-Received: by 10.180.87.164 with SMTP id az4mr6633347wib.1.1445422258558; Wed, 21 Oct 2015 03:10:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.81.148 with SMTP id f142ls180248lfb.68.gmail; Wed, 21 Oct 2015 03:10:58 -0700 (PDT) X-Received: by 10.25.156.5 with SMTP id f5mr2623230lfe.46.1445422258381; Wed, 21 Oct 2015 03:10:58 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id xu2si5768519lbb.104.2015.10.21.03.10.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2015 03:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbcao8 with SMTP id ao8so34591106lbc.3 for ; Wed, 21 Oct 2015 03:10:58 -0700 (PDT) X-Received: by 10.112.163.131 with SMTP id yi3mr4734064lbb.36.1445422258272; Wed, 21 Oct 2015 03:10:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2594666lbq; Wed, 21 Oct 2015 03:10:57 -0700 (PDT) X-Received: by 10.68.131.6 with SMTP id oi6mr9723513pbb.3.1445422257142; Wed, 21 Oct 2015 03:10:57 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sa10si12280198pac.110.2015.10.21.03.10.56; Wed, 21 Oct 2015 03:10:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932553AbbJUKKr (ORCPT + 28 others); Wed, 21 Oct 2015 06:10:47 -0400 Received: from foss.arm.com ([217.140.101.70]:59935 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932525AbbJUKKn (ORCPT ); Wed, 21 Oct 2015 06:10:43 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02FD447D; Wed, 21 Oct 2015 03:10:38 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.207.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AE0F23F308; Wed, 21 Oct 2015 03:10:41 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: Sudeep Holla , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com Subject: [PATCH 03/19] rtc: opal: enable support for the stardard "wakeup-source" property Date: Wed, 21 Oct 2015 11:10:00 +0100 Message-Id: <1445422216-29375-4-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445422216-29375-1-git-send-email-sudeep.holla@arm.com> References: <1445422216-29375-1-git-send-email-sudeep.holla@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sudeep.holla@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Though the opal rtc driver should and will continue to support the legacy "has-tpo" 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 "has-tpo" property. Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: rtc-linux@googlegroups.com Signed-off-by: Sudeep Holla --- drivers/rtc/rtc-opal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-opal.c b/drivers/rtc/rtc-opal.c index 6fbf9e617151..4087d53ecd73 100644 --- a/drivers/rtc/rtc-opal.c +++ b/drivers/rtc/rtc-opal.c @@ -199,8 +199,9 @@ static int opal_rtc_probe(struct platform_device *pdev) { struct rtc_device *rtc; - if (pdev->dev.of_node && of_get_property(pdev->dev.of_node, "has-tpo", - NULL)) { + if (pdev->dev.of_node && + (of_property_read_bool(pdev->dev.of_node, "wakeup-source") || + of_property_read_bool(pdev->dev.of_node, "has-tpo")/* legacy */)) { device_set_wakeup_capable(&pdev->dev, true); opal_rtc_ops.read_alarm = opal_get_tpo_time; opal_rtc_ops.set_alarm = opal_set_tpo_time;