diff options
author | John Garry <john.garry@huawei.com> | 2015-11-17 11:50:44 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2015-11-25 22:12:58 -0500 |
commit | 9fb10b54861f481de4c484a67a60d981e54fe9a1 (patch) | |
tree | 172afe916a92729aadd3f7e51359ad8a9e5d673e /drivers/scsi/hisi_sas | |
parent | fa42d80dc3c5196b0359fab9a212cc4ede257502 (diff) |
hisi_sas: Add v1 hw module init
Add module init code for v1 hw.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hisi_sas')
-rw-r--r-- | drivers/scsi/hisi_sas/Makefile | 1 | ||||
-rw-r--r-- | drivers/scsi/hisi_sas/hisi_sas.h | 3 | ||||
-rw-r--r-- | drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 53 |
3 files changed, 57 insertions, 0 deletions
diff --git a/drivers/scsi/hisi_sas/Makefile b/drivers/scsi/hisi_sas/Makefile index d86b05e262e9..3e70eae81343 100644 --- a/drivers/scsi/hisi_sas/Makefile +++ b/drivers/scsi/hisi_sas/Makefile | |||
@@ -1 +1,2 @@ | |||
1 | obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas_main.o | 1 | obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas_main.o |
2 | obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas_v1_hw.o | ||
diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 3749c46bc6d0..72533cae320d 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h | |||
@@ -269,5 +269,8 @@ union hisi_sas_command_table { | |||
269 | struct hisi_sas_command_table_smp smp; | 269 | struct hisi_sas_command_table_smp smp; |
270 | struct hisi_sas_command_table_stp stp; | 270 | struct hisi_sas_command_table_stp stp; |
271 | }; | 271 | }; |
272 | extern int hisi_sas_probe(struct platform_device *pdev, | ||
273 | const struct hisi_sas_hw *ops); | ||
274 | extern int hisi_sas_remove(struct platform_device *pdev); | ||
272 | 275 | ||
273 | #endif | 276 | #endif |
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c new file mode 100644 index 000000000000..e9aebcec7aac --- /dev/null +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2015 Linaro Ltd. | ||
3 | * Copyright (c) 2015 Hisilicon Limited. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include "hisi_sas.h" | ||
13 | #define DRV_NAME "hisi_sas_v1_hw" | ||
14 | |||
15 | |||
16 | struct hisi_sas_complete_v1_hdr { | ||
17 | __le32 data; | ||
18 | }; | ||
19 | static const struct hisi_sas_hw hisi_sas_v1_hw = { | ||
20 | .complete_hdr_size = sizeof(struct hisi_sas_complete_v1_hdr), | ||
21 | }; | ||
22 | |||
23 | static int hisi_sas_v1_probe(struct platform_device *pdev) | ||
24 | { | ||
25 | return hisi_sas_probe(pdev, &hisi_sas_v1_hw); | ||
26 | } | ||
27 | |||
28 | static int hisi_sas_v1_remove(struct platform_device *pdev) | ||
29 | { | ||
30 | return hisi_sas_remove(pdev); | ||
31 | } | ||
32 | |||
33 | static const struct of_device_id sas_v1_of_match[] = { | ||
34 | { .compatible = "hisilicon,hip05-sas-v1",}, | ||
35 | {}, | ||
36 | }; | ||
37 | MODULE_DEVICE_TABLE(of, sas_v1_of_match); | ||
38 | |||
39 | static struct platform_driver hisi_sas_v1_driver = { | ||
40 | .probe = hisi_sas_v1_probe, | ||
41 | .remove = hisi_sas_v1_remove, | ||
42 | .driver = { | ||
43 | .name = DRV_NAME, | ||
44 | .of_match_table = sas_v1_of_match, | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | module_platform_driver(hisi_sas_v1_driver); | ||
49 | |||
50 | MODULE_LICENSE("GPL"); | ||
51 | MODULE_AUTHOR("John Garry <john.garry@huawei.com>"); | ||
52 | MODULE_DESCRIPTION("HISILICON SAS controller v1 hw driver"); | ||
53 | MODULE_ALIAS("platform:" DRV_NAME); | ||