Commit a34e035
spi: spi-imx: fix mixing of native and gpio chipselects for imx51/imx53/imx6 variants
Commit 87c6141 (spi: spi-imx: fix MX51_ECSPI_* macros when cs >
3) ensured that the argument passed to the macros was masked with &3,
so that we no longer write outside the intended fields in the various
control registers. When all chip selects are gpios, this works just
fine.
However, when a mix of native and gpio chip selects are in use, that
masking is too naive. Say, for example, that SS0 is muxed as native
chip select, and there is also a chip at 4 (obviously with a gpio
cs). In that case, when accessing the latter chip, both the SS0 pin
and the gpio pin will be asserted low.
The fix for this is to use the ->unused_native_cs value as channel
number for any spi device which uses a gpio as chip select.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lore.kernel.org/r/20230602115731.708883-1-linux@rasmusvillemoes.dk
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 20c475d commit a34e035
1 file changed
Lines changed: 22 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
520 | 527 | | |
521 | 528 | | |
522 | 529 | | |
| |||
527 | 534 | | |
528 | 535 | | |
529 | 536 | | |
| 537 | + | |
530 | 538 | | |
531 | 539 | | |
532 | 540 | | |
| |||
541 | 549 | | |
542 | 550 | | |
543 | 551 | | |
544 | | - | |
| 552 | + | |
545 | 553 | | |
546 | 554 | | |
547 | 555 | | |
| |||
562 | 570 | | |
563 | 571 | | |
564 | 572 | | |
565 | | - | |
| 573 | + | |
566 | 574 | | |
567 | | - | |
| 575 | + | |
568 | 576 | | |
569 | 577 | | |
570 | | - | |
571 | | - | |
| 578 | + | |
| 579 | + | |
572 | 580 | | |
573 | | - | |
574 | | - | |
| 581 | + | |
| 582 | + | |
575 | 583 | | |
576 | 584 | | |
577 | 585 | | |
578 | | - | |
| 586 | + | |
579 | 587 | | |
580 | | - | |
| 588 | + | |
581 | 589 | | |
582 | 590 | | |
583 | | - | |
| 591 | + | |
584 | 592 | | |
585 | | - | |
| 593 | + | |
586 | 594 | | |
587 | 595 | | |
588 | 596 | | |
| |||
627 | 635 | | |
628 | 636 | | |
629 | 637 | | |
| 638 | + | |
630 | 639 | | |
631 | 640 | | |
632 | 641 | | |
633 | 642 | | |
634 | 643 | | |
635 | | - | |
| 644 | + | |
636 | 645 | | |
637 | | - | |
| 646 | + | |
638 | 647 | | |
639 | 648 | | |
640 | 649 | | |
| |||
0 commit comments