Skip to contentSkip to conversation

Remove the IIO counter ABI

PATCH Applied William Breathitt Gray 2 participants 4 messages Jan 30, 2021

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH v2 1/2 counter: 104-quad-8: Remove IIO counter ABI

In reply to William Breathitt Gray

The IIO counter driver has been superseded by the Counter subsystem as discussed in [1]. This patch removes the IIO counter ABI from the 104-QUAD-8 driver.

[1] https://lore.kernel.org/lkml/[email protected]/

---
 .../testing/sysfs-bus-iio-counter-104-quad-8  | 133 ----
 MAINTAINERS                                   |   1 -
 drivers/counter/104-quad-8.c                  | 653 ++----------------
 drivers/counter/Kconfig                       |   2 +-
 4 files changed, 65 insertions(+), 724 deletions(-)
 delete mode 100644 Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8
Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8 deleted +0 -133
deleted file mode 100644
index bac3d0d48b7b..000000000000
@@ -1,133 +0,0 @@
-What:		/sys/bus/iio/devices/iio:deviceX/in_count_count_mode_available
-What:		/sys/bus/iio/devices/iio:deviceX/in_count_noise_error_available
-What:		/sys/bus/iio/devices/iio:deviceX/in_count_quadrature_mode_available
-What:		/sys/bus/iio/devices/iio:deviceX/in_index_index_polarity_available
-What:		/sys/bus/iio/devices/iio:deviceX/in_index_synchronous_mode_available
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Discrete set of available values for the respective counter
-		configuration are listed in this file.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_countY_count_mode
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Count mode for channel Y. Four count modes are available:
-		normal, range limit, non-recycle, and modulo-n. The preset value
-		for channel Y is used by the count mode where required.
-
-		Normal:
-			Counting is continuous in either direction.
-
-		Range Limit:
-			An upper or lower limit is set, mimicking limit switches
-			in the mechanical counterpart. The upper limit is set to
-			the preset value, while the lower limit is set to 0. The
-			counter freezes at count = preset when counting up, and
-			at count = 0 when counting down. At either of these
-			limits, the counting is resumed only when the count
-			direction is reversed.
-
-		Non-recycle:
-			Counter is disabled whenever a 24-bit count overflow or
-			underflow takes place. The counter is re-enabled when a
-			new count value is loaded to the counter via a preset
-			operation or write to raw.
-
-		Modulo-N:
-			A count boundary is set between 0 and the preset value.
-			The counter is reset to 0 at count = preset when
-			counting up, while the counter is set to the preset
-			value at count = 0 when counting down; the counter does
-			not freeze at the bundary points, but counts
-			continuously throughout.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_countY_noise_error
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Read-only attribute that indicates whether excessive noise is
-		present at the channel Y count inputs in quadrature clock mode;
-		irrelevant in non-quadrature clock mode.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_countY_preset
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		If the counter device supports preset registers, the preset
-		count for channel Y is provided by this attribute.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_countY_quadrature_mode
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Configure channel Y counter for non-quadrature or quadrature
-		clock mode. Selecting non-quadrature clock mode will disable
-		synchronous load mode. In quadrature clock mode, the channel Y
-		scale attribute selects the encoder phase division (scale of 1
-		selects full-cycle, scale of 0.5 selects half-cycle, scale of
-		0.25 selects quarter-cycle) processed by the channel Y counter.
-
-		Non-quadrature:
-			The filter and decoder circuit are bypassed. Encoder A
-			input serves as the count input and B as the UP/DOWN
-			direction control input, with B = 1 selecting UP Count
-			mode and B = 0 selecting Down Count mode.
-
-		Quadrature:
-			Encoder A and B inputs are digitally filtered and
-			decoded for UP/DN clock.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_countY_set_to_preset_on_index
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Whether to set channel Y counter with channel Y preset value
-		when channel Y index input is active, or continuously count.
-		Valid attribute values are boolean.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_indexY_index_polarity
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Active level of channel Y index input; irrelevant in
-		non-synchronous load mode.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_indexY_synchronous_mode
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Configure channel Y counter for non-synchronous or synchronous
-		load mode. Synchronous load mode cannot be selected in
-		non-quadrature clock mode.
-
-		Non-synchronous:
-			A logic low level is the active level at this index
-			input. The index function (as enabled via
-			set_to_preset_on_index) is performed directly on the
-			active level of the index input.
-
-		Synchronous:
-			Intended for interfacing with encoder Index output in
-			quadrature clock mode. The active level is configured
-			via index_polarity. The index function (as enabled via
-			set_to_preset_on_index) is performed synchronously with
-			the quadrature clock on the active level of the index
-			input.
MAINTAINERS +0 -1
index 546aa66428c9..f2d94e1f4032 100644
@@ -298,7 +298,6 @@ M:	Syed Nayyar Waris <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	Documentation/ABI/testing/sysfs-bus-counter-104-quad-8
-F:	Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8
 F:	drivers/counter/104-quad-8.c
 
 ACCES PCI-IDIO-16 GPIO DRIVER
drivers/counter/104-quad-8.c +64 -589

883 lines not on this page · raw message

drivers/counter/Kconfig +1 -1
index 2de53ab0dd25..63ffbebcf455 100644
@@ -14,7 +14,7 @@ if COUNTER
 
 config 104_QUAD_8
 	tristate "ACCES 104-QUAD-8 driver"
-	depends on PC104 && X86 && IIO
+	depends on PC104 && X86
 	select ISA_BUS_API
 	help
 	  Say yes here to build support for the ACCES 104-QUAD-8 quadrature
