[rtc-linux] Re: [PATCH 1/2] RTC: s35390a: handle invalid RTC time

2017-01-16 Thread Alexandre Belloni
Hi, On 12/01/2017 at 11:43:37 +0100, Fabien Lahoudere wrote : > If RTC time have been altered by low voltage, we notify users > that RTC time is invalid by returning -EINVAL. > The RTC time needs to be set correctly to clear the invalid flag. > If the RTC is not set before restarting, the informat

[rtc-linux] Re: [PATCH 2/2] RTC: s35390a: implement ioctls

2017-01-16 Thread Alexandre Belloni
On 12/01/2017 at 11:43:38 +0100, Fabien Lahoudere wrote : > Implements RTC_VL_READ and RTC_VL_CLR ioctls. > > Signed-off-by: Fabien Lahoudere > --- > drivers/rtc/rtc-s35390a.c | 40 ++-- > 1 file changed, 38 insertions(+), 2 deletions(-) > > diff --git a/driv

[rtc-linux] Re: [PATCH] rtc: sun6i: Switch to the external oscillator

2017-01-16 Thread Alexandre Belloni
On 16/01/2017 at 17:13:49 +0100, Maxime Ripard wrote : > On Mon, Jan 16, 2017 at 04:39:59PM +0100, Alexandre Belloni wrote: > > On 16/01/2017 at 16:21:48 +0100, Maxime Ripard wrote : > > > The RTC is clocked from either an internal, imprecise, oscillator or an > > > external one, which is usually m

[rtc-linux] Re: [PATCH] rtc: sun6i: Switch to the external oscillator

2017-01-16 Thread Maxime Ripard
Hi, On Mon, Jan 16, 2017 at 04:39:59PM +0100, Alexandre Belloni wrote: > On 16/01/2017 at 16:21:48 +0100, Maxime Ripard wrote : > > The RTC is clocked from either an internal, imprecise, oscillator or an > > external one, which is usually much more accurate. > > > > The difference perceived betwe

[rtc-linux] Re: [PATCH] rtc: sun6i: Switch to the external oscillator

2017-01-16 Thread Alexandre Belloni
On 16/01/2017 at 16:21:48 +0100, Maxime Ripard wrote : > The RTC is clocked from either an internal, imprecise, oscillator or an > external one, which is usually much more accurate. > > The difference perceived between the time elapsed and the time reported by > the RTC is in a 10% scale, which pr

[rtc-linux] [PATCH] rtc: sun6i: Switch to the external oscillator

2017-01-16 Thread Maxime Ripard
The RTC is clocked from either an internal, imprecise, oscillator or an external one, which is usually much more accurate. The difference perceived between the time elapsed and the time reported by the RTC is in a 10% scale, which prevents the RTC from being useful at all. Fortunately, the extern

[rtc-linux] Re: [PATCHv3 8/8] ARM: configs: stm32: Add RTC support in STM32 defconfig

2017-01-16 Thread Alexandre Torgue
Hi Amélie, On 01/05/2017 02:43 PM, Amelie Delaunay wrote: This patch adds STM32 RTC support in stm32_defconfig file. Signed-off-by: Amelie Delaunay --- arch/arm/configs/stm32_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/st

[rtc-linux] Re: [bug report] rtc: add STM32 RTC driver

2017-01-16 Thread Dan Carpenter
Yeah. I just read your patch now. Thanks. regards, dan carpenter -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a drive

[rtc-linux] Re: [bug report] rtc: add STM32 RTC driver

2017-01-16 Thread Amelie DELAUNAY
I've changed the comparison: @@ -525,7 +525,7 @@ static int stm32_rtc_init(struct platform_device *pdev, pred_s = (rate / (pred_a + 1)) - 1; dev_warn(&pdev->dev, "ck_rtc is %s\n", -(rate - ((pred_a + 1) * (pred_s + 1)) < 0) ? +

[rtc-linux] Re: [bug report] rtc: add STM32 RTC driver

2017-01-16 Thread Dan Carpenter
Oh. That still won't fix this: drivers/rtc/rtc-stm32.c 519 /* 520 * Can't find a 1Hz, so give priority to RTC power consumption 521 * by choosing the higher possible value for prediv_a 522 */ 523 if ((pred_s > pred_s_max) || (pred_a >

[rtc-linux] RE: [bug report] rtc: add STM32 RTC driver

2017-01-16 Thread Amelie DELAUNAY
Hi Dan, Thanks for reporting this issue. I've already send a fix ("rtc: stm32: fix comparison warnings"): https://patchwork.kernel.org/patch/9518411/. Regards, Amelie > -Original Message- > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: lundi 16 janvier 2017 13:14 > To: A

[rtc-linux] [bug report] rtc: add STM32 RTC driver

2017-01-16 Thread Dan Carpenter
Hello Amelie Delaunay, The patch 4e64350f42e2: "rtc: add STM32 RTC driver" from Jan 11, 2017, leads to the following static checker warning: drivers/rtc/rtc-stm32.c:514 stm32_rtc_init() warn: always true condition '(pred_a >= 0) => (0-u32max >= 0)' drivers/rtc/rtc-stm32.c 499

[rtc-linux] [PATCH] rtc: stm32: fix comparison warnings

2017-01-16 Thread Amelie Delaunay
This patches fixes comparison between signed and unsigned values as it could produce an incorrect result when the signed value is converted to unsigned: drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_valid_alrm': drivers/rtc/rtc-stm32.c:404:21: warning: comparison between signed and unsigned int

[rtc-linux] [PATCH] rtc: stm32: use 0 instead of ~PWR_CR_DBP in regmap_update_bits

2017-01-16 Thread Amelie Delaunay
Using the ~ operator on a BIT() constant results in a large 'unsigned long' constant that won't fit into an 'unsigned int' function argument on 64-bit architectures, resulting in a harmless build warning in x86 allmodconfig: drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_probe': drivers/rtc/rtc-s