summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2016-11-09 03:56:36 +0300
committerTejun Heo <tj@kernel.org>2016-11-09 19:48:56 +0300
commit65a443ea54832cdf221c03c285930f0089c03f9a (patch)
treee6a4c55fcd675fc76a7fddf78df217283cf2f3bd /drivers/ata
parent07b9733fdad991ded44370badc8bad0c64c6660e (diff)
downloadlinux-65a443ea54832cdf221c03c285930f0089c03f9a.tar.xz
pata: imx: set controller PIO mode with .set_piomode callback
Convert .set_mode callback function to more specific .set_piomode, the driver does not have support of DMA modes, thus a simpler version of the callback is preferred. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_imx.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index 203e3092ed07..00df18b07fa6 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -38,28 +38,17 @@ struct pata_imx_priv {
u32 ata_ctl;
};
-static int pata_imx_set_mode(struct ata_link *link, struct ata_device **unused)
+static void pata_imx_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
- struct ata_device *dev;
- struct ata_port *ap = link->ap;
struct pata_imx_priv *priv = ap->host->private_data;
u32 val;
- ata_for_each_dev(dev, link, ENABLED) {
- dev->pio_mode = dev->xfer_mode = XFER_PIO_0;
- dev->xfer_shift = ATA_SHIFT_PIO;
- dev->flags |= ATA_DFLAG_PIO;
-
- val = __raw_readl(priv->host_regs + PATA_IMX_ATA_CONTROL);
- if (ata_pio_need_iordy(dev))
- val |= PATA_IMX_ATA_CTRL_IORDY_EN;
- else
- val &= ~PATA_IMX_ATA_CTRL_IORDY_EN;
- __raw_writel(val, priv->host_regs + PATA_IMX_ATA_CONTROL);
-
- ata_dev_info(dev, "configured for PIO\n");
- }
- return 0;
+ val = __raw_readl(priv->host_regs + PATA_IMX_ATA_CONTROL);
+ if (ata_pio_need_iordy(adev))
+ val |= PATA_IMX_ATA_CTRL_IORDY_EN;
+ else
+ val &= ~PATA_IMX_ATA_CTRL_IORDY_EN;
+ __raw_writel(val, priv->host_regs + PATA_IMX_ATA_CONTROL);
}
static struct scsi_host_template pata_imx_sht = {
@@ -70,7 +59,7 @@ static struct ata_port_operations pata_imx_port_ops = {
.inherits = &ata_sff_port_ops,
.sff_data_xfer = ata_sff_data_xfer_noirq,
.cable_detect = ata_cable_unknown,
- .set_mode = pata_imx_set_mode,
+ .set_piomode = pata_imx_set_piomode,
};
static void pata_imx_setup_port(struct ata_ioports *ioaddr)