From patchwork Mon May 31 04:46:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Beranek X-Patchwork-Id: 12288651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A00FDC47082 for ; Mon, 31 May 2021 04:49:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 630436100A for ; Mon, 31 May 2021 04:49:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 630436100A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=prusa3d.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G9j4g/Vz8cv8bhnbsqun7T99Yg1DeUflScXA6/48Lw4=; b=CvCb0F1W4wXqc4 GdFTxDYXEycoSoSowvr8yuI/KMgSv1NYGXg4eNanj3GrRkiW/J5fOdvbLUid/amg7j0uxsYmuNFPi GIj0LeDEaXadinlyKxHqVXwF20iSI6n57rx4iO3OZIYZHfTgM8bLuUDJUfiz88nF/wWjB88RrM+nx QN1DEAPXjiVh0nokXHwWZKyHj20C3mrLBJmAfS1pK3N8YEw9cGwo7YJgsVtfb0z6yLHrz9du2Fvcw Q+tbbXA7ti6cSkWUCN30jns7IwXJa6yDLoLRcJtUWzUV5P7uFV3i2XtNNdK9Idazl0Yx9MEVxVm4Y IH61N+HYONzKUc/5BK1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnZq9-00AjdY-1E; Mon, 31 May 2021 04:47:49 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnZom-00AjJ8-8B for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 04:46:25 +0000 Received: by mail-ed1-x530.google.com with SMTP id b17so12025928ede.0 for ; Sun, 30 May 2021 21:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prusa3d-cz.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QVg7Hdl4/ZVFOwC3zdm+BtLAL/F8bdjWGF9QT4YTdO4=; b=OD5S65QZS3iZyC4Zwlx2TkaDHQa6IzCi9DD8krUyi0osNRlwD/CF+7Q22MY+oOnnJa lvo3pxndm9A+HqC/jvsLwMOrRpROf7oKOXPOzzcmmbdUG0asCnUy9LRmZXj+W3vcreqM fqERsSCercBb8Dk0Y3aU/PfdrqFGpLFWS/VHgzV+IrcZGrDXL0YpQnPw2+kN2gTYRuPK IAjoRdliJBA64SgjMWpXknEfJZ5nkL4Mw3h1pxIhAyc8jRYY3cHnzh8HccH7csXR543C RseTB3a3ChOqipdWlv40xL5tFgkjznFX+XTnqDeELDLrqNmzKpN2C0zXeuSnAbRoeScb /JMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QVg7Hdl4/ZVFOwC3zdm+BtLAL/F8bdjWGF9QT4YTdO4=; b=fJcY5oVxq60VodC1ZKDTnzsNHI88898hJXGceZWKBkk+uZRJLxFYy+WwU3SYzKv/az SAjXLQC8CkRRt588PiIedLx6aBc9EP8DjQ8Opqs0R1872S+nkGn5QuyzZ+1lf6FwPMfH 6ndGws98XBoO11hOzT0fltg6OIURKCA/jMnm/E5OEIvhUaLT+t1WM1lyxDO/ynBLN57X 0F9kf7aHe82tqepJLzc6aP8p9LFl7m+WnCEPlpQ2JSWlmNAZpef7oLT09tJqU4gIK4Ha FWq3ZRG+zCAT4yaiGJYGETIOFF8+ipOkbLCgMStKJngiZPzmpW2a1sgfDyRikwBv+3E2 2RUQ== X-Gm-Message-State: AOAM5324dikis/i8La0LB5SAgwFYSI2IxY37gbp/iJ55Z7ShZw4iA24I J5sastP/MOm+RhB3Dht2qTDDvw== X-Google-Smtp-Source: ABdhPJxsQ+/nHjpVQtyAxvH1LPlS/MyEUURoxZBF/XAqcXhXjL3TGweCjrGnBsD78Gk8GZai/gBaIg== X-Received: by 2002:a05:6402:b8c:: with SMTP id cf12mr23173772edb.61.1622436383155; Sun, 30 May 2021 21:46:23 -0700 (PDT) Received: from zen.local (ip-89-103-215-157.net.upcbroadband.cz. [89.103.215.157]) by smtp.gmail.com with ESMTPSA id h9sm6238376edt.18.2021.05.30.21.46.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 May 2021 21:46:22 -0700 (PDT) From: Roman Beranek X-Google-Original-From: Roman Beranek To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Cc: Thierry Reding , Emil Lenngren , Pascal Roeleven , Lee Jones , Maxime Ripard , Chen-Yu Tsai , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-sunxi@googlegroups.com Subject: [PATCH 6/6] pwm: sun4i: don't delay if the PWM is already off Date: Mon, 31 May 2021 06:46:08 +0200 Message-Id: <20210531044608.1006024-7-roman.beranek@prusa3d.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531044608.1006024-1-roman.beranek@prusa3d.com> References: <20210531044608.1006024-1-roman.beranek@prusa3d.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210530_214624_311722_C7763E7B X-CRM114-Status: GOOD ( 13.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Roman Beranek --- drivers/pwm/pwm-sun4i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c index 6ab06b9749d0..88bd90498d1f 100644 --- a/drivers/pwm/pwm-sun4i.c +++ b/drivers/pwm/pwm-sun4i.c @@ -304,7 +304,7 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, sun4i_pwm_writel(sun4i_pwm, ctrl, PWM_CTRL_REG); - if (state->enabled) { + if (state->enabled || !cstate.enabled) { mutex_unlock(&sun4i_pwm->ctrl_lock); return 0; }