From patchwork Tue May 12 12:58:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 471321 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-lb0-x237.google.com (mail-lb0-x237.google.com [IPv6:2a00:1450:4010:c04::237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9DF44140D23 for ; Tue, 12 May 2015 22:58:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=kCGXIDNs; dkim-atps=neutral Received: by lbio15 with SMTP id o15sf1833922lbi.0 for ; Tue, 12 May 2015 05:58:29 -0700 (PDT) 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:content-type:precedence:mailing-list:list-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe; bh=nRO6am0Nwu6LJylqndCFgMsa9G1ENg0LGbugiczaUlw=; b=kCGXIDNsmTT/cMOm8/AUme+Ft9Y/6Qn5Zx8kLlYq6b3lRkkwAOoy3BqjvO8LW321fh uB5/8G4AmaQ1V7pzlMuSfCsJmX2OH2LH7ka7L0T/mEfscLG/ITcjcj3odab7jqL9Tql9 mC4rXboT59eEUbiIJqvCIVqrtGJw56/1Aaen0H2D5BsCIeZfP5TnrJWl4a+ciJ3g1lTy HZ3MaqJxRguFuUJiX1uJoQCFCjNypyRZsqARZC2eqX6SXETTUnz4kDF6BO8NuQx9ahrr xv1sDCxdRm4eqSW1Dj9Z3fJob6T2sG6oIjzp44a9eTrzqStHr/2YdY2KeGtV0XZYUUf4 Vpdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results:reply-to:content-type:precedence :mailing-list:list-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe; bh=nRO6am0Nwu6LJylqndCFgMsa9G1ENg0LGbugiczaUlw=; b=lTZzbBuz2qoe+SUO6++f8MPNyNSbO34lsTn+fVJL/GHq3ZWQIdf/bzlh2K3QDaMLG4 wA10yRNJWoX2RNkTz5IGK7JR7yRphhkqtvDQ1pxp0n9ehPG8znXA5AjJ6hAaP22OSBzN VKV1F9CjpKq/J9oA9iA24kjZp8C4jdRWu9se+Ym0Mt0TqfSHVJUq7EHnFLVLj6EE58/r QUcus3z5C39IcyJBpmsUDsN0fz0BNA7826Dl/uGk17fB5snpGrUDI+ijAHb3etvah201 VoxZlnN5efpMynHeOuTkbRlEROpXduKH/AN+XAwxZWNCcXlRUR6MjTbJPWW/0rA/7AWy WK6Q== X-Received: by 10.152.4.104 with SMTP id j8mr183602laj.0.1431435509977; Tue, 12 May 2015 05:58:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.152.206.73 with SMTP id lm9ls32887lac.20.gmail; Tue, 12 May 2015 05:58:29 -0700 (PDT) X-Received: by 10.152.184.73 with SMTP id es9mr10592349lac.4.1431435509505; Tue, 12 May 2015 05:58:29 -0700 (PDT) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com. [74.125.82.42]) by gmr-mx.google.com with ESMTPS id ec7si92213wib.3.2015.05.12.05.58.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 05:58:29 -0700 (PDT) Received-SPF: pass (google.com: domain of lee.jones@linaro.org designates 74.125.82.42 as permitted sender) client-ip=74.125.82.42; Received: by mail-wg0-f42.google.com with SMTP id c8so8766444wgi.1 for ; Tue, 12 May 2015 05:58:29 -0700 (PDT) X-Gm-Message-State: ALoCoQksf5CyISCaUSsQfAnLAOFORLmp9QJw8F3vRZe30O17IPLFJldlQeUkK7qb4nWU3CJsfVji X-Received: by 10.194.85.116 with SMTP id g20mr30257704wjz.154.1431435509408; Tue, 12 May 2015 05:58:29 -0700 (PDT) Received: from localhost.localdomain (host81-129-169-99.range81-129.btcentralplus.com. [81.129.169.99]) by mx.google.com with ESMTPSA id k2sm2783057wix.4.2015.05.12.05.58.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 May 2015 05:58:28 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, daniel.lezcano@linaro.org, tglx@linutronix.de, wim@iguana.be, a.zummo@towertech.it, linux-watchdog@vger.kernel.org, rtc-linux@googlegroups.com, linux@roeck-us.net Cc: kernel@stlinux.com, Lee Jones Subject: [rtc-linux] [PATCH v2 03/12] clocksource: sti: Provide 'use timer as sched clock' capability Date: Tue, 12 May 2015 13:58:11 +0100 Message-Id: <1431435500-22899-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431435500-22899-1-git-send-email-lee.jones@linaro.org> References: <1431435500-22899-1-git-send-email-lee.jones@linaro.org> X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of lee.jones@linaro.org designates 74.125.82.42 as permitted sender) smtp.mail=lee.jones@linaro.org 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: , List-Unsubscribe: , Signed-off-by: Lee Jones Acked-by: Daniel Lezcano --- drivers/clocksource/clksrc_st_lpc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/clocksource/clksrc_st_lpc.c b/drivers/clocksource/clksrc_st_lpc.c index 1ad1714..90f5bb8 100644 --- a/drivers/clocksource/clksrc_st_lpc.c +++ b/drivers/clocksource/clksrc_st_lpc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -38,6 +39,11 @@ static void st_clksrc_reset(void) writel_relaxed(1, ddata.base + LPC_LPT_START_OFF); } +static u64 notrace st_clksrc_sched_clock_read(void) +{ + return (u64)readl_relaxed(ddata.base + LPC_LPT_LSB_OFF); +} + static int __init st_clksrc_init(void) { unsigned long rate; @@ -47,6 +53,8 @@ static int __init st_clksrc_init(void) rate = clk_get_rate(ddata.clk); + sched_clock_register(st_clksrc_sched_clock_read, 32, rate); + ret = clocksource_mmio_init(ddata.base + LPC_LPT_LSB_OFF, "clksrc-st-lpc", rate, 300, 32, clocksource_mmio_readl_up);