Re: [PATCH v2 3/3] rtc: rzn1: support input frequencies other than 32768Hz

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Wolfram,

...

> @@ -357,22 +359,21 @@ static int rzn1_rtc_set_offset(struct device *dev, long offset)
>  	return 0;
>  }
>  
> -static const struct rtc_class_ops rzn1_rtc_ops = {
> +static struct rtc_class_ops rzn1_rtc_ops = {
>  	.read_time = rzn1_rtc_read_time,
>  	.set_time = rzn1_rtc_set_time,
>  	.read_alarm = rzn1_rtc_read_alarm,
>  	.set_alarm = rzn1_rtc_set_alarm,
>  	.alarm_irq_enable = rzn1_rtc_alarm_irq_enable,
> -	.read_offset = rzn1_rtc_read_offset,
> -	.set_offset = rzn1_rtc_set_offset,
>  };

...

> -	writel(RZN1_RTC_CTL0_CE | RZN1_RTC_CTL0_AMPM | RZN1_RTC_CTL0_SLSB_SUBU,
> -	       rtc->base + RZN1_RTC_CTL0);
> +	/* Set desired modes while leaving the controller disabled */
> +	writel(RZN1_RTC_CTL0_AMPM | scmp_val, rtc->base + RZN1_RTC_CTL0);
> +
> +	if (scmp_val) {
> +		writel(rate - 1, rtc->base + RZN1_RTC_SCMP);
> +	} else {
> +		rzn1_rtc_ops.read_offset = rzn1_rtc_read_offset;
> +		rzn1_rtc_ops.set_offset = rzn1_rtc_set_offset;

I guess this situation is not possible but let me ask. Do we care
about the very unlikely case where two RTCs are available and configured
differently? Because we are overwriting a static entry here. Maybe we
could have two static structures and pick the correct one during probe
instead.

> +	}
> +
> +	/* Enable controller finally */
> +	writel(RZN1_RTC_CTL0_CE | RZN1_RTC_CTL0_AMPM | scmp_val, rtc->base + RZN1_RTC_CTL0);
>  
>  	/* Disable all interrupts */
>  	writel(0, rtc->base + RZN1_RTC_CTL1);

Anyhow, I don't see this comment as a no-go so,

Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>

Thanks,
Miquèl





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux