diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2012-06-06 12:19:44 +0200 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-06-06 08:52:12 -0400 |
commit | 693e5e2025278d90e1427f037e5ec8ea1ec7d5c4 (patch) | |
tree | 00ff2b11eeb9f828c7efebe0921ca7f2e655858d /drivers/mmc/host/atmel-mci-regs.h | |
parent | b87cc1b5d3a96ef9f1b3a4f8ce7aaff18e96c994 (diff) |
mmc: atmel-mci: fix burst/chunk size modification
The use of DMA slave config operation requires that the burst size
(aka chunk size) is specified through this interface.
Modify atmel-mci slave driver to use this specification on its side.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/atmel-mci-regs.h')
-rw-r--r-- | drivers/mmc/host/atmel-mci-regs.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mmc/host/atmel-mci-regs.h b/drivers/mmc/host/atmel-mci-regs.h index 787aba1682bb..ab56f7db5315 100644 --- a/drivers/mmc/host/atmel-mci-regs.h +++ b/drivers/mmc/host/atmel-mci-regs.h @@ -140,4 +140,18 @@ #define atmci_writel(port,reg,value) \ __raw_writel((value), (port)->regs + reg) +/* + * Fix sconfig's burst size according to atmel MCI. We need to convert them as: + * 1 -> 0, 4 -> 1, 8 -> 2, 16 -> 3. + * + * This can be done by finding most significant bit set. + */ +static inline unsigned int atmci_convert_chksize(unsigned int maxburst) +{ + if (maxburst > 1) + return fls(maxburst) - 2; + else + return 0; +} + #endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */ |