Skip to content

Commit d70f60a

Browse files
andy-shevAndi Shyti
authored andcommitted
i2c: designware: Remove not-going-to-be-supported code for Baikal SoC
As noticed in the discussion [1] the Baikal SoC and platforms are not going to be finalized, hence remove stale code. Link: https://lore.kernel.org/lkml/22b92ddf-6321-41b5-8073-f9c7064d3432@infradead.org/ [1] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20260114081954.252160-2-andriy.shevchenko@linux.intel.com
1 parent 7b5073f commit d70f60a

3 files changed

Lines changed: 0 additions & 70 deletions

File tree

drivers/i2c/busses/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,6 @@ if I2C_DESIGNWARE_CORE
579579
config I2C_DESIGNWARE_PLATFORM
580580
tristate "Synopsys DesignWare Platform driver"
581581
depends on (ACPI && COMMON_CLK) || !ACPI
582-
select MFD_SYSCON if MIPS_BAIKAL_T1
583582
default I2C_DESIGNWARE_CORE
584583
help
585584
If you say yes to this option, support will be included for the

drivers/i2c/busses/i2c-designware-core.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ struct dw_i2c_dev {
314314
#define ACCESS_POLLING BIT(3)
315315

316316
#define MODEL_MSCC_OCELOT BIT(8)
317-
#define MODEL_BAIKAL_BT1 BIT(9)
318317
#define MODEL_AMD_NAVI_GPU BIT(10)
319318
#define MODEL_WANGXUN_SP BIT(11)
320319
#define MODEL_MASK GENMASK(11, 8)

drivers/i2c/busses/i2c-designware-platdrv.c

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -37,70 +37,6 @@ static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
3737
return clk_get_rate(dev->clk) / HZ_PER_KHZ;
3838
}
3939

40-
#ifdef CONFIG_OF
41-
#define BT1_I2C_CTL 0x100
42-
#define BT1_I2C_CTL_ADDR_MASK GENMASK(7, 0)
43-
#define BT1_I2C_CTL_WR BIT(8)
44-
#define BT1_I2C_CTL_GO BIT(31)
45-
#define BT1_I2C_DI 0x104
46-
#define BT1_I2C_DO 0x108
47-
48-
static int bt1_i2c_read(void *context, unsigned int reg, unsigned int *val)
49-
{
50-
struct dw_i2c_dev *dev = context;
51-
int ret;
52-
53-
/*
54-
* Note these methods shouldn't ever fail because the system controller
55-
* registers are memory mapped. We check the return value just in case.
56-
*/
57-
ret = regmap_write(dev->sysmap, BT1_I2C_CTL,
58-
BT1_I2C_CTL_GO | (reg & BT1_I2C_CTL_ADDR_MASK));
59-
if (ret)
60-
return ret;
61-
62-
return regmap_read(dev->sysmap, BT1_I2C_DO, val);
63-
}
64-
65-
static int bt1_i2c_write(void *context, unsigned int reg, unsigned int val)
66-
{
67-
struct dw_i2c_dev *dev = context;
68-
int ret;
69-
70-
ret = regmap_write(dev->sysmap, BT1_I2C_DI, val);
71-
if (ret)
72-
return ret;
73-
74-
return regmap_write(dev->sysmap, BT1_I2C_CTL,
75-
BT1_I2C_CTL_GO | BT1_I2C_CTL_WR | (reg & BT1_I2C_CTL_ADDR_MASK));
76-
}
77-
78-
static const struct regmap_config bt1_i2c_cfg = {
79-
.reg_bits = 32,
80-
.val_bits = 32,
81-
.reg_stride = 4,
82-
.fast_io = true,
83-
.reg_read = bt1_i2c_read,
84-
.reg_write = bt1_i2c_write,
85-
.max_register = DW_IC_COMP_TYPE,
86-
};
87-
88-
static int bt1_i2c_request_regs(struct dw_i2c_dev *dev)
89-
{
90-
dev->sysmap = syscon_node_to_regmap(dev->dev->of_node->parent);
91-
if (IS_ERR(dev->sysmap))
92-
return PTR_ERR(dev->sysmap);
93-
94-
dev->map = devm_regmap_init(dev->dev, NULL, dev, &bt1_i2c_cfg);
95-
return PTR_ERR_OR_ZERO(dev->map);
96-
}
97-
#else
98-
static int bt1_i2c_request_regs(struct dw_i2c_dev *dev)
99-
{
100-
return -ENODEV;
101-
}
102-
#endif
103-
10440
static int dw_i2c_get_parent_regmap(struct dw_i2c_dev *dev)
10541
{
10642
dev->map = dev_get_regmap(dev->dev->parent, NULL);
@@ -127,9 +63,6 @@ static int dw_i2c_plat_request_regs(struct dw_i2c_dev *dev)
12763
return dw_i2c_get_parent_regmap(dev);
12864

12965
switch (dev->flags & MODEL_MASK) {
130-
case MODEL_BAIKAL_BT1:
131-
ret = bt1_i2c_request_regs(dev);
132-
break;
13366
case MODEL_WANGXUN_SP:
13467
ret = dw_i2c_get_parent_regmap(dev);
13568
break;
@@ -334,7 +267,6 @@ static void dw_i2c_plat_remove(struct platform_device *pdev)
334267
}
335268

336269
static const struct of_device_id dw_i2c_of_match[] = {
337-
{ .compatible = "baikal,bt1-sys-i2c", .data = (void *)MODEL_BAIKAL_BT1 },
338270
{ .compatible = "mscc,ocelot-i2c", .data = (void *)MODEL_MSCC_OCELOT },
339271
{ .compatible = "snps,designware-i2c" },
340272
{}

0 commit comments

Comments
 (0)