October 2017
Intermediate to advanced
586 pages
14h 8m
English
OF match style can be combined with any other matching mechanism. In the following example, we have a mix of DT and device ID match styles:
We fill an array for the device ID match style, each device with its data:
static const struct platform_device_id sdma_devtypes[] = {
{
.name = "imx51-sdma",
.driver_data = (unsigned long)&sdma_imx51,
}, {
.name = "imx53-sdma",
.driver_data = (unsigned long)&sdma_imx53,
}, {
.name = "imx6q-sdma",
.driver_data = (unsigned long)&sdma_imx6q,
}, {
.name = "imx7d-sdma",
.driver_data = (unsigned long)&sdma_imx7d,
}, {
/* sentinel */
}
};
MODULE_DEVICE_TABLE(platform, sdma_devtypes);
We do the same for OF match style:
static const struct of_device_idsdma_dt_ids[] = { { .compatible = "fsl,imx6q-sdma", ...Read now
Unlock full access