Lines Matching +full:ati +full:- +full:base
1 // SPDX-License-Identifier: GPL-2.0-or-later
27 #include "i2c-designware-core.h"
28 #include "i2c-ccgx-ucsi.h"
30 #define DRIVER_NAME "i2c-designware-pci"
91 /* NAVI-AMD HCNT/LCNT/SDA hold time */
107 switch (pdev->device) { in mfld_setup()
109 dev->timings.bus_freq_hz = I2C_MAX_STANDARD_MODE_FREQ; in mfld_setup()
113 c->bus_num = pdev->device - 0x817 + 3; in mfld_setup()
118 c->bus_num = pdev->device - 0x82C + 0; in mfld_setup()
121 return -ENODEV; in mfld_setup()
132 switch (PCI_SLOT(pdev->devfn)) { in mrfld_setup()
134 c->bus_num = PCI_FUNC(pdev->devfn) + 0 + 1; in mrfld_setup()
137 c->bus_num = PCI_FUNC(pdev->devfn) + 4 + 1; in mrfld_setup()
140 return -ENODEV; in mrfld_setup()
157 dev->flags |= MODEL_AMD_NAVI_GPU | ACCESS_POLLING; in navi_amd_setup()
158 dev->timings.bus_freq_hz = I2C_MAX_STANDARD_MODE_FREQ; in navi_amd_setup()
164 .bus_num = -1,
169 .bus_num = -1,
174 .bus_num = -1,
178 .bus_num = -1,
182 .bus_num = -1,
186 .bus_num = -1,
190 .bus_num = -1,
198 /* USB-C doesn't power the system */
216 if (id->driver_data >= ARRAY_SIZE(dw_pci_controllers)) in i2c_dw_pci_probe()
217 return dev_err_probe(&pdev->dev, -EINVAL, in i2c_dw_pci_probe()
219 id->driver_data); in i2c_dw_pci_probe()
221 controller = &dw_pci_controllers[id->driver_data]; in i2c_dw_pci_probe()
225 return dev_err_probe(&pdev->dev, r, in i2c_dw_pci_probe()
232 return dev_err_probe(&pdev->dev, r, in i2c_dw_pci_probe()
235 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); in i2c_dw_pci_probe()
237 return -ENOMEM; in i2c_dw_pci_probe()
243 dev->get_clk_rate_khz = controller->get_clk_rate_khz; in i2c_dw_pci_probe()
244 dev->base = pcim_iomap_table(pdev)[0]; in i2c_dw_pci_probe()
245 dev->dev = &pdev->dev; in i2c_dw_pci_probe()
246 dev->irq = pci_irq_vector(pdev, 0); in i2c_dw_pci_probe()
247 dev->flags |= controller->flags; in i2c_dw_pci_probe()
251 if (controller->setup) { in i2c_dw_pci_probe()
252 r = controller->setup(pdev, controller); in i2c_dw_pci_probe()
263 if (controller->scl_sda_cfg) { in i2c_dw_pci_probe()
264 cfg = controller->scl_sda_cfg; in i2c_dw_pci_probe()
265 dev->ss_hcnt = cfg->ss_hcnt; in i2c_dw_pci_probe()
266 dev->fs_hcnt = cfg->fs_hcnt; in i2c_dw_pci_probe()
267 dev->ss_lcnt = cfg->ss_lcnt; in i2c_dw_pci_probe()
268 dev->fs_lcnt = cfg->fs_lcnt; in i2c_dw_pci_probe()
269 dev->sda_hold_time = cfg->sda_hold; in i2c_dw_pci_probe()
272 adap = &dev->adapter; in i2c_dw_pci_probe()
273 adap->owner = THIS_MODULE; in i2c_dw_pci_probe()
274 adap->class = 0; in i2c_dw_pci_probe()
275 adap->nr = controller->bus_num; in i2c_dw_pci_probe()
281 if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU) { in i2c_dw_pci_probe()
282 dev->slave = i2c_new_ccgx_ucsi(&dev->adapter, dev->irq, &dgpu_node); in i2c_dw_pci_probe()
283 if (IS_ERR(dev->slave)) in i2c_dw_pci_probe()
284 return dev_err_probe(dev->dev, PTR_ERR(dev->slave), in i2c_dw_pci_probe()
288 pm_runtime_set_autosuspend_delay(&pdev->dev, 1000); in i2c_dw_pci_probe()
289 pm_runtime_use_autosuspend(&pdev->dev); in i2c_dw_pci_probe()
290 pm_runtime_put_autosuspend(&pdev->dev); in i2c_dw_pci_probe()
291 pm_runtime_allow(&pdev->dev); in i2c_dw_pci_probe()
302 pm_runtime_forbid(&pdev->dev); in i2c_dw_pci_remove()
303 pm_runtime_get_noresume(&pdev->dev); in i2c_dw_pci_remove()
305 i2c_del_adapter(&dev->adapter); in i2c_dw_pci_remove()
348 { PCI_VDEVICE(ATI, 0x7314), navi_amd },
349 { PCI_VDEVICE(ATI, 0x73a4), navi_amd },
350 { PCI_VDEVICE(ATI, 0x73e4), navi_amd },
351 { PCI_VDEVICE(ATI, 0x73c4), navi_amd },
352 { PCI_VDEVICE(ATI, 0x7444), navi_amd },
353 { PCI_VDEVICE(ATI, 0x7464), navi_amd },