]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dpll: zl3073x: detect DPLL channel count from chip ID at runtime
authorIvan Vecera <ivecera@redhat.com>
Fri, 27 Feb 2026 10:52:59 +0000 (11:52 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 3 Mar 2026 11:15:30 +0000 (12:15 +0100)
commit4845f2fff730f0cdf8f7fe6401c8b871891cf1cb
treeddebeadb4c29bf337d12a200aca11e3246124006
parent2b12ffb669553972f5cd017c69a2b81593b09106
dpll: zl3073x: detect DPLL channel count from chip ID at runtime

Replace the five per-variant zl3073x_chip_info structures and their
exported symbol definitions with a single consolidated chip ID lookup
table. The chip variant is now detected at runtime by reading the chip
ID register from hardware and looking it up in the table, rather than
being selected at compile time via the bus driver match data.

Repurpose struct zl3073x_chip_info to hold a single chip ID, its
channel count, and a flags field. Introduce enum zl3073x_flags with
ZL3073X_FLAG_REF_PHASE_COMP_32 to replace the chip_id switch statement
in zl3073x_dev_is_ref_phase_comp_32bit(). Store a pointer to the
detected chip_info entry in struct zl3073x_dev for runtime access.

This simplifies the bus drivers by removing per-variant .data and
.driver_data references from the I2C/SPI match tables, and makes
adding support for new chip variants a single-line table addition.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Link: https://patch.msgid.link/20260227105300.710272-2-ivecera@redhat.com
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/dpll/zl3073x/core.c
drivers/dpll/zl3073x/core.h
drivers/dpll/zl3073x/i2c.c
drivers/dpll/zl3073x/spi.c