Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2041126ybv; Sun, 23 Feb 2020 21:23:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwxuI0kRCaio7woIFMsFfzqbz2ks239AgyehjSlKFmcUMwo06XwtHYldiR5xxhLG9WAhDMC X-Received: by 2002:a05:6808:618:: with SMTP id y24mr10831668oih.86.1582521785429; Sun, 23 Feb 2020 21:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582521785; cv=none; d=google.com; s=arc-20160816; b=iJE6JVFSl9kWqVfHyJ/Nu32K6wUj5lE6/Fqx0OSv5dQrjBLcxz2zrHxuW8jBWUhSJN y9/b3PYpDhmj5xnOReVNT4nWu0po2GKnJ0k+rnzfMUO7c4KNBYcw0y07TkK26OuNgRTT sh88U5zmySuMp90B/xGIlWoNhLzK1VrQZD07cGXI6hqzz+6G0t9d3gE20z3a6Ez8m6ri ej0BgZCv/XMNQ8CiDqmcmgFuf4fvm1ATxkFiErpYp9mBKLrDajSEaR7c0cfkAZo0dp0Z alnN5Kuizgvh+sYS/pyjpDwWBhlyHmex7Sk8PRKlGhmSD+AHFTi7k+5vCiMcrwfKcxv5 euJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ub/AkC4hs4nhHqp695yVuvYgShg1yFbpNjw0ND9BGFs=; b=QT11TtDk/6bjO+KAMUmyzagFEChCW8mMuDr+5Q6shvAgX+DMROy/429ksLaReMOKN7 bJY1Le07Y0Y8+1f5dkDhiKOYSoWR+mliUd6kmrw4hM9Wv4wKt+2swLXAfLYu7uR4ly7k sXv9wcCv4p13jWfsytZsTKX6x57HxTDmwNEIrIon/PQa6TYLzX08oZyiF4LseHp4guhl Jye+hARW2e2ihwM+JZjwwrwTztNtdneqDA7Df55QgxcBp5qeBE8YatWIzX03wJ+wKKUU L+IiAzdKNp464YN+OV81x4rwbZzIBPOpTrVTtgRVYTP1umFdaGKu8r3Gk6281RJlAsGZ /8Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=P1AOjG0S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si5657156otk.120.2020.02.23.21.22.53; Sun, 23 Feb 2020 21:23:05 -0800 (PST) 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; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=P1AOjG0S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727282AbgBXFWp (ORCPT + 99 others); Mon, 24 Feb 2020 00:22:45 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:33618 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727267AbgBXFWo (ORCPT ); Mon, 24 Feb 2020 00:22:44 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 01O5McIS008110; Sun, 23 Feb 2020 23:22:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1582521758; bh=ub/AkC4hs4nhHqp695yVuvYgShg1yFbpNjw0ND9BGFs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=P1AOjG0SSSkR2d9+ntppckjA5xVxxCXWEaNpg1S4WWfmjhF0R57sIqt6vRj81kX1f No85l72baHonoJNFi86DaDod4Kr6xVR2cj2do4IdVYKZoZg5nBMMWQCZWS3pGY0wyb Z/sXWOMGRfeTjTzt5YDgxYRRDvaoDX8FzXWwHCNg= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 01O5McwX114243; Sun, 23 Feb 2020 23:22:38 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Sun, 23 Feb 2020 23:22:38 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Sun, 23 Feb 2020 23:22:38 -0600 Received: from uda0131933.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 01O5MPN7012421; Sun, 23 Feb 2020 23:22:35 -0600 From: Lokesh Vutla To: Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= CC: Tony Lindgren , Linux OMAP Mailing List , , , Sekhar Nori , Lokesh Vutla Subject: [PATCH 3/4] pwm: omap-dmtimer: Do not disable pwm before changing period/duty_cycle Date: Mon, 24 Feb 2020 10:51:34 +0530 Message-ID: <20200224052135.17278-4-lokeshvutla@ti.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200224052135.17278-1-lokeshvutla@ti.com> References: <20200224052135.17278-1-lokeshvutla@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only the Timer control register(TCLR) can be updated only when the timer is stopped. Registers like Counter register(TCRR), loader register(TLDR), match register(TMAR) can be updated when the counter is running. Since TCLR is not updated in pwm_omap_dmtimer_config(), do not stop the timer for period/duty_cycle update. Signed-off-by: Lokesh Vutla --- drivers/pwm/pwm-omap-dmtimer.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c index f13be7216847..58c61559e72f 100644 --- a/drivers/pwm/pwm-omap-dmtimer.c +++ b/drivers/pwm/pwm-omap-dmtimer.c @@ -102,7 +102,6 @@ static int pwm_omap_dmtimer_config(struct pwm_chip *chip, u32 load_value, match_value; struct clk *fclk; unsigned long clk_rate; - bool timer_active; dev_dbg(chip->dev, "requested duty cycle: %d ns, period: %d ns\n", duty_ns, period_ns); @@ -178,25 +177,12 @@ static int pwm_omap_dmtimer_config(struct pwm_chip *chip, load_value = (DM_TIMER_MAX - period_cycles) + 1; match_value = load_value + duty_cycles - 1; - /* - * We MUST stop the associated dual-mode timer before attempting to - * write its registers, but calls to omap_dm_timer_start/stop must - * be balanced so check if timer is active before calling timer_stop. - */ - timer_active = pm_runtime_active(&omap->dm_timer_pdev->dev); - if (timer_active) - omap->pdata->stop(omap->dm_timer); - omap->pdata->set_load(omap->dm_timer, true, load_value); omap->pdata->set_match(omap->dm_timer, true, match_value); dev_dbg(chip->dev, "load value: %#08x (%d), match value: %#08x (%d)\n", load_value, load_value, match_value, match_value); - /* If config was called while timer was running it must be reenabled. */ - if (timer_active) - pwm_omap_dmtimer_start(omap); - mutex_unlock(&omap->mutex); return 0; -- 2.23.0