Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp193209rdb; Mon, 22 Jan 2024 00:34:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEeWZuLN9dsfBuGVI+sNIkJF2j5woE7zOsMHFnglpaJgOqgkuMFlOK9ZwcTy+s5MGgQBtuu X-Received: by 2002:a05:6402:14d9:b0:55a:59f1:2b3e with SMTP id f25-20020a05640214d900b0055a59f12b3emr1912812edx.31.1705912464310; Mon, 22 Jan 2024 00:34:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705912464; cv=pass; d=google.com; s=arc-20160816; b=kubb1/Ec6B+3DqTyx+h43UortiJ1hBUV6PFAHFHQIPGYZaUwur/razHPAyU5MxvJn1 hW53qcJX/JBvd9J2+FeHoqOIdtvJ44BFXj3gpIpjGVm6i9aYhJmDANo7ryBFz75Ci6qi Q5E+hEmz+HrU1W26LX/k5y7W7o+8Y9gy64nsuXH7zC8P8VkeFnHszdBoch6PxxuPrWga LlqQNZdos41i6m4+LC2panl0vn+70VIxVwk77ggp19fdvvv80tKTQAoLH3bBKtIIKgM2 DyYpvnQxQluUmvOkW0cI6K9SxCklzLukcqkVJRx25b6V+xeWEdLeCiSQs9v466OgK2x8 R0sw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=zkwnvGLbqFItCCRb578zOlJjANzoAer2/ivLxkfy9/8=; fh=wLD8wD9z8cKCdAN7Iu9VnV4KUD/6ogtMugEAYUv4P3g=; b=pr8VqbzTnoGpYh54PSsUIACNdlGplxQDmKVOTVOx7KY0eacAOyz7PVY0EhdCeOuuOn rVA9l2rhhN2+MVcDbooiMSJQtTHcDZJfEl5rXktDA/lvttS+0fncSxMacgD+XOD8GSI/ h7ZCy1vXiOKjMdzhf5WBJr9q8Ovfds0tm7gAPNlLmT4aUp93Ur7SAwrl/t1MzgOCVITY 6SRuBFncv0mTIi55P3uDYTJyZBn5AxL4n1a8idKUhXS8ky552tqeF/xUJuGEqY02pRBB 7uoY6Lwl1Z/LEiaKNYJK4UgukstS5makBAn0U/Gvw5y00f1CqXvPALNfvINXKW6lEh+y qMow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g9Wi7kHO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-32529-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32529-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s30-20020a50ab1e000000b0055a3288684asi4306495edc.191.2024.01.22.00.34.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 00:34:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32529-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g9Wi7kHO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-32529-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32529-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 am.mirrors.kernel.org (Postfix) with ESMTPS id E1EDA1F23856 for ; Mon, 22 Jan 2024 08:34:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78DCD21353; Mon, 22 Jan 2024 08:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g9Wi7kHO" Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60F98210E0; Mon, 22 Jan 2024 08:34:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705912453; cv=none; b=RwhA5yDKY5FGddVo9JEkBmyOFL77nI3Wk08ILEaNDe4Nisy6s1eMdmUGuQ+QoVPoYBEb2sptx7jba8rOgUIwfDLU+01XJi/XILHjn7ToVnD9IeN18NV1EKKIp4w9gI/1OmM47svdF0qWIjXCDqWPCHUFF8BwJ70SlG3BGwM6ZQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705912453; c=relaxed/simple; bh=zkwnvGLbqFItCCRb578zOlJjANzoAer2/ivLxkfy9/8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=XpCnOfGVXyUrSb8OphCcn6U5AHIwfbgz8TjxDd3iipedbbio2h4T4RKXW3kaaZBOP55ftzYP8j258bCtAh2hYzE3+15Xft6MmEVMJW6pNSuQ4CcFxjIyYdEfFL+43Cbh7TWTSL+W2CDyhxAeH1DP22QR4VqGC1yfjXfH7D7Dx+w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g9Wi7kHO; arc=none smtp.client-ip=209.85.167.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3bba50cd318so3346930b6e.0; Mon, 22 Jan 2024 00:34:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705912451; x=1706517251; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zkwnvGLbqFItCCRb578zOlJjANzoAer2/ivLxkfy9/8=; b=g9Wi7kHOsGPpc1pGhcynsHRjFIYivRW1rXqB1UENSYD2rGJLSAJMr8MHvBnNzd6vnG MXgVq3ytt4GK1vmpFuSZyhv2oKZQBjPUiU0i3rKonvl6Ob23OJ1dsAE61u4fep8LmLl0 lRIXJTXemfyTZGHu2Wnst9NNURlv7cZOKlLFRgN1+3DDzrKG5ghLlwZL9jBpMvUHBK+P 9cllRpHWwpKKe8z7xCYpd2Ws73TjhFAKpf9RjUqy+2b0kauDzvbxIEa6GJklm0qvidDL G6HR19LQK16NthfEzii9zj6+yutsnAUlebtQb6d3bZ6fK1Rtv002iytqGBSEmdk7ZCCy Jc0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705912451; x=1706517251; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zkwnvGLbqFItCCRb578zOlJjANzoAer2/ivLxkfy9/8=; b=IOWpYZHAmjgErh152k+EsT2z2Frj6dgyyOdJi6fkSvl9QnhNgY3/JfDjNWV+5FM3Yi gX6/IZYLgS891qgR1D81pXmzUNkme2TO/+F9ifYDpMBmvmxxbjDFANgt/UDaBOA9bjux eFtJeZl4UxYC9S1Ad68Wq7HzqsBN//+rJtrU5BmRbgXuaSXvGJOVFt0rGVwiEnuSVOwH LYhUkH/fHSoGb/sigsz3u1V/tR5bS2ECAwovgNetZJLchgkRSAfDaNdIiB5FkcHSjwmu uDicJJFs+kEHYIkdGbzm5AhPaeJ0cgCa+KwR07Iv0epL8aWbHjT1B/841I3duPTunVg0 kTjw== X-Gm-Message-State: AOJu0YxJe4cDVDuHZS5sviloGtu9KcWCDAJpmp42uxVcWI8td/nZs32D uoVuizR7q6Q1SkZqpQfIWHkVwPMcAmeZXT0Vy9KFu1qi1FQMVL1IivdzrEu1vE6B97e7QMutb4R Q0dGncz8IQHPkwwgynuu/UrDBYLY23g8ms94= X-Received: by 2002:a05:6871:549:b0:210:d1b9:dda2 with SMTP id t9-20020a056871054900b00210d1b9dda2mr4790038oal.3.1705912450867; Mon, 22 Jan 2024 00:34:10 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240122080631.2880-1-qiujingbao.dlmu@gmail.com> <20240122081722868bdda5@mail.local> In-Reply-To: <20240122081722868bdda5@mail.local> From: Jingbao Qiu Date: Mon, 22 Jan 2024 16:34:00 +0800 Message-ID: Subject: Re: [PATCH v7 2/3] rtc: sophgo: add rtc support for Sophgo CV1800 SoC To: Alexandre Belloni 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 22, 2024 at 4:17=E2=80=AFPM Alexandre Belloni wrote: > > 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/IA1PR20MB4953C774D41EDF1EADB6EC1= 8BB6D2@IA1PR20MB4953.namprd20.prod.outlook.com/ > > What is the dependency? > Thank you, this driver requires support from the CLK driver. I will add an explanation in the next version. > > Also, please fix the checkpatch.pl --strict warnings I will use the -- strict option for testing. > > > +/** > > + * 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 *inf= o) > > This is still not working as well as you think it is. You should > Implement the offset callbacks instead. > I'm sorry, I don't quite understand offset callbacks. Do you mean that this function needs to be executed periodically. Best regards, Jingbao Qiu