Skip to content

Commit

Permalink
i2c: mlxbf: remove device tree support
Browse files Browse the repository at this point in the history
BlueField customers have to use the BlueField firmware with
UEFI ACPI tables so there is no need to have device tree
support in the i2c-mlxbf.c driver. Remove the device tree
binding documentation as well.

Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Reviewed-by: Khalil Blaiech <kblaiech@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
  • Loading branch information
Asmaa Mnebhi authored and Wolfram Sang committed Sep 27, 2022
1 parent 19e13e1 commit be18c5e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 126 deletions.
77 changes: 0 additions & 77 deletions Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml

This file was deleted.

1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -12987,7 +12987,6 @@ M: Khalil Blaiech <kblaiech@nvidia.com>
M: Asmaa Mnebhi <asmaa@nvidia.com>
L: linux-i2c@vger.kernel.org
S: Supported
F: Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml
F: drivers/i2c/busses/i2c-mlxbf.c

MELLANOX ETHERNET DRIVER (mlx4_en)
Expand Down
49 changes: 1 addition & 48 deletions drivers/i2c/busses/i2c-mlxbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2247,24 +2247,6 @@ static struct i2c_adapter_quirks mlxbf_i2c_quirks = {
.max_write_len = MLXBF_I2C_MASTER_DATA_W_LENGTH,
};

static const struct of_device_id mlxbf_i2c_dt_ids[] = {
{
.compatible = "mellanox,i2c-mlxbf1",
.data = &mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1]
},
{
.compatible = "mellanox,i2c-mlxbf2",
.data = &mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_2]
},
{
.compatible = "mellanox,i2c-mlxbf3",
.data = &mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_3]
},
{},
};

MODULE_DEVICE_TABLE(of, mlxbf_i2c_dt_ids);

#ifdef CONFIG_ACPI
static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = {
{ "MLNXBF03", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1] },
Expand Down Expand Up @@ -2315,31 +2297,6 @@ static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
}
#endif /* CONFIG_ACPI */

static int mlxbf_i2c_of_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
{
const struct of_device_id *oid;
int bus_id = -1;

if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
oid = of_match_node(mlxbf_i2c_dt_ids, dev->of_node);
if (!oid)
return -ENODEV;

priv->chip = oid->data;

bus_id = of_alias_get_id(dev->of_node, "i2c");
if (bus_id >= 0)
priv->bus = bus_id;
}

if (bus_id < 0) {
dev_err(dev, "Cannot get bus id");
return bus_id;
}

return 0;
}

static int mlxbf_i2c_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
Expand All @@ -2353,14 +2310,11 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
return -ENOMEM;

ret = mlxbf_i2c_acpi_probe(dev, priv);
if (ret < 0 && ret != -ENOENT && ret != -ENXIO)
ret = mlxbf_i2c_of_probe(dev, priv);

if (ret < 0)
return ret;

/* This property allows the driver to stay backward compatible with older
* ACPI table and device trees versions.
* ACPI tables.
* Starting BlueField-3 SoC, the "smbus" resource was broken down into 3
* separate resources "timer", "master" and "slave".
*/
Expand Down Expand Up @@ -2544,7 +2498,6 @@ static struct platform_driver mlxbf_i2c_driver = {
.remove = mlxbf_i2c_remove,
.driver = {
.name = "i2c-mlxbf",
.of_match_table = mlxbf_i2c_dt_ids,
#ifdef CONFIG_ACPI
.acpi_match_table = ACPI_PTR(mlxbf_i2c_acpi_ids),
#endif /* CONFIG_ACPI */
Expand Down

0 comments on commit be18c5e

Please sign in to comment.