From patchwork Thu Oct 9 19:06:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 5060511 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 107349F30B for ; Thu, 9 Oct 2014 19:14:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E5532024F for ; Thu, 9 Oct 2014 19:14:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 676982022A for ; Thu, 9 Oct 2014 19:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751540AbaJITMn (ORCPT ); Thu, 9 Oct 2014 15:12:43 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:53458 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751128AbaJITMa (ORCPT ); Thu, 9 Oct 2014 15:12:30 -0400 Received: by mail-lb0-f180.google.com with SMTP id n15so1744261lbi.39 for ; Thu, 09 Oct 2014 12:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=+S9isltbvIANcidoXYBF9HDP0upw7V1B9YDf1s7wxTI=; b=ukavHNyUpXhIA/tRJF5ZcGTULSEOOfAudcaZnmbU/r93fj1m1/FDn6VH7suiblt3pj w6H4gRDMcOKad06ZGqikGY5lKd8BqvGcN/pb1iJPCJbs6iyJ7/TVTYOt5JWijwEqyvqh BTCbUA9v+V9fAnHCp3r55jcC1SIQl3kIPDv296cFHiajxbmW9gLV7EW+smRDh5yIBUxB Z4dKca8qcs56wxM6weM3LBcgd90mkbhfEmGzmpK0Nex2Jlaou4XnoMjXlGv5rikDI5p1 kgMQ+8Y1hdRe7BQ9hhsgz3ISmR5RwtWIpbxr3mdF8AVKNg+X7Mb2utD5NlrEqn4kpZH+ hhiw== X-Received: by 10.112.164.71 with SMTP id yo7mr19839803lbb.73.1412881947009; Thu, 09 Oct 2014 12:12:27 -0700 (PDT) Received: from xi.terra (s83-177-171-8.cust.tele2.se. [83.177.171.8]) by mx.google.com with ESMTPSA id p8sm1190672lap.24.2014.10.09.12.12.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Oct 2014 12:12:26 -0700 (PDT) X-Google-Original-Sender: Received: from johan by xi.terra with local (Exim 4.84) (envelope-from ) id 1XcJ5o-0006h6-6e; Thu, 09 Oct 2014 21:09:40 +0200 From: Johan Hovold To: Alessandro Zummo , Tony Lindgren , =?UTF-8?q?Beno=C3=AEt=20Cousson?= Cc: Andrew Morton , Felipe Balbi , Lokesh Vutla , Guenter Roeck , Colin Foe-Parker , AnilKumar Ch , nsekhar@ti.com, t-kristo@ti.com, j-keerthy@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, Johan Hovold , stable Subject: [PATCH 01/12] rtc: omap: fix clock-source configuration Date: Thu, 9 Oct 2014 21:06:23 +0200 Message-Id: <1412881594-25678-2-git-send-email-johan@kernel.org> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1412881594-25678-1-git-send-email-johan@kernel.org> References: <1412881594-25678-1-git-send-email-johan@kernel.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure not to reset the clock-source configuration when enabling the 32kHz clock mux. Until the clock source can be configured through device tree we must not overwrite settings made by the bootloader (e.g. clock-source selection). Fixes: cd914bba03d8 ("drivers/rtc/rtc-omap.c: add support for enabling 32khz clock") Cc: stable Signed-off-by: Johan Hovold Reviewed-by: Felipe Balbi --- drivers/rtc/rtc-omap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 21142e6574a9..f842c216f2dd 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -431,8 +431,10 @@ static int __init omap_rtc_probe(struct platform_device *pdev) rtc_write(0, OMAP_RTC_INTERRUPTS_REG); /* enable RTC functional clock */ - if (id_entry->driver_data & OMAP_RTC_HAS_32KCLK_EN) - rtc_writel(OMAP_RTC_OSC_32KCLK_EN, OMAP_RTC_OSC_REG); + if (id_entry->driver_data & OMAP_RTC_HAS_32KCLK_EN) { + reg = rtc_read(OMAP_RTC_OSC_REG); + rtc_writel(reg | OMAP_RTC_OSC_32KCLK_EN, OMAP_RTC_OSC_REG); + } /* clear old status */ reg = rtc_read(OMAP_RTC_STATUS_REG);