Lines Matching defs:dev
298 * @dev: device for this controller
331 struct device *dev;
470 dev_err(i2c_dev->dev, "speed out of bound {%d}\n",
477 dev_err(i2c_dev->dev,
486 dev_err(i2c_dev->dev,
514 dev_dbg(i2c_dev->dev, "SDADEL(min/max): %i/%i, SCLDEL(Min): %i\n",
555 dev_err(i2c_dev->dev, "no Prescaler solution\n");
612 dev_err(i2c_dev->dev, "no solution at all\n");
623 dev_dbg(i2c_dev->dev,
660 i2c_parse_fw_timings(i2c_dev->dev, t, false);
663 dev_err(i2c_dev->dev, "Invalid bus speed (%i>%i)\n",
675 dev_err(i2c_dev->dev, "clock rate is 0\n");
679 if (!of_property_read_bool(i2c_dev->dev->of_node, "i2c-digital-filter"))
686 dev_err(i2c_dev->dev,
692 dev_warn(i2c_dev->dev,
699 dev_err(i2c_dev->dev, "Impossible to compute I2C timings.\n");
703 i2c_dev->analog_filter = of_property_read_bool(i2c_dev->dev->of_node,
706 dev_dbg(i2c_dev->dev, "I2C Speed(%i), Clk Source(%i)\n",
708 dev_dbg(i2c_dev->dev, "I2C Rise(%i) and Fall(%i) Time\n",
710 dev_dbg(i2c_dev->dev, "I2C Analog Filter(%s), DNF(%i)\n",
730 struct device *dev = dma->chan_using->device->dev;
733 dma_unmap_single(dev, dma->dma_buf, dma->dma_len, dma->dma_data_dir);
919 ret = stm32_i2c_prep_dma_xfer(i2c_dev->dev, i2c_dev->dma,
927 dev_warn(i2c_dev->dev, "can't use DMA\n");
957 struct device *dev = i2c_dev->dev;
1019 dev_err(dev, "Invalid block write size %d\n",
1039 dev_err(dev, "Invalid block write size %d\n",
1053 dev_err(dev, "Unsupported smbus protocol %d\n", f7_msg->size);
1086 ret = stm32_i2c_prep_dma_xfer(i2c_dev->dev, i2c_dev->dma,
1094 dev_warn(i2c_dev->dev, "can't use DMA\n");
1180 ret = stm32_i2c_prep_dma_xfer(i2c_dev->dev, i2c_dev->dma,
1189 dev_warn(i2c_dev->dev, "can't use DMA\n");
1227 dev_err(i2c_dev->dev, "Unsupported smbus protocol for PEC\n");
1232 dev_err(i2c_dev->dev, "Bad PEC 0x%02x vs. 0x%02x\n",
1352 dev_err(i2c_dev->dev, "Slave 0x%x not registered\n", slave->addr);
1360 struct device *dev = i2c_dev->dev;
1386 dev_err(dev, "Slave 0x%x could not be registered\n", slave->addr);
1457 dev_dbg(i2c_dev->dev, "<%s>: Receive NACK\n", __func__);
1518 dev_dbg(i2c_dev->dev, "<%s>: Receive NACK (addr %x)\n",
1588 dev_dbg(i2c_dev->dev, "<%s>: Timed out\n", __func__);
1617 struct device *dev = i2c_dev->dev;
1625 dev_err(dev, "<%s>: Bus error accessing addr 0x%x\n",
1634 dev_dbg(dev, "<%s>: Arbitration loss accessing addr 0x%x\n",
1641 dev_err(dev, "<%s>: PEC error in reception accessing addr 0x%x\n",
1648 dev_dbg(dev, "<%s>: SMBus alert received\n", __func__);
1690 ret = pm_runtime_resume_and_get(i2c_dev->dev);
1718 dev_dbg(i2c_dev->dev, "Access to slave 0x%x timed out\n",
1727 pm_runtime_mark_last_busy(i2c_dev->dev);
1728 pm_runtime_put_autosuspend(i2c_dev->dev);
1741 struct device *dev = i2c_dev->dev;
1750 ret = pm_runtime_resume_and_get(dev);
1780 dev_dbg(dev, "Access to slave 0x%x timed out\n", f7_msg->addr);
1812 dev_err(dev, "Unsupported smbus transaction\n");
1818 pm_runtime_mark_last_busy(dev);
1819 pm_runtime_put_autosuspend(dev);
1833 device_set_wakeup_enable(i2c_dev->dev, true);
1836 device_set_wakeup_enable(i2c_dev->dev, false);
1845 struct device *dev = i2c_dev->dev;
1850 dev_err(dev, "SMBus PEC not supported in slave mode\n");
1855 dev_err(dev, "Too much slave registered\n");
1863 ret = pm_runtime_resume_and_get(dev);
1907 dev_err(dev, "I2C slave id not supported\n");
1925 pm_runtime_mark_last_busy(dev);
1926 pm_runtime_put_autosuspend(dev);
1944 ret = pm_runtime_resume_and_get(i2c_dev->dev);
1963 pm_runtime_mark_last_busy(i2c_dev->dev);
1964 pm_runtime_put_autosuspend(i2c_dev->dev);
1996 struct device_node *np = pdev->dev.of_node;
2050 struct device *dev = i2c_dev->dev;
2053 alert = devm_kzalloc(dev, sizeof(*alert), GFP_KERNEL);
2117 i2c_dev = devm_kzalloc(&pdev->dev, sizeof(*i2c_dev), GFP_KERNEL);
2134 i2c_dev->wakeup_src = of_property_read_bool(pdev->dev.of_node,
2137 i2c_dev->clk = devm_clk_get(&pdev->dev, NULL);
2139 return dev_err_probe(&pdev->dev, PTR_ERR(i2c_dev->clk),
2144 dev_err(&pdev->dev, "Failed to prepare_enable clock\n");
2148 rst = devm_reset_control_get(&pdev->dev, NULL);
2150 ret = dev_err_probe(&pdev->dev, PTR_ERR(rst),
2158 i2c_dev->dev = &pdev->dev;
2160 ret = devm_request_threaded_irq(&pdev->dev, irq_event,
2166 dev_err(&pdev->dev, "Failed to request irq event %i\n",
2171 ret = devm_request_irq(&pdev->dev, irq_error, stm32f7_i2c_isr_error, 0,
2174 dev_err(&pdev->dev, "Failed to request irq error %i\n",
2179 setup = of_device_get_match_data(&pdev->dev);
2181 dev_err(&pdev->dev, "Can't get device data\n");
2209 adap->dev.parent = &pdev->dev;
2210 adap->dev.of_node = pdev->dev.of_node;
2215 i2c_dev->dma = stm32_i2c_dma_request(i2c_dev->dev, phy_addr,
2223 dev_dbg(i2c_dev->dev, "No DMA option: fallback using interrupts\n");
2228 device_set_wakeup_capable(i2c_dev->dev, true);
2230 ret = dev_pm_set_wake_irq(i2c_dev->dev, irq_event);
2232 dev_err(i2c_dev->dev, "Failed to set wake up irq\n");
2239 pm_runtime_set_autosuspend_delay(i2c_dev->dev,
2241 pm_runtime_use_autosuspend(i2c_dev->dev);
2242 pm_runtime_set_active(i2c_dev->dev);
2243 pm_runtime_enable(i2c_dev->dev);
2245 pm_runtime_get_noresume(&pdev->dev);
2249 i2c_dev->smbus_mode = of_property_read_bool(pdev->dev.of_node, "smbus");
2258 dev_err(i2c_dev->dev,
2265 if (of_property_read_bool(pdev->dev.of_node, "smbus-alert")) {
2268 dev_err(i2c_dev->dev,
2275 dev_info(i2c_dev->dev, "STM32F7 I2C-%d bus adapter\n", adap->nr);
2277 pm_runtime_mark_last_busy(i2c_dev->dev);
2278 pm_runtime_put_autosuspend(i2c_dev->dev);
2289 pm_runtime_put_noidle(i2c_dev->dev);
2290 pm_runtime_disable(i2c_dev->dev);
2291 pm_runtime_set_suspended(i2c_dev->dev);
2292 pm_runtime_dont_use_autosuspend(i2c_dev->dev);
2295 dev_pm_clear_wake_irq(i2c_dev->dev);
2299 device_set_wakeup_capable(i2c_dev->dev, false);
2323 pm_runtime_get_sync(i2c_dev->dev);
2326 dev_pm_clear_wake_irq(i2c_dev->dev);
2331 device_init_wakeup(i2c_dev->dev, false);
2334 pm_runtime_put_noidle(i2c_dev->dev);
2335 pm_runtime_disable(i2c_dev->dev);
2336 pm_runtime_set_suspended(i2c_dev->dev);
2337 pm_runtime_dont_use_autosuspend(i2c_dev->dev);
2349 static int __maybe_unused stm32f7_i2c_runtime_suspend(struct device *dev)
2351 struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev);
2359 static int __maybe_unused stm32f7_i2c_runtime_resume(struct device *dev)
2361 struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev);
2367 dev_err(dev, "failed to prepare_enable clock\n");
2380 ret = pm_runtime_resume_and_get(i2c_dev->dev);
2391 pm_runtime_put_sync(i2c_dev->dev);
2402 ret = pm_runtime_resume_and_get(i2c_dev->dev);
2422 pm_runtime_put_sync(i2c_dev->dev);
2427 static int __maybe_unused stm32f7_i2c_suspend(struct device *dev)
2429 struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev);
2434 if (!device_may_wakeup(dev) && !device_wakeup_path(dev)) {
2441 pinctrl_pm_select_sleep_state(dev);
2442 pm_runtime_force_suspend(dev);
2448 static int __maybe_unused stm32f7_i2c_resume(struct device *dev)
2450 struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev);
2453 if (!device_may_wakeup(dev) && !device_wakeup_path(dev)) {
2454 ret = pm_runtime_force_resume(dev);
2457 pinctrl_pm_select_default_state(dev);