Skip to content

Commit 5ab4909

Browse files
committed
Merge tag 'intel-pinctrl-v6.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel
intel-pinctrl for v6.3-1 * Add ~4kOhm bias support to Intel pin control drivers * Convert Intel pin control drivers to use INTEL_COMMUNITY_*() * Add struct pinfunction and use it in Intel pin control drivers * Make pin control documentation up to date * Miscellaneous cleanups The following is an automated git shortlog grouped by driver: pinctrl: - Proofreading and updating the documentation accordingly - Proofreading and updating the documentation (part 2) alderlake: - Replace ADL_COMMUNITY() by INTEL_COMMUNITY_GPPS() baytrail: - Convert to use new memeber in struct intel_function broxton: - Replace BXT_COMMUNITY() by INTEL_COMMUNITY_SIZE() cannonlake: - Replace CNL_COMMUNITY() by INTEL_COMMUNITY_GPPS() cedarfork: - Replace CDF_COMMUNITY() by INTEL_COMMUNITY_GPPS() cherryview: - Convert to use new memeber in struct intel_function denverton: - Replace DNV_COMMUNITY() by INTEL_COMMUNITY_GPPS() elkhartlake: - Replace EHL_COMMUNITY() by INTEL_COMMUNITY_GPPS() emmitsburg: - Replace EBG_COMMUNITY() by INTEL_COMMUNITY_GPPS() geminilake: - Replace GLK_COMMUNITY() by INTEL_COMMUNITY_SIZE() icelake: - Replace ICL_COMMUNITY() by INTEL_COMMUNITY_GPPS() intel: - Get rid of unused members in struct intel_function - Make use of struct pinfunction and PINCTRL_PINFUNCTION() - Define maximum pad number in the group - Use same order of bit fields for PADCFG2 - Add ~4k bias support - Add definitions to all possible biases - Deduplicate some code in intel_config_set_pull() - Add default case to intel_config_set_pull() - Convert to generic_handle_domain_irq() - Always use gpp_num_padown_regs in the main driver - Introduce INTEL_COMMUNITY_*() to unify community macros Introduce struct pinfunction and PINCTRL_PINFUNCTION() macro: - Introduce struct pinfunction and PINCTRL_PINFUNCTION() macro jasperlake: - Replace JSL_COMMUNITY() by INTEL_COMMUNITY_GPPS() lakefield: - Replace LKF_COMMUNITY() by INTEL_COMMUNITY_GPPS() lewisburg: - Replace LBG_COMMUNITY() by INTEL_COMMUNITY_SIZE() lynxpoint: - Convert to use new memeber in struct intel_function merrifield: - Convert to use new memeber in struct intel_function meteorlake: - Replace MTL_COMMUNITY() by INTEL_COMMUNITY_GPPS() moorefield: - Convert to use new memeber in struct intel_function sunrisepoint: - Replace SPT_COMMUNITY() by INTEL_COMMUNITY_*() tigerlake: - Replace TGL_COMMUNITY() by INTEL_COMMUNITY_GPPS()
2 parents 19a2c39 + 88f8ac4 commit 5ab4909

24 files changed

+440
-570
lines changed

Documentation/driver-api/pin-control.rst

Lines changed: 243 additions & 255 deletions
Large diffs are not rendered by default.

drivers/pinctrl/intel/pinctrl-alderlake.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,11 @@
3434
.gpio_base = (g), \
3535
}
3636

37-
#define ADL_COMMUNITY(b, s, e, g, v) \
38-
{ \
39-
.barno = (b), \
40-
.padown_offset = ADL_##v##_PAD_OWN, \
41-
.padcfglock_offset = ADL_##v##_PADCFGLOCK, \
42-
.hostown_offset = ADL_##v##_HOSTSW_OWN, \
43-
.is_offset = ADL_##v##_GPI_IS, \
44-
.ie_offset = ADL_##v##_GPI_IE, \
45-
.pin_base = (s), \
46-
.npins = ((e) - (s) + 1), \
47-
.gpps = (g), \
48-
.ngpps = ARRAY_SIZE(g), \
49-
}
50-
5137
#define ADL_N_COMMUNITY(b, s, e, g) \
52-
ADL_COMMUNITY(b, s, e, g, N)
38+
INTEL_COMMUNITY_GPPS(b, s, e, g, ADL_N)
5339

