aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-15 18:52:52 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-15 18:52:52 +0200
commit6dae44f9a55f13765c877687602cd2bf1a057cfd (patch)
tree27c448046ce6ed1b546848a6ced57c2012435274 /include
parent79ca743f68a94443518f165355d4327bc0f87632 (diff)
downloadkernel_samsung_smdk4412-6dae44f9a55f13765c877687602cd2bf1a057cfd.zip
kernel_samsung_smdk4412-6dae44f9a55f13765c877687602cd2bf1a057cfd.tar.gz
kernel_samsung_smdk4412-6dae44f9a55f13765c877687602cd2bf1a057cfd.tar.bz2
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')
-rw-r--r--include/linux/ata.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 915da43..9c75921 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)
return id[ATA_ID_ROT_SPEED] == 0x01;
}
+static inline int ata_id_pio_need_iordy(const u16 *id, const u8 pio)
+{
+ /* CF spec. r4.1 Table 22 says no IORDY on PIO5 and PIO6. */
+ if (pio > 4 && ata_id_is_cfa(id))
+ return 0;
+ /* For PIO3 and higher it is mandatory. */
+ if (pio > 2)
+ return 1;
+ /* Turn it on when possible. */
+ if (ata_id_has_iordy(id))
+ return 1;
+ return 0;
+}
+
static inline int ata_drive_40wire(const u16 *dev_id)
{
if (ata_id_is_sata(dev_id))