Skip to contentSkip to conversation

rtcan-flexcan: Add support for imx6q platform

PATCH New Thierry Bultel 1 participant 1 message Dec 11, 2012 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtcan-flexcan: Add support for imx6q platform

Hello,

This patch adds support for rtcan-flexcan on the iMX6q Many thanks to Wolfgang for the original driver.

Regards
Thierry

rtcan_flexcan.c.imx6q renamed from rtcan_flexcan.c +31 -4
@@ -1099,13 +1099,40 @@ static struct of_device_id flexcan_of_ma
 	{},
 };
 
+enum flexcan_ip_version {
+	FLEXCAN_VER_3_0_0,
+	FLEXCAN_VER_3_0_4,
+	FLEXCAN_VER_10_0_12,
+};
+
+static struct platform_device_id flexcan_devtype[] = {
+	{
+		.name = "imx25-flexcan",
+		.driver_data = FLEXCAN_VER_3_0_0,
+	}, {
+		.name = "imx28-flexcan",
+		.driver_data = FLEXCAN_VER_3_0_4,
+	}, {
+		.name = "imx35-flexcan",
+		.driver_data = FLEXCAN_VER_3_0_0,
+	}, {
+		.name = "imx53-flexcan",
+		.driver_data = FLEXCAN_VER_3_0_0,
+	}, {
+		.name = "imx6q-flexcan",
+		.driver_data = FLEXCAN_VER_10_0_12,
+	},
+};
+
 static struct platform_driver flexcan_driver = {
 	.driver = {
 		/* For legacy platform support */
-		.name = "flexcan",
+		.name = DRV_NAME,
 		.owner = THIS_MODULE,
 		.of_match_table = flexcan_of_match,
+
 	},
+	.id_table = flexcan_devtype,
 	.probe = flexcan_probe,
 	.remove = __devexit_p(flexcan_remove),
 };
@@ -1113,14 +1140,14 @@ static struct platform_driver flexcan_dr
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
 static int __init flexcan_init(void)
 {
-	pr_info("%s netdevice driver\n", DRV_NAME);
-	return platform_driver_register(&flexcan_driver);
+	pr_info("RTCAN %s netdevice driver\n", DRV_NAME);
+	return platform_driver_register(&flexcan_driver);;
 }
 
 static void __exit flexcan_exit(void)
 {
 	platform_driver_unregister(&flexcan_driver);
-	pr_info("%s: driver removed\n", DRV_NAME);
+	pr_info("RTCAN %s: driver removed\n", DRV_NAME);
 }
 module_init(flexcan_init);
 module_exit(flexcan_exit);