diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2019-01-19 07:52:01 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-02-08 16:42:53 +0300 |
commit | f3d5e4f18dba18d7c2303dda68b9dbcf5ccc05cd (patch) | |
tree | 325d873caee753bca9ee40555d84a5afcb64686c /drivers/ata/pata_of_platform.c | |
parent | 740c68a0cd42aab21ad9aaae092ff8a2215966b1 (diff) | |
download | linux-f3d5e4f18dba18d7c2303dda68b9dbcf5ccc05cd.tar.xz |
ata: pata_of_platform: Allow to use 16-bit wide data transfer
In some cases, the system bus can be configured for 16-bit mode,
in this case using read/write functions for 32-bit values
results in two cycles of 16 bits each, which is wrong.
This patch adds the devicetree flag to switch the driver to
use 16-bit mode for I/O transfers.
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/ata/pata_of_platform.c')
-rw-r--r-- | drivers/ata/pata_of_platform.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c index 01161c1aef4d..7a0b1759e5f0 100644 --- a/drivers/ata/pata_of_platform.c +++ b/drivers/ata/pata_of_platform.c @@ -32,6 +32,7 @@ static int pata_of_platform_probe(struct platform_device *ofdev) unsigned int reg_shift = 0; int pio_mode = 0; int pio_mask; + bool use16bit; ret = of_address_to_resource(dn, 0, &io_res); if (ret) { @@ -60,11 +61,14 @@ static int pata_of_platform_probe(struct platform_device *ofdev) dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n"); } + use16bit = of_property_read_bool(dn, "ata-generic,use16bit"); + pio_mask = 1 << pio_mode; pio_mask |= (1 << pio_mode) - 1; return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, irq_res, - reg_shift, pio_mask, &pata_platform_sht); + reg_shift, pio_mask, &pata_platform_sht, + use16bit); } static const struct of_device_id pata_of_platform_match[] = { |