Message ID | 20230228135508.1798428-5-u.kleine-koenig@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3030707wrd; Tue, 28 Feb 2023 06:04:03 -0800 (PST) X-Google-Smtp-Source: AK7set91bIFJki2oa/wh8Wysz99RfEp5RHLSpiK0auEL1gC3b9DGHGsri5/swt3ZTsEbuHAR5Wq1 X-Received: by 2002:a05:6402:356:b0:4ac:c6ca:b1f8 with SMTP id r22-20020a056402035600b004acc6cab1f8mr2916514edw.12.1677593043172; Tue, 28 Feb 2023 06:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677593043; cv=none; d=google.com; s=arc-20160816; b=TJlSCLONpuwP/Qw6ECd5jm3IrJFqLTFPVZODTHrCkaqT0uHOGbdRPUDOchqYLwMuo+ B2GWRtVs0BU0RpSyyI6QdHa7B+/en+xSEwPdjTV5hB9NPhdGL+a8qnp9mkC/b8nJPXCV LLrtgnlYjky9jupV/Zyvl3CRePM6T6VFMk5kei9KKAbnYLx/dZfvAJbypHKz7Yx5MJUG Q4P01vW355lDj0/ujt+72j6+OSv40ZO25C29frm8mkpe6tlkmOd5+tSzps5aM/3L+wPQ IB2f6YPfVA9W2xO3HiFn3Dp0ZGtbfhy6YNcfc4PPpd05mNeg3p0fC9QURUNGFGDc8uHY LKcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TU0IibZk81ON8uMC6969NrZx4EAjaeJxVnhw+jFgCgw=; b=MKy+bvoaCA84wjiXo8ghNXrnz3y4D3gSBllC7EyeVQgUqynvE8t+mgRK71UMTLR2Z2 uAiRzYxbd/unODjiLrD2DlwDUtPQ2vXVr9z0KRxYZPk/4c2Ap5KCTivtR76J/ymE+zOd Mf9VDb9bRVN1QwhjaR2fC2jVSpVS/v6YZ8u1WFpqtzAw4KTbdj9rBCGRSxmCM2U0H2e9 xDt1/WKEFDvOfaSK5RYnJvg0/EbUOX9r9NUqnGH/I4CT0HkwoEUQB/sSzCspTxVJFqr5 hYobgcjJQQvbHATPX/7CoK3teSNZDkaAnPpfJ0Z/w978PCzaujThCkHthAJMydFagINT 1JFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr37-20020a1709073fa500b008dd491949c6si3476372ejc.978.2023.02.28.06.03.38; Tue, 28 Feb 2023 06:04:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbjB1Nzd (ORCPT <rfc822;brysonjbanks@gmail.com> + 99 others); Tue, 28 Feb 2023 08:55:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbjB1Nza (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Feb 2023 08:55:30 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF482305FE for <linux-kernel@vger.kernel.org>; Tue, 28 Feb 2023 05:55:28 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <ukl@pengutronix.de>) id 1pX0Rt-0007wy-2Z; Tue, 28 Feb 2023 14:55:21 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1pX0Rs-000sdF-0S; Tue, 28 Feb 2023 14:55:20 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1pX0Rr-0011e4-CB; Tue, 28 Feb 2023 14:55:19 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Thierry Reding <thierry.reding@gmail.com>, Munehisa Kamata <kamatam@amazon.com>, Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com> Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 4/4] pwm: sprd: Explicitly set .polarity in .get_state() Date: Tue, 28 Feb 2023 14:55:08 +0100 Message-Id: <20230228135508.1798428-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230228135508.1798428-1-u.kleine-koenig@pengutronix.de> References: <20230228135508.1798428-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=824; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bmf2HoXP9Rt5LT3z0AtFgY3qIfAp4/hwx1OXH8EwlFw=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBj/ge2KHuAInQ+QDahQS2YY03DGST7KS6YuYIAG cCGk1az48GJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY/4HtgAKCRDB/BR4rcrs CbNsB/9xAqs3WfLL+n74CI2B0P7vOauSZIUEMz7vuNJ1o8YDjSnmlkDtdJr4LA7olD3QWLXFyG2 QzZJSGsglYbR8rn87eemML3a8r3wiDlqeInSg4C1Ol5U9vDQLlOijd3c4BwWuKDDJCgzCt05Adi fVkCwABcaQteeTcFE3bwoLhFk14vTzmoGtp8Lb5teawf22xNNDd45/vAolptfbuFSv1s2qHKRP6 gT9zP4OIVm/x2QRC0/aH/tzfBI1zTQy6G55Az274UHAktxCPGvZmh3KM6KCC6ngEmfDXR99MF3w Q0DwLe7vriTk0Gly0sx2tEe9u84tUscrbYL3+Uh6Q88FCDR8 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759083802694712695?= X-GMAIL-MSGID: =?utf-8?q?1759083802694712695?= |
Series |
pwm: Ensure .polarity is set in .get_state()
|
|
Commit Message
Uwe Kleine-König
Feb. 28, 2023, 1:55 p.m. UTC
The driver only supports normal polarity. Complete the implementation of
.get_state() by setting .polarity accordingly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/pwm/pwm-sprd.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Tue, Feb 28, 2023 at 02:55:08PM +0100, Uwe Kleine-König wrote: > The driver only supports normal polarity. Complete the implementation of > .get_state() by setting .polarity accordingly. > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> I think we should apply this patch as a fix to prevent similar failures as reported for the meson driver. To justify that: Fixes: 8aae4b02e8a6 ("pwm: sprd: Add Spreadtrum PWM support") Best regards Uwe
diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c index d866ce345f97..bde579a338c2 100644 --- a/drivers/pwm/pwm-sprd.c +++ b/drivers/pwm/pwm-sprd.c @@ -109,6 +109,7 @@ static int sprd_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, duty = val & SPRD_PWM_DUTY_MSK; tmp = (prescale + 1) * NSEC_PER_SEC * duty; state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate); + state->polarity = PWM_POLARITY_NORMAL; /* Disable PWM clocks if the PWM channel is not in enable state. */ if (!state->enabled)