Loading include/linux/spi/spi.h +20 −0 Original line number Diff line number Diff line Loading @@ -1005,6 +1005,26 @@ spi_max_transfer_size(struct spi_device *spi) return min(tr_max, msg_max); } /** * spi_is_bpw_supported - Check if bits per word is supported * @spi: SPI device * @bpw: Bits per word * * This function checks to see if the SPI controller supports @bpw. * * Returns: * True if @bpw is supported, false otherwise. */ static inline bool spi_is_bpw_supported(struct spi_device *spi, u32 bpw) { u32 bpw_mask = spi->master->bits_per_word_mask; if (bpw == 8 || (bpw <= 32 && bpw_mask & SPI_BPW_MASK(bpw))) return true; return false; } /*---------------------------------------------------------------------------*/ /* SPI transfer replacement methods which make use of spi_res */ Loading Loading
include/linux/spi/spi.h +20 −0 Original line number Diff line number Diff line Loading @@ -1005,6 +1005,26 @@ spi_max_transfer_size(struct spi_device *spi) return min(tr_max, msg_max); } /** * spi_is_bpw_supported - Check if bits per word is supported * @spi: SPI device * @bpw: Bits per word * * This function checks to see if the SPI controller supports @bpw. * * Returns: * True if @bpw is supported, false otherwise. */ static inline bool spi_is_bpw_supported(struct spi_device *spi, u32 bpw) { u32 bpw_mask = spi->master->bits_per_word_mask; if (bpw == 8 || (bpw <= 32 && bpw_mask & SPI_BPW_MASK(bpw))) return true; return false; } /*---------------------------------------------------------------------------*/ /* SPI transfer replacement methods which make use of spi_res */ Loading