public inbox for linux-rtc@vger.kernel.org
 help / color / mirror / Atom feed
From: Troy Mitchell <troymitchell988@gmail.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: troymitchell988@gmail.com, linux-rtc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: pcf8563: fix wrong alarm register
Date: Sun, 25 May 2025 10:36:55 +0800	[thread overview]
Message-ID: <3fca9368-9f2e-4f4f-a02a-2ccb9f23deb4@gmail.com> (raw)
In-Reply-To: <20250524213645d5543d64@mail.local>

On 2025/5/25 05:36, Alexandre Belloni wrote:
> On 19/04/2025 22:37:10+0800, Troy Mitchell wrote:
>> Fix wrong register and align `pcf8563_get_alarm_mode`
>> with the naming convention used in ops.
>>
>> Signed-off-by: Troy Mitchell <troymitchell988@gmail.com>
>> ---
>> Since this patch[1], the set_alarm function has been setting
>> an wrong register.
>>
>> Link:
>> https://lore.kernel.org/all/20241010084949.3351182-3-iwamatsu@nigauri.org/ [1]
>> ---
>>  drivers/rtc/rtc-pcf8563.c | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
>> index 5a084d426e58d09cfedf0809695a96a27627c420..61e2f9757de9f24407f9262657da0d1586ce124e 100644
>> --- a/drivers/rtc/rtc-pcf8563.c
>> +++ b/drivers/rtc/rtc-pcf8563.c
>> @@ -103,7 +103,7 @@ static int pcf8563_set_alarm_mode(struct pcf8563 *pcf8563, bool on)
>>  	return regmap_write(pcf8563->regmap, PCF8563_REG_ST2, buf);
>>  }
>>  
>> -static int pcf8563_get_alarm_mode(struct pcf8563 *pcf8563, unsigned char *en,
>> +static int pcf8563_read_alarm_mode(struct pcf8563 *pcf8563, unsigned char *en,
> 
> I was going to apply the patch but this is an unrelated change, please submit
> just the fix so it can be backported.
Hi, Could you please clarify if this renaming change would be acceptable?
If it is acceptable, I will split the original patch into two.
If not, I will remove the renaming change.

			- Troy
> 
>>  				  unsigned char *pen)
>>  {
>>  	u32 buf;
>> @@ -127,7 +127,7 @@ static irqreturn_t pcf8563_irq(int irq, void *dev_id)
>>  	char pending;
>>  	int err;
>>  
>> -	err = pcf8563_get_alarm_mode(pcf8563, NULL, &pending);
>> +	err = pcf8563_read_alarm_mode(pcf8563, NULL, &pending);
>>  	if (err)
>>  		return IRQ_NONE;
>>  
>> @@ -262,7 +262,7 @@ static int pcf8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm)
>>  	tm->time.tm_mday = bcd2bin(buf[2] & 0x3F);
>>  	tm->time.tm_wday = bcd2bin(buf[3] & 0x7);
>>  
>> -	err = pcf8563_get_alarm_mode(pcf8563, &tm->enabled, &tm->pending);
>> +	err = pcf8563_read_alarm_mode(pcf8563, &tm->enabled, &tm->pending);
>>  	if (err < 0)
>>  		return err;
>>  
>> @@ -285,7 +285,7 @@ static int pcf8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *tm)
>>  	buf[2] = bin2bcd(tm->time.tm_mday);
>>  	buf[3] = tm->time.tm_wday & 0x07;
>>  
>> -	err = regmap_bulk_write(pcf8563->regmap, PCF8563_REG_SC, buf,
>> +	err = regmap_bulk_write(pcf8563->regmap, PCF8563_REG_AMN, buf,
>>  				sizeof(buf));
>>  	if (err)
>>  		return err;
>>
>> ---
>> base-commit: 8560697b23dc2f405cb463af2b17256a9888129d
>> change-id: 20250419-pcf8563-fix-alarm-5e787f095861
>>
>> Best regards,
>> -- 
>> Troy Mitchell <troymitchell988@gmail.com>
>>
> 

-- 
Troy Mitchell


  reply	other threads:[~2025-05-25  2:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-19 14:37 [PATCH] rtc: pcf8563: fix wrong alarm register Troy Mitchell
2025-05-24 21:36 ` Alexandre Belloni
2025-05-25  2:36   ` Troy Mitchell [this message]
2025-06-18 14:42     ` Alexandre Belloni

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=3fca9368-9f2e-4f4f-a02a-2ccb9f23deb4@gmail.com \
    --to=troymitchell988@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --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