Skip to content

Commit 4d0565a

Browse files
committed
pinctrl: qcom: establish proper EBI2 pin groups
After some digging around I found documentation (!) of the APQ8060 EBI2 pin groups. It turns out I first need to split the group in two: ebi2cs and ebi2 proper. The chip select pins are kind of orthogonal to the other EBI2 pins since CS1B and CS2B can be muxed over address bits 7 and 6 (don't know why, but they can). This is good to fix up before we add users. Also found what the "holes" in the assignment all the way up to gpio158 was actually for. All mux documentation comes from "Snapdragon(TM) S3 APQ8060-based DragonBoard(TM) GPIO User Guide Rev. E August 10, 2012", published by Bsquare Corporation. As the documentation seems a bit hard to come by I put some comments in the group definitions so that it is clear to all readers what is going on here and what the lines are used for. Cc: Björn Andersson <[email protected]> Cc: Stephen Boyd <[email protected]> Reviewed-by: Andy Gross <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 8229bcf commit 4d0565a

File tree

1 file changed

+46
-22
lines changed

1 file changed

+46
-22
lines changed

drivers/pinctrl/qcom/pinctrl-msm8660.c

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ enum msm8660_functions {
506506
MSM_MUX_usb_fs2_oe_n,
507507
MSM_MUX_vfe,
508508
MSM_MUX_vsens_alarm,
509+
MSM_MUX_ebi2cs,
509510
MSM_MUX_ebi2,
510511
MSM_MUX__,
511512
};
@@ -697,13 +698,35 @@ static const char * const vfe_groups[] = {
697698
static const char * const vsens_alarm_groups[] = {
698699
"gpio127"
699700
};
701+
static const char * const ebi2cs_groups[] = {
702+
"gpio39", /* CS1A */
703+
"gpio40", /* CS2A */
704+
"gpio123", /* CS1B */
705+
"gpio124", /* CS2B */
706+
"gpio131", /* CS5 */
707+
"gpio132", /* CS4 */
708+
"gpio133", /* CS3 */
709+
"gpio134", /* CS0 */
710+
};
700711
static const char * const ebi2_groups[] = {
701-
"gpio39", "gpio40", "gpio123", "gpio124", "gpio125", "gpio126",
702-
"gpio127", "gpio128", "gpio129", "gpio130", "gpio132", "gpio133",
703-
"gpio134", "gpio135", "gpio136", "gpio137", "gpio138", "gpio139",
704-
"gpio140", "gpio141", "gpio142", "gpio143", "gpio144", "gpio145",
705-
"gpio146", "gpio147", "gpio148", "gpio149", "gpio150", "gpio151",
706-
"gpio153", "gpio157"
712+
/* ADDR9 & ADDR8 */
713+
"gpio37", "gpio38",
714+
/* ADDR7 - ADDR 0 */
715+
"gpio123", "gpio124", "gpio125", "gpio126",
716+
"gpio127", "gpio128", "gpio129", "gpio130",
717+
/* (muxed address+data) AD15 - AD0 */
718+
"gpio135", "gpio136", "gpio137", "gpio138", "gpio139",
719+
"gpio140", "gpio141", "gpio142", "gpio143", "gpio144",
720+
"gpio145", "gpio146", "gpio147", "gpio148", "gpio149",
721+
"gpio150",
722+
"gpio151", /* OE output enable */
723+
"gpio152", /* clock */
724+
"gpio153", /* ADV */
725+
"gpio154", /* WAIT (input) */
726+
"gpio155", /* UB Upper Byte Enable */
727+
"gpio156", /* LB Lower Byte Enable */
728+
"gpio157", /* WE Write Enable */
729+
"gpio158", /* busy */
707730
};
708731

709732
static const struct msm_function msm8660_functions[] = {
@@ -758,7 +781,8 @@ static const struct msm_function msm8660_functions[] = {
758781
FUNCTION(usb_fs2_oe_n),
759782
FUNCTION(vfe),
760783
FUNCTION(vsens_alarm),
761-
FUNCTION(ebi2),
784+
FUNCTION(ebi2cs), /* for EBI2 chip selects */
785+
FUNCTION(ebi2), /* for general EBI2 pins */
762786
};
763787

764788
static const struct msm_pingroup msm8660_groups[] = {
@@ -799,10 +823,10 @@ static const struct msm_pingroup msm8660_groups[] = {
799823
PINGROUP(34, gsbi1, _, _, _, _, _, _),
800824
PINGROUP(35, gsbi1, _, _, _, _, _, _),
801825
PINGROUP(36, gsbi1, _, _, _, _, _, _),
802-
PINGROUP(37, gsbi2, _, _, _, _, _, _),
803-
PINGROUP(38, gsbi2, _, _, _, _, _, _),
804-
PINGROUP(39, gsbi2, ebi2, mdp_vsync, _, _, _, _),
805-
PINGROUP(40, gsbi2, ebi2, _, _, _, _, _),
826+
PINGROUP(37, gsbi2, ebi2, _, _, _, _, _),
827+
PINGROUP(38, gsbi2, ebi2, _, _, _, _, _),
828+
PINGROUP(39, gsbi2, ebi2cs, mdp_vsync, _, _, _, _),
829+
PINGROUP(40, gsbi2, ebi2cs, _, _, _, _, _),
806830
PINGROUP(41, gsbi3, mdp_vsync, _, _, _, _, _),
807831
PINGROUP(42, gsbi3, vfe, _, _, _, _, _),
808832
PINGROUP(43, gsbi3, _, _, _, _, _, _),
@@ -885,18 +909,18 @@ static const struct msm_pingroup msm8660_groups[] = {
885909
PINGROUP(120, i2s, _, _, _, _, _, _),
886910
PINGROUP(121, i2s, _, _, _, _, _, _),
887911
PINGROUP(122, i2s, gp_clk_1b, _, _, _, _, _),
888-
PINGROUP(123, ebi2, gsbi2_spi_cs1_n, _, _, _, _, _),
889-
PINGROUP(124, ebi2, gsbi2_spi_cs2_n, _, _, _, _, _),
912+
PINGROUP(123, ebi2, gsbi2_spi_cs1_n, ebi2cs, _, _, _, _),
913+
PINGROUP(124, ebi2, gsbi2_spi_cs2_n, ebi2cs, _, _, _, _),
890914
PINGROUP(125, ebi2, gsbi2_spi_cs3_n, _, _, _, _, _),
891915
PINGROUP(126, ebi2, _, _, _, _, _, _),
892916
PINGROUP(127, ebi2, vsens_alarm, _, _, _, _, _),
893917
PINGROUP(128, ebi2, _, _, _, _, _, _),
894918
PINGROUP(129, ebi2, _, _, _, _, _, _),
895919
PINGROUP(130, ebi2, _, _, _, _, _, _),
896-
PINGROUP(131, _, _, _, _, _, _, _),
897-
PINGROUP(132, ebi2, _, _, _, _, _, _),
898-
PINGROUP(133, ebi2, _, _, _, _, _, _),
899-
PINGROUP(134, ebi2, _, _, _, _, _, _),
920+
PINGROUP(131, ebi2cs, _, _, _, _, _, _),
921+
PINGROUP(132, ebi2cs, _, _, _, _, _, _),
922+
PINGROUP(133, ebi2cs, _, _, _, _, _, _),
923+
PINGROUP(134, ebi2cs, _, _, _, _, _, _),
900924
PINGROUP(135, ebi2, _, _, _, _, _, _),
901925
PINGROUP(136, ebi2, _, _, _, _, _, _),
902926
PINGROUP(137, ebi2, _, _, _, _, _, _),
@@ -914,13 +938,13 @@ static const struct msm_pingroup msm8660_groups[] = {
914938
PINGROUP(149, ebi2, sdc2, _, _, _, _, _),
915939
PINGROUP(150, ebi2, sdc2, _, _, _, _, _),
916940
PINGROUP(151, ebi2, sdc2, _, _, _, _, _),
917-
PINGROUP(152, _, sdc2, _, _, _, _, _),
941+
PINGROUP(152, ebi2, sdc2, _, _, _, _, _),
918942
PINGROUP(153, ebi2, _, _, _, _, _, _),
919-
PINGROUP(154, _, _, _, _, _, _, _),
920-
PINGROUP(155, _, _, _, _, _, _, _),
921-
PINGROUP(156, _, _, _, _, _, _, _),
943+
PINGROUP(154, ebi2, _, _, _, _, _, _),
944+
PINGROUP(155, ebi2, _, _, _, _, _, _),
945+
PINGROUP(156, ebi2, _, _, _, _, _, _),
922946
PINGROUP(157, ebi2, _, _, _, _, _, _),
923-
PINGROUP(158, _, _, _, _, _, _, _),
947+
PINGROUP(158, ebi2, _, _, _, _, _, _),
924948
PINGROUP(159, sdc1, _, _, _, _, _, _),
925949
PINGROUP(160, sdc1, _, _, _, _, _, _),
926950
PINGROUP(161, sdc1, _, _, _, _, _, _),

0 commit comments

Comments
 (0)