Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1314246pxm; Thu, 3 Mar 2022 15:01:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3C7RimQgD60GZ0oZIrGRouh1AX/govuhfaL41RK6jpDg5Z4cdTPBDHNNZfk3eAQfR55C9 X-Received: by 2002:a17:907:7f05:b0:6d9:89e1:3032 with SMTP id qf5-20020a1709077f0500b006d989e13032mr8542567ejc.320.1646348512339; Thu, 03 Mar 2022 15:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646348512; cv=none; d=google.com; s=arc-20160816; b=GzteQshkNcIVSxuL9jFBbfktsCQbZRjef+pvTS0hum1HUsF7LTsM38w+inbXye/pUK RhTf5swpqzKgP6kEg+nrRjZlIu4rcLliJ0rH1DBzTEt93uWmAHGR0GT6IMJ7lheJ8g68 hWSB1AqTtH5sVcheuKf8it/K9/YOCgmxoWASA3f8daY5GPN1Ta3Jfv7i3YBdq/LJ+juc K4hHpV/6C3SPIWnZQaXBMSLh9W+1J9wtPsiX1i64i0+3zwYiI3hRn9tr59wW6SqhhMrI JZwapvFOG5cqr219SXM6Lksh/6ExwJOwnPXW+kKkGHhgv67CCgyaZMUm1JoOPbyl0v/A juCA== 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=X00PBFgiI9sJT3xsm/outzD4rqHqwIudXh5LITUD0a0=; b=AhbWg3s2DTlgmTK40HH1nlzOBQ7b+9gS0fqj1SjMMXTksJPLsx4Lgos2mEdj8PZBUJ AHqHKj9apqzpHuujfqPKi2skp7If/l+8PrUuK2bv72FMc1N19HEPPNWVm/WanSvRP5cT nt6gdwMPANa+D7VYCr5+IF2u3Ah2xZ8BlSgAX2sBQ282FgnMDhh2KrlnIZW/K3/9qzw4 D68kOVdiqugiuxLzVWAzy8r5BO9h/CPg0KEkJC9ykBggzCnatu2TOL3J/avkabRWK2Uz Yrg4HgqTMnXD88aw/T8m/ygBIlOeFQzh/B2J9kKMmkzVlQ8xHXpXDP+yplTz+hL1e2ff Tl2Q== 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 jr3-20020a170906a98300b006c746eedf75si2157366ejb.442.2022.03.03.15.01.28; Thu, 03 Mar 2022 15:01:52 -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 S236873AbiCCW0k (ORCPT + 99 others); Thu, 3 Mar 2022 17:26:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235719AbiCCW0j (ORCPT ); Thu, 3 Mar 2022 17:26:39 -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 CA55C10CF22 for ; Thu, 3 Mar 2022 14:25:53 -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 ) id 1nPttM-0000xB-0x; Thu, 03 Mar 2022 23:25:48 +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 ) id 1nPttL-002Ugn-HZ; Thu, 03 Mar 2022 23:25:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nPttK-006nUd-1x; Thu, 03 Mar 2022 23:25:46 +0100 Date: Thu, 3 Mar 2022 23:25:42 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Sean Anderson Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, Thierry Reding , linux-arm-kernel@lists.infradead.org, Alvaro Gamez , Mubin Usman Sayyed , linux-kernel@vger.kernel.org, michal.simek@xilinx.com, Lee Jones Subject: Re: [PATCH v13 2/2] pwm: Add support for Xilinx AXI Timer Message-ID: <20220303222542.6ytwfp3bvm62igyy@pengutronix.de> References: <20220204180106.154000-1-sean.anderson@seco.com> <20220204180106.154000-2-sean.anderson@seco.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2xupj2groypst2wu" Content-Disposition: inline In-Reply-To: <20220204180106.154000-2-sean.anderson@seco.com> 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,T_SCC_BODY_TEXT_LINE 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 --2xupj2groypst2wu Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, just a few minor things left for me to criticise: On Fri, Feb 04, 2022 at 01:01:06PM -0500, Sean Anderson wrote: > [...] > + regmap_read(priv->map, TCSR1, &tcsr1); > + state->period =3D xilinx_timer_get_period(priv, tlr0, tcsr0); > + state->duty_cycle =3D xilinx_timer_get_period(priv, tlr1, tcsr1); > + state->enabled =3D xilinx_timer_pwm_enabled(tcsr0, tcsr1); > + state->polarity =3D PWM_POLARITY_NORMAL; > + > + /* > + * 100% duty cycle results in constant low output. This may be slightly > + * wrong if rate >=3D 1GHz, so fix this if you have such hardware :) > + */ I'd drop "slightly" here. If the bug happens (e.g. tlr0 =3D 999999999, tlr1 =3D 999999998, clkrate =3D 1000000001 Hz) then you diagnose a nearly 100% relative duty cycle as 0%. Also s/>=3D 1GHz/> 1 GHz/. > [...] > + if (one_timer) > + return dev_err_probe(dev, -EINVAL, > + "Two timers required for PWM mode\n"); > + > + One empty line here would be enough. > diff --git a/include/clocksource/timer-xilinx.h b/include/clocksource/tim= er-xilinx.h > new file mode 100644 > index 000000000000..1f7757b84a5e > --- /dev/null > +++ b/include/clocksource/timer-xilinx.h > @@ -0,0 +1,91 @@ > [...] > +/** > + * xilinx_timer_common_init() - Perform common initialization for Xilinx > + * AXI timer drivers. > + * @priv: The timer's private data > + * @np: The devicetree node for the timer > + * @one_timer: Set to %1 if there is only one timer > + * > + * This performs common initialization, such as detecting endianness, > + * and parsing devicetree properties. @priv->regs must be initialized > + * before calling this function. This function initializes @priv->read, > + * @priv->write, and @priv->width. > + * > + * Return: 0, or negative errno > + */ > +int xilinx_timer_common_init(struct device_node *np, > + struct xilinx_timer_priv *priv, > + u32 *one_timer); This function is gone, so the prototype should go away, too. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --2xupj2groypst2wu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmIhQGEACgkQwfwUeK3K 7AmcjQf/a7MAlCMNM5lvqiaw7OpFD0g8pNPNzdwtn4NNqLHkrBGt8g9ChE0ykucL l5cAGL1emH4+fkZvvpN98Iu5rGqQBm/KdudQVBDzEdgRM4BkryUkg8bBxrYmBVZE 7Ztg2o+k4XI8ojlEKJgI+YiNOXyKkjgoKzkbkjUkObCkCOpjfXDjtMFP4oUAIJJF GMCVZ9Ft+s3uzr7LOdh1TsSlJlPTGh/+Byt5V+wAI0uQlNGgTH/a1P8QyjusA1tm Pd2bnCZQORHEX9pnG/iagl1mZ6AHTbSAi5HrZWoN/uJuNEk+maRcrUsBdPR5cKEp XFQR/odrOWusqXXFu9i8MVQ+gA/nvg== =VoZb -----END PGP SIGNATURE----- --2xupj2groypst2wu--