* [PATCH v1 1/1] i2c: k1: Use generic definitions for bus frequencies
@ 2026-06-18 14:11 Andy Shevchenko
2026-06-23 6:38 ` Troy Mitchell
2026-06-23 14:31 ` Andi Shyti
0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-06-18 14:11 UTC (permalink / raw)
To: Troy Mitchell, linux-i2c, linux-kernel; +Cc: Andi Shyti, Andy Shevchenko
Since we have generic definitions for bus frequencies, let's use them.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/i2c/busses/i2c-k1.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/i2c/busses/i2c-k1.c b/drivers/i2c/busses/i2c-k1.c
index 9152cf436bea..7732dd8b9074 100644
--- a/drivers/i2c/busses/i2c-k1.c
+++ b/drivers/i2c/busses/i2c-k1.c
@@ -91,9 +91,6 @@
/* i2c bus recover timeout: us */
#define SPACEMIT_I2C_BUS_BUSY_TIMEOUT 100000
-#define SPACEMIT_I2C_MAX_STANDARD_MODE_FREQ 100000 /* Hz */
-#define SPACEMIT_I2C_MAX_FAST_MODE_FREQ 400000 /* Hz */
-
#define SPACEMIT_SR_ERR (SPACEMIT_SR_BED | SPACEMIT_SR_RXOV | SPACEMIT_SR_ALD)
#define SPACEMIT_BUS_RESET_CLK_CNT_MAX 9
@@ -286,7 +283,7 @@ static void spacemit_i2c_init(struct spacemit_i2c_dev *i2c)
val |= SPACEMIT_CR_MSDIE;
}
- if (i2c->clock_freq == SPACEMIT_I2C_MAX_FAST_MODE_FREQ)
+ if (i2c->clock_freq == I2C_MAX_FAST_MODE_FREQ)
val |= SPACEMIT_CR_MODE_FAST;
/* disable response to general call */
@@ -703,14 +700,14 @@ static int spacemit_i2c_probe(struct platform_device *pdev)
dev_warn(dev, "failed to read clock-frequency property: %d\n", ret);
/* For now, this driver doesn't support high-speed. */
- if (!i2c->clock_freq || i2c->clock_freq > SPACEMIT_I2C_MAX_FAST_MODE_FREQ) {
+ if (!i2c->clock_freq || i2c->clock_freq > I2C_MAX_FAST_MODE_FREQ) {
dev_warn(dev, "unsupported clock frequency %u; using %u\n",
- i2c->clock_freq, SPACEMIT_I2C_MAX_FAST_MODE_FREQ);
- i2c->clock_freq = SPACEMIT_I2C_MAX_FAST_MODE_FREQ;
- } else if (i2c->clock_freq < SPACEMIT_I2C_MAX_STANDARD_MODE_FREQ) {
+ i2c->clock_freq, I2C_MAX_FAST_MODE_FREQ);
+ i2c->clock_freq = I2C_MAX_FAST_MODE_FREQ;
+ } else if (i2c->clock_freq < I2C_MAX_STANDARD_MODE_FREQ) {
dev_warn(dev, "unsupported clock frequency %u; using %u\n",
- i2c->clock_freq, SPACEMIT_I2C_MAX_STANDARD_MODE_FREQ);
- i2c->clock_freq = SPACEMIT_I2C_MAX_STANDARD_MODE_FREQ;
+ i2c->clock_freq, I2C_MAX_STANDARD_MODE_FREQ);
+ i2c->clock_freq = I2C_MAX_STANDARD_MODE_FREQ;
}
i2c->dev = &pdev->dev;
--
2.50.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v1 1/1] i2c: k1: Use generic definitions for bus frequencies
2026-06-18 14:11 [PATCH v1 1/1] i2c: k1: Use generic definitions for bus frequencies Andy Shevchenko
@ 2026-06-23 6:38 ` Troy Mitchell
2026-06-23 14:31 ` Andi Shyti
1 sibling, 0 replies; 4+ messages in thread
From: Troy Mitchell @ 2026-06-23 6:38 UTC (permalink / raw)
To: Andy Shevchenko, Troy Mitchell, linux-i2c, linux-kernel; +Cc: Andi Shyti
On Thu Jun 18, 2026 at 10:11 PM CST, Andy Shevchenko wrote:
> Since we have generic definitions for bus frequencies, let's use them.
Thanks, Andy. Indeed, this macro was introduced in e6282fc6f889d.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/1] i2c: k1: Use generic definitions for bus frequencies
2026-06-18 14:11 [PATCH v1 1/1] i2c: k1: Use generic definitions for bus frequencies Andy Shevchenko
2026-06-23 6:38 ` Troy Mitchell
@ 2026-06-23 14:31 ` Andi Shyti
2026-06-23 14:56 ` Andy Shevchenko
1 sibling, 1 reply; 4+ messages in thread
From: Andi Shyti @ 2026-06-23 14:31 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Troy Mitchell, linux-i2c, linux-kernel
Hi Andy,
On Thu, Jun 18, 2026 at 04:11:25PM +0200, Andy Shevchenko wrote:
> Since we have generic definitions for bus frequencies, let's use them.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This had some merge conflicts that I fixed. If you want to double
check here's the commit id(*).
Merged to i2c/i2c.
Thanks,
Andi
(*) fda74eaaf4cf ("i2c: k1: Use generic definitions for bus frequencies")
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v1 1/1] i2c: k1: Use generic definitions for bus frequencies
2026-06-23 14:31 ` Andi Shyti
@ 2026-06-23 14:56 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-06-23 14:56 UTC (permalink / raw)
To: Andi Shyti; +Cc: Troy Mitchell, linux-i2c, linux-kernel
On Tue, Jun 23, 2026 at 04:31:08PM +0200, Andi Shyti wrote:
> On Thu, Jun 18, 2026 at 04:11:25PM +0200, Andy Shevchenko wrote:
> > Since we have generic definitions for bus frequencies, let's use them.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> This had some merge conflicts that I fixed. If you want to double
> check here's the commit id(*).
Looks fine to me.
> Merged to i2c/i2c.
Thank you!
> (*) fda74eaaf4cf ("i2c: k1: Use generic definitions for bus frequencies")
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-23 14:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 14:11 [PATCH v1 1/1] i2c: k1: Use generic definitions for bus frequencies Andy Shevchenko
2026-06-23 6:38 ` Troy Mitchell
2026-06-23 14:31 ` Andi Shyti
2026-06-23 14:56 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox