From patchwork Mon Aug 12 23:28:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 11090981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71C926C5 for ; Mon, 12 Aug 2019 23:28:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FF89285AB for ; Mon, 12 Aug 2019 23:28:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 528C7285B3; Mon, 12 Aug 2019 23:28:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0972D285AB for ; Mon, 12 Aug 2019 23:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dBR3kl5pOUzjEcixCVv7l4HsR0ALBYluonhnv/MLXYY=; b=uSnxRj2gCynuZL 5tdv231/2IY3epmjGOPrMyf4da914cmtA5/uqVFAxHrJlf0vfVxyUGwHUIozSzXCuaknj3v6AHc5H 6ZR5L9moBpItLEjqVh/Fq2T9WOIODUqQmiPqKaZLbir7ySdqqihOpzCREVa+laOySiEOGkUUp29kB MwvOjKI+EJh5vicmvE63tVvN3e0Y63AjRta6GHEuY5wuiF9cXVYCTsI1+kH6zcjYf+MCc4e3zMZLq QchaopUxWOZpGUOoaxJmWODRM37JJB7xBVxOzDXxAahSmcOia4zr1igi+3IRXV7Nqqf0HU+4NdzNS ZEnNIm9Bbd4690f6m5GA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hxJkI-0003E1-8Z; Mon, 12 Aug 2019 23:28:58 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hxJkE-0003CO-12; Mon, 12 Aug 2019 23:28:55 +0000 Received: from localhost (c-71-197-186-152.hsd1.wa.comcast.net [71.197.186.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA3F620665; Mon, 12 Aug 2019 23:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565652532; bh=ahoNLQPnX82nGz86Y7FW3a1cpXocBYRKZ1y2smEqp9A=; h=From:To:Cc:Subject:Date:From; b=SgRawVWOSYB+zs6GRhqN0CAZz+chFVi+ssW8Bfm5yd2twCRJEsMoVGuyJ3Z6aUSFU eJ+T6/YYkUkqs+sdXgx9YMhB4k4QkyMQHc44qM4jTCyAlK4bormafrCFgWhr2zhcxz Agqf5Ba9N/0iGYbhfQDN1m5mSeXM1yChtFD/51mM= From: Kevin Hilman To: Alexandre Belloni , linux-rtc@vger.kernel.org Subject: [PATCH v3 0/2] rtc: add new Amlogic Virtual Wake RTC Date: Mon, 12 Aug 2019 16:28:48 -0700 Message-Id: <20190812232850.8016-1-khilman@kernel.org> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190812_162854_097001_06CBD2DC X-CRM114-Status: GOOD ( 10.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kevin Hilman Add a new driver for the virtual wake RTC on Amlogic SoCs. The RTC is virtual from the Linux side because it's a hardware timer managed by firmware on the secure co-processor (SCP.) The interface is 1 register where a wakeup time (in seconds) is written. The SCP then uses this value to program an always-on timer. Changes since v2: - switch to devm_platform_ioremap_resource() - switch to devm_rtc_allocate_device() and rtc_register_device() Changes since v1: - add MAINTAINERS entry - add nop ->alarm_irq_enable() (workaround for RTC core limitation pointed out by Alexandre Belloni) - remove unused ->read_alarm() - fix statics - move resume to dev_pm_ops - add suspend hook - don't calculate (or write) the alarm timer value until suspend time Changes since Neil's original version - move from do_gettimeofday() to ktime_get() Kevin Hilman (1): dt-bindings: rtc: new binding for Amlogic VRTC Neil Armstrong (1): rtc: Add Amlogic Virtual Wake RTC .../bindings/rtc/rtc-meson-vrtc.txt | 22 +++ MAINTAINERS | 1 + drivers/rtc/Kconfig | 11 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-meson-vrtc.c | 156 ++++++++++++++++++ 5 files changed, 191 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/rtc-meson-vrtc.txt create mode 100644 drivers/rtc/rtc-meson-vrtc.c