Skip to content

Commit a0cec28

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: sunrisepoint: Modify COMMUNITY macros to be consistent
Modify COMMUNITY macros to be consistent with Tiger Lake and others. No functional change intended. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Mika Westerberg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 701372c commit a0cec28

File tree

1 file changed

+27
-33
lines changed

1 file changed

+27
-33
lines changed

drivers/pinctrl/intel/pinctrl-sunrisepoint.c

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,35 @@
2222
#define SPT_GPI_IS 0x100
2323
#define SPT_GPI_IE 0x120
2424

25-
#define SPT_COMMUNITY(b, s, e) \
25+
#define SPT_COMMUNITY(b, s, e, pl, gs, gn, g, n) \
2626
{ \
2727
.barno = (b), \
2828
.padown_offset = SPT_PAD_OWN, \
29-
.padcfglock_offset = SPT_LP_PADCFGLOCK, \
29+
.padcfglock_offset = (pl), \
3030
.hostown_offset = SPT_HOSTSW_OWN, \
3131
.is_offset = SPT_GPI_IS, \
3232
.ie_offset = SPT_GPI_IE, \
33-
.gpp_size = 24, \
34-
.gpp_num_padown_regs = 4, \
33+
.gpp_size = (gs), \
34+
.gpp_num_padown_regs = (gn), \
3535
.pin_base = (s), \
3636
.npins = ((e) - (s) + 1), \
37+
.gpps = (g), \
38+
.ngpps = (n), \
3739
}
3840

39-
#define SPTH_GPP(r, s, e, g) \
41+
#define SPT_LP_COMMUNITY(b, s, e) \
42+
SPT_COMMUNITY(b, s, e, SPT_LP_PADCFGLOCK, 24, 4, NULL, 0)
43+
44+
#define SPT_H_GPP(r, s, e, g) \
4045
{ \
4146
.reg_num = (r), \
4247
.base = (s), \
4348
.size = ((e) - (s) + 1), \
4449
.gpio_base = (g), \
4550
}
4651

47-
#define SPTH_COMMUNITY(b, s, e, g) \
48-
{ \
49-
.barno = (b), \
50-
.padown_offset = SPT_PAD_OWN, \
51-
.padcfglock_offset = SPT_H_PADCFGLOCK, \
52-
.hostown_offset = SPT_HOSTSW_OWN, \
53-
.is_offset = SPT_GPI_IS, \
54-
.ie_offset = SPT_GPI_IE, \
55-
.pin_base = (s), \
56-
.npins = ((e) - (s) + 1), \
57-
.gpps = (g), \
58-
.ngpps = ARRAY_SIZE(g), \
59-
}
52+
#define SPT_H_COMMUNITY(b, s, e, g) \
53+
SPT_COMMUNITY(b, s, e, SPT_H_PADCFGLOCK, 0, 0, g, ARRAY_SIZE(g))
6054

6155
/* Sunrisepoint-LP */
6256
static const struct pinctrl_pin_desc sptlp_pins[] = {
@@ -292,9 +286,9 @@ static const struct intel_function sptlp_functions[] = {
292286
};
293287

294288
static const struct intel_community sptlp_communities[] = {
295-
SPT_COMMUNITY(0, 0, 47),
296-
SPT_COMMUNITY(1, 48, 119),
297-
SPT_COMMUNITY(2, 120, 151),
289+
SPT_LP_COMMUNITY(0, 0, 47),
290+
SPT_LP_COMMUNITY(1, 48, 119),
291+
SPT_LP_COMMUNITY(2, 120, 151),
298292
};
299293

300294
static const struct intel_pinctrl_soc_data sptlp_soc_data = {
@@ -554,27 +548,27 @@ static const struct intel_function spth_functions[] = {
554548
};
555549

556550
static const struct intel_padgroup spth_community0_gpps[] = {
557-
SPTH_GPP(0, 0, 23, 0), /* GPP_A */
558-
SPTH_GPP(1, 24, 47, 24), /* GPP_B */
551+
SPT_H_GPP(0, 0, 23, 0), /* GPP_A */
552+
SPT_H_GPP(1, 24, 47, 24), /* GPP_B */
559553
};
560554

561555
static const struct intel_padgroup spth_community1_gpps[] = {
562-
SPTH_GPP(0, 48, 71, 48), /* GPP_C */
563-
SPTH_GPP(1, 72, 95, 72), /* GPP_D */
564-
SPTH_GPP(2, 96, 108, 96), /* GPP_E */
565-
SPTH_GPP(3, 109, 132, 120), /* GPP_F */
566-
SPTH_GPP(4, 133, 156, 144), /* GPP_G */
567-
SPTH_GPP(5, 157, 180, 168), /* GPP_H */
556+
SPT_H_GPP(0, 48, 71, 48), /* GPP_C */
557+
SPT_H_GPP(1, 72, 95, 72), /* GPP_D */
558+
SPT_H_GPP(2, 96, 108, 96), /* GPP_E */
559+
SPT_H_GPP(3, 109, 132, 120), /* GPP_F */
560+
SPT_H_GPP(4, 133, 156, 144), /* GPP_G */
561+
SPT_H_GPP(5, 157, 180, 168), /* GPP_H */
568562
};
569563

570564
static const struct intel_padgroup spth_community3_gpps[] = {
571-
SPTH_GPP(0, 181, 191, 192), /* GPP_I */
565+
SPT_H_GPP(0, 181, 191, 192), /* GPP_I */
572566
};
573567

574568
static const struct intel_community spth_communities[] = {
575-
SPTH_COMMUNITY(0, 0, 47, spth_community0_gpps),
576-
SPTH_COMMUNITY(1, 48, 180, spth_community1_gpps),
577-
SPTH_COMMUNITY(2, 181, 191, spth_community3_gpps),
569+
SPT_H_COMMUNITY(0, 0, 47, spth_community0_gpps),
570+
SPT_H_COMMUNITY(1, 48, 180, spth_community1_gpps),
571+
SPT_H_COMMUNITY(2, 181, 191, spth_community3_gpps),
578572
};
579573

580574
static const struct intel_pinctrl_soc_data spth_soc_data = {

0 commit comments

Comments
 (0)