Source
130
130
static inline void dw_spi_debugfs_remove(struct dw_spi *dws)
131
131
{
132
132
}
133
133
#endif /* CONFIG_DEBUG_FS */
134
134
135
135
void dw_spi_set_cs(struct spi_device *spi, bool enable)
136
136
{
137
137
struct dw_spi *dws = spi_controller_get_devdata(spi->controller);
138
138
struct chip_data *chip = spi_get_ctldata(spi);
139
139
140
-
/* Chip select logic is inverted from spi_set_cs() */
141
140
if (chip && chip->cs_control)
142
-
chip->cs_control(!enable);
141
+
chip->cs_control(enable);
143
142
144
-
if (!enable)
143
+
if (enable)
145
144
dw_writel(dws, DW_SPI_SER, BIT(spi->chip_select));
146
145
else if (dws->cs_override)
147
146
dw_writel(dws, DW_SPI_SER, 0);
148
147
}
149
148
EXPORT_SYMBOL_GPL(dw_spi_set_cs);
150
149
151
150
/* Return the max entries we can fill into tx fifo */
152
151
static inline u32 tx_max(struct dw_spi *dws)
153
152
{
154
153
u32 tx_left, tx_room, rxtx_gap;