|
40 | 40 | #include <linux/ata.h>
|
41 | 41 | #include <linux/libata.h>
|
42 | 42 | #include <linux/platform_device.h>
|
| 43 | +#include <linux/sys_soc.h> |
43 | 44 | #include <linux/delay.h>
|
44 | 45 | #include <linux/dmaengine.h>
|
45 | 46 | #include <linux/ktime.h>
|
@@ -910,6 +911,12 @@ static struct ata_port_operations ep93xx_pata_port_ops = {
|
910 | 911 | .port_start = ep93xx_pata_port_start,
|
911 | 912 | };
|
912 | 913 |
|
| 914 | +static const struct soc_device_attribute ep93xx_soc_table[] = { |
| 915 | + { .revision = "E1", .data = (void *)ATA_UDMA3 }, |
| 916 | + { .revision = "E2", .data = (void *)ATA_UDMA4 }, |
| 917 | + { /* sentinel */ } |
| 918 | +}; |
| 919 | + |
913 | 920 | static int ep93xx_pata_probe(struct platform_device *pdev)
|
914 | 921 | {
|
915 | 922 | struct ep93xx_pata_data *drv_data;
|
@@ -976,12 +983,11 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
|
976 | 983 | * so this driver supports only UDMA modes.
|
977 | 984 | */
|
978 | 985 | if (drv_data->dma_rx_channel && drv_data->dma_tx_channel) {
|
979 |
| - int chip_rev = ep93xx_chip_revision(); |
| 986 | + const struct soc_device_attribute *match; |
980 | 987 |
|
981 |
| - if (chip_rev == EP93XX_CHIP_REV_E1) |
982 |
| - ap->udma_mask = ATA_UDMA3; |
983 |
| - else if (chip_rev == EP93XX_CHIP_REV_E2) |
984 |
| - ap->udma_mask = ATA_UDMA4; |
| 988 | + match = soc_device_match(ep93xx_soc_table); |
| 989 | + if (match) |
| 990 | + ap->udma_mask = (unsigned int) match->data; |
985 | 991 | else
|
986 | 992 | ap->udma_mask = ATA_UDMA2;
|
987 | 993 | }
|
|
0 commit comments