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: 48363 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9C9E92121F for ; Tue, 12 May 2015 13:03:37 +0000 (UTC) Received: by layy10 with SMTP id y10sf1864139lay.0 for ; Tue, 12 May 2015 06:03:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=WqVXkuM7IvZRTQ30rOkhQjxZMe8Kmge63YF0Ov/6MEc=; b=LcQ2AcS0UihNO3NaUztT0EGaOExcLjLNqihknPZ7zUoQgsi6TIBHcoQ0uLgv1WdEuv YzB9ysjtB/dVcU7CUeOJ2JG65Ct3MWo0CJwXzeXUJ3P8Vy6dCsskJwd4cCdkEKu3fX9S zQTQ3WM/9GR2GnDv9TCIw174WiHcz4y5xTLH6sONJq1MbfBF0+FwBtmPayPD3Q+us/i9 miEhp17jOE+HiNyXx2EsyRSXq32yqutYjeVkr3HUD3IKmo4X54PtbB8DeMR47JocbPiv Lk64r2J0tZ9dKS0G7AHFhCqRYGRsP6OPHXSfYvj7V2zX+tZPRuAyyQbhlC7BcnnaYXoJ yzJQ== X-Gm-Message-State: ALoCoQkUFjh++5WGmbiHCB9lmaWprWPcXzKQFTVFqMonznq/pjgQlgaVvM3Mo5BJQokWyJ/U4ouy X-Received: by 10.112.93.203 with SMTP id cw11mr10678535lbb.0.1431435816545; Tue, 12 May 2015 06:03:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.101 with SMTP id i5ls25595laa.58.gmail; Tue, 12 May 2015 06:03:36 -0700 (PDT) X-Received: by 10.112.171.101 with SMTP id at5mr12110881lbc.66.1431435816297; Tue, 12 May 2015 06:03:36 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id yg6si10320237lbb.137.2015.05.12.06.03.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 06:03:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by layy10 with SMTP id y10so5232293lay.0 for ; Tue, 12 May 2015 06:03:36 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr3756303lak.117.1431435816169; Tue, 12 May 2015 06:03:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2077987lbb; Tue, 12 May 2015 06:03:35 -0700 (PDT) X-Received: by 10.70.102.11 with SMTP id fk11mr27783152pdb.144.1431435814195; Tue, 12 May 2015 06:03:34 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id lc15si22464279pab.25.2015.05.12.06.03.04; Tue, 12 May 2015 06:03:34 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933402AbbELNCU (ORCPT + 28 others); Tue, 12 May 2015 09:02:20 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:37646 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933160AbbELM6a (ORCPT ); Tue, 12 May 2015 08:58:30 -0400 Received: by widdi4 with SMTP id di4so14291815wid.0 for ; Tue, 12 May 2015 05:58:29 -0700 (PDT) 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: [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> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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);