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

spi: lantiq-ssc: add LTQ_ prefix to defines

The blackfin architecture has a SPI_STAT define which conflicts with
the define from the spi-lantiq-ssc driver in compile test mode. Fix
this by adding a prefix in front of every define.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Hauke Mehrtens and committed by
Mark Brown
ad2fca07 57f22cd2

+209 -202
+209 -202
drivers/spi/spi-lantiq-ssc.c
··· 26 26 #include <lantiq_soc.h> 27 27 #endif 28 28 29 - #define SPI_RX_IRQ_NAME "spi_rx" 30 - #define SPI_TX_IRQ_NAME "spi_tx" 31 - #define SPI_ERR_IRQ_NAME "spi_err" 32 - #define SPI_FRM_IRQ_NAME "spi_frm" 29 + #define LTQ_SPI_RX_IRQ_NAME "spi_rx" 30 + #define LTQ_SPI_TX_IRQ_NAME "spi_tx" 31 + #define LTQ_SPI_ERR_IRQ_NAME "spi_err" 32 + #define LTQ_SPI_FRM_IRQ_NAME "spi_frm" 33 33 34 - #define SPI_CLC 0x00 35 - #define SPI_PISEL 0x04 36 - #define SPI_ID 0x08 37 - #define SPI_CON 0x10 38 - #define SPI_STAT 0x14 39 - #define SPI_WHBSTATE 0x18 40 - #define SPI_TB 0x20 41 - #define SPI_RB 0x24 42 - #define SPI_RXFCON 0x30 43 - #define SPI_TXFCON 0x34 44 - #define SPI_FSTAT 0x38 45 - #define SPI_BRT 0x40 46 - #define SPI_BRSTAT 0x44 47 - #define SPI_SFCON 0x60 48 - #define SPI_SFSTAT 0x64 49 - #define SPI_GPOCON 0x70 50 - #define SPI_GPOSTAT 0x74 51 - #define SPI_FPGO 0x78 52 - #define SPI_RXREQ 0x80 53 - #define SPI_RXCNT 0x84 54 - #define SPI_DMACON 0xec 55 - #define SPI_IRNEN 0xf4 56 - #define SPI_IRNICR 0xf8 57 - #define SPI_IRNCR 0xfc 34 + #define LTQ_SPI_CLC 0x00 35 + #define LTQ_SPI_PISEL 0x04 36 + #define LTQ_SPI_ID 0x08 37 + #define LTQ_SPI_CON 0x10 38 + #define LTQ_SPI_STAT 0x14 39 + #define LTQ_SPI_WHBSTATE 0x18 40 + #define LTQ_SPI_TB 0x20 41 + #define LTQ_SPI_RB 0x24 42 + #define LTQ_SPI_RXFCON 0x30 43 + #define LTQ_SPI_TXFCON 0x34 44 + #define LTQ_SPI_FSTAT 0x38 45 + #define LTQ_SPI_BRT 0x40 46 + #define LTQ_SPI_BRSTAT 0x44 47 + #define LTQ_SPI_SFCON 0x60 48 + #define LTQ_SPI_SFSTAT 0x64 49 + #define LTQ_SPI_GPOCON 0x70 50 + #define LTQ_SPI_GPOSTAT 0x74 51 + #define LTQ_SPI_FPGO 0x78 52 + #define LTQ_SPI_RXREQ 0x80 53 + #define LTQ_SPI_RXCNT 0x84 54 + #define LTQ_SPI_DMACON 0xec 55 + #define LTQ_SPI_IRNEN 0xf4 56 + #define LTQ_SPI_IRNICR 0xf8 57 + #define LTQ_SPI_IRNCR 0xfc 58 58 59 - #define SPI_CLC_SMC_S 16 /* Clock divider for sleep mode */ 60 - #define SPI_CLC_SMC_M (0xFF << SPI_CLC_SMC_S) 61 - #define SPI_CLC_RMC_S 8 /* Clock divider for normal run mode */ 62 - #define SPI_CLC_RMC_M (0xFF << SPI_CLC_RMC_S) 63 - #define SPI_CLC_DISS BIT(1) /* Disable status bit */ 64 - #define SPI_CLC_DISR BIT(0) /* Disable request bit */ 59 + #define LTQ_SPI_CLC_SMC_S 16 /* Clock divider for sleep mode */ 60 + #define LTQ_SPI_CLC_SMC_M (0xFF << LTQ_SPI_CLC_SMC_S) 61 + #define LTQ_SPI_CLC_RMC_S 8 /* Clock divider for normal run mode */ 62 + #define LTQ_SPI_CLC_RMC_M (0xFF << LTQ_SPI_CLC_RMC_S) 63 + #define LTQ_SPI_CLC_DISS BIT(1) /* Disable status bit */ 64 + #define LTQ_SPI_CLC_DISR BIT(0) /* Disable request bit */ 65 65 66 - #define SPI_ID_TXFS_S 24 /* Implemented TX FIFO size */ 67 - #define SPI_ID_TXFS_M (0x3F << SPI_ID_TXFS_S) 68 - #define SPI_ID_RXFS_S 16 /* Implemented RX FIFO size */ 69 - #define SPI_ID_RXFS_M (0x3F << SPI_ID_RXFS_S) 70 - #define SPI_ID_MOD_S 8 /* Module ID */ 71 - #define SPI_ID_MOD_M (0xff << SPI_ID_MOD_S) 72 - #define SPI_ID_CFG_S 5 /* DMA interface support */ 73 - #define SPI_ID_CFG_M (1 << SPI_ID_CFG_S) 74 - #define SPI_ID_REV_M 0x1F /* Hardware revision number */ 66 + #define LTQ_SPI_ID_TXFS_S 24 /* Implemented TX FIFO size */ 67 + #define LTQ_SPI_ID_TXFS_M (0x3F << LTQ_SPI_ID_TXFS_S) 68 + #define LTQ_SPI_ID_RXFS_S 16 /* Implemented RX FIFO size */ 69 + #define LTQ_SPI_ID_RXFS_M (0x3F << LTQ_SPI_ID_RXFS_S) 70 + #define LTQ_SPI_ID_MOD_S 8 /* Module ID */ 71 + #define LTQ_SPI_ID_MOD_M (0xff << LTQ_SPI_ID_MOD_S) 72 + #define LTQ_SPI_ID_CFG_S 5 /* DMA interface support */ 73 + #define LTQ_SPI_ID_CFG_M (1 << LTQ_SPI_ID_CFG_S) 74 + #define LTQ_SPI_ID_REV_M 0x1F /* Hardware revision number */ 75 75 76 - #define SPI_CON_BM_S 16 /* Data width selection */ 77 - #define SPI_CON_BM_M (0x1F << SPI_CON_BM_S) 78 - #define SPI_CON_EM BIT(24) /* Echo mode */ 79 - #define SPI_CON_IDLE BIT(23) /* Idle bit value */ 80 - #define SPI_CON_ENBV BIT(22) /* Enable byte valid control */ 81 - #define SPI_CON_RUEN BIT(12) /* Receive underflow error enable */ 82 - #define SPI_CON_TUEN BIT(11) /* Transmit underflow error enable */ 83 - #define SPI_CON_AEN BIT(10) /* Abort error enable */ 84 - #define SPI_CON_REN BIT(9) /* Receive overflow error enable */ 85 - #define SPI_CON_TEN BIT(8) /* Transmit overflow error enable */ 86 - #define SPI_CON_LB BIT(7) /* Loopback control */ 87 - #define SPI_CON_PO BIT(6) /* Clock polarity control */ 88 - #define SPI_CON_PH BIT(5) /* Clock phase control */ 89 - #define SPI_CON_HB BIT(4) /* Heading control */ 90 - #define SPI_CON_RXOFF BIT(1) /* Switch receiver off */ 91 - #define SPI_CON_TXOFF BIT(0) /* Switch transmitter off */ 76 + #define LTQ_SPI_CON_BM_S 16 /* Data width selection */ 77 + #define LTQ_SPI_CON_BM_M (0x1F << LTQ_SPI_CON_BM_S) 78 + #define LTQ_SPI_CON_EM BIT(24) /* Echo mode */ 79 + #define LTQ_SPI_CON_IDLE BIT(23) /* Idle bit value */ 80 + #define LTQ_SPI_CON_ENBV BIT(22) /* Enable byte valid control */ 81 + #define LTQ_SPI_CON_RUEN BIT(12) /* Receive underflow error enable */ 82 + #define LTQ_SPI_CON_TUEN BIT(11) /* Transmit underflow error enable */ 83 + #define LTQ_SPI_CON_AEN BIT(10) /* Abort error enable */ 84 + #define LTQ_SPI_CON_REN BIT(9) /* Receive overflow error enable */ 85 + #define LTQ_SPI_CON_TEN BIT(8) /* Transmit overflow error enable */ 86 + #define LTQ_SPI_CON_LB BIT(7) /* Loopback control */ 87 + #define LTQ_SPI_CON_PO BIT(6) /* Clock polarity control */ 88 + #define LTQ_SPI_CON_PH BIT(5) /* Clock phase control */ 89 + #define LTQ_SPI_CON_HB BIT(4) /* Heading control */ 90 + #define LTQ_SPI_CON_RXOFF BIT(1) /* Switch receiver off */ 91 + #define LTQ_SPI_CON_TXOFF BIT(0) /* Switch transmitter off */ 92 92 93 - #define SPI_STAT_RXBV_S 28 94 - #define SPI_STAT_RXBV_M (0x7 << SPI_STAT_RXBV_S) 95 - #define SPI_STAT_BSY BIT(13) /* Busy flag */ 96 - #define SPI_STAT_RUE BIT(12) /* Receive underflow error flag */ 97 - #define SPI_STAT_TUE BIT(11) /* Transmit underflow error flag */ 98 - #define SPI_STAT_AE BIT(10) /* Abort error flag */ 99 - #define SPI_STAT_RE BIT(9) /* Receive error flag */ 100 - #define SPI_STAT_TE BIT(8) /* Transmit error flag */ 101 - #define SPI_STAT_ME BIT(7) /* Mode error flag */ 102 - #define SPI_STAT_MS BIT(1) /* Master/slave select bit */ 103 - #define SPI_STAT_EN BIT(0) /* Enable bit */ 104 - #define SPI_STAT_ERRORS (SPI_STAT_ME | SPI_STAT_TE | SPI_STAT_RE | \ 105 - SPI_STAT_AE | SPI_STAT_TUE | SPI_STAT_RUE) 93 + #define LTQ_SPI_STAT_RXBV_S 28 94 + #define LTQ_SPI_STAT_RXBV_M (0x7 << LTQ_SPI_STAT_RXBV_S) 95 + #define LTQ_SPI_STAT_BSY BIT(13) /* Busy flag */ 96 + #define LTQ_SPI_STAT_RUE BIT(12) /* Receive underflow error flag */ 97 + #define LTQ_SPI_STAT_TUE BIT(11) /* Transmit underflow error flag */ 98 + #define LTQ_SPI_STAT_AE BIT(10) /* Abort error flag */ 99 + #define LTQ_SPI_STAT_RE BIT(9) /* Receive error flag */ 100 + #define LTQ_SPI_STAT_TE BIT(8) /* Transmit error flag */ 101 + #define LTQ_SPI_STAT_ME BIT(7) /* Mode error flag */ 102 + #define LTQ_SPI_STAT_MS BIT(1) /* Master/slave select bit */ 103 + #define LTQ_SPI_STAT_EN BIT(0) /* Enable bit */ 104 + #define LTQ_SPI_STAT_ERRORS (LTQ_SPI_STAT_ME | LTQ_SPI_STAT_TE | \ 105 + LTQ_SPI_STAT_RE | LTQ_SPI_STAT_AE | \ 106 + LTQ_SPI_STAT_TUE | LTQ_SPI_STAT_RUE) 106 107 107 - #define SPI_WHBSTATE_SETTUE BIT(15) /* Set transmit underflow error flag */ 108 - #define SPI_WHBSTATE_SETAE BIT(14) /* Set abort error flag */ 109 - #define SPI_WHBSTATE_SETRE BIT(13) /* Set receive error flag */ 110 - #define SPI_WHBSTATE_SETTE BIT(12) /* Set transmit error flag */ 111 - #define SPI_WHBSTATE_CLRTUE BIT(11) /* Clear transmit underflow error flag */ 112 - #define SPI_WHBSTATE_CLRAE BIT(10) /* Clear abort error flag */ 113 - #define SPI_WHBSTATE_CLRRE BIT(9) /* Clear receive error flag */ 114 - #define SPI_WHBSTATE_CLRTE BIT(8) /* Clear transmit error flag */ 115 - #define SPI_WHBSTATE_SETME BIT(7) /* Set mode error flag */ 116 - #define SPI_WHBSTATE_CLRME BIT(6) /* Clear mode error flag */ 117 - #define SPI_WHBSTATE_SETRUE BIT(5) /* Set receive underflow error flag */ 118 - #define SPI_WHBSTATE_CLRRUE BIT(4) /* Clear receive underflow error flag */ 119 - #define SPI_WHBSTATE_SETMS BIT(3) /* Set master select bit */ 120 - #define SPI_WHBSTATE_CLRMS BIT(2) /* Clear master select bit */ 121 - #define SPI_WHBSTATE_SETEN BIT(1) /* Set enable bit (operational mode) */ 122 - #define SPI_WHBSTATE_CLREN BIT(0) /* Clear enable bit (config mode */ 123 - #define SPI_WHBSTATE_CLR_ERRORS (SPI_WHBSTATE_CLRRUE | SPI_WHBSTATE_CLRME | \ 124 - SPI_WHBSTATE_CLRTE | SPI_WHBSTATE_CLRRE | \ 125 - SPI_WHBSTATE_CLRAE | SPI_WHBSTATE_CLRTUE) 108 + #define LTQ_SPI_WHBSTATE_SETTUE BIT(15) /* Set transmit underflow error flag */ 109 + #define LTQ_SPI_WHBSTATE_SETAE BIT(14) /* Set abort error flag */ 110 + #define LTQ_SPI_WHBSTATE_SETRE BIT(13) /* Set receive error flag */ 111 + #define LTQ_SPI_WHBSTATE_SETTE BIT(12) /* Set transmit error flag */ 112 + #define LTQ_SPI_WHBSTATE_CLRTUE BIT(11) /* Clear transmit underflow error flag */ 113 + #define LTQ_SPI_WHBSTATE_CLRAE BIT(10) /* Clear abort error flag */ 114 + #define LTQ_SPI_WHBSTATE_CLRRE BIT(9) /* Clear receive error flag */ 115 + #define LTQ_SPI_WHBSTATE_CLRTE BIT(8) /* Clear transmit error flag */ 116 + #define LTQ_SPI_WHBSTATE_SETME BIT(7) /* Set mode error flag */ 117 + #define LTQ_SPI_WHBSTATE_CLRME BIT(6) /* Clear mode error flag */ 118 + #define LTQ_SPI_WHBSTATE_SETRUE BIT(5) /* Set receive underflow error flag */ 119 + #define LTQ_SPI_WHBSTATE_CLRRUE BIT(4) /* Clear receive underflow error flag */ 120 + #define LTQ_SPI_WHBSTATE_SETMS BIT(3) /* Set master select bit */ 121 + #define LTQ_SPI_WHBSTATE_CLRMS BIT(2) /* Clear master select bit */ 122 + #define LTQ_SPI_WHBSTATE_SETEN BIT(1) /* Set enable bit (operational mode) */ 123 + #define LTQ_SPI_WHBSTATE_CLREN BIT(0) /* Clear enable bit (config mode */ 124 + #define LTQ_SPI_WHBSTATE_CLR_ERRORS (LTQ_SPI_WHBSTATE_CLRRUE | \ 125 + LTQ_SPI_WHBSTATE_CLRME | \ 126 + LTQ_SPI_WHBSTATE_CLRTE | \ 127 + LTQ_SPI_WHBSTATE_CLRRE | \ 128 + LTQ_SPI_WHBSTATE_CLRAE | \ 129 + LTQ_SPI_WHBSTATE_CLRTUE) 126 130 127 - #define SPI_RXFCON_RXFITL_S 8 /* FIFO interrupt trigger level */ 128 - #define SPI_RXFCON_RXFITL_M (0x3F << SPI_RXFCON_RXFITL_S) 129 - #define SPI_RXFCON_RXFLU BIT(1) /* FIFO flush */ 130 - #define SPI_RXFCON_RXFEN BIT(0) /* FIFO enable */ 131 + #define LTQ_SPI_RXFCON_RXFITL_S 8 /* FIFO interrupt trigger level */ 132 + #define LTQ_SPI_RXFCON_RXFITL_M (0x3F << LTQ_SPI_RXFCON_RXFITL_S) 133 + #define LTQ_SPI_RXFCON_RXFLU BIT(1) /* FIFO flush */ 134 + #define LTQ_SPI_RXFCON_RXFEN BIT(0) /* FIFO enable */ 131 135 132 - #define SPI_TXFCON_TXFITL_S 8 /* FIFO interrupt trigger level */ 133 - #define SPI_TXFCON_TXFITL_M (0x3F << SPI_TXFCON_TXFITL_S) 134 - #define SPI_TXFCON_TXFLU BIT(1) /* FIFO flush */ 135 - #define SPI_TXFCON_TXFEN BIT(0) /* FIFO enable */ 136 + #define LTQ_SPI_TXFCON_TXFITL_S 8 /* FIFO interrupt trigger level */ 137 + #define LTQ_SPI_TXFCON_TXFITL_M (0x3F << LTQ_SPI_TXFCON_TXFITL_S) 138 + #define LTQ_SPI_TXFCON_TXFLU BIT(1) /* FIFO flush */ 139 + #define LTQ_SPI_TXFCON_TXFEN BIT(0) /* FIFO enable */ 136 140 137 - #define SPI_FSTAT_RXFFL_S 0 138 - #define SPI_FSTAT_RXFFL_M (0x3f << SPI_FSTAT_RXFFL_S) 139 - #define SPI_FSTAT_TXFFL_S 8 140 - #define SPI_FSTAT_TXFFL_M (0x3f << SPI_FSTAT_TXFFL_S) 141 + #define LTQ_SPI_FSTAT_RXFFL_S 0 142 + #define LTQ_SPI_FSTAT_RXFFL_M (0x3f << LTQ_SPI_FSTAT_RXFFL_S) 143 + #define LTQ_SPI_FSTAT_TXFFL_S 8 144 + #define LTQ_SPI_FSTAT_TXFFL_M (0x3f << LTQ_SPI_FSTAT_TXFFL_S) 141 145 142 - #define SPI_GPOCON_ISCSBN_S 8 143 - #define SPI_GPOCON_INVOUTN_S 0 146 + #define LTQ_SPI_GPOCON_ISCSBN_S 8 147 + #define LTQ_SPI_GPOCON_INVOUTN_S 0 144 148 145 - #define SPI_FGPO_SETOUTN_S 8 146 - #define SPI_FGPO_CLROUTN_S 0 149 + #define LTQ_SPI_FGPO_SETOUTN_S 8 150 + #define LTQ_SPI_FGPO_CLROUTN_S 0 147 151 148 - #define SPI_RXREQ_RXCNT_M 0xFFFF /* Receive count value */ 149 - #define SPI_RXCNT_TODO_M 0xFFFF /* Recevie to-do value */ 152 + #define LTQ_SPI_RXREQ_RXCNT_M 0xFFFF /* Receive count value */ 153 + #define LTQ_SPI_RXCNT_TODO_M 0xFFFF /* Recevie to-do value */ 150 154 151 - #define SPI_IRNEN_TFI BIT(4) /* TX finished interrupt */ 152 - #define SPI_IRNEN_F BIT(3) /* Frame end interrupt request */ 153 - #define SPI_IRNEN_E BIT(2) /* Error end interrupt request */ 154 - #define SPI_IRNEN_T_XWAY BIT(1) /* Transmit end interrupt request */ 155 - #define SPI_IRNEN_R_XWAY BIT(0) /* Receive end interrupt request */ 156 - #define SPI_IRNEN_R_XRX BIT(1) /* Transmit end interrupt request */ 157 - #define SPI_IRNEN_T_XRX BIT(0) /* Receive end interrupt request */ 158 - #define SPI_IRNEN_ALL 0x1F 155 + #define LTQ_SPI_IRNEN_TFI BIT(4) /* TX finished interrupt */ 156 + #define LTQ_SPI_IRNEN_F BIT(3) /* Frame end interrupt request */ 157 + #define LTQ_SPI_IRNEN_E BIT(2) /* Error end interrupt request */ 158 + #define LTQ_SPI_IRNEN_T_XWAY BIT(1) /* Transmit end interrupt request */ 159 + #define LTQ_SPI_IRNEN_R_XWAY BIT(0) /* Receive end interrupt request */ 160 + #define LTQ_SPI_IRNEN_R_XRX BIT(1) /* Transmit end interrupt request */ 161 + #define LTQ_SPI_IRNEN_T_XRX BIT(0) /* Receive end interrupt request */ 162 + #define LTQ_SPI_IRNEN_ALL 0x1F 159 163 160 164 struct lantiq_ssc_hwcfg { 161 165 unsigned int irnen_r; ··· 212 208 213 209 static unsigned int tx_fifo_level(const struct lantiq_ssc_spi *spi) 214 210 { 215 - u32 fstat = lantiq_ssc_readl(spi, SPI_FSTAT); 211 + u32 fstat = lantiq_ssc_readl(spi, LTQ_SPI_FSTAT); 216 212 217 - return (fstat & SPI_FSTAT_TXFFL_M) >> SPI_FSTAT_TXFFL_S; 213 + return (fstat & LTQ_SPI_FSTAT_TXFFL_M) >> LTQ_SPI_FSTAT_TXFFL_S; 218 214 } 219 215 220 216 static unsigned int rx_fifo_level(const struct lantiq_ssc_spi *spi) 221 217 { 222 - u32 fstat = lantiq_ssc_readl(spi, SPI_FSTAT); 218 + u32 fstat = lantiq_ssc_readl(spi, LTQ_SPI_FSTAT); 223 219 224 - return fstat & SPI_FSTAT_RXFFL_M; 220 + return fstat & LTQ_SPI_FSTAT_RXFFL_M; 225 221 } 226 222 227 223 static unsigned int tx_fifo_free(const struct lantiq_ssc_spi *spi) ··· 231 227 232 228 static void rx_fifo_reset(const struct lantiq_ssc_spi *spi) 233 229 { 234 - u32 val = spi->rx_fifo_size << SPI_RXFCON_RXFITL_S; 230 + u32 val = spi->rx_fifo_size << LTQ_SPI_RXFCON_RXFITL_S; 235 231 236 - val |= SPI_RXFCON_RXFEN | SPI_RXFCON_RXFLU; 237 - lantiq_ssc_writel(spi, val, SPI_RXFCON); 232 + val |= LTQ_SPI_RXFCON_RXFEN | LTQ_SPI_RXFCON_RXFLU; 233 + lantiq_ssc_writel(spi, val, LTQ_SPI_RXFCON); 238 234 } 239 235 240 236 static void tx_fifo_reset(const struct lantiq_ssc_spi *spi) 241 237 { 242 - u32 val = 1 << SPI_TXFCON_TXFITL_S; 238 + u32 val = 1 << LTQ_SPI_TXFCON_TXFITL_S; 243 239 244 - val |= SPI_TXFCON_TXFEN | SPI_TXFCON_TXFLU; 245 - lantiq_ssc_writel(spi, val, SPI_TXFCON); 240 + val |= LTQ_SPI_TXFCON_TXFEN | LTQ_SPI_TXFCON_TXFLU; 241 + lantiq_ssc_writel(spi, val, LTQ_SPI_TXFCON); 246 242 } 247 243 248 244 static void rx_fifo_flush(const struct lantiq_ssc_spi *spi) 249 245 { 250 - lantiq_ssc_maskl(spi, 0, SPI_RXFCON_RXFLU, SPI_RXFCON); 246 + lantiq_ssc_maskl(spi, 0, LTQ_SPI_RXFCON_RXFLU, LTQ_SPI_RXFCON); 251 247 } 252 248 253 249 static void tx_fifo_flush(const struct lantiq_ssc_spi *spi) 254 250 { 255 - lantiq_ssc_maskl(spi, 0, SPI_TXFCON_TXFLU, SPI_TXFCON); 251 + lantiq_ssc_maskl(spi, 0, LTQ_SPI_TXFCON_TXFLU, LTQ_SPI_TXFCON); 256 252 } 257 253 258 254 static void hw_enter_config_mode(const struct lantiq_ssc_spi *spi) 259 255 { 260 - lantiq_ssc_writel(spi, SPI_WHBSTATE_CLREN, SPI_WHBSTATE); 256 + lantiq_ssc_writel(spi, LTQ_SPI_WHBSTATE_CLREN, LTQ_SPI_WHBSTATE); 261 257 } 262 258 263 259 static void hw_enter_active_mode(const struct lantiq_ssc_spi *spi) 264 260 { 265 - lantiq_ssc_writel(spi, SPI_WHBSTATE_SETEN, SPI_WHBSTATE); 261 + lantiq_ssc_writel(spi, LTQ_SPI_WHBSTATE_SETEN, LTQ_SPI_WHBSTATE); 266 262 } 267 263 268 264 static void hw_setup_speed_hz(const struct lantiq_ssc_spi *spi, ··· 291 287 dev_dbg(spi->dev, "spi_clk %u, max_speed_hz %u, brt %u\n", 292 288 spi_clk, max_speed_hz, brt); 293 289 294 - lantiq_ssc_writel(spi, brt, SPI_BRT); 290 + lantiq_ssc_writel(spi, brt, LTQ_SPI_BRT); 295 291 } 296 292 297 293 static void hw_setup_bits_per_word(const struct lantiq_ssc_spi *spi, ··· 300 296 u32 bm; 301 297 302 298 /* CON.BM value = bits_per_word - 1 */ 303 - bm = (bits_per_word - 1) << SPI_CON_BM_S; 299 + bm = (bits_per_word - 1) << LTQ_SPI_CON_BM_S; 304 300 305 - lantiq_ssc_maskl(spi, SPI_CON_BM_M, bm, SPI_CON); 301 + lantiq_ssc_maskl(spi, LTQ_SPI_CON_BM_M, bm, LTQ_SPI_CON); 306 302 } 307 303 308 304 static void hw_setup_clock_mode(const struct lantiq_ssc_spi *spi, ··· 319 315 * 3 1 1 1 0 320 316 */ 321 317 if (mode & SPI_CPHA) 322 - con_clr |= SPI_CON_PH; 318 + con_clr |= LTQ_SPI_CON_PH; 323 319 else 324 - con_set |= SPI_CON_PH; 320 + con_set |= LTQ_SPI_CON_PH; 325 321 326 322 if (mode & SPI_CPOL) 327 - con_set |= SPI_CON_PO | SPI_CON_IDLE; 323 + con_set |= LTQ_SPI_CON_PO | LTQ_SPI_CON_IDLE; 328 324 else 329 - con_clr |= SPI_CON_PO | SPI_CON_IDLE; 325 + con_clr |= LTQ_SPI_CON_PO | LTQ_SPI_CON_IDLE; 330 326 331 327 /* Set heading control */ 332 328 if (mode & SPI_LSB_FIRST) 333 - con_clr |= SPI_CON_HB; 329 + con_clr |= LTQ_SPI_CON_HB; 334 330 else 335 - con_set |= SPI_CON_HB; 331 + con_set |= LTQ_SPI_CON_HB; 336 332 337 333 /* Set loopback mode */ 338 334 if (mode & SPI_LOOP) 339 - con_set |= SPI_CON_LB; 335 + con_set |= LTQ_SPI_CON_LB; 340 336 else 341 - con_clr |= SPI_CON_LB; 337 + con_clr |= LTQ_SPI_CON_LB; 342 338 343 - lantiq_ssc_maskl(spi, con_clr, con_set, SPI_CON); 339 + lantiq_ssc_maskl(spi, con_clr, con_set, LTQ_SPI_CON); 344 340 } 345 341 346 342 static void lantiq_ssc_hw_init(const struct lantiq_ssc_spi *spi) ··· 351 347 * Set clock divider for run mode to 1 to 352 348 * run at same frequency as FPI bus 353 349 */ 354 - lantiq_ssc_writel(spi, 1 << SPI_CLC_RMC_S, SPI_CLC); 350 + lantiq_ssc_writel(spi, 1 << LTQ_SPI_CLC_RMC_S, LTQ_SPI_CLC); 355 351 356 352 /* Put controller into config mode */ 357 353 hw_enter_config_mode(spi); 358 354 359 355 /* Clear error flags */ 360 - lantiq_ssc_maskl(spi, 0, SPI_WHBSTATE_CLR_ERRORS, SPI_WHBSTATE); 356 + lantiq_ssc_maskl(spi, 0, LTQ_SPI_WHBSTATE_CLR_ERRORS, LTQ_SPI_WHBSTATE); 361 357 362 358 /* Enable error checking, disable TX/RX */ 363 - lantiq_ssc_writel(spi, SPI_CON_RUEN | SPI_CON_AEN | SPI_CON_TEN | 364 - SPI_CON_REN | SPI_CON_TXOFF | SPI_CON_RXOFF, SPI_CON); 359 + lantiq_ssc_writel(spi, LTQ_SPI_CON_RUEN | LTQ_SPI_CON_AEN | 360 + LTQ_SPI_CON_TEN | LTQ_SPI_CON_REN | LTQ_SPI_CON_TXOFF | 361 + LTQ_SPI_CON_RXOFF, LTQ_SPI_CON); 365 362 366 363 /* Setup default SPI mode */ 367 364 hw_setup_bits_per_word(spi, spi->bits_per_word); 368 365 hw_setup_clock_mode(spi, SPI_MODE_0); 369 366 370 367 /* Enable master mode and clear error flags */ 371 - lantiq_ssc_writel(spi, SPI_WHBSTATE_SETMS | SPI_WHBSTATE_CLR_ERRORS, 372 - SPI_WHBSTATE); 368 + lantiq_ssc_writel(spi, LTQ_SPI_WHBSTATE_SETMS | 369 + LTQ_SPI_WHBSTATE_CLR_ERRORS, 370 + LTQ_SPI_WHBSTATE); 373 371 374 372 /* Reset GPIO/CS registers */ 375 - lantiq_ssc_writel(spi, 0, SPI_GPOCON); 376 - lantiq_ssc_writel(spi, 0xFF00, SPI_FPGO); 373 + lantiq_ssc_writel(spi, 0, LTQ_SPI_GPOCON); 374 + lantiq_ssc_writel(spi, 0xFF00, LTQ_SPI_FPGO); 377 375 378 376 /* Enable and flush FIFOs */ 379 377 rx_fifo_reset(spi); 380 378 tx_fifo_reset(spi); 381 379 382 380 /* Enable interrupts */ 383 - lantiq_ssc_writel(spi, hwcfg->irnen_t | hwcfg->irnen_r | SPI_IRNEN_E, 384 - SPI_IRNEN); 381 + lantiq_ssc_writel(spi, hwcfg->irnen_t | hwcfg->irnen_r | 382 + LTQ_SPI_IRNEN_E, LTQ_SPI_IRNEN); 385 383 } 386 384 387 385 static int lantiq_ssc_setup(struct spi_device *spidev) ··· 406 400 } 407 401 408 402 /* set GPO pin to CS mode */ 409 - gpocon = 1 << ((cs - spi->base_cs) + SPI_GPOCON_ISCSBN_S); 403 + gpocon = 1 << ((cs - spi->base_cs) + LTQ_SPI_GPOCON_ISCSBN_S); 410 404 411 405 /* invert GPO pin */ 412 406 if (spidev->mode & SPI_CS_HIGH) 413 407 gpocon |= 1 << (cs - spi->base_cs); 414 408 415 - lantiq_ssc_maskl(spi, 0, gpocon, SPI_GPOCON); 409 + lantiq_ssc_maskl(spi, 0, gpocon, LTQ_SPI_GPOCON); 416 410 417 411 return 0; 418 412 } ··· 448 442 } 449 443 450 444 /* Configure transmitter and receiver */ 451 - con = lantiq_ssc_readl(spi, SPI_CON); 445 + con = lantiq_ssc_readl(spi, LTQ_SPI_CON); 452 446 if (t->tx_buf) 453 - con &= ~SPI_CON_TXOFF; 447 + con &= ~LTQ_SPI_CON_TXOFF; 454 448 else 455 - con |= SPI_CON_TXOFF; 449 + con |= LTQ_SPI_CON_TXOFF; 456 450 457 451 if (t->rx_buf) 458 - con &= ~SPI_CON_RXOFF; 452 + con &= ~LTQ_SPI_CON_RXOFF; 459 453 else 460 - con |= SPI_CON_RXOFF; 454 + con |= LTQ_SPI_CON_RXOFF; 461 455 462 - lantiq_ssc_writel(spi, con, SPI_CON); 456 + lantiq_ssc_writel(spi, con, LTQ_SPI_CON); 463 457 } 464 458 465 459 static int lantiq_ssc_unprepare_message(struct spi_master *master, ··· 470 464 flush_workqueue(spi->wq); 471 465 472 466 /* Disable transmitter and receiver while idle */ 473 - lantiq_ssc_maskl(spi, 0, SPI_CON_TXOFF | SPI_CON_RXOFF, SPI_CON); 467 + lantiq_ssc_maskl(spi, 0, LTQ_SPI_CON_TXOFF | LTQ_SPI_CON_RXOFF, 468 + LTQ_SPI_CON); 474 469 475 470 return 0; 476 471 } ··· 510 503 break; 511 504 } 512 505 513 - lantiq_ssc_writel(spi, data, SPI_TB); 506 + lantiq_ssc_writel(spi, data, LTQ_SPI_TB); 514 507 tx_free--; 515 508 } 516 509 } ··· 524 517 unsigned int rx_fill = rx_fifo_level(spi); 525 518 526 519 while (rx_fill) { 527 - data = lantiq_ssc_readl(spi, SPI_RB); 520 + data = lantiq_ssc_readl(spi, LTQ_SPI_RB); 528 521 529 522 switch (spi->bits_per_word) { 530 523 case 2 ... 8: ··· 570 563 */ 571 564 while (rx_fill) { 572 565 if (spi->rx_todo < 4) { 573 - rxbv = (lantiq_ssc_readl(spi, SPI_STAT) & 574 - SPI_STAT_RXBV_M) >> SPI_STAT_RXBV_S; 575 - data = lantiq_ssc_readl(spi, SPI_RB); 566 + rxbv = (lantiq_ssc_readl(spi, LTQ_SPI_STAT) & 567 + LTQ_SPI_STAT_RXBV_M) >> LTQ_SPI_STAT_RXBV_S; 568 + data = lantiq_ssc_readl(spi, LTQ_SPI_RB); 576 569 577 570 shift = (rxbv - 1) * 8; 578 571 rx8 = spi->rx; ··· 585 578 spi->rx++; 586 579 } 587 580 } else { 588 - data = lantiq_ssc_readl(spi, SPI_RB); 581 + data = lantiq_ssc_readl(spi, LTQ_SPI_RB); 589 582 rx32 = (u32 *) spi->rx; 590 583 591 584 *rx32++ = data; ··· 610 603 if (rxreq > rxreq_max) 611 604 rxreq = rxreq_max; 612 605 613 - lantiq_ssc_writel(spi, rxreq, SPI_RXREQ); 606 + lantiq_ssc_writel(spi, rxreq, LTQ_SPI_RXREQ); 614 607 } 615 608 616 609 static irqreturn_t lantiq_ssc_xmit_interrupt(int irq, void *data) ··· 649 642 static irqreturn_t lantiq_ssc_err_interrupt(int irq, void *data) 650 643 { 651 644 struct lantiq_ssc_spi *spi = data; 652 - u32 stat = lantiq_ssc_readl(spi, SPI_STAT); 645 + u32 stat = lantiq_ssc_readl(spi, LTQ_SPI_STAT); 653 646 654 - if (!(stat & SPI_STAT_ERRORS)) 647 + if (!(stat & LTQ_SPI_STAT_ERRORS)) 655 648 return IRQ_NONE; 656 649 657 - if (stat & SPI_STAT_RUE) 650 + if (stat & LTQ_SPI_STAT_RUE) 658 651 dev_err(spi->dev, "receive underflow error\n"); 659 - if (stat & SPI_STAT_TUE) 652 + if (stat & LTQ_SPI_STAT_TUE) 660 653 dev_err(spi->dev, "transmit underflow error\n"); 661 - if (stat & SPI_STAT_AE) 654 + if (stat & LTQ_SPI_STAT_AE) 662 655 dev_err(spi->dev, "abort error\n"); 663 - if (stat & SPI_STAT_RE) 656 + if (stat & LTQ_SPI_STAT_RE) 664 657 dev_err(spi->dev, "receive overflow error\n"); 665 - if (stat & SPI_STAT_TE) 658 + if (stat & LTQ_SPI_STAT_TE) 666 659 dev_err(spi->dev, "transmit overflow error\n"); 667 - if (stat & SPI_STAT_ME) 660 + if (stat & LTQ_SPI_STAT_ME) 668 661 dev_err(spi->dev, "mode error\n"); 669 662 670 663 /* Clear error flags */ 671 - lantiq_ssc_maskl(spi, 0, SPI_WHBSTATE_CLR_ERRORS, SPI_WHBSTATE); 664 + lantiq_ssc_maskl(spi, 0, LTQ_SPI_WHBSTATE_CLR_ERRORS, LTQ_SPI_WHBSTATE); 672 665 673 666 /* set bad status so it can be retried */ 674 667 if (spi->master->cur_msg) ··· 728 721 729 722 end = jiffies + msecs_to_jiffies(timeout); 730 723 do { 731 - u32 stat = lantiq_ssc_readl(spi, SPI_STAT); 724 + u32 stat = lantiq_ssc_readl(spi, LTQ_SPI_STAT); 732 725 733 - if (!(stat & SPI_STAT_BSY)) { 726 + if (!(stat & LTQ_SPI_STAT_BSY)) { 734 727 spi_finalize_current_transfer(spi->master); 735 728 return; 736 729 } ··· 762 755 if (!!(spidev->mode & SPI_CS_HIGH) == enable) 763 756 fgpo = (1 << (cs - spi->base_cs)); 764 757 else 765 - fgpo = (1 << (cs - spi->base_cs + SPI_FGPO_SETOUTN_S)); 758 + fgpo = (1 << (cs - spi->base_cs + LTQ_SPI_FGPO_SETOUTN_S)); 766 759 767 - lantiq_ssc_writel(spi, fgpo, SPI_FPGO); 760 + lantiq_ssc_writel(spi, fgpo, LTQ_SPI_FPGO); 768 761 } 769 762 770 763 static int lantiq_ssc_transfer_one(struct spi_master *master, ··· 779 772 } 780 773 781 774 static const struct lantiq_ssc_hwcfg lantiq_ssc_xway = { 782 - .irnen_r = SPI_IRNEN_R_XWAY, 783 - .irnen_t = SPI_IRNEN_T_XWAY, 775 + .irnen_r = LTQ_SPI_IRNEN_R_XWAY, 776 + .irnen_t = LTQ_SPI_IRNEN_T_XWAY, 784 777 }; 785 778 786 779 static const struct lantiq_ssc_hwcfg lantiq_ssc_xrx = { 787 - .irnen_r = SPI_IRNEN_R_XRX, 788 - .irnen_t = SPI_IRNEN_T_XRX, 780 + .irnen_r = LTQ_SPI_IRNEN_R_XRX, 781 + .irnen_t = LTQ_SPI_IRNEN_T_XRX, 789 782 }; 790 783 791 784 static const struct of_device_id lantiq_ssc_match[] = { ··· 821 814 return -ENXIO; 822 815 } 823 816 824 - rx_irq = platform_get_irq_byname(pdev, SPI_RX_IRQ_NAME); 817 + rx_irq = platform_get_irq_byname(pdev, LTQ_SPI_RX_IRQ_NAME); 825 818 if (rx_irq < 0) { 826 - dev_err(dev, "failed to get %s\n", SPI_RX_IRQ_NAME); 819 + dev_err(dev, "failed to get %s\n", LTQ_SPI_RX_IRQ_NAME); 827 820 return -ENXIO; 828 821 } 829 822 830 - tx_irq = platform_get_irq_byname(pdev, SPI_TX_IRQ_NAME); 823 + tx_irq = platform_get_irq_byname(pdev, LTQ_SPI_TX_IRQ_NAME); 831 824 if (tx_irq < 0) { 832 - dev_err(dev, "failed to get %s\n", SPI_TX_IRQ_NAME); 825 + dev_err(dev, "failed to get %s\n", LTQ_SPI_TX_IRQ_NAME); 833 826 return -ENXIO; 834 827 } 835 828 836 - err_irq = platform_get_irq_byname(pdev, SPI_ERR_IRQ_NAME); 829 + err_irq = platform_get_irq_byname(pdev, LTQ_SPI_ERR_IRQ_NAME); 837 830 if (err_irq < 0) { 838 - dev_err(dev, "failed to get %s\n", SPI_ERR_IRQ_NAME); 831 + dev_err(dev, "failed to get %s\n", LTQ_SPI_ERR_IRQ_NAME); 839 832 return -ENXIO; 840 833 } 841 834 ··· 856 849 } 857 850 858 851 err = devm_request_irq(dev, rx_irq, lantiq_ssc_xmit_interrupt, 859 - 0, SPI_RX_IRQ_NAME, spi); 852 + 0, LTQ_SPI_RX_IRQ_NAME, spi); 860 853 if (err) 861 854 goto err_master_put; 862 855 863 856 err = devm_request_irq(dev, tx_irq, lantiq_ssc_xmit_interrupt, 864 - 0, SPI_TX_IRQ_NAME, spi); 857 + 0, LTQ_SPI_TX_IRQ_NAME, spi); 865 858 if (err) 866 859 goto err_master_put; 867 860 868 861 err = devm_request_irq(dev, err_irq, lantiq_ssc_err_interrupt, 869 - 0, SPI_ERR_IRQ_NAME, spi); 862 + 0, LTQ_SPI_ERR_IRQ_NAME, spi); 870 863 if (err) 871 864 goto err_master_put; 872 865 ··· 923 916 } 924 917 INIT_WORK(&spi->work, lantiq_ssc_bussy_work); 925 918 926 - id = lantiq_ssc_readl(spi, SPI_ID); 927 - spi->tx_fifo_size = (id & SPI_ID_TXFS_M) >> SPI_ID_TXFS_S; 928 - spi->rx_fifo_size = (id & SPI_ID_RXFS_M) >> SPI_ID_RXFS_S; 929 - supports_dma = (id & SPI_ID_CFG_M) >> SPI_ID_CFG_S; 930 - revision = id & SPI_ID_REV_M; 919 + id = lantiq_ssc_readl(spi, LTQ_SPI_ID); 920 + spi->tx_fifo_size = (id & LTQ_SPI_ID_TXFS_M) >> LTQ_SPI_ID_TXFS_S; 921 + spi->rx_fifo_size = (id & LTQ_SPI_ID_RXFS_M) >> LTQ_SPI_ID_RXFS_S; 922 + supports_dma = (id & LTQ_SPI_ID_CFG_M) >> LTQ_SPI_ID_CFG_S; 923 + revision = id & LTQ_SPI_ID_REV_M; 931 924 932 925 lantiq_ssc_hw_init(spi); 933 926 ··· 959 952 { 960 953 struct lantiq_ssc_spi *spi = platform_get_drvdata(pdev); 961 954 962 - lantiq_ssc_writel(spi, 0, SPI_IRNEN); 963 - lantiq_ssc_writel(spi, 0, SPI_CLC); 955 + lantiq_ssc_writel(spi, 0, LTQ_SPI_IRNEN); 956 + lantiq_ssc_writel(spi, 0, LTQ_SPI_CLC); 964 957 rx_fifo_flush(spi); 965 958 tx_fifo_flush(spi); 966 959 hw_enter_config_mode(spi);