All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: <daniel.lezcano@linaro.org>, <tglx@linutronix.de>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: [PATCH v3 3/6] clocksource/drivers/timer-microchip-pit64b: use 5MHz for clockevent
Date: Fri, 4 Mar 2022 15:35:58 +0200	[thread overview]
Message-ID: <20220304133601.2404086-4-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <20220304133601.2404086-1-claudiu.beznea@microchip.com>

Use 5MHz clock for clockevent timers. This increases timer's
resolution.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clocksource/timer-microchip-pit64b.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/timer-microchip-pit64b.c b/drivers/clocksource/timer-microchip-pit64b.c
index 790d2c9b42a7..abce83d2f00b 100644
--- a/drivers/clocksource/timer-microchip-pit64b.c
+++ b/drivers/clocksource/timer-microchip-pit64b.c
@@ -42,8 +42,7 @@
 #define MCHP_PIT64B_LSBMASK		GENMASK_ULL(31, 0)
 #define MCHP_PIT64B_PRES_TO_MODE(p)	(MCHP_PIT64B_MR_PRES & ((p) << 8))
 #define MCHP_PIT64B_MODE_TO_PRES(m)	((MCHP_PIT64B_MR_PRES & (m)) >> 8)
-#define MCHP_PIT64B_DEF_CS_FREQ		5000000UL	/* 5 MHz */
-#define MCHP_PIT64B_DEF_CE_FREQ		32768		/* 32 KHz */
+#define MCHP_PIT64B_DEF_FREQ		5000000UL	/* 5 MHz */
 
 #define MCHP_PIT64B_NAME		"pit64b"
 
@@ -418,7 +417,6 @@ static int __init mchp_pit64b_init_clkevt(struct mchp_pit64b_timer *timer,
 static int __init mchp_pit64b_dt_init_timer(struct device_node *node,
 					    bool clkevt)
 {
-	u32 freq = clkevt ? MCHP_PIT64B_DEF_CE_FREQ : MCHP_PIT64B_DEF_CS_FREQ;
 	struct mchp_pit64b_timer timer;
 	unsigned long clk_rate;
 	u32 irq = 0;
@@ -446,7 +444,7 @@ static int __init mchp_pit64b_dt_init_timer(struct device_node *node,
 	}
 
 	/* Initialize mode (prescaler + SGCK bit). To be used at runtime. */
-	ret = mchp_pit64b_init_mode(&timer, freq);
+	ret = mchp_pit64b_init_mode(&timer, MCHP_PIT64B_DEF_FREQ);
 	if (ret)
 		goto irq_unmap;
 
-- 
2.32.0


WARNING: multiple messages have this Message-ID (diff)
From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: <daniel.lezcano@linaro.org>, <tglx@linutronix.de>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: [PATCH v3 3/6] clocksource/drivers/timer-microchip-pit64b: use 5MHz for clockevent
Date: Fri, 4 Mar 2022 15:35:58 +0200	[thread overview]
Message-ID: <20220304133601.2404086-4-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <20220304133601.2404086-1-claudiu.beznea@microchip.com>

Use 5MHz clock for clockevent timers. This increases timer's
resolution.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/clocksource/timer-microchip-pit64b.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/timer-microchip-pit64b.c b/drivers/clocksource/timer-microchip-pit64b.c
index 790d2c9b42a7..abce83d2f00b 100644
--- a/drivers/clocksource/timer-microchip-pit64b.c
+++ b/drivers/clocksource/timer-microchip-pit64b.c
@@ -42,8 +42,7 @@
 #define MCHP_PIT64B_LSBMASK		GENMASK_ULL(31, 0)
 #define MCHP_PIT64B_PRES_TO_MODE(p)	(MCHP_PIT64B_MR_PRES & ((p) << 8))
 #define MCHP_PIT64B_MODE_TO_PRES(m)	((MCHP_PIT64B_MR_PRES & (m)) >> 8)
-#define MCHP_PIT64B_DEF_CS_FREQ		5000000UL	/* 5 MHz */
-#define MCHP_PIT64B_DEF_CE_FREQ		32768		/* 32 KHz */
+#define MCHP_PIT64B_DEF_FREQ		5000000UL	/* 5 MHz */
 
 #define MCHP_PIT64B_NAME		"pit64b"
 
@@ -418,7 +417,6 @@ static int __init mchp_pit64b_init_clkevt(struct mchp_pit64b_timer *timer,
 static int __init mchp_pit64b_dt_init_timer(struct device_node *node,
 					    bool clkevt)
 {
-	u32 freq = clkevt ? MCHP_PIT64B_DEF_CE_FREQ : MCHP_PIT64B_DEF_CS_FREQ;
 	struct mchp_pit64b_timer timer;
 	unsigned long clk_rate;
 	u32 irq = 0;
@@ -446,7 +444,7 @@ static int __init mchp_pit64b_dt_init_timer(struct device_node *node,
 	}
 
 	/* Initialize mode (prescaler + SGCK bit). To be used at runtime. */
-	ret = mchp_pit64b_init_mode(&timer, freq);
+	ret = mchp_pit64b_init_mode(&timer, MCHP_PIT64B_DEF_FREQ);
 	if (ret)
 		goto irq_unmap;
 
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-03-04 13:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 13:35 [PATCH v3 0/6] clocksource/drivers/timer-microchip-pit64b: fixes and improvements Claudiu Beznea
2022-03-04 13:35 ` Claudiu Beznea
2022-03-04 13:35 ` [PATCH v3 1/6] clocksource/drivers/timer-microchip-pit64b: remove mmio selection Claudiu Beznea
2022-03-04 13:35   ` Claudiu Beznea
2022-03-14  9:28   ` [tip: timers/core] clocksource/drivers/timer-microchip-pit64b: Remove " tip-bot2 for Claudiu Beznea
2022-03-04 13:35 ` [PATCH v3 2/6] clocksource/drivers/timer-microchip-pit64b: use notrace Claudiu Beznea
2022-03-04 13:35   ` Claudiu Beznea
2022-03-14  9:28   ` [tip: timers/core] clocksource/drivers/timer-microchip-pit64b: Use notrace tip-bot2 for Claudiu Beznea
2022-03-04 13:35 ` Claudiu Beznea [this message]
2022-03-04 13:35   ` [PATCH v3 3/6] clocksource/drivers/timer-microchip-pit64b: use 5MHz for clockevent Claudiu Beznea
2022-03-14  9:28   ` [tip: timers/core] clocksource/drivers/timer-microchip-pit64b: Use " tip-bot2 for Claudiu Beznea
2022-03-04 13:35 ` [PATCH v3 4/6] clocksource/drivers/timer-microchip-pit64b: remove suspend/resume ops for ce Claudiu Beznea
2022-03-04 13:35   ` Claudiu Beznea
2022-03-04 13:36 ` [PATCH v3 5/6] clocksource/drivers/timer-microchip-pit64b: use mchp_pit64b_{suspend, resume} Claudiu Beznea
2022-03-04 13:36   ` Claudiu Beznea
2022-03-04 13:36 ` [PATCH v3 6/6] clocksource/drivers/timer-microchip-pit64b: fix compilation warnings Claudiu Beznea
2022-03-04 13:36   ` Claudiu Beznea
2022-03-04 19:46 ` [PATCH v3 0/6] clocksource/drivers/timer-microchip-pit64b: fixes and improvements Daniel Lezcano
2022-03-04 19:46   ` Daniel Lezcano
2022-03-07 12:17   ` Claudiu.Beznea
2022-03-07 12:17     ` Claudiu.Beznea

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=20220304133601.2404086-4-claudiu.beznea@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.