Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp185585rdb; Mon, 22 Jan 2024 00:17:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLb/x8058J1lSI5QzORyj9RYCu347G2MU68Pe6XL++13sexC3FKWzkZqMZj4V2owzk4LAt X-Received: by 2002:a05:622a:245:b0:42a:3e98:a1aa with SMTP id c5-20020a05622a024500b0042a3e98a1aamr2153173qtx.37.1705911457861; Mon, 22 Jan 2024 00:17:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705911457; cv=pass; d=google.com; s=arc-20160816; b=NL/9R5Zb5tDgT8ALhMdtSn+OrZGk7owH0j/kY+cfKOX5XJfjlrfyo4LprKG9JShLtJ PWXUkGcX4UVLzozsH0+1SnpF7ZX89odn2xN7Ws+D7gvTUlO4eiX75Ttr5TnGMNosxg6m 5WRX/CakUwRq37r+Qlx0pSS1Ysk/DWMcH1PyqJDG4ufUKntlbl2fwlglgE2QaH7+uqxz HAPIwo79e4REmif3vMnpK9E4H5GgX0pWmRvCYvJ7Ni8/ob2yRWwCq3N5nE/GGzzC8l+c dTLjKvQEE5891PYC9lb0RrnhSdPekQ2SE4hD8HhoIW+Z1FbpcRlAlKhZM1cDMITs+39W UVeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hftQ/3NQ3SEsGANsB0kuwB+4HmiO86h7hcHpWei/1cY=; fh=IF1Ls7jxa7JCuP5+azubHLctIo3VYRlSBwVNuSrMvUs=; b=pH0/Z9ScZzdijvFMgYq1F8YNpldBusCJJSYhOqBrOJLJU37I5EWv0SS5W968f8U2e/ i5Y2sHNDPbBrrTVAKGRHklD//nGHVtQPV78hTRV6OllRmuLb+g0CHDRSz14UVJIMr3t4 LWVFdeG3EGCD7T0FK92eI4+69+URcbHmq2MMvwrRW4afoK4qmfnO3GV6TfA9iA/8C9ic I/zighjBL32P1LFdfiu7Mnm5PeAIP5tZ46qgRaSrTf9zvybY1lDEo2k37bJQ+rdBV+dV DFdXjRxBbMDrbNx/BgyXFi63cQvP5HRJMBrfnjWwWXJRP6mYBnfdK8OydeYIk+8j4zeo uyAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=JjuFux0T; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-32497-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32497-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j6-20020a05622a038600b004282727a29dsi5122106qtx.638.2024.01.22.00.17.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 00:17:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32497-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=JjuFux0T; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-32497-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32497-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9D3F61C21C89 for ; Mon, 22 Jan 2024 08:17:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAE9720DE9; Mon, 22 Jan 2024 08:17:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="JjuFux0T" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCFC7210E0; Mon, 22 Jan 2024 08:17:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705911448; cv=none; b=lZ5JgOKAcBu0B/WQT8z0CDI6VWr1fiXKu1SrPnrGzmE1tcKu85lnTwUo8lbw3q9dQS+7AGt0gxnFQpI0Us4BCi7moIeSDSj4V9+4cQ8V1KbGUOXgIs0ksnxcfIrlKx2asGGJ2JH68D6jQFw+b2N4HTaFRdU7h249YjoBcURnUFg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705911448; c=relaxed/simple; bh=aq/witDg2poUOUnqF60PQr7UvlvL7TKPJSmbDOt5ik8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SirgKTkwAddQwv8RI2VzPhcSDuuAZe5xyrZhd5CNE8EOqzBDxbophxeEpennJe/7sROWvc2xoftMHUbgHb2jo6a/D2oSSXe1MdEeAfmlGPcThTYmV+Pu4AUj9o23n/0YuVOZELwAHOeR3HtX1kLxvdV13G5+TUmKGKBXDdWKT9c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=JjuFux0T; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id DAF611BF20D; Mon, 22 Jan 2024 08:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705911443; 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=hftQ/3NQ3SEsGANsB0kuwB+4HmiO86h7hcHpWei/1cY=; b=JjuFux0TPgsxBh3Wr7htl8dzLwncaA4+bhaVv9DjNXlLHYsfxKhXWRrYnOqdccPFWYSZU9 nNFBMmyBIWLVAGLqlnovcDgvQDTpJM4XF9OwsZ4VGK8s21Hkh0zFTCci0aDpFaglnJuBEC HXedDV07MNMJl+T0ZqExJpNZsTl2JGDXDarLF/EfYaKCjrxbSyOZmUbgnvFcG7h6ZLXgyo 3h9D0EZf93N9d8qYXzBYH6pe6s43wiIWp6Ve+iaw0pIPsLYLUneUN1eJcAq8ZdEvk00N54 BXNp5k31h49FARUEokf7um+pXt69qcw8NRSIwxkTncL9F4XUeiq1dujnyR55rw== Date: Mon, 22 Jan 2024 09:17:22 +0100 From: Alexandre Belloni To: Jingbao Qiu Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, chao.wei@sophgo.com, unicorn_wang@outlook.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dlan@gentoo.org Subject: Re: [PATCH v7 2/3] rtc: sophgo: add rtc support for Sophgo CV1800 SoC Message-ID: <20240122081722868bdda5@mail.local> References: <20240122080631.2880-1-qiujingbao.dlmu@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240122080631.2880-1-qiujingbao.dlmu@gmail.com> X-GND-Sasl: alexandre.belloni@bootlin.com On 22/01/2024 16:06:30+0800, Jingbao Qiu wrote: > Implement the RTC driver for CV1800, which able to provide time alarm > and calibrate functionality. > > Signed-off-by: Jingbao Qiu > --- > > Depends on https://lore.kernel.org/all/IA1PR20MB4953C774D41EDF1EADB6EC18BB6D2@IA1PR20MB4953.namprd20.prod.outlook.com/ What is the dependency? Also, please fix the checkpatch.pl --strict warnings > +/** > + * cv1800_rtc_32k_coarse_val_calib() - Using an external > + * clock to coarse calibrate the crystal oscillator > + * @info: the device of calibrated > + * > + * @return 0 on success, or -1 on fail > + * > + * This RTC has an independent 32KHz oscillator. However, > + * the accuracy of this oscillator is easily affected by > + * external environmental interference,resulting in lower > + * accuracy than the internal oscillator.Therefore, a 25M > + * crystal oscillator is used as a reference source to > + * calibrate the RTC and improve its accuracy.Calibration > + * is completed through two steps, namely rough calibration > + * and fine calibration. > + */ > +static int cv1800_rtc_32k_coarse_val_calib(struct cv1800_rtc_priv *info) This is still not working as well as you think it is. You should Implement the offset callbacks instead. -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com