Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2991443imu; Sun, 9 Dec 2018 14:29:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/XKTLt7q4xDi1q61qLgfvY1ls1BI+JS+MidMROEHTH4w4GkECwJ/pBKou7D0NQCC8EJ0/Ee X-Received: by 2002:a63:e302:: with SMTP id f2mr9003741pgh.320.1544394585385; Sun, 09 Dec 2018 14:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544394585; cv=none; d=google.com; s=arc-20160816; b=j04GMwdAfhYWiJzhJUEVdSTZySsXD2JAhGpGz0KA0xkXApu2ypvnCRE9AkJ5IXdYFG G5YVK+XoPNcn360WdAchdpPhfVMhcgHJ4lO4vB4J7pofTPajap6IKyXo7rp0PASijtlp wXCYfIgwrYvnWDUL7T0pqS3uSGE9TM/O5YiJj+shn7KNFpEdUcXLErTuskdv/Xf1DDyC xbbybBxt56JeX6mVf1p+cbM/NNCG6epPDKZnurRVqo/0UrelQRUICAaYxmLQbNSxBV4/ +gFbGFU5FiE8e2qQax2/5061uXbTK2RwhB9bH5NL+7NE+Zaknv/J6BgusXM9oSevRDzP oPww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=dumRBrktZdOloBr1fO0E8g8tOQtCL3pBaDuOodJXNzA=; b=JSoA8uLwM4wQKY1Z0G6HPHM2qCmHVUSk7i+1W1BOGB4I3vwTERwENu+yPWrcISHpEl yMeR/B6yRo9jS8hWkfg1HFUzYBFYb/17CQMl47Z87xhDRBH/pmF1VhMVnhoSO8N8NUNf xMQn1Qhea2Se0J8PIdodKkAMYfTqB2cj9VCjmck/cGg8a/20GV2hRV0MFhkKjKxsFfD6 boHRTsRasV9Vg/iv/0UxyJ63jdQmZB1baMk3M2K1GIA0JXB/JRj6RYF2zZWCOXcS+tnY aKNcx8y4Cb7JftwrN/IZtosN5/HJRNt9dJZbluPp5+C0Rbsk5Ft7QW46KtSLTOrv4L/T 4j7A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v30si7841434pga.45.2018.12.09.14.29.30; Sun, 09 Dec 2018 14:29:45 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728803AbeLIW1E (ORCPT + 99 others); Sun, 9 Dec 2018 17:27:04 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34706 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbeLIVzM (ORCPT ); Sun, 9 Dec 2018 16:55:12 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW72b-0002iY-Ln; Sun, 09 Dec 2018 21:55:09 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72Z-0003Ek-41; Sun, 09 Dec 2018 21:55:07 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Vignesh R" , "Thierry Reding" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 033/328] pwm: tiehrpwm: Don't use emulation mode bits to control PWM output In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Vignesh R commit aa49d628f6e016bcec8c6f8e704b9b18ee697329 upstream. As per AM335x TRM SPRUH73P "15.2.2.11 ePWM Behavior During Emulation", TBCTL[15:14] only have effect during emulation suspend events (IOW, to stop PWM when debugging using a debugger). These bits have no effect on PWM output during normal running of system. Hence, remove code accessing these bits as they have no role in enabling/disabling PWMs. Fixes: 19891b20e7c2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM") Signed-off-by: Vignesh R Signed-off-by: Thierry Reding [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- --- a/drivers/pwm/pwm-tiehrpwm.c +++ b/drivers/pwm/pwm-tiehrpwm.c @@ -35,10 +35,6 @@ #define TBCTL 0x00 #define TBPRD 0x0A -#define TBCTL_RUN_MASK (BIT(15) | BIT(14)) -#define TBCTL_STOP_NEXT 0 -#define TBCTL_STOP_ON_CYCLE BIT(14) -#define TBCTL_FREE_RUN (BIT(15) | BIT(14)) #define TBCTL_PRDLD_MASK BIT(3) #define TBCTL_PRDLD_SHDW 0 #define TBCTL_PRDLD_IMDT BIT(3) @@ -357,7 +353,7 @@ static int ehrpwm_pwm_enable(struct pwm_ /* Channels polarity can be configured from action qualifier module */ configure_polarity(pc, pwm->hwpwm); - /* Enable TBCLK before enabling PWM device */ + /* Enable TBCLK */ ret = clk_enable(pc->tbclk); if (ret) { dev_err(chip->dev, "Failed to enable TBCLK for %s\n", @@ -365,8 +361,6 @@ static int ehrpwm_pwm_enable(struct pwm_ return ret; } - /* Enable time counter for free_run */ - ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_FREE_RUN); return 0; } @@ -396,9 +390,6 @@ static void ehrpwm_pwm_disable(struct pw /* Disabling TBCLK on PWM disable */ clk_disable(pc->tbclk); - /* Stop Time base counter */ - ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_STOP_NEXT); - /* Disable clock on PWM disable */ pm_runtime_put_sync(chip->dev); }