hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/pinctrl/intel/pinctrl-icelake.c
....@@ -10,7 +10,7 @@
1010 #include <linux/acpi.h>
1111 #include <linux/module.h>
1212 #include <linux/platform_device.h>
13
-#include <linux/pm.h>
13
+
1414 #include <linux/pinctrl/pinctrl.h>
1515
1616 #include "pinctrl-intel.h"
....@@ -18,6 +18,7 @@
1818 #define ICL_PAD_OWN 0x020
1919 #define ICL_PADCFGLOCK 0x080
2020 #define ICL_HOSTSW_OWN 0x0b0
21
+#define ICL_GPI_IS 0x100
2122 #define ICL_GPI_IE 0x110
2223
2324 #define ICL_GPP(r, s, e, g) \
....@@ -28,14 +29,13 @@
2829 .gpio_base = (g), \
2930 }
3031
31
-#define ICL_NO_GPIO -1
32
-
3332 #define ICL_COMMUNITY(b, s, e, g) \
3433 { \
3534 .barno = (b), \
3635 .padown_offset = ICL_PAD_OWN, \
3736 .padcfglock_offset = ICL_PADCFGLOCK, \
3837 .hostown_offset = ICL_HOSTSW_OWN, \
38
+ .is_offset = ICL_GPI_IS, \
3939 .ie_offset = ICL_GPI_IE, \
4040 .pin_base = (s), \
4141 .npins = ((e) - (s) + 1), \
....@@ -303,29 +303,29 @@
303303 };
304304
305305 static const struct intel_padgroup icllp_community0_gpps[] = {
306
- ICL_GPP(0, 0, 7, 0), /* GPP_G */
307
- ICL_GPP(1, 8, 33, 32), /* GPP_B */
308
- ICL_GPP(2, 34, 58, 64), /* GPP_A */
306
+ ICL_GPP(0, 0, 7, 0), /* GPP_G */
307
+ ICL_GPP(1, 8, 33, 32), /* GPP_B */
308
+ ICL_GPP(2, 34, 58, 64), /* GPP_A */
309309 };
310310
311311 static const struct intel_padgroup icllp_community1_gpps[] = {
312
- ICL_GPP(0, 59, 82, 96), /* GPP_H */
313
- ICL_GPP(1, 83, 103, 128), /* GPP_D */
314
- ICL_GPP(2, 104, 123, 160), /* GPP_F */
315
- ICL_GPP(3, 124, 152, 192), /* vGPIO */
312
+ ICL_GPP(0, 59, 82, 96), /* GPP_H */
313
+ ICL_GPP(1, 83, 103, 128), /* GPP_D */
314
+ ICL_GPP(2, 104, 123, 160), /* GPP_F */
315
+ ICL_GPP(3, 124, 152, 192), /* vGPIO */
316316 };
317317
318318 static const struct intel_padgroup icllp_community4_gpps[] = {
319
- ICL_GPP(0, 153, 176, 224), /* GPP_C */
320
- ICL_GPP(1, 177, 182, ICL_NO_GPIO), /* HVCMOS */
321
- ICL_GPP(2, 183, 206, 256), /* GPP_E */
322
- ICL_GPP(3, 207, 215, ICL_NO_GPIO), /* JTAG */
319
+ ICL_GPP(0, 153, 176, 224), /* GPP_C */
320
+ ICL_GPP(1, 177, 182, INTEL_GPIO_BASE_NOMAP), /* HVCMOS */
321
+ ICL_GPP(2, 183, 206, 256), /* GPP_E */
322
+ ICL_GPP(3, 207, 215, INTEL_GPIO_BASE_NOMAP), /* JTAG */
323323 };
324324
325325 static const struct intel_padgroup icllp_community5_gpps[] = {
326
- ICL_GPP(0, 216, 223, 288), /* GPP_R */
327
- ICL_GPP(1, 224, 231, 320), /* GPP_S */
328
- ICL_GPP(2, 232, 240, ICL_NO_GPIO), /* SPI */
326
+ ICL_GPP(0, 216, 223, 288), /* GPP_R */
327
+ ICL_GPP(1, 224, 231, 320), /* GPP_S */
328
+ ICL_GPP(2, 232, 240, INTEL_GPIO_BASE_NOMAP), /* SPI */
329329 };
330330
331331 static const struct intel_community icllp_communities[] = {
....@@ -403,24 +403,16 @@
403403 .ncommunities = ARRAY_SIZE(icllp_communities),
404404 };
405405
406
-static int icl_pinctrl_probe(struct platform_device *pdev)
407
-{
408
- return intel_pinctrl_probe(pdev, &icllp_soc_data);
409
-}
410
-
411
-static const struct dev_pm_ops icl_pinctrl_pm_ops = {
412
- SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend,
413
- intel_pinctrl_resume)
414
-};
406
+static INTEL_PINCTRL_PM_OPS(icl_pinctrl_pm_ops);
415407
416408 static const struct acpi_device_id icl_pinctrl_acpi_match[] = {
417
- { "INT3455" },
418
- { },
409
+ { "INT3455", (kernel_ulong_t)&icllp_soc_data },
410
+ { }
419411 };
420412 MODULE_DEVICE_TABLE(acpi, icl_pinctrl_acpi_match);
421413
422414 static struct platform_driver icl_pinctrl_driver = {
423
- .probe = icl_pinctrl_probe,
415
+ .probe = intel_pinctrl_probe_by_hid,
424416 .driver = {
425417 .name = "icelake-pinctrl",
426418 .acpi_match_table = icl_pinctrl_acpi_match,