From patchwork Fri Feb 28 13:00:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 325180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pd0-x240.google.com (mail-pd0-x240.google.com [IPv6:2607:f8b0:400e:c02::240]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 056FC2C00AE for ; Sat, 1 Mar 2014 00:00:21 +1100 (EST) Received: by mail-pd0-f192.google.com with SMTP id r10sf162360pdi.19 for ; Fri, 28 Feb 2014 05:00:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe:content-type; bh=1/gICCYgEN3eaIBnmWxhqYAPN2Tlci1UqzVVJaqchtg=; b=b2OAsHy7ztWu1WyHymZrSMUwr7P6BRDm63o17o518MTDv13zAVPfxLmlqppxvimZSe B9RTUEVmWEPPCMUmbqyw/LXV5v0+Wz9dsYl1DjOUr4mX2rSfKcGzMhDMYH7eCdntz7TQ NCRe74000GCN/bSxgw1Az+PXwZkb1wzLGdzF55OmhYS+1eOib0VCFlbrhsT0sZKvQycX iyBRB5a52p7RQSXIP8t++h3Qs9CEw5gp9Usr8B9p18NL7Si5v9VzY3ff9SJVakMaiHMn FiimrOAzrDdxVDTr0k8IB1VhRASN501owXzYpPI/UZF8sQbSQasL55mR+KCIPjOaTIyb Dl3A== X-Received: by 10.182.199.39 with SMTP id jh7mr111328obc.25.1393592419204; Fri, 28 Feb 2014 05:00:19 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.182.46.134 with SMTP id v6ls398243obm.50.gmail; Fri, 28 Feb 2014 05:00:18 -0800 (PST) X-Received: by 10.182.55.102 with SMTP id r6mr6672266obp.7.1393592418649; Fri, 28 Feb 2014 05:00:18 -0800 (PST) Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com. [210.118.77.13]) by gmr-mx.google.com with ESMTPS id g1si548980pbw.2.2014.02.28.05.00.18 for (version=TLSv1 cipher=RC4-MD5 bits=128/128); Fri, 28 Feb 2014 05:00:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of k.kozlowski@samsung.com designates 210.118.77.13 as permitted sender) client-ip=210.118.77.13; Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N1P00G1OISHS570@mailout3.w1.samsung.com> for rtc-linux@googlegroups.com; Fri, 28 Feb 2014 13:00:17 +0000 (GMT) X-AuditID: cbfec7f5-b7fc96d000004885-98-531088612907 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id A4.E8.18565.16880135; Fri, 28 Feb 2014 13:00:17 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N1P00APRISCCQ20@eusync3.samsung.com>; Fri, 28 Feb 2014 13:00:17 +0000 (GMT) From: Krzysztof Kozlowski To: Sangbeom Kim , Samuel Ortiz , Lee Jones , Alessandro Zummo , linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com Cc: Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Tomasz Figa , Krzysztof Kozlowski Subject: [rtc-linux] [PATCH 3/5] rtc: s5m: Use shorter time of register update Date: Fri, 28 Feb 2014 14:00:06 +0100 Message-id: <1393592408-27181-4-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1393592408-27181-1-git-send-email-k.kozlowski@samsung.com> References: <1393592408-27181-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphluLIzCtJLcpLzFFi42I5/e/4Vd3EDoFgg8e75CyWXLzKbrFxxnpW i9cvDC3ONr1ht7j/9SijxeVdc9gs1h65y26xv7OD0eJ0N6vFxRVfmCzWz3jN4sDtsWfiSTaP O9f2sHnMOxno0bdlFaPH9Hk/mTw+b5ILYIvisklJzcksSy3St0vgyvg56TFjwUKBil8vNrI0 MB7l7WLk5JAQMJH48fkhE4QtJnHh3nq2LkYuDiGBpYwSR6d0M0M4fUwSH/c2sYFUsQkYS2xe vgSsSkTgKqPExCWL2UESzALPGSWefg8HsYUFnCSenlsINpZFQFXi2IEeRhCbV8BdYtHxw6xd jBxA6xQk5kyyAQlzCnhInHw+hRXEFgIqubd6K/MERt4FjAyrGEVTS5MLipPSc430ihNzi0vz 0vWS83M3MUJC8OsOxqXHrA4xCnAwKvHwTvDkDxZiTSwrrsw9xCjBwawkwvukSSBYiDclsbIq tSg/vqg0J7X4ECMTB6dUA6P/5GcbLM4+WV3P+FwjJV/vbMyzQDHxLKGLx9S/iZ4Sv3N1w25h 2bh934Tc5l1Jc/vD1JLBMjlObVNF3w7Bd+7T7T9fm2Ois+8u50pXm2Kx7ctFLq42Sm5z+DtZ PWHLv1S7rcJ3150IElTZ9sVC3O2ddu+a7zy5J5e5M+caaETsW1GwbsmbLGslluKMREMt5qLi RAAhWXsTHwIAAA== X-Original-Sender: k.kozlowski@samsung.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of k.kozlowski@samsung.com designates 210.118.77.13 as permitted sender) smtp.mail=k.kozlowski@samsung.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Set the time needed for updating alarm and time registers to 0.45 ms. The default is 7.32 ms which is too long and leads to warnings when setting alarm or time: s5m-rtc: waiting for UDR update, reached max number of retries Signed-off-by: Krzysztof Kozlowski --- drivers/rtc/rtc-s5m.c | 7 +++++++ include/linux/mfd/samsung/rtc.h | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c index b1627e9ab8f0..109d57800157 100644 --- a/drivers/rtc/rtc-s5m.c +++ b/drivers/rtc/rtc-s5m.c @@ -504,6 +504,13 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info) u8 data[2]; int ret; + /* UDR update time. Default of 7.32 ms is to long. */ + ret = regmap_update_bits(info->regmap, S5M_RTC_UDR_CON, + S5M_RTC_UDR_T_MASK, S5M_RTC_UDR_T_450_US); + if (ret < 0) + dev_err(info->dev, "%s: fail to change UDR time: %d\n", + __func__, ret); + /* Set RTC control register : Binary mode, 24hour mode */ data[0] = (1 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT); data[1] = (0 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT); diff --git a/include/linux/mfd/samsung/rtc.h b/include/linux/mfd/samsung/rtc.h index 207fcfbde82e..b6401e7661c7 100644 --- a/include/linux/mfd/samsung/rtc.h +++ b/include/linux/mfd/samsung/rtc.h @@ -111,6 +111,16 @@ enum s2mps_rtc_reg { #define RTC_TCON_MASK (1 << RTC_TCON_SHIFT) #define S5M_RTC_TIME_EN_SHIFT 3 #define S5M_RTC_TIME_EN_MASK (1 << S5M_RTC_TIME_EN_SHIFT) +/* + * UDR_T field in S5M_RTC_UDR_CON register determines the time needed + * for updating alarm and time registers. Default is 7.32 ms. + */ +#define S5M_RTC_UDR_T_SHIFT 6 +#define S5M_RTC_UDR_T_MASK (0x3 << S5M_RTC_UDR_T_SHIFT) +#define S5M_RTC_UDR_T_7320_US (0x0 << S5M_RTC_UDR_T_SHIFT) +#define S5M_RTC_UDR_T_1830_US (0x1 << S5M_RTC_UDR_T_SHIFT) +#define S5M_RTC_UDR_T_3660_US (0x2 << S5M_RTC_UDR_T_SHIFT) +#define S5M_RTC_UDR_T_450_US (0x3 << S5M_RTC_UDR_T_SHIFT) /* RTC Hour register */ #define HOUR_PM_SHIFT 6