Home
last modified time | relevance | path

Searched refs:loongson_spi (Results 1 – 2 of 2) sorted by relevance

/linux-6.6.21/drivers/spi/
Dspi-loongson-core.c18 static inline void loongson_spi_write_reg(struct loongson_spi *spi, unsigned char reg, in loongson_spi_write_reg()
24 static inline char loongson_spi_read_reg(struct loongson_spi *spi, unsigned char reg) in loongson_spi_read_reg()
34 struct loongson_spi *loongson_spi = spi_controller_get_devdata(spi->controller); in loongson_spi_set_cs() local
36 cs = loongson_spi_read_reg(loongson_spi, LOONGSON_SPI_SFCS_REG) & ~mask; in loongson_spi_set_cs()
37 loongson_spi_write_reg(loongson_spi, LOONGSON_SPI_SFCS_REG, val | cs); in loongson_spi_set_cs()
40 static void loongson_spi_set_clk(struct loongson_spi *loongson_spi, unsigned int hz) in loongson_spi_set_clk() argument
46 div = clamp_val(DIV_ROUND_UP_ULL(loongson_spi->clk_rate, hz), 2, 4096); in loongson_spi_set_clk()
48 loongson_spi->spcr = (div_tmp & GENMASK(1, 0)) >> 0; in loongson_spi_set_clk()
49 loongson_spi->sper = (div_tmp & GENMASK(3, 2)) >> 2; in loongson_spi_set_clk()
50 val = loongson_spi_read_reg(loongson_spi, LOONGSON_SPI_SPCR_REG); in loongson_spi_set_clk()
[all …]
Dspi-loongson.h32 struct loongson_spi { struct