From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7EB7C77B7A for ; Mon, 29 May 2023 22:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nckRMlL9jEtllh/2ObvPzq59JbOIMoBzh1OAAmaXAb8=; b=Ua6Jy86IvKMw0+ y/5CUIo2G7c53/YkzAP7tzdYNbkummQUoI930SC1vyx5uozpxOmddb0n9js07HOIpgYYu+GePknid gtBjvQ7gHZH1itygXVQsPj+posBqx4Bz2aaRhaUFPdPbtgdBs0vPvcuJjf+bdCaHJWPPcaKH6jq5t t+DZDY7d6HXb2fqvyntoWLCubtFPraRYKF6B3u5H9Xmg6oDaVzjoUBw0GBRqBtdYHm/gq2MAO4mos o4ru0IzVpSJDbc7DCtnqDs4ZHTsvRrHQiXfYmK0iWiJfVT2t9pDxsGnR55LDl8FW9a+UIirff9ar4 D6Hpif+aE99BDFWGGbow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3lXn-00BqOY-1r; Mon, 29 May 2023 22:40:51 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3lXj-00BqNA-1r for linux-arm-kernel@lists.infradead.org; Mon, 29 May 2023 22:40:49 +0000 X-GND-Sasl: alexandre.belloni@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1685400041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=egb4L+VNYQdcctQ3RYBg4Q3hflaDjVWsXarPSsnVIYs=; b=M562hNm36anb9Cab6H+unTLT20Dppcb2/F37ifys1sGHGM8fdtI7yoB8laolniMuvviCSJ olHs5BTN/wabe3oq8a+ODU8qSPzoiVEwHA9cP8RQreyg/5NAav2AggnHVlSSFfRKmrVxs6 l1tRBIH3FMR5ZoAcBtwiNcrJGC818IzhjFRGyXAb541cOH2Z9h3T3Vm/IfAhaEGcehkj+X rBDwrcdEock1PVXL3uN2VppWlXrRBw0vgj0ZmcajrPaPKu0iMikkt3gqITjiuBEbFS043B vd6IohyelalvAgbXm9OuoyolKkSjxwhkG2QBjJ0nOsudr3rSMoLa8Xn/4jjgrw== X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id C02AF20004; Mon, 29 May 2023 22:40:39 +0000 (UTC) Date: Tue, 30 May 2023 00:40:39 +0200 From: Alexandre Belloni To: Romain Perier Cc: Alessandro Zummo , Daniel Palmer , Rob Herring , linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/3] rtc: Add support for the SSD20xD RTC Message-ID: <20230529224039a7f270b9@mail.local> References: <20230517144144.365631-1-romain.perier@gmail.com> <20230517144144.365631-2-romain.perier@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230517144144.365631-2-romain.perier@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230529_154047_913158_0D2676AC X-CRM114-Status: GOOD ( 20.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, On 17/05/2023 16:41:42+0200, Romain Perier wrote: > Newer SigmaStar SSD20xD SoCs contain a really low power RTC (300uA claimed), The low power RTCs are more on the side of a few tenth of nA. RV3028 consumes 40nA, including the crystal. AB1805 consumes 14nA with an RC oscillator. It is funny how SoC vendors think they are low power ;) > +static int ssd20xd_rtc_isoctrl(struct ssd20xd_rtc *priv) > +{ > + static const unsigned int sequence[] = { 0x0, 0x1, 0x3, 0x7, 0x5, 0x1, 0x0 }; > + unsigned int val; > + struct device *dev = &priv->rtc_dev->dev; > + int i, ret; > + > + /* > + * This gates iso_en by writing a special sequence of bytes to iso_ctrl > + * and ensuring that it has been correctly applied by reading iso_ctrl_ack > + */ > + for (i = 0; i < ARRAY_SIZE(sequence); i++) { > + writeb(sequence[i] & ISO_CTRL_MASK, priv->base + REG_ISO_CTRL); > + > + ret = read_poll_timeout(read_iso_ctrl_ack, val, val == (i % 2), 100, > + 20 * 100, true, priv->base); > + if (ret) { > + dev_err(dev, "Timeout waiting for ack byte %i (%x) of sequence\n", i, > + sequence[i]); This is a user visible message but there is no action for the user to take apart from retrying. You should drop this. > + return ret; > + } > + } > + > + /* > + * At this point iso_en should be raised for 1ms > + */ > + ret = read_poll_timeout(read_iso_en, val, val, 100, 22 * 100, true, priv->base); > + if (ret) > + dev_err(dev, "Timeout waiting for iso_en\n"); Ditto. > + mdelay(2); > + return 0; > +} > + -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel