Message ID | 20230228135508.1798428-3-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 v21csp3031028wrd; Tue, 28 Feb 2023 06:04:27 -0800 (PST) X-Google-Smtp-Source: AK7set9gXJ/WjulLF1mzwYHbo8ks1JxLVtCTLW1EIUns6JjKsVpXkFr9tDr/od1rH0Z8REKM+wYO X-Received: by 2002:a17:906:aac4:b0:8b2:d30:e721 with SMTP id kt4-20020a170906aac400b008b20d30e721mr2440729ejb.71.1677593067097; Tue, 28 Feb 2023 06:04:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677593067; cv=none; d=google.com; s=arc-20160816; b=f+Aw8/8HmXqbdGg74HghCQxkWCKnErI42HFQL/XjfnQamfV6IunBZ5F7j3/4O+ZFl0 j50KhMYwK/NM5l/83B6X/fAZ0POK9JxafFpM+loFu2O5HkQzqHKfXMoCUFyysPB6OtT2 pfnuDlnZieBYbJKz97qGx03H9X+wTsfMbBiPfDFfzPZDi+gqfigDNyKDaFrETIVXX9AB vcpHliDGgyP4loYLnVfAOcArxuYqwOOmxYNCa68Sja3zc0ptnJ+Os0hTnGFmuJ3xO/KO 45PHOdwJ0H3lb1zJaSN6aS/iDWz/T5YqnwWh0Mh2sSgKKglEjcehRHX3xzOrz0gHAPpP msng== 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=Ufjb0v4UnoxULOv2ccC+TpLuvKf1/GUm5J1xrC1WJQM=; b=CZWr4Yab0q/hXnyAlrJ1qNtyb+Qg9ynTmtKVYbf+fCF05ICl3i9gbI/tWm+aPLDzqa G6D+jMLidSH8jSTyuAjae5QUbgoEFdNrQL7PGcNkqda2mRO4Mi+JmXp7x9n39iG9lDb+ 1wSYCXKiVjPI5OmaP/zLje5+PW/upzhsSCns5sDePif2o9Iu0899sFDHHTQB7t13nn6e vW+SL8uNYqP5uGEwWZC0gSAqWqmLf2ttcneQ4wDrRICerUNsGzonyaZ7LD+pD2fcbzJV JtFOL1957tLkxIdDvFiZgAsieK2ifNDqCggsbkMOB7Ldnqz+PtXJdLpLzhqaZ7L/SEj8 lS6w== 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 p6-20020a170906a00600b008b17e21e082si10810442ejy.295.2023.02.28.06.04.03; Tue, 28 Feb 2023 06:04:27 -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 S229758AbjB1Nzb (ORCPT <rfc822;brysonjbanks@gmail.com> + 99 others); Tue, 28 Feb 2023 08:55:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjB1Nz2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Feb 2023 08:55:28 -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 BC5681EBEF for <linux-kernel@vger.kernel.org>; Tue, 28 Feb 2023 05:55:27 -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-0007wv-33; 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 1pX0Rr-000sdC-Si; Tue, 28 Feb 2023 14:55:19 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1pX0Rr-0011dg-0Q; 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>, Benson Leung <bleung@chromium.org> Cc: Guenter Roeck <groeck@chromium.org>, linux-pwm@vger.kernel.org, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 2/4] pwm: cros-ec: Explicitly set .polarity in .get_state() Date: Tue, 28 Feb 2023 14:55:06 +0100 Message-Id: <20230228135508.1798428-3-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=749; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IAtiCGV0wRa2U+/PppANZkZKRqaD1N3SRiIodPKqHTk=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBj/gevfhS7IyOpnmkoKmE420NdX4odBQ8eZG4d2 I2ybrXNvZCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY/4HrwAKCRDB/BR4rcrs Ceq2B/9uCvaS+h95L+nfKjNahQfxtSyvPKw84Bl5AdHl2eN8Dy3mvqKAj725tx3O8JoslREBw4/ k1yU9cCbtDN000837fApwnhAo5parWgJLsStdKIuE8ddcjtwTFLlku5s7gtUkPT/DxCAb7pE9Wz jsltzncD+SOAQAJi2mZqE1GYrVMBTqUDc5JtB1RW/Z0H4/jq00y1p4T9i8Xxhy4N8LpYeax+Xnu gYp9kfIyT/KWyGBhbndnN+QCxFC8kgs03aonHEF8uflNO3hVQwOAnRJFqN3tLWwBnvZpZJaKOEf nuL3FO6V8tuHZwwslunaK8Ex15qdmjfaNLhFqXxRhVXOpWF1 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?1759083828282564883?= X-GMAIL-MSGID: =?utf-8?q?1759083828282564883?= |
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-cros-ec.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Tue, Feb 28, 2023 at 5:55 AM Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 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> Reviewed-by: Guenter Roeck <groeck@chromium.org> > --- > drivers/pwm/pwm-cros-ec.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c > index 86df6702cb83..ad18b0ebe3f1 100644 > --- a/drivers/pwm/pwm-cros-ec.c > +++ b/drivers/pwm/pwm-cros-ec.c > @@ -198,6 +198,7 @@ static int cros_ec_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, > > state->enabled = (ret > 0); > state->period = EC_PWM_MAX_DUTY; > + state->polarity = PWM_POLARITY_NORMAL; > > /* > * Note that "disabled" and "duty cycle == 0" are treated the same. If > -- > 2.39.1 >
On Tue, Feb 28, 2023 at 02:55:06PM +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: 1f0d3bb02785 ("pwm: Add ChromeOS EC PWM driver") Best regards Uwe
diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c index 86df6702cb83..ad18b0ebe3f1 100644 --- a/drivers/pwm/pwm-cros-ec.c +++ b/drivers/pwm/pwm-cros-ec.c @@ -198,6 +198,7 @@ static int cros_ec_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, state->enabled = (ret > 0); state->period = EC_PWM_MAX_DUTY; + state->polarity = PWM_POLARITY_NORMAL; /* * Note that "disabled" and "duty cycle == 0" are treated the same. If