From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932868AbcBIK5h (ORCPT ); Tue, 9 Feb 2016 05:57:37 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:41077 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755100AbcBIK5d (ORCPT ); Tue, 9 Feb 2016 05:57:33 -0500 From: Juergen Borleis To: rtc-linux@googlegroups.com Cc: Alessandro Zummo , Alexandre Belloni , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v2] RTC/PCF85063: fix reading/setting time/date Date: Tue, 9 Feb 2016 11:57:24 +0100 Message-Id: <1455015447-13886-1-git-send-email-jbe@pengutronix.de> X-Mailer: git-send-email 2.7.0.rc3 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: jbe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PCF85063 RTC needs special treatment while setting or reading the time/date: - when reading the 7 time/date registers they are blocked from updating by the 'one second' pulse internally. So reading all time/date registers should happen in one turn to ensure reading is an atomic operation - to let setting the time/date be an atomic operation as well, the clock dividers must be kept in reset state to avoid a 'one second' pulse during writing the 7 time/date registers Changes from v1: - using high level I2C access functions instead of the low level i2c_transfer() to simplify the code Comments are welcome Juergen Please keep me on CC since I'm not subscribed to the list.