Commit 34cbf87
net: dsa: mt7530: Use GPIO polarity to generate correct reset sequence
The MT7530/MT7531 reset pin is active-low in hardware, but the driver
historically hardcoded a high-active reset sequence by toggling the GPIO
as 0 → 1. This only worked because several DTS files incorrectly marked
the reset GPIO as active-high, making both DTS and driver wrong in the
same way.
This patch changes the driver to respect the GPIO polarity using
gpiod_is_active_low(), and generates the reset sequence as:
assert = drive logical active level
deassert = drive logical inactive level
As a result, both cases now correctly produce the required
high → low → high transition on the actual reset pin.
Compatibility
-------------
This change makes the driver fully backward-compatible with older,
incorrect DTS files that marked the reset line as GPIO_ACTIVE_HIGH:
* Old DTS marked active-high:
is_active_low = 0
driver drives 0 → 1
actual levels: high → low → high (correct)
* New DTS marked active-low:
is_active_low = 1
driver drives 1 → 0
actual levels: high → low → high (correct)
Therefore, regardless of whether a DTS is old or new, correct or
incorrect, the driver now generates the correct electrical reset pulse.
Going forward, DTS files should use GPIO_ACTIVE_LOW to match the
hardware, but no regressions will occur with older DTS blobs.
Signed-off-by: Chen Minqiang <[email protected]>1 parent 827f4e3 commit 34cbf87
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2405 | 2405 | | |
2406 | 2406 | | |
2407 | 2407 | | |
2408 | | - | |
| 2408 | + | |
| 2409 | + | |
2409 | 2410 | | |
2410 | | - | |
| 2411 | + | |
2411 | 2412 | | |
2412 | 2413 | | |
2413 | 2414 | | |
| |||
2643 | 2644 | | |
2644 | 2645 | | |
2645 | 2646 | | |
2646 | | - | |
| 2647 | + | |
| 2648 | + | |
2647 | 2649 | | |
2648 | | - | |
| 2650 | + | |
2649 | 2651 | | |
2650 | 2652 | | |
2651 | 2653 | | |
| |||
0 commit comments