There are several ways, depends on what diag file I open first, e.g., you can see it in lsscsi.txt
Note more than one device with same ATA#, that only happens in IDE mode (and with some SATA port multipliers), also Intel controller in AHCI is just one device, usually 1f:2, in in IDE mode there are two devices, 1f:2 and 1f:5
You can also see it in lspci.txt
Here you just need to look ate the driver in use, ata_piix for IDE, ACHI for AHCI, there's also de "IDE mode" on the controller name but this might not always be a reliable way to tell, especially on non Intel controllers, same on the syslog, you see the IDE driver being loaded:
May 21 14:54:28 Tower kernel: ata_piix 0000:00:1f.2: version 2.13
May 21 14:54:28 Tower kernel: ata_piix 0000:00:1f.2: MAP [ P0 P2 P1 P3 ]
May 21 14:54:28 Tower kernel: scsi host1: ata_piix
May 21 14:54:28 Tower kernel: scsi host2: ata_piix
and the dual ATA# ATA1.00 + ATA1.01 and ATA2.00 + ATA2.01
May 21 14:54:28 Tower kernel: ata2.00: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
May 21 14:54:28 Tower kernel: ata2.01: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
May 21 14:54:28 Tower kernel: ata1.00: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
May 21 14:54:28 Tower kernel: ata1.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
May 21 14:54:28 Tower kernel: ata2.00: ATA-8: SanDisk SD6SB1M256G1022I, 134439400836, X230600, max UDMA/133
May 21 14:54:28 Tower kernel: ata2.00: 500118192 sectors, multi 1: LBA48 NCQ (depth 0/32)
May 21 14:54:28 Tower kernel: ata1.00: ATA-9: ST4000NM0033-9ZM170, Z1Z3ESJS, GA0A, max UDMA/133
May 21 14:54:28 Tower kernel: ata1.00: 7814037168 sectors, multi 16: LBA48 NCQ (depth 0/32)
May 21 14:54:28 Tower kernel: ata2.01: ATA-10: ST4000DM005-2DP166, ZDH3HBM4, 0001, max UDMA/133
May 21 14:54:28 Tower kernel: ata2.01: 7814037168 sectors, multi 16: LBA48 NCQ (depth 0/32)
May 21 14:54:28 Tower kernel: ata1.01: ATA-8: WD4000FYYX, WCC13LZR5569, 00.0D1K4, max UDMA/133
May 21 14:54:28 Tower kernel: ata1.01: 7814037168 sectors, multi 16: LBA48 NCQ (depth 0/32)
May 21 14:54:28 Tower kernel: ata1.00: configured for UDMA/133
May 21 14:54:28 Tower kernel: ata2.00: configured for UDMA/133
May 21 14:54:28 Tower kernel: ata2.01: configured for UDMA/133
May 21 14:54:28 Tower kernel: ata1.01: configured for UDMA/133
It would be, best bet would be to warn if the ata_piix driver is loaded, though it might give some false positives since some boards/controllers might have an IDE mode for some add-on controller and not be in use, some older JMB controllers come to mind.