Skip to contentSkip to conversation

arm: mach-orion5x: ts78xx: simplify support configuration with table

PATCH In review Alex Tran 2 participants 2 messages Oct 12, 2025 – Oct 13, 2025

Subsystems (4)
lore
Share & tools
lore

Alex Tran

author
#0 lore raw

PATCH 1/1 arm: mach-orion5x: ts78xx: simplify support configuration with table

Replace switch statement based configuration with a lookup table approach. The table is iterated through matching the correct configuration instead of setting the configuration on a case by case basis.

---
 arch/arm/mach-orion5x/ts78xx-fpga.h  |  7 ++++
 arch/arm/mach-orion5x/ts78xx-setup.c | 60 +++++++++++++++-------------
 2 files changed, 40 insertions(+), 27 deletions(-)
arch/arm/mach-orion5x/ts78xx-fpga.h +7 -0
index 2f4fe3ca5c1a..e35c63382b4c 100644
@@ -40,3 +40,10 @@ struct ts78xx_fpga_data {
 
 	struct fpga_devices	supports;
 };
+
+struct ts78xx_fpga_support_config {
+	u32 id;
+	bool rtc_present;
+	bool nand_present;
+	bool rng_present;
+};
arch/arm/mach-orion5x/ts78xx-setup.c +33 -27

75 lines not on this page · raw message

Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 3 lines · Alex Tran

Replace switch statement based configuration with a lookup table approach. The table is iterated through matching the correct configuration instead of setting the configuration on a case by case basis.

Is there anything actually wrong with the current code?

How did you test this? Do you have a tx78xx?

The only changes made to this file in the last decade have been tree wide changes. So unless you have one of these machines and intend to add new features, i suggest you just leave this alone, it is just needles churn to an ancient platform.

Andrew