Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2255091pxb; Fri, 17 Sep 2021 06:00:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpXgKU05gQ/0xgVwtNmJngqP4D1zYhVxWsnoclZkUMUHR+lr0WrujN62Lwfhf95Dz9hNJ6 X-Received: by 2002:a6b:6b03:: with SMTP id g3mr892962ioc.218.1631883610041; Fri, 17 Sep 2021 06:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631883610; cv=none; d=google.com; s=arc-20160816; b=y8l26Lko5TruYzaqvKsUBxIqr9hdQzXQYzuF/3cP/3xWeJsW9jI7xtGx7Npk/z7Sxq qZlQ7QZy6IQPbkduvOWQzEstw+Vm1ojSoPXzwn8O9ILGOW5eWxQc/kBPcTs7kfc+MYlJ PuobJp2HmGh4elUSBxqdWA07KI6q2CCTbXcYGztj8yWMITr4IpCWw+r++a1reLexaYOv RVVcX+7OHnMMnjlNlRojA3yF1C6cCXIdjBx8Qal0TCuDw5ifsgpF4YR3YhEDfuffuZTt 98SRDKjBxm1rPDHiDKqkiuzwkCairGX097L2yMrUtuGc7clkVzm26lNr+lcEs44K+gLY 7Rjw== 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=/Gs4sh0F3XOSoM8DbIrzGXzKEtGdPnXelCHw2ioTC98=; b=XXa3SEeSy6bM492D1Q2VntoeDI58U7IBAS/tTy2Uz9w+CNO91f+Q3OKUrWYbopB37N i768CaOp2iDbVHesjJoqEurTRXJT8fecUNH2X2htfmIkERHtzIw5aDNgA0zHO7xwbk1l /u7lInZ7Cr+VyxgRiSBUSQDSbxMqopAOd5w/qZkcAogG5YAkebMjpzHi4ZNghlBwj7Bi x2Lrr/moTrAW4IXrph1qwdkLmbRNCkqvHptofxb4Lr2JhgcfNg1d634zBHzN67805IJ4 pXzWqOWONy8LBb8gXZ7zfJd6afMKzH/EOT5G9iy7F8zHURYZ4FAbOhIaKtLgWf+Awz0o bG8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si5994717iov.22.2021.09.17.05.59.57; Fri, 17 Sep 2021 06:00:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239766AbhIQH30 (ORCPT + 99 others); Fri, 17 Sep 2021 03:29:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240113AbhIQH3Z (ORCPT ); Fri, 17 Sep 2021 03:29:25 -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 9AE14C061574 for ; Fri, 17 Sep 2021 00:28:03 -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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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--