History

i2c: designware: Drop hard coded FIFO depth assignment

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.

Andy Shevchenko committed 6 years ago

Commit 3f350641 parent 64d0a072 files · +0 −20Browse files

Unified · Split

2 files
  1. drivers/i2c/busses/i2c-designware-common.c +0 −3
  2. drivers/i2c/busses/i2c-designware-pcidrv.c +0 −17
drivers/i2c/busses/i2c-designware-common.c+0−3
@@ -200,9 +200,6 @@ int i2c_dw_acpi_configure(struct device *device) · 199 unmodified lines
200200 struct i2c_timings *t = &dev->timings;
201201 u32 ss_ht = 0, fp_ht = 0, hs_ht = 0, fs_ht = 0;
202202
203− dev->tx_fifo_depth = 32;
204− dev->rx_fifo_depth = 32;
205−
206203 /*
207204 * Try to get SDA hold time and *CNT values from an ACPI method for
208205 * selected speed modes.
drivers/i2c/busses/i2c-designware-pcidrv.c+0−17
@@ -46,8 +46,6 @@ struct dw_scl_sda_cfg { · 45 unmodified lines
4646
4747 struct dw_pci_controller {
4848 u32 bus_num;
49− u32 tx_fifo_depth;
50− u32 rx_fifo_depth;
5149 u32 flags;
5250 struct dw_scl_sda_cfg *scl_sda_cfg;
5351 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
133131 static struct dw_pci_controller dw_pci_controllers[] = {
134132 [medfield] = {
135133 .bus_num = -1,
136− .tx_fifo_depth = 32,
137− .rx_fifo_depth = 32,
138134 .setup = mfld_setup,
139135 .get_clk_rate_khz = mfld_get_clk_rate_khz,
140136 },
141137 [merrifield] = {
142138 .bus_num = -1,
143− .tx_fifo_depth = 64,
144− .rx_fifo_depth = 64,
145139 .scl_sda_cfg = &mrfld_config,
146140 .setup = mrfld_setup,
147141 },
148142 [baytrail] = {
149143 .bus_num = -1,
150− .tx_fifo_depth = 32,
151− .rx_fifo_depth = 32,
152144 .scl_sda_cfg = &byt_config,
153145 },
154146 [haswell] = {
155147 .bus_num = -1,
156− .tx_fifo_depth = 32,
157− .rx_fifo_depth = 32,
158148 .scl_sda_cfg = &hsw_config,
159149 },
160150 [cherrytrail] = {
161151 .bus_num = -1,
162− .tx_fifo_depth = 32,
163− .rx_fifo_depth = 32,
164152 .flags = MODEL_CHERRYTRAIL,
165153 .scl_sda_cfg = &byt_config,
166154 },
167155 [elkhartlake] = {
168156 .bus_num = -1,
169− .tx_fifo_depth = 32,
170− .rx_fifo_depth = 32,
171157 .get_clk_rate_khz = ehl_get_clk_rate_khz,
172158 },
173159 };
@@ -277,9 +263,6 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, · 103 unmodified lines
277263 dev->sda_hold_time = cfg->sda_hold;
278264 }
279265
280− dev->tx_fifo_depth = controller->tx_fifo_depth;
281− dev->rx_fifo_depth = controller->rx_fifo_depth;
282−
283266 adap = &dev->adapter;
284267 adap->owner = THIS_MODULE;
285268 adap->class = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t