Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add COMPILE_TEST support

Merge series from Rosen Penev <rosenp@gmail.com>:

Allows the buildbots to test compilation. The driver has nothing
architecture specific.

+18 -21
+2 -1
drivers/spi/Kconfig
··· 916 916 917 917 config SPI_RB4XX 918 918 tristate "Mikrotik RB4XX SPI master" 919 - depends on SPI_MASTER && ATH79 919 + depends on SPI_MASTER && (ATH79 || COMPILE_TEST) 920 + depends on OF 920 921 help 921 922 SPI controller driver for the Mikrotik RB4xx series boards. 922 923
+16 -20
drivers/spi/spi-rb4xx.c
··· 16 16 #include <linux/spi/spi.h> 17 17 #include <linux/of.h> 18 18 19 - #include <asm/mach-ath79/ar71xx_regs.h> 19 + #define AR71XX_SPI_REG_FS 0x00 /* Function Select */ 20 + #define AR71XX_SPI_REG_CTRL 0x04 /* SPI Control */ 21 + #define AR71XX_SPI_REG_IOC 0x08 /* SPI I/O Control */ 22 + #define AR71XX_SPI_REG_RDS 0x0c /* Read Data Shift */ 23 + 24 + #define AR71XX_SPI_FS_GPIO BIT(0) /* Enable GPIO mode */ 25 + 26 + #define AR71XX_SPI_IOC_DO BIT(0) /* Data Out pin */ 27 + #define AR71XX_SPI_IOC_CLK BIT(8) /* CLK pin */ 28 + #define AR71XX_SPI_IOC_CS(n) BIT(16 + (n)) 20 29 21 30 struct rb4xx_spi { 22 31 void __iomem *base; ··· 72 63 if (value & BIT(1)) 73 64 regval |= AR71XX_SPI_IOC_DO; 74 65 if (value & BIT(0)) 75 - regval |= AR71XX_SPI_IOC_CS2; 66 + regval |= AR71XX_SPI_IOC_CS(2); 76 67 77 68 rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, regval); 78 69 rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, regval | AR71XX_SPI_IOC_CLK); ··· 98 89 */ 99 90 if (enable) 100 91 rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, 101 - AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1); 92 + AR71XX_SPI_IOC_CS(0) | AR71XX_SPI_IOC_CS(1)); 102 93 } 103 94 104 95 static int rb4xx_transfer_one(struct spi_controller *host, ··· 118 109 */ 119 110 if (spi_get_chipselect(spi, 0) == 2) 120 111 /* MMC */ 121 - spi_ioc = AR71XX_SPI_IOC_CS0; 112 + spi_ioc = AR71XX_SPI_IOC_CS(0); 122 113 else 123 114 /* Boot flash and CPLD */ 124 - spi_ioc = AR71XX_SPI_IOC_CS1; 115 + spi_ioc = AR71XX_SPI_IOC_CS(1); 125 116 126 117 tx_buf = t->tx_buf; 127 118 rx_buf = t->rx_buf; ··· 156 147 if (!host) 157 148 return -ENOMEM; 158 149 159 - ahb_clk = devm_clk_get(&pdev->dev, "ahb"); 150 + ahb_clk = devm_clk_get_enabled(&pdev->dev, "ahb"); 160 151 if (IS_ERR(ahb_clk)) 161 152 return PTR_ERR(ahb_clk); 162 153 ··· 172 163 rbspi = spi_controller_get_devdata(host); 173 164 rbspi->base = spi_base; 174 165 rbspi->clk = ahb_clk; 175 - platform_set_drvdata(pdev, rbspi); 176 166 177 167 err = devm_spi_register_controller(&pdev->dev, host); 178 168 if (err) { ··· 179 171 return err; 180 172 } 181 173 182 - err = clk_prepare_enable(ahb_clk); 183 - if (err) 184 - return err; 185 - 186 174 /* Enable SPI */ 187 175 rb4xx_write(rbspi, AR71XX_SPI_REG_FS, AR71XX_SPI_FS_GPIO); 188 176 189 177 return 0; 190 - } 191 - 192 - static void rb4xx_spi_remove(struct platform_device *pdev) 193 - { 194 - struct rb4xx_spi *rbspi = platform_get_drvdata(pdev); 195 - 196 - clk_disable_unprepare(rbspi->clk); 197 178 } 198 179 199 180 static const struct of_device_id rb4xx_spi_dt_match[] = { ··· 193 196 194 197 static struct platform_driver rb4xx_spi_drv = { 195 198 .probe = rb4xx_spi_probe, 196 - .remove = rb4xx_spi_remove, 197 199 .driver = { 198 200 .name = "rb4xx-spi", 199 - .of_match_table = of_match_ptr(rb4xx_spi_dt_match), 201 + .of_match_table = rb4xx_spi_dt_match, 200 202 }, 201 203 }; 202 204