diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-06-15 12:52:52 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-06-15 12:52:52 -0400 |
commit | 6dae44f9a55f13765c877687602cd2bf1a057cfd (patch) | |
tree | 27c448046ce6ed1b546848a6ced57c2012435274 /include/linux/ata.h | |
parent | 79ca743f68a94443518f165355d4327bc0f87632 (diff) |
ata: add ata_id_pio_need_iordy() helper (v2)
v2:
Minor fixes per Sergei's review.
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r-- | include/linux/ata.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 915da43edee1..9c75921f0c16 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -800,6 +800,20 @@ static inline int ata_id_is_ssd(const u16 *id) | |||
800 | return id[ATA_ID_ROT_SPEED] == 0x01; | 800 | return id[ATA_ID_ROT_SPEED] == 0x01; |
801 | } | 801 | } |
802 | 802 | ||
803 | static inline int ata_id_pio_need_iordy(const u16 *id, const u8 pio) | ||
804 | { | ||
805 | /* CF spec. r4.1 Table 22 says no IORDY on PIO5 and PIO6. */ | ||
806 | if (pio > 4 && ata_id_is_cfa(id)) | ||
807 | return 0; | ||
808 | /* For PIO3 and higher it is mandatory. */ | ||
809 | if (pio > 2) | ||
810 | return 1; | ||
811 | /* Turn it on when possible. */ | ||
812 | if (ata_id_has_iordy(id)) | ||
813 | return 1; | ||
814 | return 0; | ||
815 | } | ||
816 | |||
803 | static inline int ata_drive_40wire(const u16 *dev_id) | 817 | static inline int ata_drive_40wire(const u16 *dev_id) |
804 | { | 818 | { |
805 | if (ata_id_is_sata(dev_id)) | 819 | if (ata_id_is_sata(dev_id)) |