Lines Matching refs:dev

62 	u32 (*get_clk_rate_khz)(struct dw_i2c_dev *dev);
98 static u32 mfld_get_clk_rate_khz(struct dw_i2c_dev *dev) in mfld_get_clk_rate_khz() argument
105 struct dw_i2c_dev *dev = dev_get_drvdata(&pdev->dev); in mfld_setup() local
109 dev->timings.bus_freq_hz = I2C_MAX_STANDARD_MODE_FREQ; in mfld_setup()
143 static u32 ehl_get_clk_rate_khz(struct dw_i2c_dev *dev) in ehl_get_clk_rate_khz() argument
148 static u32 navi_amd_get_clk_rate_khz(struct dw_i2c_dev *dev) in navi_amd_get_clk_rate_khz() argument
155 struct dw_i2c_dev *dev = dev_get_drvdata(&pdev->dev); in navi_amd_setup() local
157 dev->flags |= MODEL_AMD_NAVI_GPU; in navi_amd_setup()
158 dev->timings.bus_freq_hz = I2C_MAX_STANDARD_MODE_FREQ; in navi_amd_setup()
197 static int __maybe_unused i2c_dw_pci_runtime_suspend(struct device *dev) in i2c_dw_pci_runtime_suspend() argument
199 struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); in i2c_dw_pci_runtime_suspend()
205 static int __maybe_unused i2c_dw_pci_suspend(struct device *dev) in i2c_dw_pci_suspend() argument
207 struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); in i2c_dw_pci_suspend()
211 return i2c_dw_pci_runtime_suspend(dev); in i2c_dw_pci_suspend()
214 static int __maybe_unused i2c_dw_pci_runtime_resume(struct device *dev) in i2c_dw_pci_runtime_resume() argument
216 struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); in i2c_dw_pci_runtime_resume()
221 static int __maybe_unused i2c_dw_pci_resume(struct device *dev) in i2c_dw_pci_resume() argument
223 struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); in i2c_dw_pci_resume()
226 ret = i2c_dw_pci_runtime_resume(dev); in i2c_dw_pci_resume()
251 struct dw_i2c_dev *dev; in i2c_dw_pci_probe() local
259 return dev_err_probe(&pdev->dev, -EINVAL, in i2c_dw_pci_probe()
267 return dev_err_probe(&pdev->dev, r, in i2c_dw_pci_probe()
274 return dev_err_probe(&pdev->dev, r, in i2c_dw_pci_probe()
277 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); in i2c_dw_pci_probe()
278 if (!dev) in i2c_dw_pci_probe()
285 dev->get_clk_rate_khz = controller->get_clk_rate_khz; in i2c_dw_pci_probe()
286 dev->base = pcim_iomap_table(pdev)[0]; in i2c_dw_pci_probe()
287 dev->dev = &pdev->dev; in i2c_dw_pci_probe()
288 dev->irq = pci_irq_vector(pdev, 0); in i2c_dw_pci_probe()
289 dev->flags |= controller->flags; in i2c_dw_pci_probe()
291 t = &dev->timings; in i2c_dw_pci_probe()
292 i2c_parse_fw_timings(&pdev->dev, t, false); in i2c_dw_pci_probe()
294 pci_set_drvdata(pdev, dev); in i2c_dw_pci_probe()
304 i2c_dw_adjust_bus_speed(dev); in i2c_dw_pci_probe()
306 if (has_acpi_companion(&pdev->dev)) in i2c_dw_pci_probe()
307 i2c_dw_acpi_configure(&pdev->dev); in i2c_dw_pci_probe()
309 r = i2c_dw_validate_speed(dev); in i2c_dw_pci_probe()
315 i2c_dw_configure(dev); in i2c_dw_pci_probe()
319 dev->ss_hcnt = cfg->ss_hcnt; in i2c_dw_pci_probe()
320 dev->fs_hcnt = cfg->fs_hcnt; in i2c_dw_pci_probe()
321 dev->ss_lcnt = cfg->ss_lcnt; in i2c_dw_pci_probe()
322 dev->fs_lcnt = cfg->fs_lcnt; in i2c_dw_pci_probe()
323 dev->sda_hold_time = cfg->sda_hold; in i2c_dw_pci_probe()
326 adap = &dev->adapter; in i2c_dw_pci_probe()
329 ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev)); in i2c_dw_pci_probe()
332 r = i2c_dw_probe(dev); in i2c_dw_pci_probe()
338 if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU) { in i2c_dw_pci_probe()
339 dev->slave = i2c_new_ccgx_ucsi(&dev->adapter, dev->irq, &dgpu_node); in i2c_dw_pci_probe()
340 if (IS_ERR(dev->slave)) in i2c_dw_pci_probe()
341 return dev_err_probe(dev->dev, PTR_ERR(dev->slave), in i2c_dw_pci_probe()
345 pm_runtime_set_autosuspend_delay(&pdev->dev, 1000); in i2c_dw_pci_probe()
346 pm_runtime_use_autosuspend(&pdev->dev); in i2c_dw_pci_probe()
347 pm_runtime_put_autosuspend(&pdev->dev); in i2c_dw_pci_probe()
348 pm_runtime_allow(&pdev->dev); in i2c_dw_pci_probe()
355 struct dw_i2c_dev *dev = pci_get_drvdata(pdev); in i2c_dw_pci_remove() local
357 dev->disable(dev); in i2c_dw_pci_remove()
358 pm_runtime_forbid(&pdev->dev); in i2c_dw_pci_remove()
359 pm_runtime_get_noresume(&pdev->dev); in i2c_dw_pci_remove()
361 i2c_del_adapter(&dev->adapter); in i2c_dw_pci_remove()
362 devm_free_irq(&pdev->dev, dev->irq, dev); in i2c_dw_pci_remove()