From patchwork Tue Feb 27 23:04:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3017227dyb; Tue, 27 Feb 2024 15:10:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUewZeMYsKBR8RpaF6CMgstt+Y6WaDhyh2xszdAHItDkz7RmdoZdqwNtO9pPTVpBgmVy88u2tSzG5n842u1gFf4Q5Lttg== X-Google-Smtp-Source: AGHT+IGlT9y6u8PV8vte5qu286MLlajKnu8E+RPczyuad4syyZAf/YzhsE2m74uiuEZcNgCJ0yZs X-Received: by 2002:a17:903:25c9:b0:1db:cbff:f7d6 with SMTP id jc9-20020a17090325c900b001dbcbfff7d6mr8719524plb.44.1709075424315; Tue, 27 Feb 2024 15:10:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075424; cv=pass; d=google.com; s=arc-20160816; b=eqXEWFT3lUavhy+cuPmXvXqLysvo3Bs62LDeMQL1LakPNwCHqvSmiQLW7ONS01ZlBr 4NhLXf4b888U9MjNYQqmQlBmAqsfZlLUgkfEn7gpbitz87r2V5QQrM82ZA5txjNoDh6+ ng2Neb9RCeIxGXuF0DP2hnPnEKaD8u9vKlW86W3KhFj8tzsWpfP41DrvBHXnPcmNTi30 Lkv6E+UJgF0kq6Id2IkE84x4SbJHUHTdlzS3BkY2jmU1RwuDjSuT0n5zjbuBFcmOU+qs aTkwtaQzX1aB1t5IaaHloq1uLfJIcP8z0km8DBDlIVIxxuqTl+yI9u9IjT2Sasjebkpb S9Ag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=UU5eqek636ykpjvx4kiaBg2YTtRQWsggazZSLPW+0Z8=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=ZuMVt6BF0ln6v54gFc7ISv1IAXu8fyfHFE987XADiUpxo+x8vSGxvuatiFeon8flyX +Gpx2nV9LCNy02v1b3YMOnXWjShVcs6376v464xV4fBrtYYpXOA47Mt92EYN3eE9d9Rk RmV7o/IibfY81qIQzhRxKWpEQnbWQLH6dfL45AfnidXntuOpSI7ECb1aEnLNBD79nWxF v1pX6H4Qyie48Z/PDOktz8itxk4OBv6XlmEJUxIA+qNG08jidkDFdXx418z8/qGZfzvc UIUeQvxUEha5TlJW7+BXpPUTAnxkhRSKG6HLNtlMM6C7h+Y12iuHCHOhxbVRORIe+58L 7muA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CzglCkHX; 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-84159-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84159-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a7-20020a170902b58700b001dba356b96fsi2054339pls.420.2024.02.27.15.10.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:10:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84159-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CzglCkHX; 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-84159-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84159-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D4BD928EC53 for ; Tue, 27 Feb 2024 23:04:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B7ACF56461; Tue, 27 Feb 2024 23:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="CzglCkHX" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (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 9CF4C56740; Tue, 27 Feb 2024 23:04:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075087; cv=none; b=d8oXFUdR9Lhtw/b14SFqIJV07X1cUpQ0XuZocNecAALR67Ibh8198wSrKVCl+PisioR3lnF0xjAVJXSBlpbFxM0VdByLvx4Z6oOIczLpwyQl2P7pmgYsChsJnyV568TBbezR3xVPpD8kX9RftzoP2OuD2DznAvHKzkGadwjsVFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075087; c=relaxed/simple; bh=TCLhVR18bPbwPX6om2wj/JmRt9QdCvRZ6Yg+2ueRaVw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XaGStI73CcGDstIHCdok8j+s091smINNoFU2h/9DvrF4/UHb4iNh0lo+zr7OGPWXYMb1C50LkQ+UBesz5K5yiSqj6eTP3at4kzKKRuuHpTsg7FdeBElqKEoBF9L0nmDEFkUMl1W//IeySHc8O6MA/pdsgTQPGEXwof2t1Q+2DeM= 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=CzglCkHX; arc=none smtp.client-ip=217.70.183.198 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 78EA7C0006; Tue, 27 Feb 2024 23:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UU5eqek636ykpjvx4kiaBg2YTtRQWsggazZSLPW+0Z8=; b=CzglCkHXhbujLFTTJdEzQzJIihM4PRKG92uzg+3pthCgO+Brgk19xYEEb958OoAj4SwHwS u1WNMbjlEXPWv//iNUx3vh/XSb+clKK7FcZnSQkkeD8ceLaj0HHW5vYoHFEOcYnqeI0fKg 5zVv2wFlhLgdpTBOosW9lr9VNctzwdiGyiLVdwxpWMMjqJl1Dx5HpEiqMPrzRcRj0/abtw 8nmpDQzX7tJBNtSXt2O7cDIrISr+Q6l+YGTNtx5uPM3Y/UPIXo81ijSpRGPl8XOgf8p1LB Xa0wRTamMDFf/3rc1unVNkPWAVf8ZkaFx/OR59GUpMba+MplxnAdvyRRMRKBtw== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/12] rtc: ds1511: drop useless checks Date: Wed, 28 Feb 2024 00:04:16 +0100 Message-ID: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095472153843865 X-GMAIL-MSGID: 1792095472153843865 From: Alexandre Belloni The RTC core will always pass a valid rtc_tm, it is unnecessary to check the validity of its members, especially with an open coded version of rtc_valid_tm(). Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 1109cad83838..87c52d20d31a 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -182,9 +182,6 @@ static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) if (rtc_tm->tm_year < 1900) rtc_tm->tm_year += 1900; - if (rtc_tm->tm_year < 1970) - return -EINVAL; - yrs = rtc_tm->tm_year % 100; cen = rtc_tm->tm_year / 100; mon = rtc_tm->tm_mon + 1; /* tm_mon starts at zero */ @@ -194,15 +191,6 @@ static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) min = rtc_tm->tm_min; sec = rtc_tm->tm_sec; - if ((mon > 12) || (day == 0)) - return -EINVAL; - - if (day > rtc_month_days(rtc_tm->tm_mon, rtc_tm->tm_year)) - return -EINVAL; - - if ((hrs >= 24) || (min >= 60) || (sec >= 60)) - return -EINVAL; - /* * each register is a different number of valid bits */ From patchwork Tue Feb 27 23:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3015392dyb; Tue, 27 Feb 2024 15:06:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXDB8soX8NFAvGloDvSIkSYoi9925onJRaHm/ltFP3e6kKIe4vESRF/fc6jWNXz8wBs8AnUGE9s8dHMF7hqGJTNlFuyCg== X-Google-Smtp-Source: AGHT+IHH/2WK/EQ0DTr1X/Z54hafbEB2Hf+ZD7R7+KwRwYbb4td9Je4GflQtHHwcRlRL9vYza/jM X-Received: by 2002:a05:6102:370d:b0:470:6517:3077 with SMTP id s13-20020a056102370d00b0047065173077mr11599802vst.2.1709075196480; Tue, 27 Feb 2024 15:06:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075196; cv=pass; d=google.com; s=arc-20160816; b=EKtJxJoFT3q+0WBjtmY6+4IZMDFX9dqtWPwEglAibMWWWVTRvDJYPFXyTvLoc3t3gA yIzDtKsm6TGm3+Eu7rb4nii99Tq4sPZIspbPMYhDWEIKMskCi1WVQBnPCyes9LROT8QF fX14wEeMEv4FWCJC7j9blb1SjiPfFoJ2rigb+dTy6lCSD86rl/slg9Ysgoehw/qYf+jK o5kBIajY3aacF1ynl6YziUaTntPL/aCAD1ukyCviRtF6HgSazKJ2KDdSxzXm2UCsEE02 +UYnqbABVM6bgIZ5NAsODxUhfcSwLCT3AMsWAd6hgpbzVWZ50KB1Yf0NfArqVB+hpEK/ P9Mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xPWLS2vYXFua2bug0ohUqf0o99PQKgw61UA1Alu92Xs=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=fuylDjbVLB38/k0F4Sp8ie2Q9jEOOQNJha/JRWPdfnoWpUYsurLXL7kzvyPFNNfCo1 vMt0gZAKUixKJXliUUaADBhb3a1s5ofvmeZAtuye5RZCWQI+2SNHKjUW8A50c6v3dx2g hWDatNSpT0rlJEeBc4ksCaEt+pA9Wzhqou1ZHWnI9ItWC4WcG9QApmwXNGgQNqw/jfEK Saj2rotipHOJNWxU2Oq+dZug8vqpTHe1IxKlmUx19d1FQpuSP9zEtJu0IIKNS4zKHTUy 7Lbe4BvlwnJ6lOpBoODLPVZIa6dYJj9BZ8RG8kS08NYYbC3wYjpQFkp9E+12SEiNenaj 5VzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=p00F9w65; 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-84160-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84160-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p5-20020a056102200500b00470506facf2si1106475vsr.0.2024.02.27.15.06.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:06:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84160-ouuuleilei=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=p00F9w65; 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-84160-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84160-ouuuleilei=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 8AE101C2449D for ; Tue, 27 Feb 2024 23:05:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4587A57305; Tue, 27 Feb 2024 23:04:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="p00F9w65" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (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 F362E56741; Tue, 27 Feb 2024 23:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075089; cv=none; b=s/UYshg1frNxKE95T/cRmF4STDosGT/FGnXWJBVdOedTOd5QFsfEKmPv4Bpxs3VKLwZrIxO8H/fGn/ArdW0njhB9IdNzp8FjNe9vue292wAJlgSUyZENF7WfVd60x9sYTE6ETQ1Vo4wn+ApepPuxSofH0QsGVAGrOG75OTHJZKY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075089; c=relaxed/simple; bh=zo9Df9JHxN0K53/19URRHka3gUcLUDl/foFb5EGQk34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b+wtMYxLFG9Bnx9Q0o/7B9bANq2Nb77irZbx8kBF1vxVWWPOegoNhbODWIBDotCfp7Z8qayJyiYlS5mrb1bntPtzIIFrJN+GRoSn0mvWqZYwmQFFcdmiUuRyJcYT05TK6j+xta+4/8GtKgPyMb31MTCikwYZJbaQU9IAyCm9JC0= 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=p00F9w65; arc=none smtp.client-ip=217.70.183.195 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 B2E2A60003; Tue, 27 Feb 2024 23:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xPWLS2vYXFua2bug0ohUqf0o99PQKgw61UA1Alu92Xs=; b=p00F9w65LHHP8MlKrCE93I07ZCFGBvO19baUFIUKaSdussHa1PfjLlBo/Jv8Qbx8LR5Vs5 HP0sK6QgYYQ90pzv5Pn0HcTMuoSqa6DRWOyAIqKCuOl75IGwtlM4YFyo6dCpI7HKPDq1d7 soTG0YS0nxKt685D+vmt/v+StMQn1ab4mg6SXyfUpqt9GMd1EM8cEHP4igle5RbvPQCudC 00l0hGRnSr0e++Goa4BZ+CoMc/D7sJAM1YBVlsghnNI9oaMoUGwgRWypHTWejFbFsThgBd bmoL1eLbNvmQYW2sMii7RyNrVW1mAZx5R9lT4g8sdAtZodQuCzWr0RZJSUi/Zg== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/12] rtc: ds1511: drop useless computation Date: Wed, 28 Feb 2024 00:04:17 +0100 Message-ID: <20240227230431.1837717-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095233528783718 X-GMAIL-MSGID: 1792095233528783718 From: Alexandre Belloni All the callers of ds1511_rtc_set_time will use the same epoch for tm_year which is defined as the number of years minus 1900 since POSIX.1-2001. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 87c52d20d31a..a646bcf9cd56 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -166,24 +166,13 @@ ds1511_wdog_disable(void) } #endif -/* - * set the rtc chip's idea of the time. - * stupidly, some callers call with year unmolested; - * and some call with year = year - 1900. thanks. - */ static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) { u8 mon, day, dow, hrs, min, sec, yrs, cen; unsigned long flags; - /* - * won't have to change this for a while - */ - if (rtc_tm->tm_year < 1900) - rtc_tm->tm_year += 1900; - yrs = rtc_tm->tm_year % 100; - cen = rtc_tm->tm_year / 100; + cen = 19 + rtc_tm->tm_year / 100; mon = rtc_tm->tm_mon + 1; /* tm_mon starts at zero */ day = rtc_tm->tm_mday; dow = rtc_tm->tm_wday & 0x7; /* automatic BCD */ From patchwork Tue Feb 27 23:04:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207508 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3024160dyb; Tue, 27 Feb 2024 15:26:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWAp5eYuWn1jYvTwYoRQaQTPh0u6aRLfHg3vY5Zao5VVzHZztQ2HW0rhUZcEFp7OipT2QdZtGsBQpT8j/DqcN/y/n+m2Q== X-Google-Smtp-Source: AGHT+IGUmX9p8fhM2qHspYyh3ma4dVRciDh7XXHXMg+C6MUwKeIG3VwmdTQefsru0KVMxB83zB+A X-Received: by 2002:a9d:6a9a:0:b0:6e4:8d2d:64e5 with SMTP id l26-20020a9d6a9a000000b006e48d2d64e5mr10896353otq.13.1709076410200; Tue, 27 Feb 2024 15:26:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709076410; cv=pass; d=google.com; s=arc-20160816; b=N5HYHFH0f13dd7lFwnPwJkIflrGNafI169ihwznB5rRHuDBFUp4HTyrUPmKLhdulyS CyEkvwpQdAcejFhTr4VTn61QZUEuO576zCaGbT0fMwIDaVDKGmLsuQK17uVgr9wnYebz HYOB7CrN3NHWp9jFzHiIA9eqWJl+ZplBgQhyVG2zXZ8KVqgePGJ/TNUV44ioB6GVmE8+ SwMWtaAviDshhCSS8Vif9j7hp33R6kHT/yiuR/sjjO9wD5HYW9ya+d4uQsDtqHTUQjtO EkwRlSTX7qIs1Nj6ocqKfCBCPhAgap8hvdYYrMptNg41S5WspC0ArcawHVZl9IvkGVgF u+Pw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YzsgrX6QB8QR/FJbpPrgV15wrjsvOL5YD/IkQ9w8ApU=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=RgC6M94CG3i6/FbDPtAzLwMOCzD3qDfMdhRBzOK0X8+YcaHjh6zVgKtQOgRvtL6Wuf h8RJHDTDZZdbM+2EcCaBN7s/rWQUzZBTGwYREiN6iltNSIdXIKJc9CI++sqhnix06Rj9 H8uA5eClJ6bZJ9x2hJRynlDBTkSp43m7S+mTXqe0T6Xf2+XTN7nSCwt1tTZONUWImZqd 1PYS7TNORCm+chO7xmW4ipjiZn+esTAIYRracbJbYNxnii5gOQ78sTcx3EUp+NJx9jEc NHpX/eolh9zVKVezMy01Cazlb5iVxbU1v/w+x9++wABQ9W0783by/cpY0x/025Lc7EMa 0hFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ED+AuveV; 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-84161-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84161-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h25-20020a635319000000b005dc7c197229si6187839pgb.405.2024.02.27.15.26.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:26:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84161-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ED+AuveV; 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-84161-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84161-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E48C428F3DB for ; Tue, 27 Feb 2024 23:05:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E64F57863; Tue, 27 Feb 2024 23:04:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ED+AuveV" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 669FF55E4A; Tue, 27 Feb 2024 23:04:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075090; cv=none; b=ly9XGRVwenQlGPrZWbPBZMAy8Itey8Fg7ZmvClI6lBy5buPw+M0j893Bl8EaSX3QBdHEC1rNkOBmNadT+I2nH4yz4Q/+4zZqUJv4pwxMSUzDv0EZMI3adj8dCcECPFiiRW+0bhOp5HP+e3KTWwhEWvjpDFN8pOR9WMuzjxFaREY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075090; c=relaxed/simple; bh=NWkBxd8gPCr+WPhzY0sd0MvcNJtL1sjwX5jg1KmL/vE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HoPl8ExSNAJMYkf4ul0hWmrmsIUDVPhQRO1jlgwvdNxlBUSyjTQaGmO8qEunAq54tWU09XTvwUANmp5T1nv0k36BepfwuZdVVikGCIEU+9Fhcgk2y2v7rM83HPybuqWwZEy6WfX4RvMAHBIEqesjK7sQRf9QWpH5Sf+wMGy8HKw= 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=ED+AuveV; arc=none smtp.client-ip=217.70.183.193 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 3B386240002; Tue, 27 Feb 2024 23:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YzsgrX6QB8QR/FJbpPrgV15wrjsvOL5YD/IkQ9w8ApU=; b=ED+AuveVryI4A5M7J0Ddo1tmKy83fxllXO0YOpK/L+6dqVpXmtCbxAfbleP9mrxhuzoHCC kNtcFaNwNlaN2xeTqWSJ6iYJHCOQ/VGC5DzDPcEhRf8aaU1fJ/D6k8a9GAaeaieDMTTuAY Jdd/tVfZiDti6nYmrq3nCFjxCiVrrjzOyvIge0VPiJPLTsuJEid9madOh78uSt6+Yv+XVC mtlGWAlZMopG8ywGNExzzBoLncNglU9kpXS+n6lf+vjfaikb+9S6sjxVszBqMf81IemOw+ hKYrHueQUm+SypQH35dnl7wcQsaya/rpWYVYBsW/6+V+qxmgTYDueyjmnOmepA== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/12] rtc: ds1511: drop dead code Date: Wed, 28 Feb 2024 00:04:18 +0100 Message-ID: <20240227230431.1837717-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792096505635419549 X-GMAIL-MSGID: 1792096505635419549 From: Alexandre Belloni The watchdog part of the code is not reachable and should be reimplemented properly as a watchdog driver. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 44 ---------------------------------------- 1 file changed, 44 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index a646bcf9cd56..fe8dbad51c88 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -122,50 +122,6 @@ rtc_enable_update(void) rtc_write((rtc_read(RTC_CMD) | RTC_TE), RTC_CMD); } -/* - * #define DS1511_WDOG_RESET_SUPPORT - * - * Uncomment this if you want to use these routines in - * some platform code. - */ -#ifdef DS1511_WDOG_RESET_SUPPORT -/* - * just enough code to set the watchdog timer so that it - * will reboot the system - */ -void -ds1511_wdog_set(unsigned long deciseconds) -{ - /* - * the wdog timer can take 99.99 seconds - */ - deciseconds %= 10000; - /* - * set the wdog values in the wdog registers - */ - rtc_write(bin2bcd(deciseconds % 100), DS1511_WD_MSEC); - rtc_write(bin2bcd(deciseconds / 100), DS1511_WD_SEC); - /* - * set wdog enable and wdog 'steering' bit to issue a reset - */ - rtc_write(rtc_read(RTC_CMD) | DS1511_WDE | DS1511_WDS, RTC_CMD); -} - -void -ds1511_wdog_disable(void) -{ - /* - * clear wdog enable and wdog 'steering' bits - */ - rtc_write(rtc_read(RTC_CMD) & ~(DS1511_WDE | DS1511_WDS), RTC_CMD); - /* - * clear the wdog counter - */ - rtc_write(0, DS1511_WD_MSEC); - rtc_write(0, DS1511_WD_SEC); -} -#endif - static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) { u8 mon, day, dow, hrs, min, sec, yrs, cen; From patchwork Tue Feb 27 23:04:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3030535dyb; Tue, 27 Feb 2024 15:42:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOJXycRy1YubEdAxXQ/+9NAQrYB8qBV7WUAry2NOrqQJTCuQiz1fsK5MeyT/juU04/cyYmF7c08DOzzJAIxdyQqBhAyA== X-Google-Smtp-Source: AGHT+IGbYC59+AcTOdZ785NrM+eX5+uxS2CdzHF2P9/x4jK8sSRG4BSiXquiliXwga/2Pzi9m41f X-Received: by 2002:a05:6808:1889:b0:3c1:b09b:40aa with SMTP id bi9-20020a056808188900b003c1b09b40aamr2748027oib.6.1709077364113; Tue, 27 Feb 2024 15:42:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709077364; cv=pass; d=google.com; s=arc-20160816; b=rZW4jdU1gPGCm55RfDCzx5vTlZZbNZSYI1iyxWTGH8rUIwW/x1y/jzGLv579awxzpM eblOwOTtFdH/YHS+Dtb9tiECWtMDcNuOqgFqna3DpOB1YqmSLXYOWhGrinSq3lbOlzHo QV2GCMY04aSpGj4X2pzxgVPLR2/n8NAAcl6TsfKud6cSfcum1FVaLGDuPJbVxVG9Ermz F6xfJoRcsucZoaCUqXEIWZ9MLYJxFdcRcUK1L84uHdGpaITVuFE1HghSWn2IB/AkMZ9l QiEOzY0BCGEHMG8E/G/oP1WvTx/XPOvBE736MDMaXtThBZVJAESXVL1bHdtsdx4I/xWa +R+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BVr8YT/Fo2A2GRND8aVlOgxS5f57ar95qX8+fgS4eJ0=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=ffT7kF0PO2l02YcBipzmZ82aRuCS7kbMqlUokpXP48uaZU7rJ65yQDSJ7912n/4kJg w0BaGQBQqBqpKzN8tkbFCLe+IL8feXpvwfH7dZf0aDi9JIjwQ8NtvogL9aLl48/HYDkM /jmc39HFtV4xP9k8X7Sbc4GQuXL/LL4QkxoV6EZmLd+KIXQJW5bjQxFJNqR6tCVYTNkl H9V7iJ734Y9WxvGlBJFEZrJuye4v6Nbwj43K4l7ZqJj6ysKNkqAoXsOzEglmd6qXPNe8 HxRGfL7RLZUUJr70EtXfmfhd+QSZdr7ZCvGLd0bmyAznOI+q6jnEvm3Guj/9JPRD7Mbg zZ7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hNuuAFs9; 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-84162-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84162-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s15-20020a056a00194f00b006e476b6392bsi6400676pfk.287.2024.02.27.15.42.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:42:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84162-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hNuuAFs9; 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-84162-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84162-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 20744B249C7 for ; Tue, 27 Feb 2024 23:05:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F38F57883; Tue, 27 Feb 2024 23:04:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="hNuuAFs9" Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (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 E570E5646D; Tue, 27 Feb 2024 23:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075092; cv=none; b=PaDbsaGCcJsgB7Q3u1jmiTk+ZQC3SDwh1gEx9EMaMCdSW+L5WOhxX3EJ9U39o8NeUoIG+lrQ5av/o+aCHMOTJkCA80SKbB8SelGfQpifb1CFIaUQ/krvqaUU1Y9pMySMx4IeuciTMI4Qa8i1awUkDU0k9xEZ4Inu5HDLi/he8Kc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075092; c=relaxed/simple; bh=OnaJ0bhlsJb9TTJ9KBQYFAZJtWS0+hnIyvEiq6oHctQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZjcDiiHBLfHS7/rwmbtPU8JI6H1Y8YxOQ/z+0uixY/+JMsmA0xFL3rD77OEOm3o5tbv9Z3CHKs/Ric+j816Nc6KNiEn20zAh7OOyAiFXf+AoNXztbHmkUDrd62G3peF6xHTlv7PyqZ7udFKtWxVYXRbIps5rn95QyJlwyWNbX58= 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=hNuuAFs9; arc=none smtp.client-ip=217.70.183.196 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 082C7E0003; Tue, 27 Feb 2024 23:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BVr8YT/Fo2A2GRND8aVlOgxS5f57ar95qX8+fgS4eJ0=; b=hNuuAFs9jSGGWtluSIKTiEluNX2eQiHq2pQfhbkMqsoWtfOvYyWovHLqgXLzdd7GeRCzMy XmNBivgp0qBLLMjW4hAuZ01sXbNMjxOTlH+VZzz/CNc5GHLPYteEEITKo3TDH0RTK5+Qih yI/PaAw6g+VUKih/Yc5tuPBODIaKU+juGTMX7BSCH8GXsLUBOHeNDT6bZ+lfR5MfgPhzFj BYiKQXKchBRgj8gDZX3e7IZbzunkYWavPiMS9JIKA/vcpy+3AB/TzpwIJPMKpUuUL2iGAI ziHyha6wnmLH0C3j19gEAttlSQyXYbBPTz64suYQp10a9gSw5KxMJ/WeXpRnHQ== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/12] rtc: ds1511: drop useless enum Date: Wed, 28 Feb 2024 00:04:19 +0100 Message-ID: <20240227230431.1837717-4-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792097506119921133 X-GMAIL-MSGID: 1792097506119921133 From: Alexandre Belloni Use regular defines for register offsets instead of the enum that doesn't bring any benefit. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 120 ++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 71 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index fe8dbad51c88..8e57c1395cf3 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -22,26 +22,24 @@ #include #include -enum ds1511reg { - DS1511_SEC = 0x0, - DS1511_MIN = 0x1, - DS1511_HOUR = 0x2, - DS1511_DOW = 0x3, - DS1511_DOM = 0x4, - DS1511_MONTH = 0x5, - DS1511_YEAR = 0x6, - DS1511_CENTURY = 0x7, - DS1511_AM1_SEC = 0x8, - DS1511_AM2_MIN = 0x9, - DS1511_AM3_HOUR = 0xa, - DS1511_AM4_DATE = 0xb, - DS1511_WD_MSEC = 0xc, - DS1511_WD_SEC = 0xd, - DS1511_CONTROL_A = 0xe, - DS1511_CONTROL_B = 0xf, - DS1511_RAMADDR_LSB = 0x10, - DS1511_RAMDATA = 0x13 -}; +#define DS1511_SEC 0x0 +#define DS1511_MIN 0x1 +#define DS1511_HOUR 0x2 +#define DS1511_DOW 0x3 +#define DS1511_DOM 0x4 +#define DS1511_MONTH 0x5 +#define DS1511_YEAR 0x6 +#define DS1511_CENTURY 0x7 +#define DS1511_AM1_SEC 0x8 +#define DS1511_AM2_MIN 0x9 +#define DS1511_AM3_HOUR 0xa +#define DS1511_AM4_DATE 0xb +#define DS1511_WD_MSEC 0xc +#define DS1511_WD_SEC 0xd +#define DS1511_CONTROL_A 0xe +#define DS1511_CONTROL_B 0xf +#define DS1511_RAMADDR_LSB 0x10 +#define DS1511_RAMDATA 0x13 #define DS1511_BLF1 0x80 #define DS1511_BLF2 0x40 @@ -61,26 +59,6 @@ enum ds1511reg { #define DS1511_WDS 0x01 #define DS1511_RAM_MAX 0x100 -#define RTC_CMD DS1511_CONTROL_B -#define RTC_CMD1 DS1511_CONTROL_A - -#define RTC_ALARM_SEC DS1511_AM1_SEC -#define RTC_ALARM_MIN DS1511_AM2_MIN -#define RTC_ALARM_HOUR DS1511_AM3_HOUR -#define RTC_ALARM_DATE DS1511_AM4_DATE - -#define RTC_SEC DS1511_SEC -#define RTC_MIN DS1511_MIN -#define RTC_HOUR DS1511_HOUR -#define RTC_DOW DS1511_DOW -#define RTC_DOM DS1511_DOM -#define RTC_MON DS1511_MONTH -#define RTC_YEAR DS1511_YEAR -#define RTC_CENTURY DS1511_CENTURY - -#define RTC_TIE DS1511_TIE -#define RTC_TE DS1511_TE - struct rtc_plat_data { struct rtc_device *rtc; void __iomem *ioaddr; /* virtual base address */ @@ -105,7 +83,7 @@ rtc_write(uint8_t val, uint32_t reg) } static noinline uint8_t -rtc_read(enum ds1511reg reg) +rtc_read(uint32_t reg) { return readb(ds1511_base + (reg * reg_spacing)); } @@ -113,13 +91,13 @@ rtc_read(enum ds1511reg reg) static inline void rtc_disable_update(void) { - rtc_write((rtc_read(RTC_CMD) & ~RTC_TE), RTC_CMD); + rtc_write((rtc_read(DS1511_CONTROL_B) & ~DS1511_TE), DS1511_CONTROL_B); } static void rtc_enable_update(void) { - rtc_write((rtc_read(RTC_CMD) | RTC_TE), RTC_CMD); + rtc_write((rtc_read(DS1511_CONTROL_B) | DS1511_TE), DS1511_CONTROL_B); } static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) @@ -149,14 +127,14 @@ static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) spin_lock_irqsave(&ds1511_lock, flags); rtc_disable_update(); - rtc_write(cen, RTC_CENTURY); - rtc_write(yrs, RTC_YEAR); - rtc_write((rtc_read(RTC_MON) & 0xe0) | mon, RTC_MON); - rtc_write(day, RTC_DOM); - rtc_write(hrs, RTC_HOUR); - rtc_write(min, RTC_MIN); - rtc_write(sec, RTC_SEC); - rtc_write(dow, RTC_DOW); + rtc_write(cen, DS1511_CENTURY); + rtc_write(yrs, DS1511_YEAR); + rtc_write((rtc_read(DS1511_MONTH) & 0xe0) | mon, DS1511_MONTH); + rtc_write(day, DS1511_DOM); + rtc_write(hrs, DS1511_HOUR); + rtc_write(min, DS1511_MIN); + rtc_write(sec, DS1511_SEC); + rtc_write(dow, DS1511_DOW); rtc_enable_update(); spin_unlock_irqrestore(&ds1511_lock, flags); @@ -171,14 +149,14 @@ static int ds1511_rtc_read_time(struct device *dev, struct rtc_time *rtc_tm) spin_lock_irqsave(&ds1511_lock, flags); rtc_disable_update(); - rtc_tm->tm_sec = rtc_read(RTC_SEC) & 0x7f; - rtc_tm->tm_min = rtc_read(RTC_MIN) & 0x7f; - rtc_tm->tm_hour = rtc_read(RTC_HOUR) & 0x3f; - rtc_tm->tm_mday = rtc_read(RTC_DOM) & 0x3f; - rtc_tm->tm_wday = rtc_read(RTC_DOW) & 0x7; - rtc_tm->tm_mon = rtc_read(RTC_MON) & 0x1f; - rtc_tm->tm_year = rtc_read(RTC_YEAR) & 0x7f; - century = rtc_read(RTC_CENTURY); + rtc_tm->tm_sec = rtc_read(DS1511_SEC) & 0x7f; + rtc_tm->tm_min = rtc_read(DS1511_MIN) & 0x7f; + rtc_tm->tm_hour = rtc_read(DS1511_HOUR) & 0x3f; + rtc_tm->tm_mday = rtc_read(DS1511_DOM) & 0x3f; + rtc_tm->tm_wday = rtc_read(DS1511_DOW) & 0x7; + rtc_tm->tm_mon = rtc_read(DS1511_MONTH) & 0x1f; + rtc_tm->tm_year = rtc_read(DS1511_YEAR) & 0x7f; + century = rtc_read(DS1511_CENTURY); rtc_enable_update(); spin_unlock_irqrestore(&ds1511_lock, flags); @@ -220,18 +198,18 @@ ds1511_rtc_update_alarm(struct rtc_plat_data *pdata) spin_lock_irqsave(&pdata->lock, flags); rtc_write(pdata->alrm_mday < 0 || (pdata->irqen & RTC_UF) ? 0x80 : bin2bcd(pdata->alrm_mday) & 0x3f, - RTC_ALARM_DATE); + DS1511_AM4_DATE); rtc_write(pdata->alrm_hour < 0 || (pdata->irqen & RTC_UF) ? 0x80 : bin2bcd(pdata->alrm_hour) & 0x3f, - RTC_ALARM_HOUR); + DS1511_AM3_HOUR); rtc_write(pdata->alrm_min < 0 || (pdata->irqen & RTC_UF) ? 0x80 : bin2bcd(pdata->alrm_min) & 0x7f, - RTC_ALARM_MIN); + DS1511_AM2_MIN); rtc_write(pdata->alrm_sec < 0 || (pdata->irqen & RTC_UF) ? 0x80 : bin2bcd(pdata->alrm_sec) & 0x7f, - RTC_ALARM_SEC); - rtc_write(rtc_read(RTC_CMD) | (pdata->irqen ? RTC_TIE : 0), RTC_CMD); - rtc_read(RTC_CMD1); /* clear interrupts */ + DS1511_AM1_SEC); + rtc_write(rtc_read(DS1511_CONTROL_B) | (pdata->irqen ? DS1511_TIE : 0), DS1511_CONTROL_B); + rtc_read(DS1511_CONTROL_A); /* clear interrupts */ spin_unlock_irqrestore(&pdata->lock, flags); } @@ -281,9 +259,9 @@ ds1511_interrupt(int irq, void *dev_id) /* * read and clear interrupt */ - if (rtc_read(RTC_CMD1) & DS1511_IRQF) { + if (rtc_read(DS1511_CONTROL_A) & DS1511_IRQF) { events = RTC_IRQF; - if (rtc_read(RTC_ALARM_SEC) & 0x80) + if (rtc_read(DS1511_AM1_SEC) & 0x80) events |= RTC_UF; else events |= RTC_AF; @@ -366,8 +344,8 @@ static int ds1511_rtc_probe(struct platform_device *pdev) /* * turn on the clock and the crystal, etc. */ - rtc_write(DS1511_BME, RTC_CMD); - rtc_write(0, RTC_CMD1); + rtc_write(DS1511_BME, DS1511_CONTROL_B); + rtc_write(0, DS1511_CONTROL_A); /* * clear the wdog counter */ @@ -381,7 +359,7 @@ static int ds1511_rtc_probe(struct platform_device *pdev) /* * check for a dying bat-tree */ - if (rtc_read(RTC_CMD1) & DS1511_BLF1) + if (rtc_read(DS1511_CONTROL_A) & DS1511_BLF1) dev_warn(&pdev->dev, "voltage-low detected.\n"); spin_lock_init(&pdata->lock); @@ -404,7 +382,7 @@ static int ds1511_rtc_probe(struct platform_device *pdev) * then by all means, set it */ if (pdata->irq > 0) { - rtc_read(RTC_CMD1); + rtc_read(DS1511_CONTROL_A); if (devm_request_irq(&pdev->dev, pdata->irq, ds1511_interrupt, IRQF_SHARED, pdev->name, pdev) < 0) { From patchwork Tue Feb 27 23:04:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207507 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3023669dyb; Tue, 27 Feb 2024 15:25:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUEvIxnSsoGuQjOmMKEEpX8acZoMj3sCP8zKFrHB0ffLg1nXAG9vx5uwPabKD4Kng3tua3C6KrI/jXCPZNNOL5dShddeA== X-Google-Smtp-Source: AGHT+IFOg3ianM0EUijWnALD3tDT3kbwNyL0iNXbjeStS53AFcg5aSQmSp4QrkeXVa5lY6xGvWrW X-Received: by 2002:a05:6e02:12a4:b0:363:cbb8:53c7 with SMTP id f4-20020a056e0212a400b00363cbb853c7mr11810017ilr.23.1709076337379; Tue, 27 Feb 2024 15:25:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709076337; cv=pass; d=google.com; s=arc-20160816; b=KL/UUrFL4OLyP+9S8XRL/FMlaBdnCXk8GG4DwmTMK0ZmnQh/0RkIWrBmdQjaQ/FZM/ Oomm8fd86K+jsOV8iNmwb2KKJbh4j8W/1TBCa4ZZs1aeDp+9J4A7FygpupABKrBU/owf 9Vashnq3FtgaiTpXSdVefYdxOzgwvLaPe3ORq7VckzvlNOSiGo/HTJYkUOxTXwh1dUt4 d0WTNkMPetYw+EsNdQLht23quvIydjIdFJqMtm/29L56TjapNJjYrOGu2oAnzD4XHis6 84uWlG1PRxBZVn5mWVmZZfv0p/Ui703WwSSNjKGW9JGnHNhG63YzcC8uNeO41a4KRF00 8fDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=K0oCCqgbDNckwzzWB2/8wbNi9Lkx4ZYUoUR+aHvjFFc=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=fV6XhTLc9SlT4Gna/s7qsBhorqSX+ZaBQH+yGkmVyRLmp1FWqN4WZMZtgboW6JkO/0 xYvLN/oEnaCHDNPQT2bCMWjBphgxOxkvOvJ6IrGRIUiiDamAC/Ohlyl6It/Murw8015h qdGPQZXKZHXBIlmPrn76uNodYq3PeqL5Korzky/mHhDFkCsidabDzg+5RAhlA2MqTvjC jhluClOy43uO9+7zbq4nNwoOy/96DgFHU3IYrW7pEFvjJ3WxDaH+yGU4zzd6cpXRZZy7 aelRONBxt7jfS0EfUBf/20EC0ZYcRzA8DblmrH5ECKmKic/ujQR3q28e+UylvZF7wlRy P01A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=k82xjWHa; 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-84163-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84163-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h22-20020a633856000000b005dc0b3095b3si6094879pgn.283.2024.02.27.15.25.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:25:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84163-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=k82xjWHa; 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-84163-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84163-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DBDE828FCAF for ; Tue, 27 Feb 2024 23:05:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B43B5811A; Tue, 27 Feb 2024 23:04:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="k82xjWHa" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 2C89855E4A; Tue, 27 Feb 2024 23:04:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075096; cv=none; b=mkNPT2RA2w07vjbA7q2AjxoN2yuoDy9y3wASTPoCuPrsd35JgiiyR2KKGWpGDcSHj7lHT3YEJcLjRNqVYUpxvzQM2PrYTKxaklKP7yRjUwfBZvm+C9vwoPSHyonHTzMthizF73yoGEMSowCVeSMVpfxbkuC5YsLaG60DPF136YM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075096; c=relaxed/simple; bh=pMzSdaErP8NPLXtz6xhrVDn4qQePKxsiyZ6Ly0n1m5Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rysy3s9m6G4IuIyfjN9ZEEAmQF360x2RJn+nwC2+nhfOVvwqzkMlM6NVlkUdFSh7CAfeV+n0oJkt01sMBHmTYAwH8lvjKpBS+kgcBlH1z18cNDicrOWV021geo7WZS+2BviGXTmfdkAZRW2oFSZZJWNtGv8hNQm7b1ijFpSrWaQ= 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=k82xjWHa; arc=none smtp.client-ip=217.70.183.200 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 9F6A02000A; Tue, 27 Feb 2024 23:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K0oCCqgbDNckwzzWB2/8wbNi9Lkx4ZYUoUR+aHvjFFc=; b=k82xjWHaT+/rIHOsPxPVhSnXY1SokLqybMCDM+ttcFdUbA/GXp0tDgWncwdPbANCQB5muX S3TkXNXhUgAa1/xdFDYv+QDJJFAfSQlcDJn1oYyP3mc4XVjjAq+6JYugmOHNl00NqPkc3J yheoA2QCgsZa+lh0flN6nI7h3k9m/50RBkeAjBXLZct830U/vKc2U25qTuxViZ0y6pkIz5 vEIGzgkwGVSuytlK+mUwTOcsgtGo/fYfIOHUV29XbiOO1dSu/1abKd8w45eADXmVib69gm daU7B62MCtS/kCB0pTfG/weNQWJ7wqZ2LsogHH5i4SvQkE1+puRaANWQI8wC6g== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/12] rtc: ds1511: fix function definition Date: Wed, 28 Feb 2024 00:04:20 +0100 Message-ID: <20240227230431.1837717-5-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792096429547190887 X-GMAIL-MSGID: 1792096429547190887 From: Alexandre Belloni Use proper style for function definition. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 8e57c1395cf3..1765f76dda58 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -76,26 +76,22 @@ static DEFINE_SPINLOCK(ds1511_lock); static __iomem char *ds1511_base; static u32 reg_spacing = 1; -static noinline void -rtc_write(uint8_t val, uint32_t reg) +static noinline void rtc_write(uint8_t val, uint32_t reg) { writeb(val, ds1511_base + (reg * reg_spacing)); } -static noinline uint8_t -rtc_read(uint32_t reg) +static noinline uint8_t rtc_read(uint32_t reg) { return readb(ds1511_base + (reg * reg_spacing)); } -static inline void -rtc_disable_update(void) +static inline void rtc_disable_update(void) { rtc_write((rtc_read(DS1511_CONTROL_B) & ~DS1511_TE), DS1511_CONTROL_B); } -static void -rtc_enable_update(void) +static void rtc_enable_update(void) { rtc_write((rtc_read(DS1511_CONTROL_B) | DS1511_TE), DS1511_CONTROL_B); } @@ -190,8 +186,7 @@ static int ds1511_rtc_read_time(struct device *dev, struct rtc_time *rtc_tm) * date/hours/mins/secs matches. the ds1511 has many more * permutations, but the kernel doesn't. */ -static void -ds1511_rtc_update_alarm(struct rtc_plat_data *pdata) +static void ds1511_rtc_update_alarm(struct rtc_plat_data *pdata) { unsigned long flags; @@ -213,8 +208,7 @@ ds1511_rtc_update_alarm(struct rtc_plat_data *pdata) spin_unlock_irqrestore(&pdata->lock, flags); } -static int -ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) +static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct rtc_plat_data *pdata = dev_get_drvdata(dev); @@ -232,8 +226,7 @@ ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) return 0; } -static int -ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) +static int ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct rtc_plat_data *pdata = dev_get_drvdata(dev); @@ -248,8 +241,7 @@ ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) return 0; } -static irqreturn_t -ds1511_interrupt(int irq, void *dev_id) +static irqreturn_t ds1511_interrupt(int irq, void *dev_id) { struct platform_device *pdev = dev_id; struct rtc_plat_data *pdata = platform_get_drvdata(pdev); From patchwork Tue Feb 27 23:04:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207491 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3015099dyb; Tue, 27 Feb 2024 15:06:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXhBhVcoPM+UrOdRob1nco+owlg5AJnoTkZpA9qAW8h3uJBteYrS6Nax65UU3iLus8/BmztikM3mNesj9G5/Rx8uGaWhQ== X-Google-Smtp-Source: AGHT+IGXaPjAdyWywPi6vLq8CkfBc4IyupslOVp95SQn6bcbPVJD/K8fyKWm8q7AiT+ZwDPUBWfF X-Received: by 2002:a17:906:3590:b0:a43:393c:176d with SMTP id o16-20020a170906359000b00a43393c176dmr4936008ejb.20.1709075165536; Tue, 27 Feb 2024 15:06:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075165; cv=pass; d=google.com; s=arc-20160816; b=t7pUi1hAbsOUkZSe0vptNhcq8hw9I+aH4oAjkxIamluInQ/wh1E1zCi4OSgSSXr3Wt S1wEbcAfJkmAWRcbyZPSKeUQMype6PYvN3UI+D9yvfItiw5KH4+HK/BcXHASlSj8TV2O YJGOiKNLMJ4JT43JELvr4ESCklL+JRYHBdS74I/sreWs0jgBvVhXLIzogWoFiZWMriWU tn91mZd+RCttvKrs01bPHiqqivtc+jOCFUh8K0KxZTNU1c+rPeI/NiD4h6E2PSVMdTsb cradqcpr+thUGnKDf0M60ofFWpc3KPx7b8G2rd1z+mJyw+nJpD6gRC0lxczRmUignzAc VIpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SVL6nQVxi6BF3G6V5+OIAknkxYVXO9rdhZjmxMpGBcQ=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=I20aqZaVH6VojPNBbBoWaUrGZxeh0IrUzmdNa6lOFGlu9B9BX9tuS45WlmAitOG1Nk T4Vqlo5zhA1imM5vZpqItTkJd26pGiS2N6iHyHl4ub8hUZlg0UQH8Wu7VuJKlD9DEjez i4qKLLxGBCA6Ywd8fR5F9DJ9uJelTVUp8gtlfyRVX7GwCnIvbgs3npklGmusNn6f72w/ +LMV32bJzQ86IB+LdL37q8s9Gf9bMIg4Wdc0UMuvdiu4oD19V2k8Ndzw2pI4QWshaAPM WGjdNIgoLcsNeKqN9BqBKzMYCHEopGzxzLoFEGdBFyVjgoWZ0SX7UcRlN9/pZ8Qtepc3 oi2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=fbcqfqeO; 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-84164-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84164-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c19-20020a17090603d300b00a3f2147fcc3si1084499eja.90.2024.02.27.15.06.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:06:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84164-ouuuleilei=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=@bootlin.com header.s=gm1 header.b=fbcqfqeO; 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-84164-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84164-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2E3511F2701D for ; Tue, 27 Feb 2024 23:06:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B3CF58138; Tue, 27 Feb 2024 23:05:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="fbcqfqeO" Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (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 C2C9157888; Tue, 27 Feb 2024 23:04:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075097; cv=none; b=Z19m7hlAL6RPuguWjxZCt9Bsrol+pC6qLRLtfhLu90Sdhsa/uo5qTRfUxLFyUzgUqZsdJGhJBdKfa2X/89YglJfmGKp6M/Lg8g8LI9mldGwNEQ1x88qpfeTZ34ccGZQD9ZXw/VqoR1n3cbHVdnNtdMbCi9svxu1Rp190pihJTPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075097; c=relaxed/simple; bh=Z5TKAsNiHmdmVINp1aOXSgDG6r+4tRJgppAteMXtRe4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ioltzSjTksyHoILriCSu88dWjGn/NrkRqk1nx0xTT+xWeeVHRU3cWrc7vxnN7X5qBkzexUqRsVLxdWcx6WwuiMT46AnYKgvfqotA5BVZdueekFyiBsxiJ2WeAsEpLyfQuxu122QWW8ryodH5eoykvzYfl/IvuxnFleumpa7XILQ= 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=fbcqfqeO; arc=none smtp.client-ip=217.70.183.196 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 D496BE0002; Tue, 27 Feb 2024 23:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SVL6nQVxi6BF3G6V5+OIAknkxYVXO9rdhZjmxMpGBcQ=; b=fbcqfqeO4Ziiu/q2ew83aC5CrrErZN1FgUxtM3bJasOYtUJ1FdBPHKs2JilbcuGPVG/Bvr PTwFe5suTSSsTNzyjIHOIBhR1XLEUk5hwvE0wmxZT9CNAIxCRzdUVG1yhDfXQOG7XZbGdo vYDxgCuYDX+YJqoElvOivuag/K7UsTQAU5Z7fobxqNFmH8WHPqRUypEjv9LQuFLYqWk+3O xh4VPmshZXlsdFhXjysbgHL8xV6GvG9CEAAn8OUzwAHCHgwuf3CzXt4w3T5VM871A+b5vi Zy2i6jcAX7zCT9Z7O8jvuvNtVRlHxq/WlLQHfz4qJS0qOvSzPRpEQaHtEfdmjw== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/12] rtc: ds1511: remove incomplete UIE support Date: Wed, 28 Feb 2024 00:04:21 +0100 Message-ID: <20240227230431.1837717-6-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095200726223172 X-GMAIL-MSGID: 1792095200726223172 From: Alexandre Belloni There is no way to enable UIE in the driver, drop RTC_UF support. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 1765f76dda58..4ac8988d4124 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -191,17 +191,13 @@ static void ds1511_rtc_update_alarm(struct rtc_plat_data *pdata) unsigned long flags; spin_lock_irqsave(&pdata->lock, flags); - rtc_write(pdata->alrm_mday < 0 || (pdata->irqen & RTC_UF) ? - 0x80 : bin2bcd(pdata->alrm_mday) & 0x3f, + rtc_write(pdata->alrm_mday < 0 ? 0x80 : bin2bcd(pdata->alrm_mday) & 0x3f, DS1511_AM4_DATE); - rtc_write(pdata->alrm_hour < 0 || (pdata->irqen & RTC_UF) ? - 0x80 : bin2bcd(pdata->alrm_hour) & 0x3f, + rtc_write(pdata->alrm_hour < 0 ? 0x80 : bin2bcd(pdata->alrm_hour) & 0x3f, DS1511_AM3_HOUR); - rtc_write(pdata->alrm_min < 0 || (pdata->irqen & RTC_UF) ? - 0x80 : bin2bcd(pdata->alrm_min) & 0x7f, + rtc_write(pdata->alrm_min < 0 ? 0x80 : bin2bcd(pdata->alrm_min) & 0x7f, DS1511_AM2_MIN); - rtc_write(pdata->alrm_sec < 0 || (pdata->irqen & RTC_UF) ? - 0x80 : bin2bcd(pdata->alrm_sec) & 0x7f, + rtc_write(pdata->alrm_sec < 0 ? 0x80 : bin2bcd(pdata->alrm_sec) & 0x7f, DS1511_AM1_SEC); rtc_write(rtc_read(DS1511_CONTROL_B) | (pdata->irqen ? DS1511_TIE : 0), DS1511_CONTROL_B); rtc_read(DS1511_CONTROL_A); /* clear interrupts */ @@ -252,11 +248,7 @@ static irqreturn_t ds1511_interrupt(int irq, void *dev_id) * read and clear interrupt */ if (rtc_read(DS1511_CONTROL_A) & DS1511_IRQF) { - events = RTC_IRQF; - if (rtc_read(DS1511_AM1_SEC) & 0x80) - events |= RTC_UF; - else - events |= RTC_AF; + events = RTC_IRQF | RTC_AF; rtc_update_irq(pdata->rtc, 1, events); } spin_unlock(&pdata->lock); From patchwork Tue Feb 27 23:04:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207493 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3015672dyb; Tue, 27 Feb 2024 15:07:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVcGb+OYF6AHnhIeXJvCJRAGv24f/+hV0NTFkw6K91iY1JfDvvWf6ik5Gfh5avDr2IaWZAD78blLURTXxr9YQhXSjOR8w== X-Google-Smtp-Source: AGHT+IGIdqt3ZlQdmESpPbYKjhEEcJernPZjJ1CnTEBQpY8ifkLoFUoGhVyMg1d/o4v5kV6CNQxF X-Received: by 2002:a05:6102:d8d:b0:471:e440:6604 with SMTP id d13-20020a0561020d8d00b00471e4406604mr7682300vst.32.1709075228452; Tue, 27 Feb 2024 15:07:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075228; cv=pass; d=google.com; s=arc-20160816; b=LIkBuiywCPGHuWn7ZyBmqHl01bI2xoGnkl54C+kXKpvqgXi+q6FoSdznN38qc2++Hk rGZ2Eue8m8MH76iOMzKCUJ+hHKmDiRqhaUi5Ks//s3HK3i3DMsuZzXD5FseeBu3WLZSf 6CZVaoiM8wWExgI7MyFCgcCV6HZTdCxYvWxncx8jSdt4W0GI9YkmJy2Jd3ztZYvbmVQi DJjza1UTpVKbb7gTABgKXY343ar02YOiyyZwK0HnkS1/hBmy60gcsygaW+TrvcsYudks x1SvLbN8vRlTMxUpMQbgGixgPDl29H9JopYgGvfot14n03/JONlj755grO5HpGXzFf2d Mjww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JDg0owEF3xlOehCDIXIEw25/GVMd5SHRx8SLPbdFUxk=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=vFR5v2C398KoS7R4L/fMo8oClSvmmELAW3W/llF+EBD7P+pM/ucWRms42/56fUo3Zi H95xS1e2Gj74lg9q7kX7/AoDWlDcnTWMFgtuM2a1SnbZA0SHDf/3tImIB8H00F4Rat+x x96ebozL2g9UyvH4mV7gXETAgwQmBAvch++4vQycMuTFgYNv6ulRkZa4KOUNZKxIQZoK PxCP4cBWwdhYNpNAvIkx4hWkaKQ7aloEh5vFWZczBCCxh5fww0YzCjp+fsWkOm+5BVa+ 22gYdMqBc5CrESniZD+H5TRKo1gG4c3lFsnN4NLQPi36nNqFCmsUR+2gtzzm7uU4xG8z NDzg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PPlYHwQh; 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-84165-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84165-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s10-20020a056102108a00b004726dbba3f6si63vsr.782.2024.02.27.15.07.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:07:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84165-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PPlYHwQh; 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-84165-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84165-ouuuleilei=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 045241C26C3C for ; Tue, 27 Feb 2024 23:06:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A0505646E; Tue, 27 Feb 2024 23:05:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="PPlYHwQh" Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (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 1DCB758106; Tue, 27 Feb 2024 23:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075100; cv=none; b=YlLYozk42eG0dVBsKZkxgbfWTVaHHIvont/zAXCIEtZOe5XD/6Ym461FugABNY/dcYZn8ttpZTDgUmoxzhMWTzbnxpst9N0LwVOq97zzpDKPq22tZbE5WZnQtCFZ0Zux0sV5lbV23XWaUjjZ/YeW+Z8cBDQHJptlW8IT5hwg+/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075100; c=relaxed/simple; bh=+TeOoQ8/EabvacRrcZs7lP1c51rVOFxgFfe2Z7f9Dyo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jXx/rKsPfErbgLWRXISxjwrPwt/D4Fw+LtirxVNgESKOfrzx0gRE1FQyczsF6i3fRePQrdMy2vyu/YWhJJaCzy83R/YCOZCtRHvaQh0dUJArxsLTWB8q5B1+cSiaA6JsJRVjOxPwVC42aZf/qyp6MdP7ja9KakV67PYYdsQ4Lq0= 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=PPlYHwQh; arc=none smtp.client-ip=217.70.183.197 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 0A6F41C0003; Tue, 27 Feb 2024 23:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JDg0owEF3xlOehCDIXIEw25/GVMd5SHRx8SLPbdFUxk=; b=PPlYHwQhknBlH6gzirfTHj3elUM7xQH0GVQfaAYNWr7FoeK2m9wi0qWPeCGdyol0Y8YgPI 6r5YyfsLd7nlyJLocw/unOcKlu3X9j/FanTf1N6KCZ8bt4/pG0ZV6TB2nGyRAABaxefekR WK9h8gzHRovivTIWZ/7FDj9uxN1lnWfngkiVZtAIdvfEMLxuf39GT5LjEdbL2G5EWqqUAv Gv9k3XqsDbpr2QO7DWm35/g0zqX9DiLMtwSRAAj2Q/zMYEU1NeMRvt6fsXFzNt7c4yEaFV D3OyIbG/rrjbkKUeIYXhdDpryAPEcZqSyDM80RKxFN1/NCvWN8iaDa4moCzvbg== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/12] rtc: ds1511: remove ds1511_rtc_update_alarm Date: Wed, 28 Feb 2024 00:04:22 +0100 Message-ID: <20240227230431.1837717-7-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095266973818515 X-GMAIL-MSGID: 1792095266973818515 From: Alexandre Belloni ds1511_rtc_update_alarm is called twice but one of the call is overkill as it only has to enable or disable the alarm instead of updating all the alarm registers. Merge it in its main call site and introduce a new finction to enable or disable the alarm. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 52 ++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 4ac8988d4124..b0dfdda2c8fc 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -178,35 +178,15 @@ static int ds1511_rtc_read_time(struct device *dev, struct rtc_time *rtc_tm) return 0; } -/* - * write the alarm register settings - * - * we only have the use to interrupt every second, otherwise - * known as the update interrupt, or the interrupt if the whole - * date/hours/mins/secs matches. the ds1511 has many more - * permutations, but the kernel doesn't. - */ -static void ds1511_rtc_update_alarm(struct rtc_plat_data *pdata) +static void ds1511_rtc_alarm_enable(unsigned int enabled) { - unsigned long flags; - - spin_lock_irqsave(&pdata->lock, flags); - rtc_write(pdata->alrm_mday < 0 ? 0x80 : bin2bcd(pdata->alrm_mday) & 0x3f, - DS1511_AM4_DATE); - rtc_write(pdata->alrm_hour < 0 ? 0x80 : bin2bcd(pdata->alrm_hour) & 0x3f, - DS1511_AM3_HOUR); - rtc_write(pdata->alrm_min < 0 ? 0x80 : bin2bcd(pdata->alrm_min) & 0x7f, - DS1511_AM2_MIN); - rtc_write(pdata->alrm_sec < 0 ? 0x80 : bin2bcd(pdata->alrm_sec) & 0x7f, - DS1511_AM1_SEC); - rtc_write(rtc_read(DS1511_CONTROL_B) | (pdata->irqen ? DS1511_TIE : 0), DS1511_CONTROL_B); - rtc_read(DS1511_CONTROL_A); /* clear interrupts */ - spin_unlock_irqrestore(&pdata->lock, flags); + rtc_write(rtc_read(DS1511_CONTROL_B) | (enabled ? DS1511_TIE : 0), DS1511_CONTROL_B); } static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct rtc_plat_data *pdata = dev_get_drvdata(dev); + unsigned long flags; if (pdata->irq <= 0) return -EINVAL; @@ -218,7 +198,20 @@ static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) if (alrm->enabled) pdata->irqen |= RTC_AF; - ds1511_rtc_update_alarm(pdata); + spin_lock_irqsave(&pdata->lock, flags); + rtc_write(pdata->alrm_mday < 0 ? 0x80 : bin2bcd(pdata->alrm_mday) & 0x3f, + DS1511_AM4_DATE); + rtc_write(pdata->alrm_hour < 0 ? 0x80 : bin2bcd(pdata->alrm_hour) & 0x3f, + DS1511_AM3_HOUR); + rtc_write(pdata->alrm_min < 0 ? 0x80 : bin2bcd(pdata->alrm_min) & 0x7f, + DS1511_AM2_MIN); + rtc_write(pdata->alrm_sec < 0 ? 0x80 : bin2bcd(pdata->alrm_sec) & 0x7f, + DS1511_AM1_SEC); + ds1511_rtc_alarm_enable(alrm->enabled); + + rtc_read(DS1511_CONTROL_A); /* clear interrupts */ + spin_unlock_irqrestore(&pdata->lock, flags); + return 0; } @@ -258,14 +251,15 @@ static irqreturn_t ds1511_interrupt(int irq, void *dev_id) static int ds1511_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) { struct rtc_plat_data *pdata = dev_get_drvdata(dev); + unsigned long flags; if (pdata->irq <= 0) return -EINVAL; - if (enabled) - pdata->irqen |= RTC_AF; - else - pdata->irqen &= ~RTC_AF; - ds1511_rtc_update_alarm(pdata); + + spin_lock_irqsave(&pdata->lock, flags); + ds1511_rtc_alarm_enable(enabled); + spin_unlock_irqrestore(&pdata->lock, flags); + return 0; } From patchwork Tue Feb 27 23:04:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207494 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3015745dyb; Tue, 27 Feb 2024 15:07:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXCxgWm8D6SAeehMf/KzreN1ipPkDz2lOdubYLAmKJNHcailcI8zJpNq3jynTXE2saIg9O3ZkEKnI0IQYPI/rLmwwCoIQ== X-Google-Smtp-Source: AGHT+IEDLZ3jg9SoVIE3FBekUxGmsUp7q/Q7QPXiRmyGgfpaguCi4kAPB77n1w3B+QHGWcku+JQ1 X-Received: by 2002:a05:6102:31b2:b0:472:6061:45f1 with SMTP id d18-20020a05610231b200b00472606145f1mr2351640vsh.13.1709075236558; Tue, 27 Feb 2024 15:07:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075236; cv=pass; d=google.com; s=arc-20160816; b=UFGmwzempgeIrVjnGaIC1XRdLMbSeL3mYxI6dMMMI1vVbs8lwXs1z5gZBnq5wc8Czb q93f9LBJXxz1gDb4YKtKYdG9R1i3+yJeHdRPnOGI3XEnYyBIxQspuDntKxUQJoZ5i44Q aU1aHk5ugoRJdNK86fY4rzP7vL9eeQ4oEr7OlTwVeavbwAFMXkk5T1TyOUJxuORuTDbS GWNL3cF5sSxrVvSZbIlFPnbroiUawKENRMAnEoJwfqeKty7tfUplQJ7dxugJE2tSnVeQ NDGXvI48mVgOJbEOOPCXhgF5dJSrNZwhP7iG8NNl50ZHCbC0dhx7ekVNHI/2VmGW0WtP FfvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qy0P0eoIU4XbXDbSBcw570en4VCa8cKPG47nuLjP76M=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=YCqQRWMC1ELVTvaWLOvP+DgZPHTg+Y2dHufPUQv3UMhEJiCPXib9F7aYQgmp9qO/g4 7VRihtDuNi9w+2BNrahM+UwmQyzSGodJ0h7GY0XimZ04fAvgwjwSu+TL/8zS2bQ5t0+e 70T7xtuJnHaD6as/Mues3rwFWs8GzfXsh3ML2Sz+6BSka22avf3bP2oLNxdtHruxIT4l 2izI7LRFgOblYCEWAPz6DYLIM0e/RW0rc9GDbWtUj2+EyPwJqSerznhcBPvOffIVAC3+ M8+d56Lm3Ybk93xOOoyVtdbs4N4sP047MEpzHWbC3cv7KOlIkdJs9wvyt2MIbbuvDDsh LIiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=SZHfRTgi; 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-84166-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84166-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jm26-20020a056102199a00b0047265624694si269043vsb.416.2024.02.27.15.07.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:07:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84166-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=SZHfRTgi; 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-84166-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84166-ouuuleilei=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 76F1A1C27CF2 for ; Tue, 27 Feb 2024 23:06:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 237AF56479; Tue, 27 Feb 2024 23:05:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="SZHfRTgi" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 2ECDB5812A; Tue, 27 Feb 2024 23:04:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075102; cv=none; b=RrNVyuX3dnoY3ls8j5mx3EZP/kNxHwIU4admSpSwivjawupR32cw6+smLQp4iVMLbQLag1HGxutSBWyclfeo2u3cE5mP6tdxmjApuj9KZT3M8dw7H9lPgUFwbDaUyYIojIP4GTodeBPdsBmN26Q6f5P943kajasDO5c8iO2Y3Jo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075102; c=relaxed/simple; bh=kmIa/7ZyXqprHqUEcR3GU7DrR4potHZgTHFoWWOaR2Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rz/4RDSbThoVwbHhTuAvVjfCJACUeGQldhVJKx0IhmMBYrvQMzPu5zUzn3kBxtDunzj4pcS79c8nzdb96Uz6gMYAQCC5XQYLvgyuxt88RS3Sybv9qOitkiC/vSD7Nl0OqNUTwEAEGHs+aivbpMluw4l6Q5xSUsJbJfpYAY+bRp4= 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=SZHfRTgi; arc=none smtp.client-ip=217.70.183.193 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 4A8B5240002; Tue, 27 Feb 2024 23:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qy0P0eoIU4XbXDbSBcw570en4VCa8cKPG47nuLjP76M=; b=SZHfRTgijYjEX3jiJpI9nV6GBM9BCV9lNcBt4nnks9upNXszaeDgvfyX6A0dKC2EAvwjnn ujUuQCTIW3HL9dtcW239WPcfhWSSQRFG2Un7NnkT1LX8tY38JIvqW5nSjY2sr9MI952Luc nZ/PVAlm4G7aX8yFBGPEQMDfJDOBqYC9Za1L8lkWseRMT5KmzOzY539h8m6zl4ZF6Dk28I mZu06hutJW2o1efSnqag2XZbNj02lssBCXXpZoVyKbaPFh4vvhc/pDJdFEV61HfMDiKoa7 SknrTNRRfu7z59BEWvZOXSRuTHerOWg7/fKAatZFnB6nRe30in3uT1wnc8AyQw== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/12] rtc: ds1511: let the core know when alarm are not supported Date: Wed, 28 Feb 2024 00:04:23 +0100 Message-ID: <20240227230431.1837717-8-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095275193491976 X-GMAIL-MSGID: 1792095275193491976 From: Alexandre Belloni Instead of failing function calls, let the core know alarms are not supported so it can fail early and avoid unnecessary calls. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index b0dfdda2c8fc..c81f464e6a50 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -188,9 +188,6 @@ static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) struct rtc_plat_data *pdata = dev_get_drvdata(dev); unsigned long flags; - if (pdata->irq <= 0) - return -EINVAL; - pdata->alrm_mday = alrm->time.tm_mday; pdata->alrm_hour = alrm->time.tm_hour; pdata->alrm_min = alrm->time.tm_min; @@ -219,9 +216,6 @@ static int ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct rtc_plat_data *pdata = dev_get_drvdata(dev); - if (pdata->irq <= 0) - return -EINVAL; - alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday; alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour; alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min; @@ -253,9 +247,6 @@ static int ds1511_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) struct rtc_plat_data *pdata = dev_get_drvdata(dev); unsigned long flags; - if (pdata->irq <= 0) - return -EINVAL; - spin_lock_irqsave(&pdata->lock, flags); ds1511_rtc_alarm_enable(enabled); spin_unlock_irqrestore(&pdata->lock, flags); @@ -349,12 +340,6 @@ static int ds1511_rtc_probe(struct platform_device *pdev) pdata->rtc->ops = &ds1511_rtc_ops; - ret = devm_rtc_register_device(pdata->rtc); - if (ret) - return ret; - - devm_rtc_nvmem_register(pdata->rtc, &ds1511_nvmem_cfg); - /* * if the platform has an interrupt in mind for this device, * then by all means, set it @@ -369,6 +354,15 @@ static int ds1511_rtc_probe(struct platform_device *pdev) } } + if (pdata->irq == 0) + clear_bit(RTC_FEATURE_ALARM, pdata->rtc->features); + + ret = devm_rtc_register_device(pdata->rtc); + if (ret) + return ret; + + devm_rtc_nvmem_register(pdata->rtc, &ds1511_nvmem_cfg); + return 0; } From patchwork Tue Feb 27 23:04:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207495 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3015780dyb; Tue, 27 Feb 2024 15:07:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXmnrNEx3OB58ruTzQcDTudDZVtWlbvQDm4G1f4vmSEY4Dz0qWYw7FeOoZysWiwx6AM3Ek+n026lGMHriw3A4P3D6mEmg== X-Google-Smtp-Source: AGHT+IHwaHtj99Tuv44IVCzUGIh2OECouepuSS2M8InMa+jSXkzHoGwD2aHI46OK9S2w6epKCTYy X-Received: by 2002:a0c:f082:0:b0:68f:2bba:7fc0 with SMTP id g2-20020a0cf082000000b0068f2bba7fc0mr4046175qvk.20.1709075241799; Tue, 27 Feb 2024 15:07:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075241; cv=pass; d=google.com; s=arc-20160816; b=RfU29KK7MZErC56yF6UGwj7Y47xdG8ZHZDOiqkGpgznfGGkGoWGLwgDws+BLJk2Kvc V/xedZgNqXjNth7smS/8IMDeyaHbInKMigdIxUuDrVqK4yrerx/e7h/6eJK7a6BOuBSo Zr+OBz3itagjgNkdET00MlX3++apvfgVR/EZL4J+d0qnEshLfsPPIvbcO++i0wz+AxHI t1NamWEujP9b+A17nr2SSx4+4zc281kAECg1vOplnS2biwwtHJAqZ1YK13WO5kcz1/tX BLypm42IM0MwJrcTv1I4LMOFhsOSFWYtuOVtYaAqjcX37kkr9KrdX66dI+5SkTE4IdFe jMDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kGY1Lhw9NrTAfEs+9MBkqd4BWCrhYqYXS/EilsGRZFU=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=F8lQblrhlnhyfhKa49nNw1QefuV/YK8q7jYeXU6QXtIDRuOE+PUJxziQnMm//jcLiq nndSFei0/WhJBtuIa/HSAdVVzq0TGWi6u6VVUKWzzHCraHDeChZgAQato4krACj+qqGX 2DCkhUFiqTVSZRxPAbwBpQUSRemSNxLEXkSHVPnV/ZnOQWuo1yqYkv+70AaW7ptNHxqb QR/VHpoIE+NOQPyzbSXjNWKSDapesxKKU2curMZzYe51a3/ZoVsVjSC90aAPfw16gy3y oD5d9HO8AN4wEEEpySx5hm9HZH7uytdEJsK8fFrPxdm0qavfOGVS/3KTs5if2nl7696P r0TQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=X8ng9Z2P; 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-84167-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84167-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id im12-20020a056214246c00b0068f74097af6si8559896qvb.82.2024.02.27.15.07.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:07:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84167-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=X8ng9Z2P; 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-84167-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84167-ouuuleilei=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 070931C24E75 for ; Tue, 27 Feb 2024 23:06:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CDE0C58AB2; Tue, 27 Feb 2024 23:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="X8ng9Z2P" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (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 4939E56468; Tue, 27 Feb 2024 23:05:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075104; cv=none; b=aF/EKIZvR9abLyI4JXkgqUGOoCPUmoMK180gj157SjuBP7Ur3LwcbD3w4o5gTPhUYKeo5E98giP51xKRszPEHtD51ZO0eLemeopb6IrrU7a8P3ggtQHIlDuVFGVApFUHaBbopbqDnXCpEkB4+6Er5opOVnD+WokOlUzzmww9Tbg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075104; c=relaxed/simple; bh=rq6RFPSWoMlRYMCpq0Sb4yHcqI8t099LkX3OT8uPleM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ptAxDfy0Bi3FfLoZrfVCut6qmibGTQefdCBiGx+cxevcXuHjT4rbi4MK7n6ZbuWMUWl5OrtRuHW4kXseQ+6MNY3Xyp6IaIIzqq0isOvbww9Ek/Hr/ozs2rRMHr7LxXE+5OkDMzd/Ov3qo9P2pkjSqKg2CnStv02EeU5ot+A5sM0= 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=X8ng9Z2P; arc=none smtp.client-ip=217.70.183.195 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 2261C60003; Tue, 27 Feb 2024 23:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kGY1Lhw9NrTAfEs+9MBkqd4BWCrhYqYXS/EilsGRZFU=; b=X8ng9Z2PXSiRtWBJu3rmw9tN7ajybSxGOOxiGFKJrcTp9tFB0dslWMag554sah18BtE2I4 7FvI8b6bJ//1qjf2Xx62jcJ+h2k1n5fLHR2KcgBAQjLSoNx64SFXm4RrGfpYgtnNR7hDLF b08qN1w1bKa1zG09rQmQNF2vZ8jW5XGi8yDOUfGoBLT7zJ3inqEclrELcUNUO+9eFcaeUv uHN6ynsTtCHvpUckWA2T0QVRvCczarC02hpg8cyo9yzVoSSmb762PLzeS7bxKEM6ANPylE UYI7OZsqFUc2aMqvILDVT9iao0vvsQEncl7Bpe/6tt1sbSQUal1kL0xEeagPJQ== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/12] rtc: ds1511: remove partial alarm support Date: Wed, 28 Feb 2024 00:04:24 +0100 Message-ID: <20240227230431.1837717-9-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095280420788460 X-GMAIL-MSGID: 1792095280420788460 From: Alexandre Belloni The RTC core will always provide an alarm with all its members set, it is not necessary to support partial alarms. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index c81f464e6a50..d5d59a948c59 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -196,14 +196,10 @@ static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) pdata->irqen |= RTC_AF; spin_lock_irqsave(&pdata->lock, flags); - rtc_write(pdata->alrm_mday < 0 ? 0x80 : bin2bcd(pdata->alrm_mday) & 0x3f, - DS1511_AM4_DATE); - rtc_write(pdata->alrm_hour < 0 ? 0x80 : bin2bcd(pdata->alrm_hour) & 0x3f, - DS1511_AM3_HOUR); - rtc_write(pdata->alrm_min < 0 ? 0x80 : bin2bcd(pdata->alrm_min) & 0x7f, - DS1511_AM2_MIN); - rtc_write(pdata->alrm_sec < 0 ? 0x80 : bin2bcd(pdata->alrm_sec) & 0x7f, - DS1511_AM1_SEC); + rtc_write(bin2bcd(pdata->alrm_mday) & 0x3f, DS1511_AM4_DATE); + rtc_write(bin2bcd(pdata->alrm_hour) & 0x3f, DS1511_AM3_HOUR); + rtc_write(bin2bcd(pdata->alrm_min) & 0x7f, DS1511_AM2_MIN); + rtc_write(bin2bcd(pdata->alrm_sec) & 0x7f, DS1511_AM1_SEC); ds1511_rtc_alarm_enable(alrm->enabled); rtc_read(DS1511_CONTROL_A); /* clear interrupts */ From patchwork Tue Feb 27 23:04:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207510 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3024811dyb; Tue, 27 Feb 2024 15:28:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVT/MuFWoKrD6GoytN1G5gWuh5+7suCEbWe+npTrjTiFociaEvc/hi/FZGgXU4fNHHb4u6Sez2Dk2Unt326+28b1fCBDA== X-Google-Smtp-Source: AGHT+IGqb4ZKE1B4XJVgYblZmu9QmgRyCOd5yipmuqGhQ+ZehaQuZkyCx43oaYxGbN1kztgb1Ihx X-Received: by 2002:a17:902:e74a:b0:1dc:74c4:f1dd with SMTP id p10-20020a170902e74a00b001dc74c4f1ddmr14889670plf.25.1709076503933; Tue, 27 Feb 2024 15:28:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709076503; cv=pass; d=google.com; s=arc-20160816; b=kW8Q9bKJJ/CjVkCejCazadeeQl4SSamDxU7X8abjsF+7xfIo8P3ymyd7C1BCquyjrQ EGtA0avV0RIzyXPSZHvPVuNf2N1KhxpA9zc5m+Xd0/z3bsJbMQ4iRP9CFeo08iDTF3ta 9seY+tkD9sIQLS3SlNxV4c27+BjeMGFJwCDFJvjaoxfvQgu/Z2BvV9UNGbywPsIH7W9e Nsli1Cf/fvqkOzO8MSc8FdQ+sHzzfA/sMSN5bAqRk5o+BBCRh2mPyfPKBWDlKeK1a/2W ITmiN4T94TQT9Y2z9OvWLqoi6U7sQHGoZMGiKCF2dNiOZJHmN8DWP2/W6THwXGmLU08o 423A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MYoZhGgebEeKeaaUKnQEZonlz+9SDLCeUb72d1lfySo=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=iE1qEY+qmv7ntJbsI+kPbS/7yVybWCJIzSbBIXaDBKJBS2MQ1QmuR6yJHwoDy+dkdh OYYFIVSRr1cYqoQ5ghWkdRz9AftPbcjRYj+mKJKmo4pMi0xw7gcaukNqPpicVrSjhsOF WyxKtmzTzB5WtQHct9lYBBTRe49BqX5MmNJ/76GE6iW/kS7UmeyHJMTlr64Cu0wqMIEq XwX0LfpxzXNwbi9HbU8mjfjlqzoXUueN4MkSwb1YWVVqFfps14oVU7hs3+THXN0f3xH8 q3lqAkgF1ewuG4v0YEvgZ1Rdus82JbFUZ+56ZlyNtXjP4gk3EB9YkYPFVwbXdxjXr9Q+ C0mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NR7gD8u7; 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-84168-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84168-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ju14-20020a170903428e00b001d8ecf3d0fbsi2112296plb.511.2024.02.27.15.28.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:28:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84168-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NR7gD8u7; 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-84168-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84168-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 069F6291591 for ; Tue, 27 Feb 2024 23:06:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 910B85915D; Tue, 27 Feb 2024 23:05:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NR7gD8u7" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 4EFFF58AB9; Tue, 27 Feb 2024 23:05:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075107; cv=none; b=OWRfMpgWb2WAC9LEMvLFQ2rLmGcElzTFWWffrnC0HuLpsNQQcnc2/276rvAlMYRTnkx9xyCVqXMklxDRslxu7s0dPrmZPFTzo8XeL7dXXNTkUrV9JBWJIWyMMvK7Of+VcTv/x39tvnMc9M7P7Lp2cLjMGOmDfVENx8Iz7CcuE34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075107; c=relaxed/simple; bh=gEa1QXDhcqfFS34hD+AU6YBCOa3UzXEwA23LdIpq4Dw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h6DwJD4VlnzAK+YEFoCjDHR7wjVVnxvQ0QTQZkCC/Cd7Zpbl8D8qbfZu47blRtscGwHSjCopOXO7aIsy9PMYOhFneedYFHEaOROxJ7E6H/dcxvn47VKkwRVmZFV2A8Yuay3dTeY7Z6Qsq7p2hNwOsCEktZZA9Ly0v6tD3TmsjsY= 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=NR7gD8u7; arc=none smtp.client-ip=217.70.183.199 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 0199FFF802; Tue, 27 Feb 2024 23:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MYoZhGgebEeKeaaUKnQEZonlz+9SDLCeUb72d1lfySo=; b=NR7gD8u7Kgxy0hk2plrkquMxvTLfqlRBnz5w4eSjMJRpYAH9fGp7Kg/ET7VwFVugVYxDUt f0NihIVlAsgb+kjttkQa2DYwddMIybEtyOiFvUAQVXYhpa4ipGYX3yxq2MVTUXqd7zU9Vw rQ+yem4e3dZk1Pv/G/gxR2dXHetSCdolm0me6BpHqkDC2IXB/FMwDGEHf8zkJo1JGqUm9+ iKX+7jA4qSUR+5d0Kdl61SDs84nDLymO9TLfC22pVL2oGRnJ7yU+HPIoQGQPWQyPUvzVn6 eEDABVenWsc7bipXX1kexZ2hEgAmsGVwpnhgXWTSPXStWm7Fmpf5zXTLQ+4LKA== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/12] rtc: ds1511: implement ds1511_rtc_read_alarm properly Date: Wed, 28 Feb 2024 00:04:25 +0100 Message-ID: <20240227230431.1837717-10-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792096603926747224 X-GMAIL-MSGID: 1792096603926747224 From: Alexandre Belloni ds1511_rtc_read_alarm was useless as it is only called at boot time so the alarm members of pdata have not yet been set. Read the actual registers so there is a chance to get a meaningful value. Then, drop the alarm related members of pdata as they are not used anymore. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index d5d59a948c59..c3b1376b731f 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -63,11 +63,6 @@ struct rtc_plat_data { struct rtc_device *rtc; void __iomem *ioaddr; /* virtual base address */ int irq; - unsigned int irqen; - int alrm_sec; - int alrm_min; - int alrm_hour; - int alrm_mday; spinlock_t lock; }; @@ -188,18 +183,11 @@ static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) struct rtc_plat_data *pdata = dev_get_drvdata(dev); unsigned long flags; - pdata->alrm_mday = alrm->time.tm_mday; - pdata->alrm_hour = alrm->time.tm_hour; - pdata->alrm_min = alrm->time.tm_min; - pdata->alrm_sec = alrm->time.tm_sec; - if (alrm->enabled) - pdata->irqen |= RTC_AF; - spin_lock_irqsave(&pdata->lock, flags); - rtc_write(bin2bcd(pdata->alrm_mday) & 0x3f, DS1511_AM4_DATE); - rtc_write(bin2bcd(pdata->alrm_hour) & 0x3f, DS1511_AM3_HOUR); - rtc_write(bin2bcd(pdata->alrm_min) & 0x7f, DS1511_AM2_MIN); - rtc_write(bin2bcd(pdata->alrm_sec) & 0x7f, DS1511_AM1_SEC); + rtc_write(bin2bcd(alrm->time.tm_mday) & 0x3f, DS1511_AM4_DATE); + rtc_write(bin2bcd(alrm->time.tm_hour) & 0x3f, DS1511_AM3_HOUR); + rtc_write(bin2bcd(alrm->time.tm_min) & 0x7f, DS1511_AM2_MIN); + rtc_write(bin2bcd(alrm->time.tm_sec) & 0x7f, DS1511_AM1_SEC); ds1511_rtc_alarm_enable(alrm->enabled); rtc_read(DS1511_CONTROL_A); /* clear interrupts */ @@ -210,13 +198,12 @@ static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) static int ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { - struct rtc_plat_data *pdata = dev_get_drvdata(dev); + alrm->time.tm_mday = bcd2bin(rtc_read(DS1511_AM4_DATE) & 0x3f); + alrm->time.tm_hour = bcd2bin(rtc_read(DS1511_AM3_HOUR) & 0x3f); + alrm->time.tm_min = bcd2bin(rtc_read(DS1511_AM2_MIN) & 0x7f); + alrm->time.tm_sec = bcd2bin(rtc_read(DS1511_AM1_SEC) & 0x7f); + alrm->enabled = !!(rtc_read(DS1511_CONTROL_B) & DS1511_TIE); - alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday; - alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour; - alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min; - alrm->time.tm_sec = pdata->alrm_sec < 0 ? 0 : pdata->alrm_sec; - alrm->enabled = (pdata->irqen & RTC_AF) ? 1 : 0; return 0; } From patchwork Tue Feb 27 23:04:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207496 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3015938dyb; Tue, 27 Feb 2024 15:07:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUlmcwAiwMkvz9wlmR419JrkpL1nTTdlARFbhDxmPCzRpZpiXMS3cchgpUiZui8ZMBPQY6IX3G7ejtuFOpd7VUMDZLA7w== X-Google-Smtp-Source: AGHT+IFyEezT+7LKQlVgnd8MfKa4iQRcYjeR6P9n8+zcmVXhhbCJCIi3LQqoUXxiZmiDp6QdqQXD X-Received: by 2002:a05:6102:4a2:b0:470:3dc9:44cd with SMTP id r2-20020a05610204a200b004703dc944cdmr8194042vsa.25.1709075257353; Tue, 27 Feb 2024 15:07:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075257; cv=pass; d=google.com; s=arc-20160816; b=1JkpR49Xwn7xT+kYFr6EQ45hnomqGG3xiRhj/FA2hZglebNN+Edifulkd6shjig9pn xUy8tJEIK7dlIEbo7MTeOzwlegwDwiW6TgRf13/NGTyz9+BiwnkXlzhw8BCM1jaf8JF+ /OUT+8ngb+hgccfIG5Ar47DMi7/r++EPMj8seY2Tm91xGKkfpBlewNgdPtVM0RjQVNUH S8fjV85BcFbwfjHFRzlZveSnWxcLzVjeanGrg9QLS4HknDGmtHv5xNbLApUSwEMHiMy0 nh7GtodOsUPzDOiSeRMJf0hbsuIgTst/JE2ZYMnLqUtOREPMlA/OaAYr3BLrxbOUWyyu 3HEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2ne98OHwAyUwm2hh10Sfamw+t6hhfzU/DRAw12tQy0Q=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=vik+spfsWnRiEv7Tdw8rG5iup6qCL5e1pH30bLkEuaqP1JQb8/PK8ysyP9UM33ZAbk f7o1LZi/bIvvt/uyZz69k0lsfGKDZ3PkrwwkqpZhP/HInIIFvWWoxhXIPtLK78CNttrb QkmdOGCThhFutcXSZVagEzr0Hur7FjghJZW0pLfkF9WfNDph1qzl7WeUcndJIDOTXmu+ gk5wGColwXed+ZWsA38aAwQs4cFC0gp7qa987fZ7UuxdaqXpVO02iglE5G/fCU+Lu/0X NvmU5X7Vi7qrKTUyhTDxS8PkhbF1OLVImESmRDq2AxHmOj/R4l/KTwsz2vPlMHjlDNnq fUrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bWN4bUbx; 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-84169-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84169-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id az4-20020a056102284400b0046d13c259d8si991741vsb.175.2024.02.27.15.07.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:07:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84169-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bWN4bUbx; 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-84169-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84169-ouuuleilei=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 E3F5B1C25D70 for ; Tue, 27 Feb 2024 23:07:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45BC056770; Tue, 27 Feb 2024 23:05:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="bWN4bUbx" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 E226C58AD6; Tue, 27 Feb 2024 23:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075110; cv=none; b=nZTTfR3NKMmlkp2EOyO0pwenb2BWkmHR5k3TfeH5pmGRbsn19TkCLJTi3FGMypL1cDVIXLlSMMfhrwjgUm8o0poEN0K42l+QcOSjQ776vSMhtJNcP2EqQiuG6LQDyZGOlkhDsWmRhmkWVOges4F6cozCLynLt8oqXxHbILdrKOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075110; c=relaxed/simple; bh=K0vgAjnfcErbCu7m6JHbbTv9UfXX4hDel32dYe9/n8U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YR/PzLPI8JE0bYQ5ubJEEGiCcTfO20NuHfEJ/w1PhFFqQeA6pJKEyA6KsBHbou31TrNGUcO/i8mfNJqvROaUmN/PWO1FJsySE7llDI9g3s421/MHQEGHIrbUIFDc3mSSBonhvDJD4tYzL5dhtyDO6+7vYRQXWbyoK1hR35pKO94= 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=bWN4bUbx; arc=none smtp.client-ip=217.70.183.200 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 3ADAB2000A; Tue, 27 Feb 2024 23:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ne98OHwAyUwm2hh10Sfamw+t6hhfzU/DRAw12tQy0Q=; b=bWN4bUbxn8E58jmhBJvDFhMWOGIKUnWifyCGVySnO/qkNZvTcyidEFroJwgXPqWRmjlS5V B4kMYxGQgDGfrjlHRah7V9vj2VIao5yuXfawhi90Tfy3PuVsXSWdLjQDhi7Qj5h7qeM8Fl u+kKY1hRIjVLXaOvxHRW0VaOO8Mw3CKiPmuYRKZppX7mcf0cmUZmL3DvvpertxHmgLku8C o1WpHOA1LUS8H/kcKdP73A0K6N3hDLOQEXm1qYdRUh3pV+MSmfnzCr/pwHl5u2NZo5gCa3 rRFMCce8S4mjAN96dRnoa3UOcN2vkYLAzh3QTQ4HhnAxrtxOgn+CcTFc08JGkg== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/12] rtc: ds1511: rename pdata Date: Wed, 28 Feb 2024 00:04:26 +0100 Message-ID: <20240227230431.1837717-11-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095296538998406 X-GMAIL-MSGID: 1792095296538998406 From: Alexandre Belloni pdata is not actually about patform_data, rename it to something local to the driver. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index c3b1376b731f..39efd432e8ea 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -59,7 +59,7 @@ #define DS1511_WDS 0x01 #define DS1511_RAM_MAX 0x100 -struct rtc_plat_data { +struct ds1511_data { struct rtc_device *rtc; void __iomem *ioaddr; /* virtual base address */ int irq; @@ -180,10 +180,10 @@ static void ds1511_rtc_alarm_enable(unsigned int enabled) static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { - struct rtc_plat_data *pdata = dev_get_drvdata(dev); + struct ds1511_data *ds1511 = dev_get_drvdata(dev); unsigned long flags; - spin_lock_irqsave(&pdata->lock, flags); + spin_lock_irqsave(&ds1511->lock, flags); rtc_write(bin2bcd(alrm->time.tm_mday) & 0x3f, DS1511_AM4_DATE); rtc_write(bin2bcd(alrm->time.tm_hour) & 0x3f, DS1511_AM3_HOUR); rtc_write(bin2bcd(alrm->time.tm_min) & 0x7f, DS1511_AM2_MIN); @@ -191,7 +191,7 @@ static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) ds1511_rtc_alarm_enable(alrm->enabled); rtc_read(DS1511_CONTROL_A); /* clear interrupts */ - spin_unlock_irqrestore(&pdata->lock, flags); + spin_unlock_irqrestore(&ds1511->lock, flags); return 0; } @@ -210,29 +210,29 @@ static int ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) static irqreturn_t ds1511_interrupt(int irq, void *dev_id) { struct platform_device *pdev = dev_id; - struct rtc_plat_data *pdata = platform_get_drvdata(pdev); + struct ds1511_data *ds1511 = platform_get_drvdata(pdev); unsigned long events = 0; - spin_lock(&pdata->lock); + spin_lock(&ds1511->lock); /* * read and clear interrupt */ if (rtc_read(DS1511_CONTROL_A) & DS1511_IRQF) { events = RTC_IRQF | RTC_AF; - rtc_update_irq(pdata->rtc, 1, events); + rtc_update_irq(ds1511->rtc, 1, events); } - spin_unlock(&pdata->lock); + spin_unlock(&ds1511->lock); return events ? IRQ_HANDLED : IRQ_NONE; } static int ds1511_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) { - struct rtc_plat_data *pdata = dev_get_drvdata(dev); + struct ds1511_data *ds1511 = dev_get_drvdata(dev); unsigned long flags; - spin_lock_irqsave(&pdata->lock, flags); + spin_lock_irqsave(&ds1511->lock, flags); ds1511_rtc_alarm_enable(enabled); - spin_unlock_irqrestore(&pdata->lock, flags); + spin_unlock_irqrestore(&ds1511->lock, flags); return 0; } @@ -271,7 +271,7 @@ static int ds1511_nvram_write(void *priv, unsigned int pos, void *buf, static int ds1511_rtc_probe(struct platform_device *pdev) { - struct rtc_plat_data *pdata; + struct ds1511_data *ds1511; int ret = 0; struct nvmem_config ds1511_nvmem_cfg = { .name = "ds1511_nvram", @@ -283,15 +283,15 @@ static int ds1511_rtc_probe(struct platform_device *pdev) .priv = &pdev->dev, }; - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) + ds1511 = devm_kzalloc(&pdev->dev, sizeof(*ds1511), GFP_KERNEL); + if (!ds1511) return -ENOMEM; ds1511_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ds1511_base)) return PTR_ERR(ds1511_base); - pdata->ioaddr = ds1511_base; - pdata->irq = platform_get_irq(pdev, 0); + ds1511->ioaddr = ds1511_base; + ds1511->irq = platform_get_irq(pdev, 0); /* * turn on the clock and the crystal, etc. @@ -314,37 +314,37 @@ static int ds1511_rtc_probe(struct platform_device *pdev) if (rtc_read(DS1511_CONTROL_A) & DS1511_BLF1) dev_warn(&pdev->dev, "voltage-low detected.\n"); - spin_lock_init(&pdata->lock); - platform_set_drvdata(pdev, pdata); + spin_lock_init(&ds1511->lock); + platform_set_drvdata(pdev, ds1511); - pdata->rtc = devm_rtc_allocate_device(&pdev->dev); - if (IS_ERR(pdata->rtc)) - return PTR_ERR(pdata->rtc); + ds1511->rtc = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(ds1511->rtc)) + return PTR_ERR(ds1511->rtc); - pdata->rtc->ops = &ds1511_rtc_ops; + ds1511->rtc->ops = &ds1511_rtc_ops; /* * if the platform has an interrupt in mind for this device, * then by all means, set it */ - if (pdata->irq > 0) { + if (ds1511->irq > 0) { rtc_read(DS1511_CONTROL_A); - if (devm_request_irq(&pdev->dev, pdata->irq, ds1511_interrupt, + if (devm_request_irq(&pdev->dev, ds1511->irq, ds1511_interrupt, IRQF_SHARED, pdev->name, pdev) < 0) { dev_warn(&pdev->dev, "interrupt not available.\n"); - pdata->irq = 0; + ds1511->irq = 0; } } - if (pdata->irq == 0) - clear_bit(RTC_FEATURE_ALARM, pdata->rtc->features); + if (ds1511->irq == 0) + clear_bit(RTC_FEATURE_ALARM, ds1511->rtc->features); - ret = devm_rtc_register_device(pdata->rtc); + ret = devm_rtc_register_device(ds1511->rtc); if (ret) return ret; - devm_rtc_nvmem_register(pdata->rtc, &ds1511_nvmem_cfg); + devm_rtc_nvmem_register(ds1511->rtc, &ds1511_nvmem_cfg); return 0; } From patchwork Tue Feb 27 23:04:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207500 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3019985dyb; Tue, 27 Feb 2024 15:16:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVoiA1vx7Qvaam66UKWWbUIP3m/rvzUOwrn/6H1BzJRU7yVP/T2lFheLkrBsB20+kvqVT4ZAofXRfC9fMPSlxm8EiLxPw== X-Google-Smtp-Source: AGHT+IFOg40qyxA6KxDQRngWaod5M7GAZaG6aM4Vms7VOrYjPkyDlCN4RWTUYR8ud3LnUYPsFR+E X-Received: by 2002:a17:906:b216:b0:a43:4335:cbbb with SMTP id p22-20020a170906b21600b00a434335cbbbmr5085926ejz.75.1709075798167; Tue, 27 Feb 2024 15:16:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075798; cv=pass; d=google.com; s=arc-20160816; b=EwwfDu6NNehRkQt+ShN2Hc2Xfc3Gi0UPNRZVd+1x0nuQF5mDOgXtenrLzVrBZ4a80I qMBMk/XWc/s2R3csWzKe8fUrqmLIKPd4O8K5sJy6xvXYZSzqrZA5zZCrC3hXA7u9FgvG +KO16LFuR5bp5H/Og7AHSZvXl2KPsfmH/4zULCX28XIp2X8Q/mKkmtHKAon8K2weV1zl Y6JuVaYJMKEKFFd4RfFF7p7i7m1LwHtmqB2KHXcvhENTDOGgLLo2xRcjtQoDtnWVUZ5F +pfMu2YjHFIvbWQoGyhOQMHyP6+WKnOq+gKUVkuAi0FqADUrEsMLfYU6X33h68fs6jDm ZULA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wcVFj58DWatdZCpW23XgyZzih45dzb/RtLzeIt09wSA=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=RSez4B8XPtQHXsMe/Za87/LoCdLn1ydo3TaJw/6rhgiyxCZ8VQlvocZMkQke6Rw8uG TMiFfqv5eyIyClQiEFlbsK1/A97qQnIjg1RSxm7cOT6vMSXghGn0p5sZyQHbyeWQpNhm Ibe8CrENwIXM305w3b0vPQTcgJqm9EMFUNRqRlhOvjvy4roX8cIkbHMCFLijaTyQpkGx pkMywvvS7GSPlyuCeHWseWssI2/MMllNaCWcxYcssgBCt6Jk1MnkjHP9anna415hbzl7 Gec8pTmrOtUC6p3Bik48qo35rvFCyamyG7xhNmsU7ZpPPSOn5TTekrnzUAr2IIQanvop 2UZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=otVC6l8S; 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-84170-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84170-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hg4-20020a1709072cc400b00a43bf126e8bsi797939ejc.505.2024.02.27.15.16.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:16:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84170-ouuuleilei=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=@bootlin.com header.s=gm1 header.b=otVC6l8S; 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-84170-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84170-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id D249C1F2B444 for ; Tue, 27 Feb 2024 23:07:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E046759B57; Tue, 27 Feb 2024 23:05:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="otVC6l8S" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 842C656762; Tue, 27 Feb 2024 23:05:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075112; cv=none; b=nGkJOX41UNK+g8bAWaldAX+fivSWYFM4eoDmmZBobEsKpICmUBuVZvHiu2rs9I5lXcRFmP2oDbL60afUtzK/eMeBuXL81scJ/g2v/7Fj+HYM1ABg9rmY915u7NUT3kXjYoafT7NbMt5aM0/OV65Z0NfldbEuPi7tjIZG6+bPTrE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075112; c=relaxed/simple; bh=w97gAq5uciLvnevc4CCMhUzgcuwEpOO5fWctBUO7emo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kk7kB4Hack0ZjjQcsm/Rg2dobvD2SvlGMHHkJ8+LlOiZkUwMvnFQ2HA0j0nQRynx+hkOtD4X6aH4G8527/XXIdkJK25EkCu+Y/6mh/kuW78jODhbvU1D69aM1gP2ZKzSFgZpDHiQ4BFstMFitzQ4vUzX8Ec3kp7UkCgiu4icDOM= 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=otVC6l8S; arc=none smtp.client-ip=217.70.183.199 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 10E95FF806; Tue, 27 Feb 2024 23:05:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wcVFj58DWatdZCpW23XgyZzih45dzb/RtLzeIt09wSA=; b=otVC6l8SzW1nAz68yxHvaEK+AT6fcQ+BCgD97fRa4PXi5QdvjoqJ3NaOuphLD5FBjA3bTg QwCAvDyfEWwS2JlGVYd+QNXKZGdxAwL5xkrs/LeaDzUjUslyhucFWjLP5irSJjTki/Mjd1 cxdzAf3jRcIKC0HINKtI6HSQwfy10X8PtwRThRYhMMfpZ+qV+P/GlT7U82ogRZdT7S5opG ox8zBHtLOgPYQ3Ed72PQarmPMOSDxB7WMbAlIYhlhdiNsZDQIBxOhG6Tx9IZXvW8S0Sa9W zB7PYjFppHX7+gq+pxkzHQlezmqNtErGXgNcydx+xQtlzkuYvHkjs3SPZbpRLw== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/12] rtc: ds1511: drop inline/noinline hints Date: Wed, 28 Feb 2024 00:04:27 +0100 Message-ID: <20240227230431.1837717-12-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095864080143492 X-GMAIL-MSGID: 1792095864080143492 From: Alexandre Belloni There is no reason to not let the compiler optimise those functions as it wants. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 39efd432e8ea..edb8d90812c5 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -71,17 +71,17 @@ static DEFINE_SPINLOCK(ds1511_lock); static __iomem char *ds1511_base; static u32 reg_spacing = 1; -static noinline void rtc_write(uint8_t val, uint32_t reg) +static void rtc_write(uint8_t val, uint32_t reg) { writeb(val, ds1511_base + (reg * reg_spacing)); } -static noinline uint8_t rtc_read(uint32_t reg) +static uint8_t rtc_read(uint32_t reg) { return readb(ds1511_base + (reg * reg_spacing)); } -static inline void rtc_disable_update(void) +static void rtc_disable_update(void) { rtc_write((rtc_read(DS1511_CONTROL_B) & ~DS1511_TE), DS1511_CONTROL_B); }