From patchwork Thu Jun 18 10:54:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50035 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DA02722903 for ; Thu, 18 Jun 2015 11:04:22 +0000 (UTC) Received: by laar3 with SMTP id r3sf7956325laa.1 for ; Thu, 18 Jun 2015 04:04:21 -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: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=8wg8jCU7gIJskPLHWRoYQy4XDU4eog5KF44oCd7vjbE=; b=AeZQLC7ixhbQRSepfsCx4NJDzvaGeIxT9ROLtp2or5H6yR0jTZE0yUJAWo7oM2NjbB wGJW7uYhVR0X3XRLZBhr/92zVtj8Rz/aUy/aCy8U74pGvgnnLK7ONZ22AM64jIevYhAO /WOmRe4FJY/JjqUPFkkHF+9AbL+39nCLDyPoUbP3bOMSo84wRrR9Ln79JT4fNrN80UK3 2Fi7h8HHlabp/FDFjBDtnSnvWWTsMzLE1rVsXoWP3DCIrofWoZO9hMS+O2HbnU0EFHIE QLNLq84u12XNp9RiAUkuR/cDUqWF0BSFGn4XAPAJR6NaJhMylN/pIq5Pxd6/ltWmC9Gt 3Wvw== X-Gm-Message-State: ALoCoQm9T/Gj+La+0RdjBqEijeSOzQ95dWCwH8Bxm57tbbZFesQxS33+zJyPVwoKyGPHeMtGUWCl X-Received: by 10.180.89.231 with SMTP id br7mr12782390wib.0.1434625461878; Thu, 18 Jun 2015 04:04:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.71 with SMTP id t7ls475736lae.31.gmail; Thu, 18 Jun 2015 04:04:21 -0700 (PDT) X-Received: by 10.152.164.193 with SMTP id ys1mr12446586lab.65.1434625461619; Thu, 18 Jun 2015 04:04:21 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id n7si6197539lbs.61.2015.06.18.04.04.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 04:04:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbqq2 with SMTP id qq2so49774800lbb.3 for ; Thu, 18 Jun 2015 04:04:21 -0700 (PDT) X-Received: by 10.152.225.166 with SMTP id rl6mr12520842lac.36.1434625461162; Thu, 18 Jun 2015 04:04:21 -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 hn6csp1099401lbb; Thu, 18 Jun 2015 04:04:20 -0700 (PDT) X-Received: by 10.70.38.33 with SMTP id d1mr19821701pdk.99.1434625459365; Thu, 18 Jun 2015 04:04:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bu7si10921150pdb.22.2015.06.18.04.04.16; Thu, 18 Jun 2015 04:04:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932465AbbFRLEK (ORCPT + 30 others); Thu, 18 Jun 2015 07:04:10 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:34361 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932362AbbFRK4M (ORCPT ); Thu, 18 Jun 2015 06:56:12 -0400 Received: by pdbki1 with SMTP id ki1so64234745pdb.1 for ; Thu, 18 Jun 2015 03:56:11 -0700 (PDT) X-Received: by 10.68.69.98 with SMTP id d2mr20278212pbu.71.1434624971399; Thu, 18 Jun 2015 03:56:11 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id mq2sm7655590pbb.16.2015.06.18.03.56.10 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:56:10 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Tomasz Figa , Kukjin Kim Subject: [PATCH 19/41] clocksource: samsung_pwm: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:33 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: 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: viresh.kumar@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.217.176 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: , Migrate samsung_pwm driver to the new 'set-state' interface provided by clockevents core, the earlier 'set-mode' interface is marked obsolete now. This also enables us to implement callbacks for new states of clockevent devices, for example: ONESHOT_STOPPED. Cc: Tomasz Figa Cc: Kukjin Kim Signed-off-by: Viresh Kumar --- drivers/clocksource/samsung_pwm_timer.c | 41 +++++++++++++++------------------ 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c index 5645cfc90c41..bc90e13338cc 100644 --- a/drivers/clocksource/samsung_pwm_timer.c +++ b/drivers/clocksource/samsung_pwm_timer.c @@ -207,25 +207,18 @@ static int samsung_set_next_event(unsigned long cycles, return 0; } -static void samsung_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int samsung_shutdown(struct clock_event_device *evt) { samsung_time_stop(pwm.event_id); + return 0; +} - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - samsung_time_setup(pwm.event_id, pwm.clock_count_per_tick - 1); - samsung_time_start(pwm.event_id, true); - break; - - case CLOCK_EVT_MODE_ONESHOT: - break; - - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - case CLOCK_EVT_MODE_RESUME: - break; - } +static int samsung_set_periodic(struct clock_event_device *evt) +{ + samsung_time_stop(pwm.event_id); + samsung_time_setup(pwm.event_id, pwm.clock_count_per_tick - 1); + samsung_time_start(pwm.event_id, true); + return 0; } static void samsung_clockevent_resume(struct clock_event_device *cev) @@ -240,12 +233,16 @@ static void samsung_clockevent_resume(struct clock_event_device *cev) } static struct clock_event_device time_event_device = { - .name = "samsung_event_timer", - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .rating = 200, - .set_next_event = samsung_set_next_event, - .set_mode = samsung_set_mode, - .resume = samsung_clockevent_resume, + .name = "samsung_event_timer", + .features = CLOCK_EVT_FEAT_PERIODIC | + CLOCK_EVT_FEAT_ONESHOT, + .rating = 200, + .set_next_event = samsung_set_next_event, + .set_state_shutdown = samsung_shutdown, + .set_state_periodic = samsung_set_periodic, + .set_state_oneshot = samsung_shutdown, + .tick_resume = samsung_shutdown, + .resume = samsung_clockevent_resume, }; static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id)