Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752497AbdLLJQj (ORCPT ); Tue, 12 Dec 2017 04:16:39 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:33968 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbdLLJQg (ORCPT ); Tue, 12 Dec 2017 04:16:36 -0500 X-Google-Smtp-Source: ACJfBouUoUQ4yJP3cPaj88UStkEtszn65bj0/F/mm9yMqnhyBp7I2w6eJPuWImwVs2JTGGD4Yo5FLA== Subject: Re: [PATCH v3 2/2] clocksource: sprd: Add timer driver for Spreadtrum SC9860 platform To: Baolin Wang Cc: Baolin Wang , Thomas Gleixner , Rob Herring , Mark Rutland , DTML , LKML , Mark Brown References: <1b80566bd849d68b0fc8de54ecbbc7b4efbb1077.1512708743.git.baolin.wang@spreadtrum.com> <05f19500-f8a3-7afc-a8d9-bcf0aff3e6bc@linaro.org> From: Daniel Lezcano Message-ID: <3c1da7bb-a380-072f-957d-221a6f177217@linaro.org> Date: Tue, 12 Dec 2017 10:16:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1177 Lines: 42 Hi Baolin, On 08/12/2017 09:20, Baolin Wang wrote: [ ... ] >>> +static irqreturn_t sprd_timer_interrupt(int irq, void *dev_id) >>> +{ >>> + struct clock_event_device *ce = (struct clock_event_device *)dev_id; >>> + struct timer_of *to = to_timer_of(ce); >>> + >>> + sprd_timer_clear_interrupt(timer_of_base(to)); >>> + >>> + if (clockevent_state_oneshot(ce)) >>> + sprd_timer_disable(timer_of_base(to)); >>> + >>> + ce->event_handler(ce); >>> + return IRQ_HANDLED; >>> +} >>> + >>> +static struct timer_of to = { >>> + .flags = TIMER_OF_IRQ | TIMER_OF_BASE, >> >> Why not the TIMER_OF_CLOCK ? > > The timer's clock is fixed to 32.768K and no need to divide the > frequency, so our clock tree does not supply the timer's clock now. The driver is fine. However, I would like to unify the clk usage in the timer driver, so if you refer to a clock so the TIMER_OF_CLOCK can be used, that will nice. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog