From 90224e6468e15d5eb22a10ae1849cf8ca2e7360a Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 24 Mar 2020 14:32:16 +0200 Subject: i2c: drivers: Use generic definitions for bus frequencies Since we have generic definitions for bus frequencies, let's use them. Reviewed-by: Nicolas Saenz Julienne Acked-by: Robert Richter Reviewed-by: Thor Thayer Acked-by: Elie Morisse Acked-by: Nehal Shah Reviewed-by: Brendan Higgins Acked-by: Scott Branden Reviewed-by: Mika Westerberg Acked-by: Jarkko Nikula Acked-by: Baruch Siach Reviewed-by: Guenter Roeck Acked-by: Oleksij Rempel Acked-by: Vladimir Zapolskiy Acked-by: Gregory CLEMENT Reviewed-by: Linus Walleij Reviewed-by: Manivannan Sadhasivam Reviewed-by: Chris Brandt Reviewed-by: Baolin Wang Reviewed-by: Pierre-Yves MORDRET Acked-by: Patrice Chotard Acked-by: Ard Biesheuvel Reviewed-by: Dmitry Osipenko Acked-by: Masahiro Yamada Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-qup.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'drivers/i2c/busses/i2c-qup.c') diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c index 2d7dabe12723..748872a9b0fc 100644 --- a/drivers/i2c/busses/i2c-qup.c +++ b/drivers/i2c/busses/i2c-qup.c @@ -136,13 +136,8 @@ */ #define TOUT_MIN 2 -/* I2C Frequency Modes */ -#define I2C_STANDARD_FREQ 100000 -#define I2C_FAST_MODE_FREQ 400000 -#define I2C_FAST_MODE_PLUS_FREQ 1000000 - /* Default values. Use these if FW query fails */ -#define DEFAULT_CLK_FREQ I2C_STANDARD_FREQ +#define DEFAULT_CLK_FREQ I2C_MAX_STANDARD_MODE_FREQ #define DEFAULT_SRC_CLK 20000000 /* @@ -1756,7 +1751,7 @@ static int qup_i2c_probe(struct platform_device *pdev) nodma: /* We support frequencies up to FAST Mode Plus (1MHz) */ - if (!clk_freq || clk_freq > I2C_FAST_MODE_PLUS_FREQ) { + if (!clk_freq || clk_freq > I2C_MAX_FAST_MODE_PLUS_FREQ) { dev_err(qup->dev, "clock frequency not supported %d\n", clk_freq); return -EINVAL; @@ -1861,7 +1856,7 @@ nodma: qup->in_fifo_sz = qup->in_blk_sz * (2 << size); hs_div = 3; - if (clk_freq <= I2C_STANDARD_FREQ) { + if (clk_freq <= I2C_MAX_STANDARD_MODE_FREQ) { fs_div = ((src_clk_freq / clk_freq) / 2) - 3; qup->clk_ctl = (hs_div << 8) | (fs_div & 0xff); } else { -- cgit v1.2.3