Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1265989lfc; Wed, 1 Jun 2022 13:34:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+qDI1+rVwjp47iu2w1q4TNTm6kS1AEW7eyYVRouD5Ueg9wYAwN08w/UR+T7eKmbz6xd2D X-Received: by 2002:a05:6a02:10d:b0:381:f4c8:ad26 with SMTP id bg13-20020a056a02010d00b00381f4c8ad26mr993629pgb.135.1654115675141; Wed, 01 Jun 2022 13:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654115675; cv=none; d=google.com; s=arc-20160816; b=aJkDmr9L9aB4e+ZhDSaF8IOFTLxGx5vAavgNgxZsPEI7P0xy95jNrU9A9JzfQnlVZ2 KrBE8BBY0aPXuM75kWLlVKz4EQt3oNwbksn9GF1WLfFuZbijlz5fylFabIwXt3ruEx4g kN8TpkirwFDr0qI7Eg8rpTBy9wz1d7JD4eHjwbQClgAWtdXCI0m0BBsoOSk6hOdnwr8J +S5JFzmSXvpG+gxrj4ILPfBMeJ5k8Ei203Ei3SmH415C9pNHQG0bBZtn/ms166LdDedM qTdOM5gduF+pdvaXKJkm7VmyNT+BbHZvjHWcu6nbCzfr5GhqwW2mAWs4ZiuSKYMHiYRE VD/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cN+OAsh1VRyDLaTriT8GC9dS6OSQT7TN3fOLbCLdLoM=; b=H6kt86i1NJc/+26Bf2+gL7mDM5f8/Zx5occbXdxxYHLOHZba7+WIKTGPiwKPykeBu3 OIWGo0teQfm+zQs0EKSzzYdygrWgGAQWf+LWZ+Gwtep/w5arZhmh5IXqkDH5WwPrixHJ H811pCv2HlivYYolyHwzxT4AVwvcwYP4tFNYc/WTZZIGq0Zk0cuA0np1YNfGIBSfZlmj rjKZX7/sSNc6ntCTs8R6d5tRnLikDZp0YGk6s6Osgu7i9vVrquDh0acuFPOfCT2w2F2p 0qrkDtaK+9R0NGDi+LOr2ZllRmwUv+Zc6bIBtAIOgeG7Ti9MhxJ8+afTuncoyDFd6hlu k5cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=t2K1cmbd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d16-20020a63d710000000b003c5e1870574si3015226pgg.667.2022.06.01.13.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:34:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=t2K1cmbd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3149D27E460; Wed, 1 Jun 2022 12:44:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352925AbiFAMfN (ORCPT + 99 others); Wed, 1 Jun 2022 08:35:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350780AbiFAMfH (ORCPT ); Wed, 1 Jun 2022 08:35:07 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 693829CC99; Wed, 1 Jun 2022 05:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1654086903; x=1685622903; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=KaYR/blB8zGHDSr0CLcv5ju+jN5gMeOimUNbfTUhUQs=; b=t2K1cmbde8WFTmUjbX5P3kIpIjExv3+73VlfBMTmz9XZMDYmjfA6jbIP bKwXui2aQWbNmkRGPOS+UojGbK/SVuL3d47+4lpDiFqWKp2Ac3p3YYtxG lBBdO+7J23BeKk4Uxkh1BiM/oFEEmmoEN1Ko+RkLJmYAyWFDadc+d/H4V AwC91eK/WpYdNNWXdqzB42iFAYHUF/wMfbZ93Z5Bu5i+TVH+Ezy0jMqYm tn31tGtVKTmwcZHLLzETili86RSVK+74+v8hYGYNHtjXOIwEYg4+vtRKz 1cocTeFsOyVeYLLSiNM0EvADLHyriKiASGAasGrLkhzvSu8O7IP2PgyCz w==; X-IronPort-AV: E=Sophos;i="5.91,268,1647327600"; d="scan'208";a="176039617" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Jun 2022 05:35:02 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 1 Jun 2022 05:35:02 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 1 Jun 2022 05:35:00 -0700 From: Conor Dooley To: , CC: , , , , , Subject: [PATCH v5 0/2] rtc: microchip: Add driver for PolarFire SoC Date: Wed, 1 Jun 2022 13:33:19 +0100 Message-ID: <20220601123320.2861043-1-conor.dooley@microchip.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey all, This is technically a v5 of [0], although a fair bit of time has passed since then. In the meantime I upstreamed the dt-binding, which was in the v1, and this patch depends on the fixes to the dt-binding and device tree etc which landed in v5.18-rc5. The driver is quite substantially rewritten from the v1, as you wanted it to be switched to "binary" rather than calendar mode - so hopefully I have satisfied your concerns with the original driver. Specifically you had an significant issue with the counter being reset on startup & that is no longer the case. Thanks, Conor. Changes since v4: - replace duplicate define of BIT(6) with the missing BIT(7) define - remove duplicate read of the mode register in mpfs_rtc_readalarm() - simplify if (mode & MODE_WAKE_EN) to an assignment - replace (potentially) infinite wait with read_poll_timeout Changes since v3: - invert read order of datetime registers so that they are properly aligned. reads of the upper register are aligned to the last read of the lower register - move wakeup_irq out of mpfs_rtc_dev & into probe - removed range_min since it is not set & implicity zero anyway - rewrote the remove function to not call mpfs_rtc_alarm_irq_enable(,0) Changes from v2: - move prescaler out of mpfs_rtc_dev & into probe Changes from v1: - remove duplicate and unused defines - remove oneline mpfs_rtc_set_prescaler function - dont unconditionally turn off the rtc in the init function - dont reset the rtc when init is run. - dont disable the alarm when we boot - use binary, not calendar mode - delete mpfs_rtc_init & set prescale in probe - use dev_pm_set_wake_irq rather than writing suspend/resume functions - delete calendar mode only register defines - since using binary mode, set range min to zero - set range max to max alarm value (is this acceptable?) - added a MAINTAINERS entry: when v1 was submitted there was nothing to add to, but there is now. [0] https://lore.kernel.org/linux-rtc/20210512111133.1650740-1-daire.mcnamara@microchip.com/ Conor Dooley (2): rtc: Add driver for Microchip PolarFire SoC MAINTAINERS: add PolarFire SoC's RTC MAINTAINERS | 1 + drivers/rtc/Kconfig | 10 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-mpfs.c | 326 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 338 insertions(+) create mode 100644 drivers/rtc/rtc-mpfs.c base-commit: c5eb0a61238dd6faf37f58c9ce61c9980aaffd7a -- 2.36.1