[PATCH v2 5/5] pps: generators: tio: Introduce Intel Elkhart Lake PSE TIO

Raag Jadav
2025-03-03T04:48:01Z

Add initial support for Intel Elkhart Lake PSE TIO controller.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pps/generators/Kconfig | 2 +-
drivers/pps/generators/pps_gen_tio.c | 17 ++++++++++++++++-
drivers/pps/generators/pps_gen_tio.h | 5 +++++
3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/pps/generators/Kconfig b/drivers/pps/generators/Kconfig
index b3f340ed3163..83aada693ad2 100644
--- a/drivers/pps/generators/Kconfig
+++ b/drivers/pps/generators/Kconfig
@@ -33,7 +33,7 @@ config PPS_GENERATOR_PARPORT

config PPS_GENERATOR_TIO
tristate "TIO PPS signal generator"
- depends on X86 && CPU_SUP_INTEL
+ depends on X86 && CPU_SUP_INTEL && MFD_INTEL_EHL_PSE_GPIO
help
If you say yes here you get support for a PPS TIO signal generator
which generates a pulse at a prescribed time based on the system clock.
diff --git a/drivers/pps/generators/pps_gen_tio.c b/drivers/pps/generators/pps_gen_tio.c
index 6e3a4b198259..a2a23cdc2568 100644
--- a/drivers/pps/generators/pps_gen_tio.c
+++ b/drivers/pps/generators/pps_gen_tio.c
@@ -231,6 +231,14 @@ static const struct pps_tio_data pmc_data = {
},
};

+static const struct pps_tio_data ehl_pse_data = {
+ .regs = {
+ .ctl = TIOCTL_PSE,
+ .compv = TIOCOMPV_PSE,
+ .ec = TIOEC_PSE,
+ },
+};
+
static const struct acpi_device_id intel_pmc_tio_acpi_match[] = {
{ "INTC1021", (kernel_ulong_t)&pmc_data },
{ "INTC1022", (kernel_ulong_t)&pmc_data },
@@ -240,9 +248,16 @@ static const struct acpi_device_id intel_pmc_tio_acpi_match[] = {
};
MODULE_DEVICE_TABLE(acpi, intel_pmc_tio_acpi_match);

+static const struct platform_device_id pps_gen_tio_ids[] = {
+ { "pps-gen-tio", (kernel_ulong_t)&ehl_pse_data },
+ { }
+};
+MODULE_DEVICE_TABLE(platform, pps_gen_tio_ids);
+
static struct platform_driver pps_gen_tio_driver = {
.probe = pps_gen_tio_probe,
.remove = pps_gen_tio_remove,
+ .id_table = pps_gen_tio_ids,
.driver = {
.name = "intel-pps-gen-tio",
.acpi_match_table = intel_pmc_tio_acpi_match,
@@ -255,5 +270,5 @@ MODULE_AUTHOR("Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com>");
MODULE_AUTHOR("Pandith N <pandith.n@intel.com>");
MODULE_AUTHOR("Thejesh Reddy T R <thejesh.reddy.t.r@intel.com>");
MODULE_AUTHOR("Subramanian Mohan <subramanian.mohan@intel.com>");
-MODULE_DESCRIPTION("Intel PMC Time-Aware IO Generator Driver");
+MODULE_DESCRIPTION("Intel Time-Aware IO Generator Driver");
MODULE_LICENSE("GPL");
diff --git a/drivers/pps/generators/pps_gen_tio.h b/drivers/pps/generators/pps_gen_tio.h
index 4329b6dbd598..509bd2633dfb 100644
--- a/drivers/pps/generators/pps_gen_tio.h
+++ b/drivers/pps/generators/pps_gen_tio.h
@@ -18,6 +18,11 @@

struct device;

+/* EHL PSE Registers */
+#define TIOCTL_PSE 0x00
+#define TIOCOMPV_PSE 0x04
+#define TIOEC_PSE 0x24
+
/* PMC Registers */
#define TIOCTL_PMC 0x00
#define TIOCOMPV_PMC 0x10
--
2.34.1