|
@@ -170,6 +170,14 @@ static struct device *vchiq_dev;
|
|
|
static DEFINE_SPINLOCK(msg_queue_spinlock);
|
|
|
static struct platform_device *bcm2835_camera;
|
|
|
|
|
|
+static struct vchiq_drvdata bcm2835_drvdata = {
|
|
|
+ .cache_line_size = 32,
|
|
|
+};
|
|
|
+
|
|
|
+static struct vchiq_drvdata bcm2836_drvdata = {
|
|
|
+ .cache_line_size = 64,
|
|
|
+};
|
|
|
+
|
|
|
static const char *const ioctl_names[] = {
|
|
|
"CONNECT",
|
|
|
"SHUTDOWN",
|
|
@@ -3573,12 +3581,25 @@ void vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static const struct of_device_id vchiq_of_match[] = {
|
|
|
+ { .compatible = "brcm,bcm2835-vchiq", .data = &bcm2835_drvdata },
|
|
|
+ { .compatible = "brcm,bcm2836-vchiq", .data = &bcm2836_drvdata },
|
|
|
+ {},
|
|
|
+};
|
|
|
+MODULE_DEVICE_TABLE(of, vchiq_of_match);
|
|
|
+
|
|
|
static int vchiq_probe(struct platform_device *pdev)
|
|
|
{
|
|
|
struct device_node *fw_node;
|
|
|
- struct rpi_firmware *fw;
|
|
|
+ const struct of_device_id *of_id;
|
|
|
+ struct vchiq_drvdata *drvdata;
|
|
|
int err;
|
|
|
|
|
|
+ of_id = of_match_node(vchiq_of_match, pdev->dev.of_node);
|
|
|
+ drvdata = (struct vchiq_drvdata *)of_id->data;
|
|
|
+ if (!drvdata)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
fw_node = of_find_compatible_node(NULL, NULL,
|
|
|
"raspberrypi,bcm2835-firmware");
|
|
|
if (!fw_node) {
|
|
@@ -3586,12 +3607,12 @@ static int vchiq_probe(struct platform_device *pdev)
|
|
|
return -ENOENT;
|
|
|
}
|
|
|
|
|
|
- fw = rpi_firmware_get(fw_node);
|
|
|
+ drvdata->fw = rpi_firmware_get(fw_node);
|
|
|
of_node_put(fw_node);
|
|
|
- if (!fw)
|
|
|
+ if (!drvdata->fw)
|
|
|
return -EPROBE_DEFER;
|
|
|
|
|
|
- platform_set_drvdata(pdev, fw);
|
|
|
+ platform_set_drvdata(pdev, drvdata);
|
|
|
|
|
|
err = vchiq_platform_init(pdev, &g_state);
|
|
|
if (err != 0)
|
|
@@ -3661,12 +3682,6 @@ static int vchiq_remove(struct platform_device *pdev)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static const struct of_device_id vchiq_of_match[] = {
|
|
|
- { .compatible = "brcm,bcm2835-vchiq", },
|
|
|
- {},
|
|
|
-};
|
|
|
-MODULE_DEVICE_TABLE(of, vchiq_of_match);
|
|
|
-
|
|
|
static struct platform_driver vchiq_driver = {
|
|
|
.driver = {
|
|
|
.name = "bcm2835_vchiq",
|