Lines Matching refs:rbspi
26 static inline u32 rb4xx_read(struct rb4xx_spi *rbspi, u32 reg) in rb4xx_read() argument
28 return __raw_readl(rbspi->base + reg); in rb4xx_read()
31 static inline void rb4xx_write(struct rb4xx_spi *rbspi, u32 reg, u32 value) in rb4xx_write() argument
33 __raw_writel(value, rbspi->base + reg); in rb4xx_write()
36 static inline void do_spi_clk(struct rb4xx_spi *rbspi, u32 spi_ioc, int value) in do_spi_clk() argument
44 rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, regval); in do_spi_clk()
45 rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, regval | AR71XX_SPI_IOC_CLK); in do_spi_clk()
48 static void do_spi_byte(struct rb4xx_spi *rbspi, u32 spi_ioc, u8 byte) in do_spi_byte() argument
53 do_spi_clk(rbspi, spi_ioc, byte >> i); in do_spi_byte()
57 static inline void do_spi_clk_two(struct rb4xx_spi *rbspi, u32 spi_ioc, in do_spi_clk_two() argument
68 rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, regval); in do_spi_clk_two()
69 rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, regval | AR71XX_SPI_IOC_CLK); in do_spi_clk_two()
73 static void do_spi_byte_two(struct rb4xx_spi *rbspi, u32 spi_ioc, u8 byte) in do_spi_byte_two() argument
75 do_spi_clk_two(rbspi, spi_ioc, byte >> 6); in do_spi_byte_two()
76 do_spi_clk_two(rbspi, spi_ioc, byte >> 4); in do_spi_byte_two()
77 do_spi_clk_two(rbspi, spi_ioc, byte >> 2); in do_spi_byte_two()
78 do_spi_clk_two(rbspi, spi_ioc, byte >> 0); in do_spi_byte_two()
83 struct rb4xx_spi *rbspi = spi_controller_get_devdata(spi->controller); in rb4xx_set_cs() local
91 rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, in rb4xx_set_cs()
98 struct rb4xx_spi *rbspi = spi_controller_get_devdata(host); in rb4xx_transfer_one() local
122 do_spi_byte_two(rbspi, spi_ioc, tx_buf[i]); in rb4xx_transfer_one()
124 do_spi_byte(rbspi, spi_ioc, tx_buf[i]); in rb4xx_transfer_one()
127 rx_buf[i] = rb4xx_read(rbspi, AR71XX_SPI_REG_RDS); in rb4xx_transfer_one()
138 struct rb4xx_spi *rbspi; in rb4xx_spi_probe() local
146 host = devm_spi_alloc_host(&pdev->dev, sizeof(*rbspi)); in rb4xx_spi_probe()
163 rbspi = spi_controller_get_devdata(host); in rb4xx_spi_probe()
164 rbspi->base = spi_base; in rb4xx_spi_probe()
165 rbspi->clk = ahb_clk; in rb4xx_spi_probe()
166 platform_set_drvdata(pdev, rbspi); in rb4xx_spi_probe()
179 rb4xx_write(rbspi, AR71XX_SPI_REG_FS, AR71XX_SPI_FS_GPIO); in rb4xx_spi_probe()
186 struct rb4xx_spi *rbspi = platform_get_drvdata(pdev); in rb4xx_spi_remove() local
188 clk_disable_unprepare(rbspi->clk); in rb4xx_spi_remove()