devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: ad74413r: allow setting sink current for digital input
@ 2023-03-02 13:49 Rasmus Villemoes
  2023-03-02 13:49 ` [PATCH 1/2] dt-bindings: " Rasmus Villemoes
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Rasmus Villemoes @ 2023-03-02 13:49 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Cosmin Tanislav,
	Jonathan Cameron, linux-iio, linux-kernel
  Cc: devicetree, Rob Herring, Rasmus Villemoes

Depending on the actual hardware wired up to a digital input channel,
it may be necessary to configure the ad74413r to sink a small
current. For example, in the case of a simple mechanical switch, the
charge on the external 68 nF capacitor (cf. the data sheet's Figure
34) will keep the channel as reading high even after the switch is
turned off again.

Add a DT binding and driver support for setting the desired sink current.

I have chosen the term "drive strength" because it matches existing
practice, even if this is only a sink. E.g. there's

 * @PIN_CONFIG_DRIVE_STRENGTH_UA: the pin will sink or source at most the current
 *      passed as argument. The argument is in uA.

and indeed it would be trivial to hook up that
PIN_CONFIG_DRIVE_STRENGTH_UA in ad74413r_gpio_set_comp_config().

However, unlike the debounce time, there does not appear to be any way
to actually tweak the drive strength from userspace, nor do I know if
that would actually be a good idea. For our application(s), the
current sink needed is a property of the attached hardware, and thus
can and should be defined in DT.

Rasmus Villemoes (2):
  dt-bindings: iio: ad74413r: allow setting sink current for digital
    input
  iio: ad74413r: wire up support for drive-strength-microamp property

 .../bindings/iio/addac/adi,ad74413r.yaml      | 10 ++++++++
 drivers/iio/addac/ad74413r.c                  | 24 +++++++++++++++++++
 2 files changed, 34 insertions(+)

-- 
2.37.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-03-12 15:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-02 13:49 [PATCH 0/2] iio: ad74413r: allow setting sink current for digital input Rasmus Villemoes
2023-03-02 13:49 ` [PATCH 1/2] dt-bindings: " Rasmus Villemoes
2023-03-02 14:24   ` Rob Herring
2023-03-02 13:49 ` [PATCH 2/2] iio: ad74413r: wire up support for drive-strength-microamp property Rasmus Villemoes
2023-03-03 15:14   ` Jonathan Cameron
2023-03-06  9:42 ` [PATCH v2 0/2] iio: ad74413r: allow setting sink current for digital input Rasmus Villemoes
2023-03-06  9:43   ` [PATCH v2 1/2] dt-bindings: " Rasmus Villemoes
2023-03-07  8:53     ` Krzysztof Kozlowski
2023-03-06  9:43   ` [PATCH v2 2/2] iio: ad74413r: wire up support for drive-strength-microamp property Rasmus Villemoes
2023-03-12 15:48   ` [PATCH v2 0/2] iio: ad74413r: allow setting sink current for digital input Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).