From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 15A6AC4332F for ; Fri, 17 Sep 2021 07:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7186611EE for ; Fri, 17 Sep 2021 07:28:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240172AbhIQH3Z (ORCPT ); Fri, 17 Sep 2021 03:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240199AbhIQH3X (ORCPT ); Fri, 17 Sep 2021 03:29:23 -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 DAB55C0613CF for ; Fri, 17 Sep 2021 00:28:01 -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 1mR8Ht-0006D4-G5; Fri, 17 Sep 2021 09:27:57 +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.92) (envelope-from ) id 1mR8Hr-0006Xr-8F; Fri, 17 Sep 2021 09:27:55 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mR8Hr-0004PR-6m; Fri, 17 Sep 2021 09:27:55 +0200 Date: Fri, 17 Sep 2021 09:27:55 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Linus Walleij Cc: "D, Lakshmi Sowjanya" , "thierry.reding@gmail.com" , Lee Jones , "open list:PWM SUBSYSTEM" , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , linux-kernel , Mark Gross , Andy Shevchenko , "Saha, Tamal" , bala.senthil@intel.com, Dipen Patel Subject: Re: [RFC PATCH v1 07/20] gpio: Add output event generation method to GPIOLIB and PMC Driver Message-ID: <20210917072755.d4ynxkp4scxrk6rq@pengutronix.de> References: <20210824164801.28896-1-lakshmi.sowjanya.d@intel.com> <20210824164801.28896-8-lakshmi.sowjanya.d@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="riqk2pxwp7ut5zxn" 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org --riqk2pxwp7ut5zxn Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, On Thu, Sep 16, 2021 at 11:42:04PM +0200, Linus Walleij wrote: > Hi Lakshmi, >=20 > On Tue, Aug 24, 2021 at 6:48 PM wrote: >=20 > > From: Lakshmi Sowjanya D > > > > Intel Timed I/O hardware supports output scheduled in hardware. Enable > > this functionality using GPIOlib > > > > Adds GPIOlib generate_output() hook into the driver. The driver is > > supplied with a timestamp in terms of realtime system clock (the same > > used for input timestamping). The driver must know how to translate this > > into a timebase meaningful for the hardware. > > > > Adds userspace write() interface. Output can be selected using the line > > event create ioctl. The write() interface takes a single timestamp > > event request parameter. An output edge rising or falling is generated > > for each event request. > > > > The user application supplies a trigger time in terms of the realtime > > clock the driver converts this into the corresponding ART clock value > > that is used to 'arm' the output. > > > > Work around device quirk that doesn't allow the output to be explicitly > > set. Instead, count the output edges and insert an additional edge as > > needed to reset the output to zero. > > > > Co-developed-by: Christopher Hall > > Signed-off-by: Christopher Hall > > Signed-off-by: Tamal Saha > > Signed-off-by: Lakshmi Sowjanya D > > Reviewed-by: Mark Gross >=20 > So this is some street organ machine that generates sequences > with determined timing between positive and negative edges > right? >=20 > I can't see how this hardware is different from a PWM, or well > I do to some extent, you can control the period of several > subsequent waves, but that is really just an elaborate version > of PWM in my book. =46rom looking in the patch I think this is more versatile than the PWM framework abstracts. I wonder if there is a usecase for the functionality that cannot be expressed using pwm_apply_state?! I remember we had approaches before that implemented repeating patterns (something like: active for 5ms, inactive for 10 ms, active for 30 ms, inactive for 10 ms, repeat) and limiting the number of periods (something like: .duty_cycle =3D 5ms, .period =3D 20ms, after 5 periods go into inactive state). These were considered to be too special to be abstracted in drivers/pwm. > It seems to me that this part of the functionality belongs in the > PWM subsystem which already has interfaces for similar > things, and you should probably extend PWM to handle > random waveforms rather than trying to shoehorn this > into the GPIO subsystem. I agree that GPIO is a worse candidate than PWM to abstract that. But I'm not convinced (yet?) that it's a good idea to extend PWM accordingly. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --riqk2pxwp7ut5zxn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFEQ3cACgkQwfwUeK3K 7AnLYQf9GjzSXlKt9YzS04WE2zmEQ28c5pFcvP2AuC1KNzcI+jIIAdp5e4IUltNL U9n1Ghs7cUbiHNelhrSfCD3RYZU2uDJ8zyFa5gbQU2CYnNbDzQghefSWphfepB3s XABiqd7KSB8nV7ozZJjnA0Df8XDmPvZ7hJ7nOU3Fp19wW0qm28KJ+Dmof+8EzRf2 kd3QMMdzFZaHvMt14T5uYr205VdwYhZBVntnqNHoXBVMFGkwPhCx18fzZ+5LXBTW KcpveBgQPV7U2y9oXpGH7gsi85SfmpBQ+BCaDmSvfNQ6CXfBmClBFV1fUKfHxKsi AqZ/iyU9HybkRXEYZfJM6NnL4iE3Vw== =s0o9 -----END PGP SIGNATURE----- --riqk2pxwp7ut5zxn--