It's not clear why the commit fe20ff5c7e9c ("i2c-designware: Add support for Designware core behind PCI devices.") followed by commit b61b14154b19 ("i2c-designware: add support for Intel Lynxpoint") chose to hard code FIFO depth size. The FIFO depth on all hardware, I have tested on, can be nicely detected automatically. Thus, we may safely drop hard coded FIFO sizes from the driver.
Unified · Split
| @@ -200,9 +200,6 @@ int i2c_dw_acpi_configure(struct device *device) · 199 unmodified lines | ||
| 200 | 200 | struct i2c_timings *t = &dev->timings; |
| 201 | 201 | u32 ss_ht = 0, fp_ht = 0, hs_ht = 0, fs_ht = 0; |
| 202 | 202 | |
| 203 | − dev->tx_fifo_depth = 32; | |
| 204 | − dev->rx_fifo_depth = 32; | |
| 205 | − | |
| 206 | 203 | /* |
| 207 | 204 | * Try to get SDA hold time and *CNT values from an ACPI method for |
| 208 | 205 | * selected speed modes. |
| @@ -46,8 +46,6 @@ struct dw_scl_sda_cfg { · 45 unmodified lines | ||
| 46 | 46 | |
| 47 | 47 | struct dw_pci_controller { |
| 48 | 48 | u32 bus_num; |
| 49 | − u32 tx_fifo_depth; | |
| 50 | − u32 rx_fifo_depth; | |
| 51 | 49 | u32 flags; |
| 52 | 50 | struct dw_scl_sda_cfg *scl_sda_cfg; |
| 53 | 51 | int (*setup)(struct pci_dev *pdev, struct dw_pci_controller *c); |
| @@ -133,41 +131,29 @@ static u32 ehl_get_clk_rate_khz(struct dw_i2c_dev *dev) · 79 unmodified lines | ||
| 133 | 131 | static struct dw_pci_controller dw_pci_controllers[] = { |
| 134 | 132 | [medfield] = { |
| 135 | 133 | .bus_num = -1, |
| 136 | − .tx_fifo_depth = 32, | |
| 137 | − .rx_fifo_depth = 32, | |
| 138 | 134 | .setup = mfld_setup, |
| 139 | 135 | .get_clk_rate_khz = mfld_get_clk_rate_khz, |
| 140 | 136 | }, |
| 141 | 137 | [merrifield] = { |
| 142 | 138 | .bus_num = -1, |
| 143 | − .tx_fifo_depth = 64, | |
| 144 | − .rx_fifo_depth = 64, | |
| 145 | 139 | .scl_sda_cfg = &mrfld_config, |
| 146 | 140 | .setup = mrfld_setup, |
| 147 | 141 | }, |
| 148 | 142 | [baytrail] = { |
| 149 | 143 | .bus_num = -1, |
| 150 | − .tx_fifo_depth = 32, | |
| 151 | − .rx_fifo_depth = 32, | |
| 152 | 144 | .scl_sda_cfg = &byt_config, |
| 153 | 145 | }, |
| 154 | 146 | [haswell] = { |
| 155 | 147 | .bus_num = -1, |
| 156 | − .tx_fifo_depth = 32, | |
| 157 | − .rx_fifo_depth = 32, | |
| 158 | 148 | .scl_sda_cfg = &hsw_config, |
| 159 | 149 | }, |
| 160 | 150 | [cherrytrail] = { |
| 161 | 151 | .bus_num = -1, |
| 162 | − .tx_fifo_depth = 32, | |
| 163 | − .rx_fifo_depth = 32, | |
| 164 | 152 | .flags = MODEL_CHERRYTRAIL, |
| 165 | 153 | .scl_sda_cfg = &byt_config, |
| 166 | 154 | }, |
| 167 | 155 | [elkhartlake] = { |
| 168 | 156 | .bus_num = -1, |
| 169 | − .tx_fifo_depth = 32, | |
| 170 | − .rx_fifo_depth = 32, | |
| 171 | 157 | .get_clk_rate_khz = ehl_get_clk_rate_khz, |
| 172 | 158 | }, |
| 173 | 159 | }; |
| @@ -277,9 +263,6 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, · 103 unmodified lines | ||
| 277 | 263 | dev->sda_hold_time = cfg->sda_hold; |
| 278 | 264 | } |
| 279 | 265 | |
| 280 | − dev->tx_fifo_depth = controller->tx_fifo_depth; | |
| 281 | − dev->rx_fifo_depth = controller->rx_fifo_depth; | |
| 282 | − | |
| 283 | 266 | adap = &dev->adapter; |
| 284 | 267 | adap->owner = THIS_MODULE; |
| 285 | 268 | adap->class = 0; |