Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3383422rwb; Fri, 30 Sep 2022 02:47:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7XHwA4nfzA0J4sa2Q0jJmPTezOy0ZfRhU5CcVoonZApDu4ybm5jc5KptoX8db2UzJKxAT/ X-Received: by 2002:a17:903:2451:b0:178:4423:af32 with SMTP id l17-20020a170903245100b001784423af32mr8197158pls.51.1664531260486; Fri, 30 Sep 2022 02:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664531260; cv=none; d=google.com; s=arc-20160816; b=fseowYvLEfbBRw9b50IYRxlbasybS+AvIOdMqSg+Xupe2/qLExtyDbE08s3NKtlDp8 Nvo33+cRG1q96hX6nFCOADbK+71hadowBGs7CgVqtlLjCCVekm0QFqzy6QbGVO6H7wBe h1x9w5BylGBXVG7pvK/sBS0KvHpQ5ql2Ch9s8xV/q9qgGTxJlrb63UrSCIAOsHyEt5Pd V+kUhTKSEAZB65G8v7AEk5MRv7jJtiU3zBw5vC+UUv5iUOfBhjdBJPwsxs8mgvnkEZbJ 6gO1EMOiMYGgTqQrhKqY1QnvCKoayTR0fpE7XoP3voCj8GnzxWQB5OG4uJZ0u1x4GAOq 33SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=DV4sC9LJmPyM3oQDg2JKp+FKFlQOhbtIOmQnJYO8tHU=; b=VWiEfAYzfEGPP52tDAHJkuAWzB3/uekuauSo6T78oAz3rmka8wsy4L7TSb0JxEES68 U03sZDK3bXrEzcXA/Aojm+53zXzhQqLfGtbKocfAXIrdZETTT189pAXqS8Ebk15KJ1je ckjst9g/R4bGeCPY0hybc5ank/Ba7lgGT2JslfQfFa905qcnssygDIjF0oJiLdJE7le4 4j1jzu8BccQxrY71ZwA+ZJ/qwVekxb0JEatpxFtgsnZ4s5ErvI7Ym/lc4tj1lB1SnwJj Q04cSOw39q9+tyPV98pxNsHapb8fj0Gv6M4eyFV8LZu7dUWpTpPS0VCLyJrWCye+tGhG UOkw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y21-20020a634b15000000b0043cc1b53e7dsi2391036pga.650.2022.09.30.02.47.28; Fri, 30 Sep 2022 02:47:40 -0700 (PDT) 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 S231341AbiI3JN3 (ORCPT + 99 others); Fri, 30 Sep 2022 05:13:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231331AbiI3JN1 (ORCPT ); Fri, 30 Sep 2022 05:13:27 -0400 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 DA7A314DAE1 for ; Fri, 30 Sep 2022 02:13:26 -0700 (PDT) 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 ) id 1oeC57-000471-U1; Fri, 30 Sep 2022 11:13:17 +0200 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 ) id 1oeC58-003m3N-E7; Fri, 30 Sep 2022 11:13:16 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oeC56-004YMC-Ar; Fri, 30 Sep 2022 11:13:16 +0200 Date: Fri, 30 Sep 2022 11:13:16 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Conor Dooley Cc: Thierry Reding , Rob Herring , Krzysztof Kozlowski , Daire McNamara , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v10 3/4] pwm: add microchip soft ip corePWM driver Message-ID: <20220930091316.kdkf4oeu6uvxzqa6@pengutronix.de> References: <20220824091215.141577-1-conor.dooley@microchip.com> <20220824091215.141577-4-conor.dooley@microchip.com> <20220915072152.y346csakn7wetpz5@pengutronix.de> <20220919135008.sahwmwbfwvgplji4@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mc44qmsettlbnrey" Content-Disposition: inline In-Reply-To: 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: X-Mailing-List: linux-kernel@vger.kernel.org --mc44qmsettlbnrey Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 19, 2022 at 03:29:19PM +0100, Conor Dooley wrote: > Hey Uwe, >=20 > On Mon, Sep 19, 2022 at 03:50:08PM +0200, Uwe Kleine-K=F6nig wrote: > > On Mon, Sep 19, 2022 at 01:53:56PM +0100, Conor Dooley wrote: > > > Because I was running into conflicts between the reporting here and s= ome > > > of the checks that I have added to prevent the PWM being put into an > > > invalid state. On boot both negedge and posedge will be zero & this w= as > > > preventing me from setting the period at all. > >=20 > > I don't understood that. >=20 > On startup, (negedge =3D=3D posedge) is true as both are zero, but the re= set > values for prescale and period are actually 0x8. If on reset I try to > set a small period, say "echo 1000 > period" apply() returns -EINVAL > because of a check in the pwm core in pwm_apply_state() as I am > attempting to set the period to lower than the out-of-reset duty cycle. You're supposed to keep the period for pwm#1 untouched while configuring pwm#0 only if pwm#1 already has a consumer. So if pwm#1 isn't requested, you can change the period for pwm#0. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --mc44qmsettlbnrey Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmM2sygACgkQwfwUeK3K 7AkzvAf5AVpy5bOQaZ0X+uV/8U5PrucuD6BKzlppGG7dlsaBLiSKKjzF+EAc5DKl 3zZ6Tlwuh9y/YEO55J30hnk6wZQmMGnVlStYfWyt3b7TB5EiT2sslvPnrUU50w9G zCOZwXUH4KLI3ubaIHNHA3RWxCjxtaumas2xmWTNwkRVVTKOA1JE9A2HOxyPd/09 MRzV6dx/nc8u/h0kuf3DekqvhRoHu17rxvd/x+mezVlY+einkpatKaFODCFYHHYo JxCLRhUEnJdeqqqpUB00FW7A+BAw+lyLXfx7CBAHWW+mc0e7wAH5tBATExeUCcl1 3nutfF6+YqiYarH75WEMvSxrXzz+4A== =nDLE -----END PGP SIGNATURE----- --mc44qmsettlbnrey--