i2c: designware: Delete redundant code
authorHal Feng <hal.feng@starfivetech.com>
Tue, 30 Aug 2022 12:34:22 +0000 (20:34 +0800)
committerHal Feng <hal.feng@starfivetech.com>
Wed, 31 Aug 2022 06:25:09 +0000 (14:25 +0800)
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
drivers/i2c/busses/i2c-designware-master.c
drivers/i2c/busses/i2c-designware-platdrv.c

index c6aee31..9b08bb5 100644 (file)
@@ -815,7 +815,6 @@ static void i2c_dw_unprepare_recovery(struct i2c_adapter *adap)
        i2c_dw_init_master(dev);
 }
 
-#ifndef CONFIG_SOC_STARFIVE_VIC7110
 static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
 {
        struct i2c_bus_recovery_info *rinfo = &dev->rinfo;
@@ -843,7 +842,6 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
 
        return 0;
 }
-#endif
 
 static int amd_i2c_adap_quirk(struct dw_i2c_dev *dev)
 {
@@ -912,11 +910,11 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev)
                        dev->irq, ret);
                return ret;
        }
-#ifndef CONFIG_SOC_STARFIVE_VIC7110
+
        ret = i2c_dw_init_recovery_info(dev);
        if (ret)
                return ret;
-#endif
+
        /*
         * Increment PM usage count during adapter registration in order to
         * avoid possible spurious runtime suspend when adapter device is
index dd65935..50de0bd 100755 (executable)
@@ -40,21 +40,6 @@ static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
        return clk_get_rate(dev->clk) / KILO;
 }
 
-#ifdef CONFIG_SOC_STARFIVE
-static u32 starfive_i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
-{
-       u32 val;
-
-       if(!device_property_read_u32(dev->dev, "clocks", &val)) {
-               dev_info(dev->dev, "Using 'clocks' : %u / 1000", val);
-               return (val / 1000);
-       } else {
-               dev_info(dev->dev, "Using the static setting value: 49500");
-               return 49500;
-       }
-}
-#endif
-
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id dw_i2c_acpi_match[] = {
        { "INT33C2", 0 },
@@ -287,17 +272,6 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
                if (!dev->sda_hold_time && t->sda_hold_ns)
                        dev->sda_hold_time =
                                DIV_S64_ROUND_CLOSEST(clk_khz * t->sda_hold_ns, MICRO);
-#ifdef CONFIG_SOC_STARFIVE
-       } else {
-               u64 clk_khz;
-
-               dev->get_clk_rate_khz = starfive_i2c_dw_get_clk_rate_khz;
-               clk_khz = dev->get_clk_rate_khz(dev);
-
-               if (!dev->sda_hold_time && t->sda_hold_ns)
-                       dev->sda_hold_time =
-                               DIV_S64_ROUND_CLOSEST(clk_khz * t->sda_hold_ns, MICRO);
-#endif
        }
 
        adap = &dev->adapter;