From patchwork Fri Nov 10 21:55:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 10053827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BD7F76032D for ; Fri, 10 Nov 2017 21:56:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B18392929B for ; Fri, 10 Nov 2017 21:56:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A63AD2B470; Fri, 10 Nov 2017 21:56:17 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E772C2929B for ; Fri, 10 Nov 2017 21:56:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754239AbdKJV4P (ORCPT ); Fri, 10 Nov 2017 16:56:15 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:55290 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754129AbdKJV4N (ORCPT ); Fri, 10 Nov 2017 16:56:13 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 1681E266F51 From: Enric Balletbo i Serra To: Lee Jones , bleung@chromium.org Cc: Guenter Roeck , Gwendal Grignou , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, rtc-linux@googlegroups.com, Stephen Barber Subject: [PATCH v4 1/2] mfd: cros_ec: Introduce RTC commands and events definitions. Date: Fri, 10 Nov 2017 22:55:52 +0100 Message-Id: <20171110215553.20696-2-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171110215553.20696-1-enric.balletbo@collabora.com> References: <20171110215553.20696-1-enric.balletbo@collabora.com> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Stephen Barber The EC can function as a simple RT, this patch adds the RTC related definitions needed by the rtc-cros-ec driver. Signed-off-by: Stephen Barber Signed-off-by: Enric Balletbo i Serra Acked-by: Lee Jones Acked-by: Benson Leung Reviewed-by: Brian Norris --- include/linux/mfd/cros_ec_commands.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h index 2b16e95..c6046a2 100644 --- a/include/linux/mfd/cros_ec_commands.h +++ b/include/linux/mfd/cros_ec_commands.h @@ -291,6 +291,9 @@ enum host_event_code { /* EC desires to change state of host-controlled USB mux */ EC_HOST_EVENT_USB_MUX = 28, + /* EC RTC event occurred */ + EC_HOST_EVENT_RTC = 26, + /* * The high bit of the event mask is not used as a host event code. If * it reads back as set, then the entire event mask should be @@ -799,6 +802,8 @@ enum ec_feature_code { EC_FEATURE_USB_MUX = 23, /* Motion Sensor code has an internal software FIFO */ EC_FEATURE_MOTION_SENSE_FIFO = 24, + /* EC has RTC feature that can be controlled by host commands */ + EC_FEATURE_RTC = 27, }; #define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32)) @@ -1709,6 +1714,9 @@ struct ec_response_rtc { #define EC_CMD_RTC_SET_VALUE 0x46 #define EC_CMD_RTC_SET_ALARM 0x47 +/* Pass as param to SET_ALARM to clear the current alarm */ +#define EC_RTC_ALARM_CLEAR 0 + /*****************************************************************************/ /* Port80 log access */