diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 09:47:21 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:24 -0400 |
commit | 127102aea2ea9ec4e9ca233e2b1a75c8d3b058c4 (patch) | |
tree | 92fb528eac658adbc7307a009bd8a7558db2658a /drivers/ata | |
parent | 350756f6dab6d37ef9ed3f18dec520e88969ddac (diff) |
libata: make SFF support optional
Now that SFF support is completely separated out from the core layer,
it can be made optional. Add CONFIG_ATA_SFF and let SFF drivers
depend on it. If CONFIG_ATA_SFF isn't set, all codes in libata-sff.c
and data structures for SFF support are disabled. This saves good
number of bytes for small systems.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/Kconfig | 44 | ||||
-rw-r--r-- | drivers/ata/Makefile | 4 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata.h | 4 |
5 files changed, 37 insertions, 19 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index ea665c249035..48c8fc55391e 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -49,6 +49,32 @@ config SATA_AHCI | |||
49 | 49 | ||
50 | If unsure, say N. | 50 | If unsure, say N. |
51 | 51 | ||
52 | config SATA_SIL24 | ||
53 | tristate "Silicon Image 3124/3132 SATA support" | ||
54 | depends on PCI | ||
55 | help | ||
56 | This option enables support for Silicon Image 3124/3132 Serial ATA. | ||
57 | |||
58 | If unsure, say N. | ||
59 | |||
60 | config SATA_FSL | ||
61 | tristate "Freescale 3.0Gbps SATA support" | ||
62 | depends on FSL_SOC | ||
63 | help | ||
64 | This option enables support for Freescale 3.0Gbps SATA controller. | ||
65 | It can be found on MPC837x and MPC8315. | ||
66 | |||
67 | If unsure, say N. | ||
68 | |||
69 | config ATA_SFF | ||
70 | bool "ATA SFF support" | ||
71 | default y | ||
72 | help | ||
73 | This option adds support for ATA controllers with SFF | ||
74 | compliant or similar programming interface. | ||
75 | |||
76 | if ATA_SFF | ||
77 | |||
52 | config SATA_SVW | 78 | config SATA_SVW |
53 | tristate "ServerWorks Frodo / Apple K2 SATA support" | 79 | tristate "ServerWorks Frodo / Apple K2 SATA support" |
54 | depends on PCI | 80 | depends on PCI |
@@ -125,14 +151,6 @@ config SATA_SIL | |||
125 | 151 | ||
126 | If unsure, say N. | 152 | If unsure, say N. |
127 | 153 | ||
128 | config SATA_SIL24 | ||
129 | tristate "Silicon Image 3124/3132 SATA support" | ||
130 | depends on PCI | ||
131 | help | ||
132 | This option enables support for Silicon Image 3124/3132 Serial ATA. | ||
133 | |||
134 | If unsure, say N. | ||
135 | |||
136 | config SATA_SIS | 154 | config SATA_SIS |
137 | tristate "SiS 964/965/966/180 SATA support" | 155 | tristate "SiS 964/965/966/180 SATA support" |
138 | depends on PCI | 156 | depends on PCI |
@@ -183,15 +201,6 @@ config PATA_ACPI | |||
183 | firmware in the BIOS. This driver can sometimes handle | 201 | firmware in the BIOS. This driver can sometimes handle |
184 | otherwise unsupported hardware. | 202 | otherwise unsupported hardware. |
185 | 203 | ||
186 | config SATA_FSL | ||
187 | tristate "Freescale 3.0Gbps SATA support" | ||
188 | depends on FSL_SOC | ||
189 | help | ||
190 | This option enables support for Freescale 3.0Gbps SATA controller. | ||
191 | It can be found on MPC837x and MPC8315. | ||
192 | |||
193 | If unsure, say N. | ||
194 | |||
195 | config PATA_ALI | 204 | config PATA_ALI |
196 | tristate "ALi PATA support (Experimental)" | 205 | tristate "ALi PATA support (Experimental)" |
197 | depends on PCI && EXPERIMENTAL | 206 | depends on PCI && EXPERIMENTAL |
@@ -679,4 +688,5 @@ config PATA_BF54X | |||
679 | 688 | ||
680 | If unsure, say N. | 689 | If unsure, say N. |
681 | 690 | ||
691 | endif # ATA_SFF | ||
682 | endif # ATA | 692 | endif # ATA |
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile index 0511e6f0bb58..e6e41b2c731c 100644 --- a/drivers/ata/Makefile +++ b/drivers/ata/Makefile | |||
@@ -78,6 +78,6 @@ obj-$(CONFIG_ATA_GENERIC) += ata_generic.o | |||
78 | # Should be last libata driver | 78 | # Should be last libata driver |
79 | obj-$(CONFIG_PATA_LEGACY) += pata_legacy.o | 79 | obj-$(CONFIG_PATA_LEGACY) += pata_legacy.o |
80 | 80 | ||
81 | libata-objs := libata-core.o libata-scsi.o libata-sff.o libata-eh.o \ | 81 | libata-objs := libata-core.o libata-scsi.o libata-eh.o libata-pmp.o |
82 | libata-pmp.o | 82 | libata-$(CONFIG_ATA_SFF) += libata-sff.o |
83 | libata-$(CONFIG_ATA_ACPI) += libata-acpi.o | 83 | libata-$(CONFIG_ATA_ACPI) += libata-acpi.o |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 3a94c69c7fe7..ca60af0cb051 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -5195,7 +5195,9 @@ struct ata_port *ata_port_alloc(struct ata_host *host) | |||
5195 | ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; | 5195 | ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; |
5196 | #endif | 5196 | #endif |
5197 | 5197 | ||
5198 | #ifdef CONFIG_ATA_SFF | ||
5198 | INIT_DELAYED_WORK(&ap->port_task, ata_pio_task); | 5199 | INIT_DELAYED_WORK(&ap->port_task, ata_pio_task); |
5200 | #endif | ||
5199 | INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug); | 5201 | INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug); |
5200 | INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan); | 5202 | INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan); |
5201 | INIT_LIST_HEAD(&ap->eh_done_q); | 5203 | INIT_LIST_HEAD(&ap->eh_done_q); |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index f8be92836a6e..a70881c408e5 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2393,7 +2393,9 @@ static void atapi_request_sense(struct ata_queued_cmd *qc) | |||
2393 | /* FIXME: is this needed? */ | 2393 | /* FIXME: is this needed? */ |
2394 | memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); | 2394 | memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); |
2395 | 2395 | ||
2396 | #ifdef CONFIG_ATA_SFF | ||
2396 | ap->ops->sff_tf_read(ap, &qc->tf); | 2397 | ap->ops->sff_tf_read(ap, &qc->tf); |
2398 | #endif | ||
2397 | 2399 | ||
2398 | /* fill these in, for the case where they are -not- overwritten */ | 2400 | /* fill these in, for the case where they are -not- overwritten */ |
2399 | cmd->sense_buffer[0] = 0x70; | 2401 | cmd->sense_buffer[0] = 0x70; |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 87f54a1db3b0..6b70a624828c 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -42,8 +42,10 @@ static inline int ata_is_builtin_hardreset(ata_reset_fn_t reset) | |||
42 | { | 42 | { |
43 | if (reset == sata_std_hardreset) | 43 | if (reset == sata_std_hardreset) |
44 | return 1; | 44 | return 1; |
45 | #ifdef CONFIG_ATA_SFF | ||
45 | if (reset == sata_sff_hardreset) | 46 | if (reset == sata_sff_hardreset) |
46 | return 1; | 47 | return 1; |
48 | #endif | ||
47 | return 0; | 49 | return 0; |
48 | } | 50 | } |
49 | 51 | ||
@@ -206,9 +208,11 @@ extern int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
206 | extern void ata_eh_finish(struct ata_port *ap); | 208 | extern void ata_eh_finish(struct ata_port *ap); |
207 | 209 | ||
208 | /* libata-sff.c */ | 210 | /* libata-sff.c */ |
211 | #ifdef CONFIG_ATA_SFF | ||
209 | extern void ata_dev_select(struct ata_port *ap, unsigned int device, | 212 | extern void ata_dev_select(struct ata_port *ap, unsigned int device, |
210 | unsigned int wait, unsigned int can_sleep); | 213 | unsigned int wait, unsigned int can_sleep); |
211 | extern u8 ata_irq_on(struct ata_port *ap); | 214 | extern u8 ata_irq_on(struct ata_port *ap); |
212 | extern void ata_pio_task(struct work_struct *work); | 215 | extern void ata_pio_task(struct work_struct *work); |
216 | #endif /* CONFIG_ATA_SFF */ | ||
213 | 217 | ||
214 | #endif /* __LIBATA_H__ */ | 218 | #endif /* __LIBATA_H__ */ |