5440
#define ADL_S_COMMUNITY(b, s, e, g) \
55-
ADL_COMMUNITY(b, s, e, g, S)
41+
INTEL_COMMUNITY_GPPS(b, s, e, g, ADL_S)
5642

5743
/* Alder Lake-N */
5844
static const struct pinctrl_pin_desc adln_pins[] = {

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -637,18 +637,18 @@ static const char *byt_get_function_name(struct pinctrl_dev *pctldev,
637637
{
638638
struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev);
639639

640-
return vg->soc->functions[selector].name;
640+
return vg->soc->functions[selector].func.name;
641641
}
642642

643643
static int byt_get_function_groups(struct pinctrl_dev *pctldev,
644644
unsigned int selector,
645645
const char * const **groups,
646-
unsigned int *num_groups)
646+
unsigned int *ngroups)
647647
{
648648
struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev);
649649

650-
*groups = vg->soc->functions[selector].groups;
651-
*num_groups = vg->soc->functions[selector].ngroups;
650+
*groups = vg->soc->functions[selector].func.groups;
651+
*ngroups = vg->soc->functions[selector].func.ngroups;
652652

653653
return 0;
654654
}
@@ -722,7 +722,7 @@ static int byt_set_mux(struct pinctrl_dev *pctldev, unsigned int func_selector,
722722

723723
if (group.modes)
724724
byt_set_group_mixed_mux(vg, group, group.modes);
725-
else if (!strcmp(func.name, "gpio"))
725+
else if (!strcmp(func.func.name, "gpio"))
726726
byt_set_group_simple_mux(vg, group, BYT_DEFAULT_GPIO_MUX);
727727
else
728728
byt_set_group_simple_mux(vg, group, group.mode);

drivers/pinctrl/intel/pinctrl-broxton.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,8 @@
2020
#define BXT_GPI_IS 0x100
2121
#define BXT_GPI_IE 0x110
2222

23-
#define BXT_COMMUNITY(s, e) \
24-
{ \
25-
.padown_offset = BXT_PAD_OWN, \
26-
.padcfglock_offset = BXT_PADCFGLOCK, \
27-
.hostown_offset = BXT_HOSTSW_OWN, \
28-
.is_offset = BXT_GPI_IS, \
29-
.ie_offset = BXT_GPI_IE, \
30-
.gpp_size = 32, \
31-
.pin_base = (s), \
32-
.npins = ((e) - (s) + 1), \
33-
}
23+
#define BXT_COMMUNITY(b, s, e) \
24+
INTEL_COMMUNITY_SIZE(b, s, e, 32, 4, BXT)
3425

3526
/* BXT */
3627
static const struct pinctrl_pin_desc bxt_north_pins[] = {
@@ -172,7 +163,7 @@ static const struct intel_function bxt_north_functions[] = {
172163
};
173164

174165
static const struct intel_community bxt_north_communities[] = {
175-
BXT_COMMUNITY(0, 82),
166+
BXT_COMMUNITY(0, 0, 82),
176167
};
177168

178169
static const struct intel_pinctrl_soc_data bxt_north_soc_data = {
@@ -289,7 +280,7 @@ static const struct intel_function bxt_northwest_functions[] = {
289280
};
290281

291282
static const struct intel_community bxt_northwest_communities[] = {
292-
BXT_COMMUNITY(0, 71),
283+
BXT_COMMUNITY(0, 0, 71),
293284
};
294285

295286
static const struct intel_pinctrl_soc_data bxt_northwest_soc_data = {
@@ -396,7 +387,7 @@ static const struct intel_function bxt_west_functions[] = {
396387
};
397388

398389
static const struct intel_community bxt_west_communities[] = {
399-
BXT_COMMUNITY(0, 41),
390+
BXT_COMMUNITY(0, 0, 41),
400391
};
401392

402393
static const struct intel_pinctrl_soc_data bxt_west_soc_data = {
@@ -472,7 +463,7 @@ static const struct intel_function bxt_southwest_functions[] = {
472463
};
473464

474465
static const struct intel_community bxt_southwest_communities[] = {
475-
BXT_COMMUNITY(0, 30),
466+
BXT_COMMUNITY(0, 0, 30),
476467
};
477468

478469
static const struct intel_pinctrl_soc_data bxt_southwest_soc_data = {
@@ -511,7 +502,7 @@ static const struct pinctrl_pin_desc bxt_south_pins[] = {
511502
};
512503

513504
static const struct intel_community bxt_south_communities[] = {
514-
BXT_COMMUNITY(0, 19),
505+
BXT_COMMUNITY(0, 0, 19),
515506
};
516507

517508
static const struct intel_pinctrl_soc_data bxt_south_soc_data = {
@@ -650,7 +641,7 @@ static const struct intel_function apl_north_functions[] = {
650641
};
651642

652643
static const struct intel_community apl_north_communities[] = {
653-
BXT_COMMUNITY(0, 77),
644+
BXT_COMMUNITY(0, 0, 77),
654645
};
655646

656647
static const struct intel_pinctrl_soc_data apl_north_soc_data = {
@@ -770,7 +761,7 @@ static const struct intel_function apl_northwest_functions[] = {
770761
};
771762

772763
static const struct intel_community apl_northwest_communities[] = {
773-
BXT_COMMUNITY(0, 76),
764+
BXT_COMMUNITY(0, 0, 76),
774765
};
775766

776767
static const struct intel_pinctrl_soc_data apl_northwest_soc_data = {
@@ -880,7 +871,7 @@ static const struct intel_function apl_west_functions[] = {
880871
};
881872

882873
static const struct intel_community apl_west_communities[] = {
883-
BXT_COMMUNITY(0, 46),
874+
BXT_COMMUNITY(0, 0, 46),
884875
};
885876

886877
static const struct intel_pinctrl_soc_data apl_west_soc_data = {
@@ -972,7 +963,7 @@ static const struct intel_function apl_southwest_functions[] = {
972963
};
973964

974965
static const struct intel_community apl_southwest_communities[] = {
975-
BXT_COMMUNITY(0, 42),
966+
BXT_COMMUNITY(0, 0, 42),
976967
};
977968

978969
static const struct intel_pinctrl_soc_data apl_southwest_soc_data = {

drivers/pinctrl/intel/pinctrl-cannonlake.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@
1515

1616
#include "pinctrl-intel.h"
1717

18-
#define CNL_PAD_OWN 0x020
19-
#define CNL_PADCFGLOCK 0x080
18+
#define CNL_LP_PAD_OWN 0x020
19+
#define CNL_LP_PADCFGLOCK 0x080
2020
#define CNL_LP_HOSTSW_OWN 0x0b0
21+
#define CNL_LP_GPI_IS 0x100
22+
#define CNL_LP_GPI_IE 0x120
23+
24+
#define CNL_H_PAD_OWN 0x020
25+
#define CNL_H_PADCFGLOCK 0x080
2126
#define CNL_H_HOSTSW_OWN 0x0c0
22-
#define CNL_GPI_IS 0x100
23-
#define CNL_GPI_IE 0x120
27+
#define CNL_H_GPI_IS 0x100
28+
#define CNL_H_GPI_IE 0x120
2429

2530
#define CNL_GPP(r, s, e, g) \
2631
{ \
@@ -30,25 +35,11 @@
3035
.gpio_base = (g), \
3136
}
3237

33-
#define CNL_COMMUNITY(b, s, e, g, v) \
34-
{ \
35-
.barno = (b), \
36-
.padown_offset = CNL_PAD_OWN, \
37-
.padcfglock_offset = CNL_PADCFGLOCK, \
38-
.hostown_offset = CNL_##v##_HOSTSW_OWN, \
39-
.is_offset = CNL_GPI_IS, \
40-
.ie_offset = CNL_GPI_IE, \
41-
.pin_base = (s), \
42-
.npins = ((e) - (s) + 1), \
43-
.gpps = (g), \
44-
.ngpps = ARRAY_SIZE(g), \
45-
}
46-
4738
#define CNL_LP_COMMUNITY(b, s, e, g) \
48-
CNL_COMMUNITY(b, s, e, g, LP)
39+
INTEL_COMMUNITY_GPPS(b, s, e, g, CNL_LP)
4940

5041
#define CNL_H_COMMUNITY(b, s, e, g) \
51-
CNL_COMMUNITY(b, s, e, g, H)
42+
INTEL_COMMUNITY_GPPS(b, s, e, g, CNL_H)
5243

5344
/* Cannon Lake-H */
5445
static const struct pinctrl_pin_desc cnlh_pins[] = {

drivers/pinctrl/intel/pinctrl-cedarfork.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,7 @@
2828
}
2929

3030
#define CDF_COMMUNITY(b, s, e, g) \
31-
{ \
32-
.barno = (b), \
33-
.padown_offset = CDF_PAD_OWN, \
34-
.padcfglock_offset = CDF_PADCFGLOCK, \
35-
.hostown_offset = CDF_HOSTSW_OWN, \
36-
.is_offset = CDF_GPI_IS, \
37-
.ie_offset = CDF_GPI_IE, \
38-
.pin_base = (s), \
39-
.npins = ((e) - (s) + 1), \
40-
.gpps = (g), \
41-
.ngpps = ARRAY_SIZE(g), \
42-
}
31+
INTEL_COMMUNITY_GPPS(b, s, e, g, CDF)
4332

4433
/* Cedar Fork PCH */
4534
static const struct pinctrl_pin_desc cdf_pins[] = {

drivers/pinctrl/intel/pinctrl-cherryview.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ static const char *chv_get_function_name(struct pinctrl_dev *pctldev,
694694
{
695695
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
696696

697-
return pctrl->soc->functions[function].name;
697+
return pctrl->soc->functions[function].func.name;
698698
}
699699

700700
static int chv_get_function_groups(struct pinctrl_dev *pctldev,
@@ -704,8 +704,8 @@ static int chv_get_function_groups(struct pinctrl_dev *pctldev,
704704
{
705705
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
706706

707-
*groups = pctrl->soc->functions[function].groups;
708-
*ngroups = pctrl->soc->functions[function].ngroups;
707+
*groups = pctrl->soc->functions[function].func.groups;
708+
*ngroups = pctrl->soc->functions[function].func.ngroups;
709709
return 0;
710710
}
711711

drivers/pinctrl/intel/pinctrl-denverton.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,7 @@
2828
}
2929

3030
#define DNV_COMMUNITY(b, s, e, g) \
31-
{ \
32-
.barno = (b), \
33-
.padown_offset = DNV_PAD_OWN, \
34-
.padcfglock_offset = DNV_PADCFGLOCK, \
35-
.hostown_offset = DNV_HOSTSW_OWN, \
36-
.is_offset = DNV_GPI_IS, \
37-
.ie_offset = DNV_GPI_IE, \
38-
.pin_base = (s), \
39-
.npins = ((e) - (s) + 1), \
40-
.gpps = (g), \
41-
.ngpps = ARRAY_SIZE(g), \
42-
}
31+
INTEL_COMMUNITY_GPPS(b, s, e, g, DNV)
4332

4433
/* Denverton */
4534
static const struct pinctrl_pin_desc dnv_pins[] = {

drivers/pinctrl/intel/pinctrl-elkhartlake.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,8 @@
2727
.size = ((e) - (s) + 1), \
2828
}
2929

30-
#define EHL_COMMUNITY(s, e, g) \
31-
{ \
32-
.padown_offset = EHL_PAD_OWN, \
33-
.padcfglock_offset = EHL_PADCFGLOCK, \
34-
.hostown_offset = EHL_HOSTSW_OWN, \
35-
.is_offset = EHL_GPI_IS, \
36-
.ie_offset = EHL_GPI_IE, \
37-
.pin_base = (s), \
38-
.npins = ((e) - (s) + 1), \
39-
.gpps = (g), \
40-
.ngpps = ARRAY_SIZE(g), \
41-
}
30+
#define EHL_COMMUNITY(b, s, e, g) \
31+
INTEL_COMMUNITY_GPPS(b, s, e, g, EHL)
4232

4333
/* Elkhart Lake */
4434
static const struct pinctrl_pin_desc ehl_community0_pins[] = {
@@ -121,7 +111,7 @@ static const struct intel_padgroup ehl_community0_gpps[] = {
121111
};
122112

123113
static const struct intel_community ehl_community0[] = {
124-
EHL_COMMUNITY(0, 66, ehl_community0_gpps),
114+
EHL_COMMUNITY(0, 0, 66, ehl_community0_gpps),
125115
};
126116

127117
static const struct intel_pinctrl_soc_data ehl_community0_soc_data = {
@@ -262,7 +252,7 @@ static const struct intel_padgroup ehl_community1_gpps[] = {
262252
};
263253

264254
static const struct intel_community ehl_community1[] = {
265-
EHL_COMMUNITY(0, 112, ehl_community1_gpps),
255+
EHL_COMMUNITY(0, 0, 112, ehl_community1_gpps),
266256
};
267257

268258
static const struct intel_pinctrl_soc_data ehl_community1_soc_data = {
@@ -335,7 +325,7 @@ static const struct intel_padgroup ehl_community3_gpps[] = {
335325
};
336326

337327
static const struct intel_community ehl_community3[] = {
338-
EHL_COMMUNITY(0, 46, ehl_community3_gpps),
328+
EHL_COMMUNITY(0, 0, 46, ehl_community3_gpps),
339329
};
340330

341331
static const struct intel_pinctrl_soc_data ehl_community3_soc_data = {
@@ -441,7 +431,7 @@ static const struct intel_padgroup ehl_community4_gpps[] = {
441431
};
442432

443433
static const struct intel_community ehl_community4[] = {
444-
EHL_COMMUNITY(0, 79, ehl_community4_gpps),
434+
EHL_COMMUNITY(0, 0, 79, ehl_community4_gpps),
445435
};
446436

447437
static const struct intel_pinctrl_soc_data ehl_community4_soc_data = {
@@ -469,7 +459,7 @@ static const struct intel_padgroup ehl_community5_gpps[] = {
469459
};
470460

471461
static const struct intel_community ehl_community5[] = {
472-
EHL_COMMUNITY(0, 7, ehl_community5_gpps),
462+
EHL_COMMUNITY(0, 0, 7, ehl_community5_gpps),
473463
};
474464

475465
static const struct intel_pinctrl_soc_data ehl_community5_soc_data = {

drivers/pinctrl/intel/pinctrl-emmitsburg.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,7 @@
2828
}
2929

3030
#define EBG_COMMUNITY(b, s, e, g) \
31-
{ \
32-
.barno = (b), \
33-
.padown_offset = EBG_PAD_OWN, \
34-
.padcfglock_offset = EBG_PADCFGLOCK, \
35-
.hostown_offset = EBG_HOSTSW_OWN, \
36-
.is_offset = EBG_GPI_IS, \
37-
.ie_offset = EBG_GPI_IE, \
38-
.pin_base = (s), \
39-
.npins = ((e) - (s) + 1), \
40-
.gpps = (g), \
41-
.ngpps = ARRAY_SIZE(g), \
42-
}
31+
INTEL_COMMUNITY_GPPS(b, s, e, g, EBG)
4332

4433
/* Emmitsburg */
4534
static const struct pinctrl_pin_desc ebg_pins[] = {

0 commit comments

Comments
 (0)