Hi Andy,
On 2/27/20 6:21 AM, Andy Shevchenko wrote:
Since we have generic definitions for bus frequencies, let's use them.
Cc: Thor Thayer <thor.thayer@xxxxxxxxxxxxxxx>
Acked-by: Elie Morisse <syniurge@xxxxxxxxx>
Acked-by: Nehal Shah <nehal-bakulchandra.shah@xxxxxxx>
Cc: Shyam Sundar S K <shyam-sundar.s-k@xxxxxxx>
Reviewed-by: Brendan Higgins <brendanhiggins@xxxxxxxxxx>
Cc: Krzysztof Adamski <krzysztof.adamski@xxxxxxxxx>
Cc: Florian Fainelli <f.fainelli@xxxxxxxxx>
Cc: Ray Jui <rjui@xxxxxxxxxxxx>
Acked-by: Scott Branden <scott.branden@xxxxxxxxxxxx>
Cc: Michal Simek <michal.simek@xxxxxxxxxx>
Reviewed-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
Acked-by: Jarkko Nikula <jarkko.nikula@xxxxxxxxxxxxxxx>
Acked-by: Baruch Siach <baruch@xxxxxxxxxx>
Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
Cc: Kukjin Kim <kgene@xxxxxxxxxx>
Cc: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
Cc: Dong Aisheng <aisheng.dong@xxxxxxx>
Cc: Shawn Guo <shawnguo@xxxxxxxxxx>
Cc: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
Acked-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Acked-by: Vladimir Zapolskiy <vz@xxxxxxxxx>
Cc: Matthias Brugger <matthias.bgg@xxxxxxxxx>
Cc: Gregory CLEMENT <gregory.clement@xxxxxxxxxxx>
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
Cc: "Andreas Färber" <afaerber@xxxxxxx>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
Cc: Andy Gross <agross@xxxxxxxxxx>
Cc: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
Reviewed-by: Chris Brandt <chris.brandt@xxxxxxxxxxx>
Cc: Heiko Stuebner <heiko@xxxxxxxxx>
Cc: Barry Song <baohua@xxxxxxxxxx>
Cc: Orson Zhai <orsonzhai@xxxxxxxxx>
Reviewed-by: Baolin Wang <baolin.wang7@xxxxxxxxx>
Cc: Chunyan Zhang <zhang.lyra@xxxxxxxxx>
Cc: Pierre-Yves MORDRET <pierre-yves.mordret@xxxxxx>
Cc: Maxime Coquelin <mcoquelin.stm32@xxxxxxxxx>
Cc: Alexandre Torgue <alexandre.torgue@xxxxxx>
Cc: Patrice Chotard <patrice.chotard@xxxxxx>
Acked-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
Cc: Laxman Dewangan <ldewangan@xxxxxxxxxx>
Cc: Dmitry Osipenko <digetx@xxxxxxxxx>
Cc: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
---
v2:
squash to one patch (Wolfram)
used MAX in the definition names (Wolfram)
dropped HZ_PER_*
added collected tags
drivers/i2c/busses/i2c-altera.c | 6 ++--
drivers/i2c/busses/i2c-amd-mp2-plat.c | 27 +++++++++------
drivers/i2c/busses/i2c-aspeed.c | 2 +-
drivers/i2c/busses/i2c-axxia.c | 4 +--
drivers/i2c/busses/i2c-bcm-iproc.c | 14 ++++----
drivers/i2c/busses/i2c-bcm-kona.c | 8 ++---
drivers/i2c/busses/i2c-cadence.c | 7 ++--
drivers/i2c/busses/i2c-designware-platdrv.c | 37 ++++++++++++---------
drivers/i2c/busses/i2c-digicolor.c | 3 +-
drivers/i2c/busses/i2c-diolan-u2c.c | 12 +++----
drivers/i2c/busses/i2c-exynos5.c | 18 ++++------
drivers/i2c/busses/i2c-hix5hd2.c | 10 +++---
drivers/i2c/busses/i2c-img-scb.c | 4 +--
drivers/i2c/busses/i2c-imx-lpi2c.c | 16 +++------
drivers/i2c/busses/i2c-imx.c | 5 +--
drivers/i2c/busses/i2c-lpc2k.c | 6 ++--
drivers/i2c/busses/i2c-mt65xx.c | 21 +++++-------
drivers/i2c/busses/i2c-mv64xxx.c | 6 ++--
drivers/i2c/busses/i2c-mxs.c | 4 +--
drivers/i2c/busses/i2c-nomadik.c | 8 ++---
drivers/i2c/busses/i2c-owl.c | 9 ++---
drivers/i2c/busses/i2c-qup.c | 11 ++----
drivers/i2c/busses/i2c-rcar.c | 2 +-
drivers/i2c/busses/i2c-riic.c | 6 ++--
drivers/i2c/busses/i2c-rk3x.c | 12 +++----
drivers/i2c/busses/i2c-s3c2410.c | 4 +--
drivers/i2c/busses/i2c-sh_mobile.c | 9 ++---
drivers/i2c/busses/i2c-sirf.c | 3 +-
drivers/i2c/busses/i2c-sprd.c | 9 ++---
drivers/i2c/busses/i2c-st.c | 6 ++--
drivers/i2c/busses/i2c-stm32f4.c | 6 ++--
drivers/i2c/busses/i2c-stm32f7.c | 24 ++++++-------
drivers/i2c/busses/i2c-stu300.c | 6 ++--
drivers/i2c/busses/i2c-synquacer.c | 6 ++--
drivers/i2c/busses/i2c-tegra.c | 18 ++++------
drivers/i2c/busses/i2c-uniphier-f.c | 6 ++--
drivers/i2c/busses/i2c-uniphier.c | 7 ++--
drivers/i2c/busses/i2c-xlp9xx.c | 8 ++---
38 files changed, 168 insertions(+), 202 deletions(-)
diff --git a/drivers/i2c/busses/i2c-altera.c b/drivers/i2c/busses/i2c-altera.c
index 1de23b4f3809..20ef63820c77 100644
--- a/drivers/i2c/busses/i2c-altera.c
+++ b/drivers/i2c/busses/i2c-altera.c
@@ -147,7 +147,7 @@ static void altr_i2c_init(struct altr_i2c_dev *idev)
(ALTR_I2C_THRESHOLD << ALTR_I2C_CTRL_TCT_SHFT);
u32 t_high, t_low;
- if (idev->bus_clk_rate <= 100000) {
+ if (idev->bus_clk_rate <= I2C_MAX_STANDARD_MODE_FREQ) {
tmp &= ~ALTR_I2C_CTRL_BSPEED;
/* Standard mode SCL 50/50 */
t_high = divisor * 1 / 2;
@@ -423,10 +423,10 @@ static int altr_i2c_probe(struct platform_device *pdev)
&idev->bus_clk_rate);
if (val) {
dev_err(&pdev->dev, "Default to 100kHz\n");
- idev->bus_clk_rate = 100000; /* default clock rate */
+ idev->bus_clk_rate = I2C_MAX_STANDARD_MODE_FREQ; /* default clock rate */
}
- if (idev->bus_clk_rate > 400000) {
+ if (idev->bus_clk_rate > I2C_MAX_FAST_MODE_FREQ) {
dev_err(&pdev->dev, "invalid clock-frequency %d\n",
idev->bus_clk_rate);
return -EINVAL;
Reviewed-by: Thor Thayer <thor.thayer@xxxxxxxxxxxxxxx>
Thanks
<snip>