Signature · 1 line
2.30.0
#2 lore raw

PATCH v2 2/2 iio: Remove the IIO counter ABI documentation

In reply to William Breathitt Gray

The IIO counter driver has been superseded by the Counter subsystem as discussed in [1]. This patch removes the IIO counter ABI documentation.

[1] https://lore.kernel.org/lkml/[email protected]/

Cc Fabrice Gasnier <[email protected]>
Cc Benjamin Gaignard <[email protected]>
---
 Documentation/ABI/testing/sysfs-bus-iio | 40 -------------------------
 1 file changed, 40 deletions(-)
Documentation/ABI/testing/sysfs-bus-iio +0 -40
index d957f5da5c04..c207484a86d0 100644
@@ -1704,46 +1704,6 @@ Description:
 		Raw (unscaled no offset etc.) electric conductivity reading that
 		can be processed to siemens per meter.
 
-What:		/sys/bus/iio/devices/iio:deviceX/in_countY_raw
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Raw counter device counts from channel Y. For quadrature
-		counters, multiplication by an available [Y]_scale results in
-		the counts of a single quadrature signal phase from channel Y.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_indexY_raw
-KernelVersion:	4.10
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Raw counter device index value from channel Y. This attribute
-		provides an absolute positional reference (e.g. a pulse once per
-		revolution) which may be used to home positional systems as
-		required.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_count_count_direction_available
-KernelVersion:	4.12
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		A list of possible counting directions which are:
-
-		- "up"	: counter device is increasing.
-		- "down": counter device is decreasing.
-
-What:		/sys/bus/iio/devices/iio:deviceX/in_countY_count_direction
-KernelVersion:	4.12
-Contact:	[email protected]
-Description:
-		This interface is deprecated; please use the Counter subsystem.
-
-		Raw counter device counters direction for channel Y.
-
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_label
 What:		/sys/bus/iio/devices/iio:deviceX/out_voltageY_label
 KernelVersion:	5.8
Signature · 1 line
2.30.0
#0 lore raw

v2 cover Remove the IIO counter ABI

Changes in v2:
- Add missing argument to devm_kzalloc() call in quad8_probe().
- Remove superfluous 'err' variable from quad8_probe().

The IIO counter driver has been superseded by the Counter subsystem as discussed in [1]. This patchset removes the IIO counter ABI code and documentation.

A patch to remove the IIO counter ABI code from the stm32-lptimer-cnt counter driver has been submitted to the list separately [2]; if you would like me to combine it with this patchset, please let me know.

One final user of the IIO counter ABI code is still remaining for now:
drivers/iio/trigger/stm32-timer-trigger.c. Is this driver related to the drivers/counter/stm32-timer-cnt.c driver? Can it be migrated to the Counter subsystem ABI instead?

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://marc.info/?l=linux-arm-kernel&m=161192667926697

William Breathitt Gray (2):
counter: 104-quad-8: Remove IIO counter ABI
iio: Remove the IIO counter ABI documentation

 Documentation/ABI/testing/sysfs-bus-iio       |  40 --
 .../testing/sysfs-bus-iio-counter-104-quad-8  | 133 ----
 MAINTAINERS                                   |   1 -
 drivers/counter/104-quad-8.c                  | 653 ++----------------
 drivers/counter/Kconfig                       |   2 +-
 5 files changed, 65 insertions(+), 764 deletions(-)
 delete mode 100644 Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8
Signature · 1 line
2.30.0
maintainer Applied
#3 lore raw
Quoted 11 lines · On Sat, 30 Jan 2021 11:37:02 +0900 William Breathitt Gray…

Changes in v2:
- Add missing argument to devm_kzalloc() call in quad8_probe().
- Remove superfluous 'err' variable from quad8_probe().

The IIO counter driver has been superseded by the Counter subsystem as discussed in [1]. This patchset removes the IIO counter ABI code and documentation.

A patch to remove the IIO counter ABI code from the stm32-lptimer-cnt counter driver has been submitted to the list separately [2]; if you would like me to combine it with this patchset, please let me know.

No problem, I've already picked that one.

Quoted 5 lines

One final user of the IIO counter ABI code is still remaining for now:
drivers/iio/trigger/stm32-timer-trigger.c. Is this driver related to the drivers/counter/stm32-timer-cnt.c driver? Can it be migrated to the Counter subsystem ABI instead?

I'm going to guess that we could probably drop the iio_dev part of the stm32-timer-trigger entirely, though I'm not totally sure so wouldn't be confident doing it without someone having hardware to test. In particular there may be some connections between whether the device is enabled and the triggers working that isn't documented anywhere that I can spot.

Whilst that's still in place, I'm going to pick up patch 1 of this set, but leave patch 2. The ABI is clearly marked deprecated so we shouldn't get new users and we can pick up that patch hwen the stm32-timer-trigger has been tidied up as well.

Applied patch 1. Thanks,

Jonathan

Quoted 16 lines

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://marc.info/?l=linux-arm-kernel&m=161192667926697

William Breathitt Gray (2):
counter: 104-quad-8: Remove IIO counter ABI
iio: Remove the IIO counter ABI documentation

 Documentation/ABI/testing/sysfs-bus-iio       |  40 --
 .../testing/sysfs-bus-iio-counter-104-quad-8  | 133 ----
 MAINTAINERS                                   |   1 -
 drivers/counter/104-quad-8.c                  | 653 ++----------------
 drivers/counter/Kconfig                       |   2 +-
 5 files changed, 65 insertions(+), 764 deletions(-)
 delete mode 100644 Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8