Skip to content

Commit a416634

Browse files
fabioestevamwsakernel
authored andcommitted
Revert "i2c: imx: Remove unused .id_table support"
Coldfire platforms are non-DT users of this driver, so keep the .id_table support. This reverts commit c610199. Fixes: c610199 (i2c: imx: Remove unused .id_table support") Reported-by: Sascha Hauer <sha@pengutronix.de> Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 1b2cfa2 commit a416634

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

drivers/i2c/busses/i2c-imx.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,19 @@ static struct imx_i2c_hwdata vf610_i2c_hwdata = {
241241

242242
};
243243

244+
static const struct platform_device_id imx_i2c_devtype[] = {
245+
{
246+
.name = "imx1-i2c",
247+
.driver_data = (kernel_ulong_t)&imx1_i2c_hwdata,
248+
}, {
249+
.name = "imx21-i2c",
250+
.driver_data = (kernel_ulong_t)&imx21_i2c_hwdata,
251+
}, {
252+
/* sentinel */
253+
}
254+
};
255+
MODULE_DEVICE_TABLE(platform, imx_i2c_devtype);
256+
244257
static const struct of_device_id i2c_imx_dt_ids[] = {
245258
{ .compatible = "fsl,imx1-i2c", .data = &imx1_i2c_hwdata, },
246259
{ .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, },
@@ -1330,7 +1343,11 @@ static int i2c_imx_probe(struct platform_device *pdev)
13301343
return -ENOMEM;
13311344

13321345
match = device_get_match_data(&pdev->dev);
1333-
i2c_imx->hwdata = match;
1346+
if (match)
1347+
i2c_imx->hwdata = match;
1348+
else
1349+
i2c_imx->hwdata = (struct imx_i2c_hwdata *)
1350+
platform_get_device_id(pdev)->driver_data;
13341351

13351352
/* Setup i2c_imx driver structure */
13361353
strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
@@ -1498,6 +1515,7 @@ static struct platform_driver i2c_imx_driver = {
14981515
.of_match_table = i2c_imx_dt_ids,
14991516
.acpi_match_table = i2c_imx_acpi_ids,
15001517
},
1518+
.id_table = imx_i2c_devtype,
15011519
};
15021520

15031521
static int __init i2c_adap_imx_init(void)

0 commit comments

Comments
 (0)