spi: spi-msm-geni: Propagate missing change from 4.14 to 5.4

Propagate following change from 4.14 to 5.4 for SPI driver.
'commit 6276c3f68f8ecf5 ("spi: spi-geni-qcom : Don't configure
SPI WORD LEN for SPI Slave")'.

Change-Id: I714f455589be75d19d8f32e9f04e8cdc518a0430
Signed-off-by: Ashish Kori <akori@codeaurora.org>
This commit is contained in:
Ashish Kori 2020-08-25 20:07:07 +05:30 • committed by Gerrit - the friendly Code Review server
commit 2e7d855eea

View file

@ -221,6 +221,7 @@ static int get_spi_clk_cfg(u32 speed_hz, struct spi_geni_master *mas,
static void spi_setup_word_len(struct spi_geni_master *mas, u32 mode,
int bits_per_word)
{
struct spi_master *spi = get_spi_master(mas->dev);
int pack_words = 1;
bool msb_first = (mode & SPI_LSB_FIRST) ? false : true;
u32 word_len = geni_read_reg(mas->base, SE_SPI_WORD_LEN);
@ -232,10 +233,19 @@ static void spi_setup_word_len(struct spi_geni_master *mas, u32 mode,
*/
if (!(mas->tx_fifo_width % bits_per_word))
pack_words = mas->tx_fifo_width / bits_per_word;
word_len &= ~WORD_LEN_MSK;
word_len |= ((bits_per_word - MIN_WORD_LEN) & WORD_LEN_MSK);
se_config_packing(mas->base, bits_per_word, pack_words, msb_first);
geni_write_reg(word_len, mas->base, SE_SPI_WORD_LEN);
/*
* Don't configure SPI word length for SPI Slave it is an optional
* property for SPI Slave. H/W will take care of SPI slave word
* if SPI_SLAVE_EN bit is set.
*/
if (!spi->slave) {
word_len &= ~WORD_LEN_MSK;
word_len |= ((bits_per_word - MIN_WORD_LEN) & WORD_LEN_MSK);
geni_write_reg(word_len, mas->base, SE_SPI_WORD_LEN);
}
se_get_packing_config(bits_per_word, pack_words, msb_first,
&cfg0, &cfg1);
GENI_SE_DBG(mas->ipc, false, mas->dev,