diff options
| author | Guilherme Ivo Bozi <guilherme.bozi@usp.br> | 2026-05-12 21:31:52 -0300 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-05-31 10:59:41 +0100 |
| commit | 43a66cae2e9dc97b309a296deb141a9b3446eb1a (patch) | |
| tree | 2ad3b8ff95f0467c6fa13c6d06d936ecd7e0aa12 /tools/perf/scripts/python/parallel-perf.py | |
| parent | f3c1ef2bca5c128b62b5b804a50ad3f6f64a3098 (diff) | |
iio: adc: xilinx-ams: refactor alarm mapping to table-driven approach
Replace multiple open-coded switch statements that map between
scan_index, alarm bits, and register offsets with a centralized
table-driven approach.
Introduce a struct-based alarm_map to describe the relationship
between scan indices and alarm offsets, and add a helper to
translate scan_index to event IDs. This removes duplicated logic
across ams_get_alarm_offset(), ams_event_to_channel(), and
ams_get_alarm_mask().
The new approach improves maintainability, reduces code size,
and makes it easier to extend or modify alarm mappings in the
future, while preserving existing behavior.
Signed-off-by: Guilherme Ivo Bozi <guilherme.bozi@usp.br>
Reviewed-by: Salih Erim <salih.erim@amd.com>
Tested-by: Salih Erim <salih.erim@amd.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions
