summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_at91.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-02-18 15:40:00 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-02-18 15:40:00 -0800
commitbe2874cb4e625716fa9758ad122084da7764cad0 (patch)
tree68966366c698bac9e4fd5dc5d12aa4bc3aad98fc /drivers/ata/pata_at91.c
parent584216b79ca684431ac6f961ae5cf0bb1d31024f (diff)
parenta5368e770c9ec58b9d18378844c149df8513e7b8 (diff)
Merge tag 'fixes-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
These are the bug fixes that have accumulated since 3.3-rc3 in arm-soc. The majority of them are regression fixes for stuff that broke during the merge 3.3 window. The notable ones are: * The at91 ata drivers both broke because of an earlier cleanup patch that some other patches were based on. Jean-Christophe decided to remove the legacy at91_ide driver and fix the new-style at91-pata driver while keeping the cleanup patch. I almost rejected the patches for being too late and too big but in the end decided to accept them because they fix a regression. * A patch fixing build breakage from the sysdev-to-device conversion colliding with other changes touches a number of mach-s3c files. * b0654037 "ARM: orion: Fix Orion5x GPIO regression from MPP cleanup" is a mechanical change that unfortunately touches a lot of lines that should up in the diffstat. * tag 'fixes-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (28 commits) ARM: at91: drop ide driver in favor of the pata one pata/at91: use newly introduced SMC accessors ARM: at91: add accessor to manage SMC ARM: at91:rtc/rtc-at91sam9: ioremap register bank ARM: at91: USB AT91 gadget registration for module ep93xx: fix build of vision_ep93xx.c ARM: OMAP2xxx: PM: fix OMAP2xxx-specific UART idle bug in v3.3 ARM: orion: Fix USB phy for orion5x. ARM: orion: Fix Orion5x GPIO regression from MPP cleanup ARM: EXYNOS: Add cpu-offset property in gic device tree node ARM: EXYNOS: Bring exynos4-dt up to date ARM: OMAP3: cm-t35: fix section mismatch warning ARM: OMAP2: Fix the OMAP2 only build break seen with 2011+ ARM tool-chains ARM: tegra: paz00: fix wrong UART port on mini-pcie plug ARM: tegra: paz00: fix wrong SD1 power gpio i2c: tegra: Add devexit_p() for remove ARM: EXYNOS: Correct M-5MOLS sensor clock frequency on Universal C210 board ARM: EXYNOS: Correct framebuffer window size on Nuri board ARM: SAMSUNG: Fix missing api-change from subsys_interface change ARM: EXYNOS: Fix "warning: initialization from incompatible pointer type" ...
Diffstat (limited to 'drivers/ata/pata_at91.c')
-rw-r--r--drivers/ata/pata_at91.c48
1 files changed, 21 insertions, 27 deletions
diff --git a/drivers/ata/pata_at91.c b/drivers/ata/pata_at91.c
index a7d91a72ee35..53d3770a0b1b 100644
--- a/drivers/ata/pata_at91.c
+++ b/drivers/ata/pata_at91.c
@@ -207,11 +207,11 @@ static void set_smc_timing(struct device *dev, struct ata_device *adev,
{
int ret = 0;
int use_iordy;
+ struct sam9_smc_config smc;
unsigned int t6z; /* data tristate time in ns */
unsigned int cycle; /* SMC Cycle width in MCK ticks */
unsigned int setup; /* SMC Setup width in MCK ticks */
unsigned int pulse; /* CFIOR and CFIOW pulse width in MCK ticks */
- unsigned int cs_setup = 0;/* CS4 or CS5 setup width in MCK ticks */
unsigned int cs_pulse; /* CS4 or CS5 pulse width in MCK ticks*/
unsigned int tdf_cycles; /* SMC TDF MCK ticks */
unsigned long mck_hz; /* MCK frequency in Hz */
@@ -244,26 +244,20 @@ static void set_smc_timing(struct device *dev, struct ata_device *adev,
}
dev_dbg(dev, "Use IORDY=%u, TDF Cycles=%u\n", use_iordy, tdf_cycles);
- info->mode |= AT91_SMC_TDF_(tdf_cycles);
-
- /* write SMC Setup Register */
- at91_sys_write(AT91_SMC_SETUP(info->cs),
- AT91_SMC_NWESETUP_(setup) |
- AT91_SMC_NRDSETUP_(setup) |
- AT91_SMC_NCS_WRSETUP_(cs_setup) |
- AT91_SMC_NCS_RDSETUP_(cs_setup));
- /* write SMC Pulse Register */
- at91_sys_write(AT91_SMC_PULSE(info->cs),
- AT91_SMC_NWEPULSE_(pulse) |
- AT91_SMC_NRDPULSE_(pulse) |
- AT91_SMC_NCS_WRPULSE_(cs_pulse) |
- AT91_SMC_NCS_RDPULSE_(cs_pulse));
- /* write SMC Cycle Register */
- at91_sys_write(AT91_SMC_CYCLE(info->cs),
- AT91_SMC_NWECYCLE_(cycle) |
- AT91_SMC_NRDCYCLE_(cycle));
- /* write SMC Mode Register*/
- at91_sys_write(AT91_SMC_MODE(info->cs), info->mode);
+
+ /* SMC Setup Register */
+ smc.nwe_setup = smc.nrd_setup = setup;
+ smc.ncs_write_setup = smc.ncs_read_setup = 0;
+ /* SMC Pulse Register */
+ smc.nwe_pulse = smc.nrd_pulse = pulse;
+ smc.ncs_write_pulse = smc.ncs_read_pulse = cs_pulse;
+ /* SMC Cycle Register */
+ smc.write_cycle = smc.read_cycle = cycle;
+ /* SMC Mode Register*/
+ smc.tdf_cycles = tdf_cycles;
+ smc.mode = info->mode;
+
+ sam9_smc_configure(0, info->cs, &smc);
}
static void pata_at91_set_piomode(struct ata_port *ap, struct ata_device *adev)
@@ -288,20 +282,20 @@ static unsigned int pata_at91_data_xfer_noirq(struct ata_device *dev,
struct at91_ide_info *info = dev->link->ap->host->private_data;
unsigned int consumed;
unsigned long flags;
- unsigned int mode;
+ struct sam9_smc_config smc;
local_irq_save(flags);
- mode = at91_sys_read(AT91_SMC_MODE(info->cs));
+ sam9_smc_read_mode(0, info->cs, &smc);
/* set 16bit mode before writing data */
- at91_sys_write(AT91_SMC_MODE(info->cs),
- (mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_16);
+ smc.mode = (smc.mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_16;
+ sam9_smc_write_mode(0, info->cs, &smc);
consumed = ata_sff_data_xfer(dev, buf, buflen, rw);
/* restore 8bit mode after data is written */
- at91_sys_write(AT91_SMC_MODE(info->cs),
- (mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_8);
+ smc.mode = (smc.mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_8;
+ sam9_smc_write_mode(0, info->cs, &smc);
local_irq_restore(flags);
return consumed;