Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: atmel-mci: change namespace

Homogenize namespace to atmci.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>

authored by

Ludovic Desroches and committed by
Chris Ball
2c96a293 41ebe9cd

+257 -256
+1 -1
arch/arm/mach-at91/at91sam9260_devices.c
··· 319 319 if (!data) 320 320 return; 321 321 322 - for (i = 0; i < ATMEL_MCI_MAX_NR_SLOTS; i++) { 322 + for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) { 323 323 if (data->slot[i].bus_width) { 324 324 /* input/irq */ 325 325 if (data->slot[i].detect_pin) {
+103 -103
drivers/mmc/host/atmel-mci-regs.h
··· 17 17 #define __DRIVERS_MMC_ATMEL_MCI_H__ 18 18 19 19 /* MCI Register Definitions */ 20 - #define MCI_CR 0x0000 /* Control */ 21 - # define MCI_CR_MCIEN ( 1 << 0) /* MCI Enable */ 22 - # define MCI_CR_MCIDIS ( 1 << 1) /* MCI Disable */ 23 - # define MCI_CR_PWSEN ( 1 << 2) /* Power Save Enable */ 24 - # define MCI_CR_PWSDIS ( 1 << 3) /* Power Save Disable */ 25 - # define MCI_CR_SWRST ( 1 << 7) /* Software Reset */ 26 - #define MCI_MR 0x0004 /* Mode */ 27 - # define MCI_MR_CLKDIV(x) ((x) << 0) /* Clock Divider */ 28 - # define MCI_MR_PWSDIV(x) ((x) << 8) /* Power Saving Divider */ 29 - # define MCI_MR_RDPROOF ( 1 << 11) /* Read Proof */ 30 - # define MCI_MR_WRPROOF ( 1 << 12) /* Write Proof */ 31 - # define MCI_MR_PDCFBYTE ( 1 << 13) /* Force Byte Transfer */ 32 - # define MCI_MR_PDCPADV ( 1 << 14) /* Padding Value */ 33 - # define MCI_MR_PDCMODE ( 1 << 15) /* PDC-oriented Mode */ 34 - #define MCI_DTOR 0x0008 /* Data Timeout */ 35 - # define MCI_DTOCYC(x) ((x) << 0) /* Data Timeout Cycles */ 36 - # define MCI_DTOMUL(x) ((x) << 4) /* Data Timeout Multiplier */ 37 - #define MCI_SDCR 0x000c /* SD Card / SDIO */ 38 - # define MCI_SDCSEL_SLOT_A ( 0 << 0) /* Select SD slot A */ 39 - # define MCI_SDCSEL_SLOT_B ( 1 << 0) /* Select SD slot A */ 40 - # define MCI_SDCSEL_MASK ( 3 << 0) 41 - # define MCI_SDCBUS_1BIT ( 0 << 6) /* 1-bit data bus */ 42 - # define MCI_SDCBUS_4BIT ( 2 << 6) /* 4-bit data bus */ 43 - # define MCI_SDCBUS_8BIT ( 3 << 6) /* 8-bit data bus[2] */ 44 - # define MCI_SDCBUS_MASK ( 3 << 6) 45 - #define MCI_ARGR 0x0010 /* Command Argument */ 46 - #define MCI_CMDR 0x0014 /* Command */ 47 - # define MCI_CMDR_CMDNB(x) ((x) << 0) /* Command Opcode */ 48 - # define MCI_CMDR_RSPTYP_NONE ( 0 << 6) /* No response */ 49 - # define MCI_CMDR_RSPTYP_48BIT ( 1 << 6) /* 48-bit response */ 50 - # define MCI_CMDR_RSPTYP_136BIT ( 2 << 6) /* 136-bit response */ 51 - # define MCI_CMDR_SPCMD_INIT ( 1 << 8) /* Initialization command */ 52 - # define MCI_CMDR_SPCMD_SYNC ( 2 << 8) /* Synchronized command */ 53 - # define MCI_CMDR_SPCMD_INT ( 4 << 8) /* Interrupt command */ 54 - # define MCI_CMDR_SPCMD_INTRESP ( 5 << 8) /* Interrupt response */ 55 - # define MCI_CMDR_OPDCMD ( 1 << 11) /* Open Drain */ 56 - # define MCI_CMDR_MAXLAT_5CYC ( 0 << 12) /* Max latency 5 cycles */ 57 - # define MCI_CMDR_MAXLAT_64CYC ( 1 << 12) /* Max latency 64 cycles */ 58 - # define MCI_CMDR_START_XFER ( 1 << 16) /* Start data transfer */ 59 - # define MCI_CMDR_STOP_XFER ( 2 << 16) /* Stop data transfer */ 60 - # define MCI_CMDR_TRDIR_WRITE ( 0 << 18) /* Write data */ 61 - # define MCI_CMDR_TRDIR_READ ( 1 << 18) /* Read data */ 62 - # define MCI_CMDR_BLOCK ( 0 << 19) /* Single-block transfer */ 63 - # define MCI_CMDR_MULTI_BLOCK ( 1 << 19) /* Multi-block transfer */ 64 - # define MCI_CMDR_STREAM ( 2 << 19) /* MMC Stream transfer */ 65 - # define MCI_CMDR_SDIO_BYTE ( 4 << 19) /* SDIO Byte transfer */ 66 - # define MCI_CMDR_SDIO_BLOCK ( 5 << 19) /* SDIO Block transfer */ 67 - # define MCI_CMDR_SDIO_SUSPEND ( 1 << 24) /* SDIO Suspend Command */ 68 - # define MCI_CMDR_SDIO_RESUME ( 2 << 24) /* SDIO Resume Command */ 69 - #define MCI_BLKR 0x0018 /* Block */ 70 - # define MCI_BCNT(x) ((x) << 0) /* Data Block Count */ 71 - # define MCI_BLKLEN(x) ((x) << 16) /* Data Block Length */ 72 - #define MCI_CSTOR 0x001c /* Completion Signal Timeout[2] */ 73 - # define MCI_CSTOCYC(x) ((x) << 0) /* CST cycles */ 74 - # define MCI_CSTOMUL(x) ((x) << 4) /* CST multiplier */ 75 - #define MCI_RSPR 0x0020 /* Response 0 */ 76 - #define MCI_RSPR1 0x0024 /* Response 1 */ 77 - #define MCI_RSPR2 0x0028 /* Response 2 */ 78 - #define MCI_RSPR3 0x002c /* Response 3 */ 79 - #define MCI_RDR 0x0030 /* Receive Data */ 80 - #define MCI_TDR 0x0034 /* Transmit Data */ 81 - #define MCI_SR 0x0040 /* Status */ 82 - #define MCI_IER 0x0044 /* Interrupt Enable */ 83 - #define MCI_IDR 0x0048 /* Interrupt Disable */ 84 - #define MCI_IMR 0x004c /* Interrupt Mask */ 85 - # define MCI_CMDRDY ( 1 << 0) /* Command Ready */ 86 - # define MCI_RXRDY ( 1 << 1) /* Receiver Ready */ 87 - # define MCI_TXRDY ( 1 << 2) /* Transmitter Ready */ 88 - # define MCI_BLKE ( 1 << 3) /* Data Block Ended */ 89 - # define MCI_DTIP ( 1 << 4) /* Data Transfer In Progress */ 90 - # define MCI_NOTBUSY ( 1 << 5) /* Data Not Busy */ 91 - # define MCI_SDIOIRQA ( 1 << 8) /* SDIO IRQ in slot A */ 92 - # define MCI_SDIOIRQB ( 1 << 9) /* SDIO IRQ in slot B */ 93 - # define MCI_RINDE ( 1 << 16) /* Response Index Error */ 94 - # define MCI_RDIRE ( 1 << 17) /* Response Direction Error */ 95 - # define MCI_RCRCE ( 1 << 18) /* Response CRC Error */ 96 - # define MCI_RENDE ( 1 << 19) /* Response End Bit Error */ 97 - # define MCI_RTOE ( 1 << 20) /* Response Time-Out Error */ 98 - # define MCI_DCRCE ( 1 << 21) /* Data CRC Error */ 99 - # define MCI_DTOE ( 1 << 22) /* Data Time-Out Error */ 100 - # define MCI_OVRE ( 1 << 30) /* RX Overrun Error */ 101 - # define MCI_UNRE ( 1 << 31) /* TX Underrun Error */ 102 - #define MCI_DMA 0x0050 /* DMA Configuration[2] */ 103 - # define MCI_DMA_OFFSET(x) ((x) << 0) /* DMA Write Buffer Offset */ 104 - # define MCI_DMA_CHKSIZE(x) ((x) << 4) /* DMA Channel Read and Write Chunk Size */ 105 - # define MCI_DMAEN ( 1 << 8) /* DMA Hardware Handshaking Enable */ 106 - #define MCI_CFG 0x0054 /* Configuration[2] */ 107 - # define MCI_CFG_FIFOMODE_1DATA ( 1 << 0) /* MCI Internal FIFO control mode */ 108 - # define MCI_CFG_FERRCTRL_COR ( 1 << 4) /* Flow Error flag reset control mode */ 109 - # define MCI_CFG_HSMODE ( 1 << 8) /* High Speed Mode */ 110 - # define MCI_CFG_LSYNC ( 1 << 12) /* Synchronize on the last block */ 111 - #define MCI_WPMR 0x00e4 /* Write Protection Mode[2] */ 112 - # define MCI_WP_EN ( 1 << 0) /* WP Enable */ 113 - # define MCI_WP_KEY (0x4d4349 << 8) /* WP Key */ 114 - #define MCI_WPSR 0x00e8 /* Write Protection Status[2] */ 115 - # define MCI_GET_WP_VS(x) ((x) & 0x0f) 116 - # define MCI_GET_WP_VSRC(x) (((x) >> 8) & 0xffff) 117 - #define MCI_FIFO_APERTURE 0x0200 /* FIFO Aperture[2] */ 20 + #define ATMCI_CR 0x0000 /* Control */ 21 + # define ATMCI_CR_MCIEN ( 1 << 0) /* MCI Enable */ 22 + # define ATMCI_CR_MCIDIS ( 1 << 1) /* MCI Disable */ 23 + # define ATMCI_CR_PWSEN ( 1 << 2) /* Power Save Enable */ 24 + # define ATMCI_CR_PWSDIS ( 1 << 3) /* Power Save Disable */ 25 + # define ATMCI_CR_SWRST ( 1 << 7) /* Software Reset */ 26 + #define ATMCI_MR 0x0004 /* Mode */ 27 + # define ATMCI_MR_CLKDIV(x) ((x) << 0) /* Clock Divider */ 28 + # define ATMCI_MR_PWSDIV(x) ((x) << 8) /* Power Saving Divider */ 29 + # define ATMCI_MR_RDPROOF ( 1 << 11) /* Read Proof */ 30 + # define ATMCI_MR_WRPROOF ( 1 << 12) /* Write Proof */ 31 + # define ATMCI_MR_PDCFBYTE ( 1 << 13) /* Force Byte Transfer */ 32 + # define ATMCI_MR_PDCPADV ( 1 << 14) /* Padding Value */ 33 + # define ATMCI_MR_PDCMODE ( 1 << 15) /* PDC-oriented Mode */ 34 + #define ATMCI_DTOR 0x0008 /* Data Timeout */ 35 + # define ATMCI_DTOCYC(x) ((x) << 0) /* Data Timeout Cycles */ 36 + # define ATMCI_DTOMUL(x) ((x) << 4) /* Data Timeout Multiplier */ 37 + #define ATMCI_SDCR 0x000c /* SD Card / SDIO */ 38 + # define ATMCI_SDCSEL_SLOT_A ( 0 << 0) /* Select SD slot A */ 39 + # define ATMCI_SDCSEL_SLOT_B ( 1 << 0) /* Select SD slot A */ 40 + # define ATMCI_SDCSEL_MASK ( 3 << 0) 41 + # define ATMCI_SDCBUS_1BIT ( 0 << 6) /* 1-bit data bus */ 42 + # define ATMCI_SDCBUS_4BIT ( 2 << 6) /* 4-bit data bus */ 43 + # define ATMCI_SDCBUS_8BIT ( 3 << 6) /* 8-bit data bus[2] */ 44 + # define ATMCI_SDCBUS_MASK ( 3 << 6) 45 + #define ATMCI_ARGR 0x0010 /* Command Argument */ 46 + #define ATMCI_CMDR 0x0014 /* Command */ 47 + # define ATMCI_CMDR_CMDNB(x) ((x) << 0) /* Command Opcode */ 48 + # define ATMCI_CMDR_RSPTYP_NONE ( 0 << 6) /* No response */ 49 + # define ATMCI_CMDR_RSPTYP_48BIT ( 1 << 6) /* 48-bit response */ 50 + # define ATMCI_CMDR_RSPTYP_136BIT ( 2 << 6) /* 136-bit response */ 51 + # define ATMCI_CMDR_SPCMD_INIT ( 1 << 8) /* Initialization command */ 52 + # define ATMCI_CMDR_SPCMD_SYNC ( 2 << 8) /* Synchronized command */ 53 + # define ATMCI_CMDR_SPCMD_INT ( 4 << 8) /* Interrupt command */ 54 + # define ATMCI_CMDR_SPCMD_INTRESP ( 5 << 8) /* Interrupt response */ 55 + # define ATMCI_CMDR_OPDCMD ( 1 << 11) /* Open Drain */ 56 + # define ATMCI_CMDR_MAXLAT_5CYC ( 0 << 12) /* Max latency 5 cycles */ 57 + # define ATMCI_CMDR_MAXLAT_64CYC ( 1 << 12) /* Max latency 64 cycles */ 58 + # define ATMCI_CMDR_START_XFER ( 1 << 16) /* Start data transfer */ 59 + # define ATMCI_CMDR_STOP_XFER ( 2 << 16) /* Stop data transfer */ 60 + # define ATMCI_CMDR_TRDIR_WRITE ( 0 << 18) /* Write data */ 61 + # define ATMCI_CMDR_TRDIR_READ ( 1 << 18) /* Read data */ 62 + # define ATMCI_CMDR_BLOCK ( 0 << 19) /* Single-block transfer */ 63 + # define ATMCI_CMDR_MULTI_BLOCK ( 1 << 19) /* Multi-block transfer */ 64 + # define ATMCI_CMDR_STREAM ( 2 << 19) /* MMC Stream transfer */ 65 + # define ATMCI_CMDR_SDIO_BYTE ( 4 << 19) /* SDIO Byte transfer */ 66 + # define ATMCI_CMDR_SDIO_BLOCK ( 5 << 19) /* SDIO Block transfer */ 67 + # define ATMCI_CMDR_SDIO_SUSPEND ( 1 << 24) /* SDIO Suspend Command */ 68 + # define ATMCI_CMDR_SDIO_RESUME ( 2 << 24) /* SDIO Resume Command */ 69 + #define ATMCI_BLKR 0x0018 /* Block */ 70 + # define ATMCI_BCNT(x) ((x) << 0) /* Data Block Count */ 71 + # define ATMCI_BLKLEN(x) ((x) << 16) /* Data Block Length */ 72 + #define ATMCI_CSTOR 0x001c /* Completion Signal Timeout[2] */ 73 + # define ATMCI_CSTOCYC(x) ((x) << 0) /* CST cycles */ 74 + # define ATMCI_CSTOMUL(x) ((x) << 4) /* CST multiplier */ 75 + #define ATMCI_RSPR 0x0020 /* Response 0 */ 76 + #define ATMCI_RSPR1 0x0024 /* Response 1 */ 77 + #define ATMCI_RSPR2 0x0028 /* Response 2 */ 78 + #define ATMCI_RSPR3 0x002c /* Response 3 */ 79 + #define ATMCI_RDR 0x0030 /* Receive Data */ 80 + #define ATMCI_TDR 0x0034 /* Transmit Data */ 81 + #define ATMCI_SR 0x0040 /* Status */ 82 + #define ATMCI_IER 0x0044 /* Interrupt Enable */ 83 + #define ATMCI_IDR 0x0048 /* Interrupt Disable */ 84 + #define ATMCI_IMR 0x004c /* Interrupt Mask */ 85 + # define ATMCI_CMDRDY ( 1 << 0) /* Command Ready */ 86 + # define ATMCI_RXRDY ( 1 << 1) /* Receiver Ready */ 87 + # define ATMCI_TXRDY ( 1 << 2) /* Transmitter Ready */ 88 + # define ATMCI_BLKE ( 1 << 3) /* Data Block Ended */ 89 + # define ATMCI_DTIP ( 1 << 4) /* Data Transfer In Progress */ 90 + # define ATMCI_NOTBUSY ( 1 << 5) /* Data Not Busy */ 91 + # define ATMCI_SDIOIRQA ( 1 << 8) /* SDIO IRQ in slot A */ 92 + # define ATMCI_SDIOIRQB ( 1 << 9) /* SDIO IRQ in slot B */ 93 + # define ATMCI_RINDE ( 1 << 16) /* Response Index Error */ 94 + # define ATMCI_RDIRE ( 1 << 17) /* Response Direction Error */ 95 + # define ATMCI_RCRCE ( 1 << 18) /* Response CRC Error */ 96 + # define ATMCI_RENDE ( 1 << 19) /* Response End Bit Error */ 97 + # define ATMCI_RTOE ( 1 << 20) /* Response Time-Out Error */ 98 + # define ATMCI_DCRCE ( 1 << 21) /* Data CRC Error */ 99 + # define ATMCI_DTOE ( 1 << 22) /* Data Time-Out Error */ 100 + # define ATMCI_OVRE ( 1 << 30) /* RX Overrun Error */ 101 + # define ATMCI_UNRE ( 1 << 31) /* TX Underrun Error */ 102 + #define ATMCI_DMA 0x0050 /* DMA Configuration[2] */ 103 + # define ATMCI_DMA_OFFSET(x) ((x) << 0) /* DMA Write Buffer Offset */ 104 + # define ATMCI_DMA_CHKSIZE(x) ((x) << 4) /* DMA Channel Read and Write Chunk Size */ 105 + # define ATMCI_DMAEN ( 1 << 8) /* DMA Hardware Handshaking Enable */ 106 + #define ATMCI_CFG 0x0054 /* Configuration[2] */ 107 + # define ATMCI_CFG_FIFOMODE_1DATA ( 1 << 0) /* MCI Internal FIFO control mode */ 108 + # define ATMCI_CFG_FERRCTRL_COR ( 1 << 4) /* Flow Error flag reset control mode */ 109 + # define ATMCI_CFG_HSMODE ( 1 << 8) /* High Speed Mode */ 110 + # define ATMCI_CFG_LSYNC ( 1 << 12) /* Synchronize on the last block */ 111 + #define ATMCI_WPMR 0x00e4 /* Write Protection Mode[2] */ 112 + # define ATMCI_WP_EN ( 1 << 0) /* WP Enable */ 113 + # define ATMCI_WP_KEY (0x4d4349 << 8) /* WP Key */ 114 + #define ATMCI_WPSR 0x00e8 /* Write Protection Status[2] */ 115 + # define ATMCI_GET_WP_VS(x) ((x) & 0x0f) 116 + # define ATMCI_GET_WP_VSRC(x) (((x) >> 8) & 0xffff) 117 + #define ATMCI_FIFO_APERTURE 0x0200 /* FIFO Aperture[2] */ 118 118 119 119 /* This is not including the FIFO Aperture on MCI2 */ 120 - #define MCI_REGS_SIZE 0x100 120 + #define ATMCI_REGS_SIZE 0x100 121 121 122 122 /* Register access macros */ 123 - #define mci_readl(port,reg) \ 124 - __raw_readl((port)->regs + MCI_##reg) 125 - #define mci_writel(port,reg,value) \ 126 - __raw_writel((value), (port)->regs + MCI_##reg) 123 + #define atmci_readl(port,reg) \ 124 + __raw_readl((port)->regs + ATMCI_##reg) 125 + #define atmci_writel(port,reg,value) \ 126 + __raw_writel((value), (port)->regs + ATMCI_##reg) 127 127 128 128 #endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */
+151 -150
drivers/mmc/host/atmel-mci.c
··· 39 39 40 40 #include "atmel-mci-regs.h" 41 41 42 - #define ATMCI_DATA_ERROR_FLAGS (MCI_DCRCE | MCI_DTOE | MCI_OVRE | MCI_UNRE) 42 + #define ATMCI_DATA_ERROR_FLAGS (ATMCI_DCRCE | ATMCI_DTOE | ATMCI_OVRE | ATMCI_UNRE) 43 43 #define ATMCI_DMA_THRESHOLD 16 44 44 45 45 enum { ··· 166 166 struct clk *mck; 167 167 struct platform_device *pdev; 168 168 169 - struct atmel_mci_slot *slot[ATMEL_MCI_MAX_NR_SLOTS]; 169 + struct atmel_mci_slot *slot[ATMCI_MAX_NR_SLOTS]; 170 170 }; 171 171 172 172 /** ··· 223 223 * Enable or disable features/registers based on 224 224 * whether the processor supports them 225 225 */ 226 - static bool mci_has_rwproof(void) 226 + static bool atmci_has_rwproof(void) 227 227 { 228 228 if (cpu_is_at91sam9261() || cpu_is_at91rm9200()) 229 229 return false; ··· 352 352 struct atmel_mci *host = s->private; 353 353 u32 *buf; 354 354 355 - buf = kmalloc(MCI_REGS_SIZE, GFP_KERNEL); 355 + buf = kmalloc(ATMCI_REGS_SIZE, GFP_KERNEL); 356 356 if (!buf) 357 357 return -ENOMEM; 358 358 ··· 363 363 */ 364 364 spin_lock_bh(&host->lock); 365 365 clk_enable(host->mck); 366 - memcpy_fromio(buf, host->regs, MCI_REGS_SIZE); 366 + memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE); 367 367 clk_disable(host->mck); 368 368 spin_unlock_bh(&host->lock); 369 369 370 370 seq_printf(s, "MR:\t0x%08x%s%s CLKDIV=%u\n", 371 - buf[MCI_MR / 4], 372 - buf[MCI_MR / 4] & MCI_MR_RDPROOF ? " RDPROOF" : "", 373 - buf[MCI_MR / 4] & MCI_MR_WRPROOF ? " WRPROOF" : "", 374 - buf[MCI_MR / 4] & 0xff); 375 - seq_printf(s, "DTOR:\t0x%08x\n", buf[MCI_DTOR / 4]); 376 - seq_printf(s, "SDCR:\t0x%08x\n", buf[MCI_SDCR / 4]); 377 - seq_printf(s, "ARGR:\t0x%08x\n", buf[MCI_ARGR / 4]); 371 + buf[ATMCI_MR / 4], 372 + buf[ATMCI_MR / 4] & ATMCI_MR_RDPROOF ? " RDPROOF" : "", 373 + buf[ATMCI_MR / 4] & ATMCI_MR_WRPROOF ? " WRPROOF" : "", 374 + buf[ATMCI_MR / 4] & 0xff); 375 + seq_printf(s, "DTOR:\t0x%08x\n", buf[ATMCI_DTOR / 4]); 376 + seq_printf(s, "SDCR:\t0x%08x\n", buf[ATMCI_SDCR / 4]); 377 + seq_printf(s, "ARGR:\t0x%08x\n", buf[ATMCI_ARGR / 4]); 378 378 seq_printf(s, "BLKR:\t0x%08x BCNT=%u BLKLEN=%u\n", 379 - buf[MCI_BLKR / 4], 380 - buf[MCI_BLKR / 4] & 0xffff, 381 - (buf[MCI_BLKR / 4] >> 16) & 0xffff); 379 + buf[ATMCI_BLKR / 4], 380 + buf[ATMCI_BLKR / 4] & 0xffff, 381 + (buf[ATMCI_BLKR / 4] >> 16) & 0xffff); 382 382 if (atmci_is_mci2()) 383 - seq_printf(s, "CSTOR:\t0x%08x\n", buf[MCI_CSTOR / 4]); 383 + seq_printf(s, "CSTOR:\t0x%08x\n", buf[ATMCI_CSTOR / 4]); 384 384 385 385 /* Don't read RSPR and RDR; it will consume the data there */ 386 386 387 - atmci_show_status_reg(s, "SR", buf[MCI_SR / 4]); 388 - atmci_show_status_reg(s, "IMR", buf[MCI_IMR / 4]); 387 + atmci_show_status_reg(s, "SR", buf[ATMCI_SR / 4]); 388 + atmci_show_status_reg(s, "IMR", buf[ATMCI_IMR / 4]); 389 389 390 390 if (atmci_is_mci2()) { 391 391 u32 val; 392 392 393 - val = buf[MCI_DMA / 4]; 393 + val = buf[ATMCI_DMA / 4]; 394 394 seq_printf(s, "DMA:\t0x%08x OFFSET=%u CHKSIZE=%u%s\n", 395 395 val, val & 3, 396 396 ((val >> 4) & 3) ? 397 397 1 << (((val >> 4) & 3) + 1) : 1, 398 - val & MCI_DMAEN ? " DMAEN" : ""); 398 + val & ATMCI_DMAEN ? " DMAEN" : ""); 399 399 400 - val = buf[MCI_CFG / 4]; 400 + val = buf[ATMCI_CFG / 4]; 401 401 seq_printf(s, "CFG:\t0x%08x%s%s%s%s\n", 402 402 val, 403 - val & MCI_CFG_FIFOMODE_1DATA ? " FIFOMODE_ONE_DATA" : "", 404 - val & MCI_CFG_FERRCTRL_COR ? " FERRCTRL_CLEAR_ON_READ" : "", 405 - val & MCI_CFG_HSMODE ? " HSMODE" : "", 406 - val & MCI_CFG_LSYNC ? " LSYNC" : ""); 403 + val & ATMCI_CFG_FIFOMODE_1DATA ? " FIFOMODE_ONE_DATA" : "", 404 + val & ATMCI_CFG_FERRCTRL_COR ? " FERRCTRL_CLEAR_ON_READ" : "", 405 + val & ATMCI_CFG_HSMODE ? " HSMODE" : "", 406 + val & ATMCI_CFG_LSYNC ? " LSYNC" : ""); 407 407 } 408 408 409 409 kfree(buf); ··· 466 466 dev_err(&mmc->class_dev, "failed to initialize debugfs for slot\n"); 467 467 } 468 468 469 - static inline unsigned int ns_to_clocks(struct atmel_mci *host, 469 + static inline unsigned int atmci_ns_to_clocks(struct atmel_mci *host, 470 470 unsigned int ns) 471 471 { 472 472 return (ns * (host->bus_hz / 1000000) + 999) / 1000; ··· 482 482 unsigned dtocyc; 483 483 unsigned dtomul; 484 484 485 - timeout = ns_to_clocks(host, data->timeout_ns) + data->timeout_clks; 485 + timeout = atmci_ns_to_clocks(host, data->timeout_ns) 486 + + data->timeout_clks; 486 487 487 488 for (dtomul = 0; dtomul < 8; dtomul++) { 488 489 unsigned shift = dtomul_to_shift[dtomul]; ··· 499 498 500 499 dev_vdbg(&slot->mmc->class_dev, "setting timeout to %u cycles\n", 501 500 dtocyc << dtomul_to_shift[dtomul]); 502 - mci_writel(host, DTOR, (MCI_DTOMUL(dtomul) | MCI_DTOCYC(dtocyc))); 501 + atmci_writel(host, DTOR, (ATMCI_DTOMUL(dtomul) | ATMCI_DTOCYC(dtocyc))); 503 502 } 504 503 505 504 /* ··· 513 512 514 513 cmd->error = -EINPROGRESS; 515 514 516 - cmdr = MCI_CMDR_CMDNB(cmd->opcode); 515 + cmdr = ATMCI_CMDR_CMDNB(cmd->opcode); 517 516 518 517 if (cmd->flags & MMC_RSP_PRESENT) { 519 518 if (cmd->flags & MMC_RSP_136) 520 - cmdr |= MCI_CMDR_RSPTYP_136BIT; 519 + cmdr |= ATMCI_CMDR_RSPTYP_136BIT; 521 520 else 522 - cmdr |= MCI_CMDR_RSPTYP_48BIT; 521 + cmdr |= ATMCI_CMDR_RSPTYP_48BIT; 523 522 } 524 523 525 524 /* ··· 527 526 * it's too difficult to determine whether this is an ACMD or 528 527 * not. Better make it 64. 529 528 */ 530 - cmdr |= MCI_CMDR_MAXLAT_64CYC; 529 + cmdr |= ATMCI_CMDR_MAXLAT_64CYC; 531 530 532 531 if (mmc->ios.bus_mode == MMC_BUSMODE_OPENDRAIN) 533 - cmdr |= MCI_CMDR_OPDCMD; 532 + cmdr |= ATMCI_CMDR_OPDCMD; 534 533 535 534 data = cmd->data; 536 535 if (data) { 537 - cmdr |= MCI_CMDR_START_XFER; 536 + cmdr |= ATMCI_CMDR_START_XFER; 538 537 539 538 if (cmd->opcode == SD_IO_RW_EXTENDED) { 540 - cmdr |= MCI_CMDR_SDIO_BLOCK; 539 + cmdr |= ATMCI_CMDR_SDIO_BLOCK; 541 540 } else { 542 541 if (data->flags & MMC_DATA_STREAM) 543 - cmdr |= MCI_CMDR_STREAM; 542 + cmdr |= ATMCI_CMDR_STREAM; 544 543 else if (data->blocks > 1) 545 - cmdr |= MCI_CMDR_MULTI_BLOCK; 544 + cmdr |= ATMCI_CMDR_MULTI_BLOCK; 546 545 else 547 - cmdr |= MCI_CMDR_BLOCK; 546 + cmdr |= ATMCI_CMDR_BLOCK; 548 547 } 549 548 550 549 if (data->flags & MMC_DATA_READ) 551 - cmdr |= MCI_CMDR_TRDIR_READ; 550 + cmdr |= ATMCI_CMDR_TRDIR_READ; 552 551 } 553 552 554 553 return cmdr; ··· 564 563 "start command: ARGR=0x%08x CMDR=0x%08x\n", 565 564 cmd->arg, cmd_flags); 566 565 567 - mci_writel(host, ARGR, cmd->arg); 568 - mci_writel(host, CMDR, cmd_flags); 566 + atmci_writel(host, ARGR, cmd->arg); 567 + atmci_writel(host, CMDR, cmd_flags); 569 568 } 570 569 571 - static void send_stop_cmd(struct atmel_mci *host, struct mmc_data *data) 570 + static void atmci_send_stop_cmd(struct atmel_mci *host, struct mmc_data *data) 572 571 { 573 572 atmci_start_command(host, data->stop, host->stop_cmdr); 574 - mci_writel(host, IER, MCI_CMDRDY); 573 + atmci_writel(host, IER, ATMCI_CMDRDY); 575 574 } 576 575 577 576 #ifdef CONFIG_MMC_ATMELMCI_DMA ··· 596 595 } else { 597 596 /* Data transfer was stopped by the interrupt handler */ 598 597 atmci_set_pending(host, EVENT_XFER_COMPLETE); 599 - mci_writel(host, IER, MCI_NOTBUSY); 598 + atmci_writel(host, IER, ATMCI_NOTBUSY); 600 599 } 601 600 } 602 601 ··· 610 609 611 610 if (atmci_is_mci2()) 612 611 /* Disable DMA hardware handshaking on MCI */ 613 - mci_writel(host, DMA, mci_readl(host, DMA) & ~MCI_DMAEN); 612 + atmci_writel(host, DMA, atmci_readl(host, DMA) & ~ATMCI_DMAEN); 614 613 615 614 atmci_dma_cleanup(host); 616 615 ··· 642 641 * completion callback" rule of the dma engine 643 642 * framework. 644 643 */ 645 - mci_writel(host, IER, MCI_NOTBUSY); 644 + atmci_writel(host, IER, ATMCI_NOTBUSY); 646 645 } 647 646 } 648 647 ··· 661 660 * non-word-aligned buffers or lengths. Also, we don't bother 662 661 * with all the DMA setup overhead for short transfers. 663 662 */ 664 - if (data->blocks * data->blksz < ATMCI_DMA_THRESHOLD) 663 + if (data->blocks * data->blksz < ATATMCI_DMA_THRESHOLD) 665 664 return -EINVAL; 666 665 if (data->blksz & 3) 667 666 return -EINVAL; ··· 680 679 return -ENODEV; 681 680 682 681 if (atmci_is_mci2()) 683 - mci_writel(host, DMA, MCI_DMA_CHKSIZE(3) | MCI_DMAEN); 682 + atmci_writel(host, DMA, ATMCI_DMA_CHKSIZE(3) | ATMCI_DMAEN); 684 683 685 684 if (data->flags & MMC_DATA_READ) 686 685 direction = DMA_FROM_DEVICE; ··· 730 729 { 731 730 /* Data transfer was stopped by the interrupt handler */ 732 731 atmci_set_pending(host, EVENT_XFER_COMPLETE); 733 - mci_writel(host, IER, MCI_NOTBUSY); 732 + atmci_writel(host, IER, ATMCI_NOTBUSY); 734 733 } 735 734 736 735 #endif /* CONFIG_MMC_ATMELMCI_DMA */ ··· 767 766 host->sg = data->sg; 768 767 host->pio_offset = 0; 769 768 if (data->flags & MMC_DATA_READ) 770 - iflags |= MCI_RXRDY; 769 + iflags |= ATMCI_RXRDY; 771 770 else 772 - iflags |= MCI_TXRDY; 771 + iflags |= ATMCI_TXRDY; 773 772 } 774 773 775 774 return iflags; ··· 793 792 host->data_status = 0; 794 793 795 794 if (host->need_reset) { 796 - mci_writel(host, CR, MCI_CR_SWRST); 797 - mci_writel(host, CR, MCI_CR_MCIEN); 798 - mci_writel(host, MR, host->mode_reg); 795 + atmci_writel(host, CR, ATMCI_CR_SWRST); 796 + atmci_writel(host, CR, ATMCI_CR_MCIEN); 797 + atmci_writel(host, MR, host->mode_reg); 799 798 if (atmci_is_mci2()) 800 - mci_writel(host, CFG, host->cfg_reg); 799 + atmci_writel(host, CFG, host->cfg_reg); 801 800 host->need_reset = false; 802 801 } 803 - mci_writel(host, SDCR, slot->sdc_reg); 802 + atmci_writel(host, SDCR, slot->sdc_reg); 804 803 805 - iflags = mci_readl(host, IMR); 806 - if (iflags & ~(MCI_SDIOIRQA | MCI_SDIOIRQB)) 804 + iflags = atmci_readl(host, IMR); 805 + if (iflags & ~(ATMCI_SDIOIRQA | ATMCI_SDIOIRQB)) 807 806 dev_warn(&slot->mmc->class_dev, "WARNING: IMR=0x%08x\n", 808 807 iflags); 809 808 810 809 if (unlikely(test_and_clear_bit(ATMCI_CARD_NEED_INIT, &slot->flags))) { 811 810 /* Send init sequence (74 clock cycles) */ 812 - mci_writel(host, CMDR, MCI_CMDR_SPCMD_INIT); 813 - while (!(mci_readl(host, SR) & MCI_CMDRDY)) 811 + atmci_writel(host, CMDR, ATMCI_CMDR_SPCMD_INIT); 812 + while (!(atmci_readl(host, SR) & ATMCI_CMDRDY)) 814 813 cpu_relax(); 815 814 } 816 815 iflags = 0; ··· 819 818 atmci_set_timeout(host, slot, data); 820 819 821 820 /* Must set block count/size before sending command */ 822 - mci_writel(host, BLKR, MCI_BCNT(data->blocks) 823 - | MCI_BLKLEN(data->blksz)); 821 + atmci_writel(host, BLKR, ATMCI_BCNT(data->blocks) 822 + | ATMCI_BLKLEN(data->blksz)); 824 823 dev_vdbg(&slot->mmc->class_dev, "BLKR=0x%08x\n", 825 - MCI_BCNT(data->blocks) | MCI_BLKLEN(data->blksz)); 824 + ATMCI_BCNT(data->blocks) | ATMCI_BLKLEN(data->blksz)); 826 825 827 826 iflags |= atmci_prepare_data(host, data); 828 827 } 829 828 830 - iflags |= MCI_CMDRDY; 829 + iflags |= ATMCI_CMDRDY; 831 830 cmd = mrq->cmd; 832 831 cmdflags = atmci_prepare_command(slot->mmc, cmd); 833 832 atmci_start_command(host, cmd, cmdflags); ··· 837 836 838 837 if (mrq->stop) { 839 838 host->stop_cmdr = atmci_prepare_command(slot->mmc, mrq->stop); 840 - host->stop_cmdr |= MCI_CMDR_STOP_XFER; 839 + host->stop_cmdr |= ATMCI_CMDR_STOP_XFER; 841 840 if (!(data->flags & MMC_DATA_WRITE)) 842 - host->stop_cmdr |= MCI_CMDR_TRDIR_READ; 841 + host->stop_cmdr |= ATMCI_CMDR_TRDIR_READ; 843 842 if (data->flags & MMC_DATA_STREAM) 844 - host->stop_cmdr |= MCI_CMDR_STREAM; 843 + host->stop_cmdr |= ATMCI_CMDR_STREAM; 845 844 else 846 - host->stop_cmdr |= MCI_CMDR_MULTI_BLOCK; 845 + host->stop_cmdr |= ATMCI_CMDR_MULTI_BLOCK; 847 846 } 848 847 849 848 /* ··· 852 851 * conditions (e.g. command and data complete, but stop not 853 852 * prepared yet.) 854 853 */ 855 - mci_writel(host, IER, iflags); 854 + atmci_writel(host, IER, iflags); 856 855 } 857 856 858 857 static void atmci_queue_request(struct atmel_mci *host, ··· 910 909 struct atmel_mci *host = slot->host; 911 910 unsigned int i; 912 911 913 - slot->sdc_reg &= ~MCI_SDCBUS_MASK; 912 + slot->sdc_reg &= ~ATMCI_SDCBUS_MASK; 914 913 switch (ios->bus_width) { 915 914 case MMC_BUS_WIDTH_1: 916 - slot->sdc_reg |= MCI_SDCBUS_1BIT; 915 + slot->sdc_reg |= ATMCI_SDCBUS_1BIT; 917 916 break; 918 917 case MMC_BUS_WIDTH_4: 919 - slot->sdc_reg |= MCI_SDCBUS_4BIT; 918 + slot->sdc_reg |= ATMCI_SDCBUS_4BIT; 920 919 break; 921 920 } 922 921 ··· 927 926 spin_lock_bh(&host->lock); 928 927 if (!host->mode_reg) { 929 928 clk_enable(host->mck); 930 - mci_writel(host, CR, MCI_CR_SWRST); 931 - mci_writel(host, CR, MCI_CR_MCIEN); 929 + atmci_writel(host, CR, ATMCI_CR_SWRST); 930 + atmci_writel(host, CR, ATMCI_CR_MCIEN); 932 931 if (atmci_is_mci2()) 933 - mci_writel(host, CFG, host->cfg_reg); 932 + atmci_writel(host, CFG, host->cfg_reg); 934 933 } 935 934 936 935 /* ··· 938 937 * core ios update when finding the minimum. 939 938 */ 940 939 slot->clock = ios->clock; 941 - for (i = 0; i < ATMEL_MCI_MAX_NR_SLOTS; i++) { 940 + for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) { 942 941 if (host->slot[i] && host->slot[i]->clock 943 942 && host->slot[i]->clock < clock_min) 944 943 clock_min = host->slot[i]->clock; ··· 953 952 clkdiv = 255; 954 953 } 955 954 956 - host->mode_reg = MCI_MR_CLKDIV(clkdiv); 955 + host->mode_reg = ATMCI_MR_CLKDIV(clkdiv); 957 956 958 957 /* 959 958 * WRPROOF and RDPROOF prevent overruns/underruns by 960 959 * stopping the clock when the FIFO is full/empty. 961 960 * This state is not expected to last for long. 962 961 */ 963 - if (mci_has_rwproof()) 964 - host->mode_reg |= (MCI_MR_WRPROOF | MCI_MR_RDPROOF); 962 + if (atmci_has_rwproof()) 963 + host->mode_reg |= (ATMCI_MR_WRPROOF | ATMCI_MR_RDPROOF); 965 964 966 965 if (atmci_is_mci2()) { 967 966 /* setup High Speed mode in relation with card capacity */ 968 967 if (ios->timing == MMC_TIMING_SD_HS) 969 - host->cfg_reg |= MCI_CFG_HSMODE; 968 + host->cfg_reg |= ATMCI_CFG_HSMODE; 970 969 else 971 - host->cfg_reg &= ~MCI_CFG_HSMODE; 970 + host->cfg_reg &= ~ATMCI_CFG_HSMODE; 972 971 } 973 972 974 973 if (list_empty(&host->queue)) { 975 - mci_writel(host, MR, host->mode_reg); 974 + atmci_writel(host, MR, host->mode_reg); 976 975 if (atmci_is_mci2()) 977 - mci_writel(host, CFG, host->cfg_reg); 976 + atmci_writel(host, CFG, host->cfg_reg); 978 977 } else { 979 978 host->need_clock_update = true; 980 979 } ··· 985 984 986 985 spin_lock_bh(&host->lock); 987 986 slot->clock = 0; 988 - for (i = 0; i < ATMEL_MCI_MAX_NR_SLOTS; i++) { 987 + for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) { 989 988 if (host->slot[i] && host->slot[i]->clock) { 990 989 any_slot_active = true; 991 990 break; 992 991 } 993 992 } 994 993 if (!any_slot_active) { 995 - mci_writel(host, CR, MCI_CR_MCIDIS); 994 + atmci_writel(host, CR, ATMCI_CR_MCIDIS); 996 995 if (host->mode_reg) { 997 - mci_readl(host, MR); 996 + atmci_readl(host, MR); 998 997 clk_disable(host->mck); 999 998 } 1000 999 host->mode_reg = 0; ··· 1058 1057 struct atmel_mci *host = slot->host; 1059 1058 1060 1059 if (enable) 1061 - mci_writel(host, IER, slot->sdio_irq); 1060 + atmci_writel(host, IER, slot->sdio_irq); 1062 1061 else 1063 - mci_writel(host, IDR, slot->sdio_irq); 1062 + atmci_writel(host, IDR, slot->sdio_irq); 1064 1063 } 1065 1064 1066 1065 static const struct mmc_host_ops atmci_ops = { ··· 1087 1086 * busy transferring data. 1088 1087 */ 1089 1088 if (host->need_clock_update) { 1090 - mci_writel(host, MR, host->mode_reg); 1089 + atmci_writel(host, MR, host->mode_reg); 1091 1090 if (atmci_is_mci2()) 1092 - mci_writel(host, CFG, host->cfg_reg); 1091 + atmci_writel(host, CFG, host->cfg_reg); 1093 1092 } 1094 1093 1095 1094 host->cur_slot->mrq = NULL; ··· 1118 1117 u32 status = host->cmd_status; 1119 1118 1120 1119 /* Read the response from the card (up to 16 bytes) */ 1121 - cmd->resp[0] = mci_readl(host, RSPR); 1122 - cmd->resp[1] = mci_readl(host, RSPR); 1123 - cmd->resp[2] = mci_readl(host, RSPR); 1124 - cmd->resp[3] = mci_readl(host, RSPR); 1120 + cmd->resp[0] = atmci_readl(host, RSPR); 1121 + cmd->resp[1] = atmci_readl(host, RSPR); 1122 + cmd->resp[2] = atmci_readl(host, RSPR); 1123 + cmd->resp[3] = atmci_readl(host, RSPR); 1125 1124 1126 - if (status & MCI_RTOE) 1125 + if (status & ATMCI_RTOE) 1127 1126 cmd->error = -ETIMEDOUT; 1128 - else if ((cmd->flags & MMC_RSP_CRC) && (status & MCI_RCRCE)) 1127 + else if ((cmd->flags & MMC_RSP_CRC) && (status & ATMCI_RCRCE)) 1129 1128 cmd->error = -EILSEQ; 1130 - else if (status & (MCI_RINDE | MCI_RDIRE | MCI_RENDE)) 1129 + else if (status & (ATMCI_RINDE | ATMCI_RDIRE | ATMCI_RENDE)) 1131 1130 cmd->error = -EIO; 1132 1131 else 1133 1132 cmd->error = 0; ··· 1139 1138 if (cmd->data) { 1140 1139 atmci_stop_dma(host); 1141 1140 host->data = NULL; 1142 - mci_writel(host, IDR, MCI_NOTBUSY 1143 - | MCI_TXRDY | MCI_RXRDY 1141 + atmci_writel(host, IDR, ATMCI_NOTBUSY 1142 + | ATMCI_TXRDY | ATMCI_RXRDY 1144 1143 | ATMCI_DATA_ERROR_FLAGS); 1145 1144 } 1146 1145 } ··· 1192 1191 * Reset controller to terminate any ongoing 1193 1192 * commands or data transfers. 1194 1193 */ 1195 - mci_writel(host, CR, MCI_CR_SWRST); 1196 - mci_writel(host, CR, MCI_CR_MCIEN); 1197 - mci_writel(host, MR, host->mode_reg); 1194 + atmci_writel(host, CR, ATMCI_CR_SWRST); 1195 + atmci_writel(host, CR, ATMCI_CR_MCIEN); 1196 + atmci_writel(host, MR, host->mode_reg); 1198 1197 if (atmci_is_mci2()) 1199 - mci_writel(host, CFG, host->cfg_reg); 1198 + atmci_writel(host, CFG, host->cfg_reg); 1200 1199 1201 1200 host->data = NULL; 1202 1201 host->cmd = NULL; ··· 1262 1261 dev_vdbg(&host->pdev->dev, 1263 1262 "tasklet: state %u pending/completed/mask %lx/%lx/%x\n", 1264 1263 state, host->pending_events, host->completed_events, 1265 - mci_readl(host, IMR)); 1264 + atmci_readl(host, IMR)); 1266 1265 1267 1266 do { 1268 1267 prev_state = state; ··· 1292 1291 EVENT_DATA_ERROR)) { 1293 1292 atmci_stop_dma(host); 1294 1293 if (data->stop) 1295 - send_stop_cmd(host, data); 1294 + atmci_send_stop_cmd(host, data); 1296 1295 state = STATE_DATA_ERROR; 1297 1296 break; 1298 1297 } ··· 1314 1313 atmci_set_completed(host, EVENT_DATA_COMPLETE); 1315 1314 status = host->data_status; 1316 1315 if (unlikely(status & ATMCI_DATA_ERROR_FLAGS)) { 1317 - if (status & MCI_DTOE) { 1316 + if (status & ATMCI_DTOE) { 1318 1317 dev_dbg(&host->pdev->dev, 1319 1318 "data timeout error\n"); 1320 1319 data->error = -ETIMEDOUT; 1321 - } else if (status & MCI_DCRCE) { 1320 + } else if (status & ATMCI_DCRCE) { 1322 1321 dev_dbg(&host->pdev->dev, 1323 1322 "data CRC error\n"); 1324 1323 data->error = -EILSEQ; ··· 1331 1330 } else { 1332 1331 data->bytes_xfered = data->blocks * data->blksz; 1333 1332 data->error = 0; 1334 - mci_writel(host, IDR, ATMCI_DATA_ERROR_FLAGS); 1333 + atmci_writel(host, IDR, ATMCI_DATA_ERROR_FLAGS); 1335 1334 } 1336 1335 1337 1336 if (!data->stop) { ··· 1341 1340 1342 1341 prev_state = state = STATE_SENDING_STOP; 1343 1342 if (!data->error) 1344 - send_stop_cmd(host, data); 1343 + atmci_send_stop_cmd(host, data); 1345 1344 /* fall through */ 1346 1345 1347 1346 case STATE_SENDING_STOP: ··· 1381 1380 unsigned int nbytes = 0; 1382 1381 1383 1382 do { 1384 - value = mci_readl(host, RDR); 1383 + value = atmci_readl(host, RDR); 1385 1384 if (likely(offset + 4 <= sg->length)) { 1386 1385 put_unaligned(value, (u32 *)(buf + offset)); 1387 1386 ··· 1413 1412 nbytes += offset; 1414 1413 } 1415 1414 1416 - status = mci_readl(host, SR); 1415 + status = atmci_readl(host, SR); 1417 1416 if (status & ATMCI_DATA_ERROR_FLAGS) { 1418 - mci_writel(host, IDR, (MCI_NOTBUSY | MCI_RXRDY 1417 + atmci_writel(host, IDR, (ATMCI_NOTBUSY | ATMCI_RXRDY 1419 1418 | ATMCI_DATA_ERROR_FLAGS)); 1420 1419 host->data_status = status; 1421 1420 data->bytes_xfered += nbytes; ··· 1424 1423 tasklet_schedule(&host->tasklet); 1425 1424 return; 1426 1425 } 1427 - } while (status & MCI_RXRDY); 1426 + } while (status & ATMCI_RXRDY); 1428 1427 1429 1428 host->pio_offset = offset; 1430 1429 data->bytes_xfered += nbytes; ··· 1432 1431 return; 1433 1432 1434 1433 done: 1435 - mci_writel(host, IDR, MCI_RXRDY); 1436 - mci_writel(host, IER, MCI_NOTBUSY); 1434 + atmci_writel(host, IDR, ATMCI_RXRDY); 1435 + atmci_writel(host, IER, ATMCI_NOTBUSY); 1437 1436 data->bytes_xfered += nbytes; 1438 1437 smp_wmb(); 1439 1438 atmci_set_pending(host, EVENT_XFER_COMPLETE); ··· 1452 1451 do { 1453 1452 if (likely(offset + 4 <= sg->length)) { 1454 1453 value = get_unaligned((u32 *)(buf + offset)); 1455 - mci_writel(host, TDR, value); 1454 + atmci_writel(host, TDR, value); 1456 1455 1457 1456 offset += 4; 1458 1457 nbytes += 4; ··· 1473 1472 1474 1473 host->sg = sg = sg_next(sg); 1475 1474 if (!sg) { 1476 - mci_writel(host, TDR, value); 1475 + atmci_writel(host, TDR, value); 1477 1476 goto done; 1478 1477 } 1479 1478 1480 1479 offset = 4 - remaining; 1481 1480 buf = sg_virt(sg); 1482 1481 memcpy((u8 *)&value + remaining, buf, offset); 1483 - mci_writel(host, TDR, value); 1482 + atmci_writel(host, TDR, value); 1484 1483 nbytes += offset; 1485 1484 } 1486 1485 1487 - status = mci_readl(host, SR); 1486 + status = atmci_readl(host, SR); 1488 1487 if (status & ATMCI_DATA_ERROR_FLAGS) { 1489 - mci_writel(host, IDR, (MCI_NOTBUSY | MCI_TXRDY 1488 + atmci_writel(host, IDR, (ATMCI_NOTBUSY | ATMCI_TXRDY 1490 1489 | ATMCI_DATA_ERROR_FLAGS)); 1491 1490 host->data_status = status; 1492 1491 data->bytes_xfered += nbytes; ··· 1495 1494 tasklet_schedule(&host->tasklet); 1496 1495 return; 1497 1496 } 1498 - } while (status & MCI_TXRDY); 1497 + } while (status & ATMCI_TXRDY); 1499 1498 1500 1499 host->pio_offset = offset; 1501 1500 data->bytes_xfered += nbytes; ··· 1503 1502 return; 1504 1503 1505 1504 done: 1506 - mci_writel(host, IDR, MCI_TXRDY); 1507 - mci_writel(host, IER, MCI_NOTBUSY); 1505 + atmci_writel(host, IDR, ATMCI_TXRDY); 1506 + atmci_writel(host, IER, ATMCI_NOTBUSY); 1508 1507 data->bytes_xfered += nbytes; 1509 1508 smp_wmb(); 1510 1509 atmci_set_pending(host, EVENT_XFER_COMPLETE); ··· 1512 1511 1513 1512 static void atmci_cmd_interrupt(struct atmel_mci *host, u32 status) 1514 1513 { 1515 - mci_writel(host, IDR, MCI_CMDRDY); 1514 + atmci_writel(host, IDR, ATMCI_CMDRDY); 1516 1515 1517 1516 host->cmd_status = status; 1518 1517 smp_wmb(); ··· 1524 1523 { 1525 1524 int i; 1526 1525 1527 - for (i = 0; i < ATMEL_MCI_MAX_NR_SLOTS; i++) { 1526 + for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) { 1528 1527 struct atmel_mci_slot *slot = host->slot[i]; 1529 1528 if (slot && (status & slot->sdio_irq)) { 1530 1529 mmc_signal_sdio_irq(slot->mmc); ··· 1540 1539 unsigned int pass_count = 0; 1541 1540 1542 1541 do { 1543 - status = mci_readl(host, SR); 1544 - mask = mci_readl(host, IMR); 1542 + status = atmci_readl(host, SR); 1543 + mask = atmci_readl(host, IMR); 1545 1544 pending = status & mask; 1546 1545 if (!pending) 1547 1546 break; 1548 1547 1549 1548 if (pending & ATMCI_DATA_ERROR_FLAGS) { 1550 - mci_writel(host, IDR, ATMCI_DATA_ERROR_FLAGS 1551 - | MCI_RXRDY | MCI_TXRDY); 1552 - pending &= mci_readl(host, IMR); 1549 + atmci_writel(host, IDR, ATMCI_DATA_ERROR_FLAGS 1550 + | ATMCI_RXRDY | ATMCI_TXRDY); 1551 + pending &= atmci_readl(host, IMR); 1553 1552 1554 1553 host->data_status = status; 1555 1554 smp_wmb(); 1556 1555 atmci_set_pending(host, EVENT_DATA_ERROR); 1557 1556 tasklet_schedule(&host->tasklet); 1558 1557 } 1559 - if (pending & MCI_NOTBUSY) { 1560 - mci_writel(host, IDR, 1561 - ATMCI_DATA_ERROR_FLAGS | MCI_NOTBUSY); 1558 + if (pending & ATMCI_NOTBUSY) { 1559 + atmci_writel(host, IDR, 1560 + ATMCI_DATA_ERROR_FLAGS | ATMCI_NOTBUSY); 1562 1561 if (!host->data_status) 1563 1562 host->data_status = status; 1564 1563 smp_wmb(); 1565 1564 atmci_set_pending(host, EVENT_DATA_COMPLETE); 1566 1565 tasklet_schedule(&host->tasklet); 1567 1566 } 1568 - if (pending & MCI_RXRDY) 1567 + if (pending & ATMCI_RXRDY) 1569 1568 atmci_read_data_pio(host); 1570 - if (pending & MCI_TXRDY) 1569 + if (pending & ATMCI_TXRDY) 1571 1570 atmci_write_data_pio(host); 1572 1571 1573 - if (pending & MCI_CMDRDY) 1572 + if (pending & ATMCI_CMDRDY) 1574 1573 atmci_cmd_interrupt(host, status); 1575 1574 1576 - if (pending & (MCI_SDIOIRQA | MCI_SDIOIRQB)) 1575 + if (pending & (ATMCI_SDIOIRQA | ATMCI_SDIOIRQB)) 1577 1576 atmci_sdio_interrupt(host, status); 1578 1577 1579 1578 } while (pass_count++ < 5); ··· 1706 1705 } 1707 1706 1708 1707 #ifdef CONFIG_MMC_ATMELMCI_DMA 1709 - static bool filter(struct dma_chan *chan, void *slave) 1708 + static bool atmci_filter(struct dma_chan *chan, void *slave) 1710 1709 { 1711 1710 struct mci_dma_data *sl = slave; 1712 1711 ··· 1731 1730 dma_cap_mask_t mask; 1732 1731 1733 1732 setup_dma_addr(pdata->dma_slave, 1734 - host->mapbase + MCI_TDR, 1735 - host->mapbase + MCI_RDR); 1733 + host->mapbase + ATMCI_TDR, 1734 + host->mapbase + ATMCI_RDR); 1736 1735 1737 1736 /* Try to grab a DMA channel */ 1738 1737 dma_cap_zero(mask); 1739 1738 dma_cap_set(DMA_SLAVE, mask); 1740 1739 host->dma.chan = 1741 - dma_request_channel(mask, filter, pdata->dma_slave); 1740 + dma_request_channel(mask, atmci_filter, pdata->dma_slave); 1742 1741 } 1743 1742 if (!host->dma.chan) 1744 1743 dev_notice(&host->pdev->dev, "DMA not available, using PIO\n"); ··· 1790 1789 goto err_ioremap; 1791 1790 1792 1791 clk_enable(host->mck); 1793 - mci_writel(host, CR, MCI_CR_SWRST); 1792 + atmci_writel(host, CR, ATMCI_CR_SWRST); 1794 1793 host->bus_hz = clk_get_rate(host->mck); 1795 1794 clk_disable(host->mck); 1796 1795 ··· 1811 1810 ret = -ENODEV; 1812 1811 if (pdata->slot[0].bus_width) { 1813 1812 ret = atmci_init_slot(host, &pdata->slot[0], 1814 - 0, MCI_SDCSEL_SLOT_A, MCI_SDIOIRQA); 1813 + 0, ATMCI_SDCSEL_SLOT_A, ATMCI_SDIOIRQA); 1815 1814 if (!ret) 1816 1815 nr_slots++; 1817 1816 } 1818 1817 if (pdata->slot[1].bus_width) { 1819 1818 ret = atmci_init_slot(host, &pdata->slot[1], 1820 - 1, MCI_SDCSEL_SLOT_B, MCI_SDIOIRQB); 1819 + 1, ATMCI_SDCSEL_SLOT_B, ATMCI_SDIOIRQB); 1821 1820 if (!ret) 1822 1821 nr_slots++; 1823 1822 } ··· 1855 1854 1856 1855 platform_set_drvdata(pdev, NULL); 1857 1856 1858 - for (i = 0; i < ATMEL_MCI_MAX_NR_SLOTS; i++) { 1857 + for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) { 1859 1858 if (host->slot[i]) 1860 1859 atmci_cleanup_slot(host->slot[i], i); 1861 1860 } 1862 1861 1863 1862 clk_enable(host->mck); 1864 - mci_writel(host, IDR, ~0UL); 1865 - mci_writel(host, CR, MCI_CR_MCIDIS); 1866 - mci_readl(host, SR); 1863 + atmci_writel(host, IDR, ~0UL); 1864 + atmci_writel(host, CR, ATMCI_CR_MCIDIS); 1865 + atmci_readl(host, SR); 1867 1866 clk_disable(host->mck); 1868 1867 1869 1868 #ifdef CONFIG_MMC_ATMELMCI_DMA ··· 1886 1885 struct atmel_mci *host = dev_get_drvdata(dev); 1887 1886 int i; 1888 1887 1889 - for (i = 0; i < ATMEL_MCI_MAX_NR_SLOTS; i++) { 1888 + for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) { 1890 1889 struct atmel_mci_slot *slot = host->slot[i]; 1891 1890 int ret; 1892 1891 ··· 1917 1916 int i; 1918 1917 int ret = 0; 1919 1918 1920 - for (i = 0; i < ATMEL_MCI_MAX_NR_SLOTS; i++) { 1919 + for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) { 1921 1920 struct atmel_mci_slot *slot = host->slot[i]; 1922 1921 int err; 1923 1922
+2 -2
include/linux/atmel-mci.h
··· 1 1 #ifndef __LINUX_ATMEL_MCI_H 2 2 #define __LINUX_ATMEL_MCI_H 3 3 4 - #define ATMEL_MCI_MAX_NR_SLOTS 2 4 + #define ATMCI_MAX_NR_SLOTS 2 5 5 6 6 /** 7 7 * struct mci_slot_pdata - board-specific per-slot configuration ··· 33 33 */ 34 34 struct mci_platform_data { 35 35 struct mci_dma_data *dma_slave; 36 - struct mci_slot_pdata slot[ATMEL_MCI_MAX_NR_SLOTS]; 36 + struct mci_slot_pdata slot[ATMCI_MAX_NR_SLOTS]; 37 37 }; 38 38 39 39 #endif /* __LINUX_ATMEL_MCI_H */