mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
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:
parent
a2839ca38b
commit
2e7d855eea
1 changed files with 13 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue