Linux RTC
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Kars de Jong <jongk@linux-m68k.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] rtc: msm6242: Remove unneeded msm6242_set()/msm6242_clear() functions
Date: Mon, 18 Nov 2019 15:19:09 +0100	[thread overview]
Message-ID: <20191118141909.GF3632@piout.net> (raw)
In-Reply-To: <20191116114620.9193-1-jongk@linux-m68k.org>

On 16/11/2019 12:46:20+0100, Kars de Jong wrote:
> The msm6242_set()/msm6242_clear() functions are used when writing to Control
> Register D to set or clear the HOLD bit when reading the current time from
> the RTC.
> 
> Doing this with a read-modify-write cycle will potentially clear an
> interrupt condition which occurs between the read and the write.
> 
> The datasheet states the following about this:
> 
>   When writing the HOLD or 30 second adjust bits of register D, it is
>   necessary to write the IRQ FLAG bit to a "1".
> 
> Since the only other bits in the register are the 30 second adjust bit
> (which is not used) and the BUSY bit (which is read-only), the
> read-modify-write cycle can be replaced by a simple write with the IRQ FLAG
> bit set to 1 and the other bits (except HOLD) set to 0.
> 
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Tested-by: Kars de Jong <jongk@linux-m68k.org>
> Signed-off-by: Kars de Jong <jongk@linux-m68k.org>
> ---
>  drivers/rtc/rtc-msm6242.c | 20 ++++----------------
>  1 file changed, 4 insertions(+), 16 deletions(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-11-18 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16 11:46 [PATCH] rtc: msm6242: Remove unneeded msm6242_set()/msm6242_clear() functions Kars de Jong
2019-11-18 14:19 ` Alexandre Belloni [this message]
2019-11-18 14:19 ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191118141909.GF3632@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=geert@linux-m68k.org \
    --cc=jongk@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox