Skip to content

Commit 26fdaa7

Browse files
Viresh KumarJeff Garzik
authored andcommitted
pata_arasan: add Device Tree probing capability
SPEAr platforms now support DT and so must convert all drivers to support DT. This patch adds DT probing support for Arasan Compact Flash controller and updates its documentation too. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
1 parent 3f09e6c commit 26fdaa7

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
* ARASAN PATA COMPACT FLASH CONTROLLER
2+
3+
Required properties:
4+
- compatible: "arasan,cf-spear1340"
5+
- reg: Address range of the CF registers
6+
- interrupt-parent: Should be the phandle for the interrupt controller
7+
that services interrupts for this device
8+
- interrupt: Should contain the CF interrupt number
9+
10+
Example:
11+
12+
cf@fc000000 {
13+
compatible = "arasan,cf-spear1340";
14+
reg = <0xfc000000 0x1000>;
15+
interrupt-parent = <&vic1>;
16+
interrupts = <12>;
17+
};

‎drivers/ata/pata_arasan_cf.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <linux/kernel.h>
3232
#include <linux/libata.h>
3333
#include <linux/module.h>
34+
#include <linux/of.h>
3435
#include <linux/pata_arasan_cf_data.h>
3536
#include <linux/platform_device.h>
3637
#include <linux/pm.h>
@@ -935,13 +936,22 @@ static int arasan_cf_resume(struct device *dev)
935936

936937
static SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_resume);
937938

939+
#ifdef CONFIG_OF
940+
static const struct of_device_id arasan_cf_id_table[] = {
941+
{ .compatible = "arasan,cf-spear1340" },
942+
{}
943+
};
944+
MODULE_DEVICE_TABLE(of, arasan_cf_id_table);
945+
#endif
946+
938947
static struct platform_driver arasan_cf_driver = {
939948
.probe = arasan_cf_probe,
940949
.remove = __devexit_p(arasan_cf_remove),
941950
.driver = {
942951
.name = DRIVER_NAME,
943952
.owner = THIS_MODULE,
944953
.pm = &arasan_cf_pm_ops,
954+
.of_match_table = of_match_ptr(arasan_cf_id_table),
945955
},
946956
};
947957

0 commit comments

Comments
 (0)