From: Raag Jadav <raag.jadav@intel.com>
To: lee@kernel.org, giometti@enneenne.com,
gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com,
raymond.tan@intel.com
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v3 3/5] pps: generators: tio: split pps_gen_tio.h
Date: Fri, 7 Mar 2025 10:52:29 +0530 [thread overview]
Message-ID: <20250307052231.551737-4-raag.jadav@intel.com> (raw)
In-Reply-To: <20250307052231.551737-1-raag.jadav@intel.com>
Split macros and structure definition to header file for better
maintainability.
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/pps_gen_tio.c | 30 +----------------
drivers/pps/generators/pps_gen_tio.h | 49 ++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 29 deletions(-)
create mode 100644 drivers/pps/generators/pps_gen_tio.h
diff --git a/drivers/pps/generators/pps_gen_tio.c b/drivers/pps/generators/pps_gen_tio.c
index 6c46b46c66cd..7f2aab1219af 100644
--- a/drivers/pps/generators/pps_gen_tio.c
+++ b/drivers/pps/generators/pps_gen_tio.c
@@ -5,8 +5,6 @@
* Copyright (C) 2024 Intel Corporation
*/
-#include <linux/bitfield.h>
-#include <linux/bits.h>
#include <linux/cleanup.h>
#include <linux/container_of.h>
#include <linux/device.h>
@@ -21,33 +19,7 @@
#include <asm/cpu_device_id.h>
-#define TIOCTL 0x00
-#define TIOCOMPV 0x10
-#define TIOEC 0x30
-
-/* Control Register */
-#define TIOCTL_EN BIT(0)
-#define TIOCTL_DIR BIT(1)
-#define TIOCTL_EP GENMASK(3, 2)
-#define TIOCTL_EP_RISING_EDGE FIELD_PREP(TIOCTL_EP, 0)
-#define TIOCTL_EP_FALLING_EDGE FIELD_PREP(TIOCTL_EP, 1)
-#define TIOCTL_EP_TOGGLE_EDGE FIELD_PREP(TIOCTL_EP, 2)
-
-/* Safety time to set hrtimer early */
-#define SAFE_TIME_NS (10 * NSEC_PER_MSEC)
-
-#define MAGIC_CONST (NSEC_PER_SEC - SAFE_TIME_NS)
-#define ART_HW_DELAY_CYCLES 2
-
-struct pps_tio {
- struct pps_gen_source_info gen_info;
- struct pps_gen_device *pps_gen;
- struct hrtimer timer;
- void __iomem *base;
- u32 prev_count;
- spinlock_t lock;
- struct device *dev;
-};
+#include "pps_gen_tio.h"
static inline u32 pps_tio_read(u32 offset, struct pps_tio *tio)
{
diff --git a/drivers/pps/generators/pps_gen_tio.h b/drivers/pps/generators/pps_gen_tio.h
new file mode 100644
index 000000000000..5033d5efdf92
--- /dev/null
+++ b/drivers/pps/generators/pps_gen_tio.h
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Intel PPS signal Generator Driver
+ *
+ * Copyright (C) 2025 Intel Corporation
+ */
+
+#ifndef _PPS_GEN_TIO_H_
+#define _PPS_GEN_TIO_H_
+
+#include <linux/bitfield.h>
+#include <linux/bits.h>
+#include <linux/hrtimer.h>
+#include <linux/pps_gen_kernel.h>
+#include <linux/spinlock_types.h>
+#include <linux/time.h>
+#include <linux/types.h>
+
+struct device;
+
+#define TIOCTL 0x00
+#define TIOCOMPV 0x10
+#define TIOEC 0x30
+
+/* Control Register */
+#define TIOCTL_EN BIT(0)
+#define TIOCTL_DIR BIT(1)
+#define TIOCTL_EP GENMASK(3, 2)
+#define TIOCTL_EP_RISING_EDGE FIELD_PREP(TIOCTL_EP, 0)
+#define TIOCTL_EP_FALLING_EDGE FIELD_PREP(TIOCTL_EP, 1)
+#define TIOCTL_EP_TOGGLE_EDGE FIELD_PREP(TIOCTL_EP, 2)
+
+/* Safety time to set hrtimer early */
+#define SAFE_TIME_NS (10 * NSEC_PER_MSEC)
+
+#define MAGIC_CONST (NSEC_PER_SEC - SAFE_TIME_NS)
+#define ART_HW_DELAY_CYCLES 2
+
+struct pps_tio {
+ struct pps_gen_source_info gen_info;
+ struct pps_gen_device *pps_gen;
+ struct hrtimer timer;
+ void __iomem *base;
+ u32 prev_count;
+ spinlock_t lock;
+ struct device *dev;
+};
+
+#endif /* _PPS_GEN_TIO_H_ */
--
2.34.1
next prev parent reply other threads:[~2025-03-07 5:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 5:22 [PATCH v3 0/5] Introduce Intel Elkhart Lake PSE TIO Raag Jadav
2025-03-07 5:22 ` [PATCH v3 1/5] mfd: intel_ehl_pse_gpio: Introduce Intel Elkhart Lake PSE GPIO and TIO Raag Jadav
2025-03-14 12:44 ` Lee Jones
2025-03-14 13:39 ` Andy Shevchenko
2025-03-14 13:57 ` Lee Jones
2025-03-14 14:20 ` Andy Shevchenko
2025-03-14 18:01 ` Raag Jadav
2025-03-21 5:28 ` Raag Jadav
2025-03-21 13:04 ` Greg KH
2025-03-21 13:22 ` Andy Shevchenko
2025-03-26 0:45 ` Greg KH
2025-03-26 9:01 ` Andy Shevchenko
2025-03-26 13:50 ` Greg KH
2025-03-07 5:22 ` [PATCH v3 2/5] gpio: elkhartlake: depend on MFD_INTEL_EHL_PSE_GPIO Raag Jadav
2025-03-11 6:37 ` Raag Jadav
2025-03-12 11:00 ` Andy Shevchenko
2025-03-12 17:03 ` Raag Jadav
2025-03-12 18:32 ` Andy Shevchenko
2025-03-13 9:19 ` Raag Jadav
2025-03-13 14:00 ` Andy Shevchenko
2025-03-13 14:24 ` Raag Jadav
2025-03-07 5:22 ` Raag Jadav [this message]
2025-03-07 5:22 ` [PATCH v3 4/5] pps: generators: tio: move to match_data() model Raag Jadav
2025-03-07 5:22 ` [PATCH v3 5/5] pps: generators: tio: Introduce Intel Elkhart Lake PSE TIO Raag Jadav
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250307052231.551737-4-raag.jadav@intel.com \
--to=raag.jadav@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=giometti@enneenne.com \
--cc=gregkh@linuxfoundation.org \
--cc=lee@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=raymond.tan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®