Lines Matching full:dev

30 static void i2c_dw_configure_fifo_master(struct dw_i2c_dev *dev)  in i2c_dw_configure_fifo_master()  argument
33 regmap_write(dev->map, DW_IC_TX_TL, dev->tx_fifo_depth / 2); in i2c_dw_configure_fifo_master()
34 regmap_write(dev->map, DW_IC_RX_TL, 0); in i2c_dw_configure_fifo_master()
37 regmap_write(dev->map, DW_IC_CON, dev->master_cfg); in i2c_dw_configure_fifo_master()
40 static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev) in i2c_dw_set_timings_master() argument
44 struct i2c_timings *t = &dev->timings; in i2c_dw_set_timings_master()
49 ret = i2c_dw_acquire_lock(dev); in i2c_dw_set_timings_master()
53 ret = regmap_read(dev->map, DW_IC_COMP_PARAM_1, &comp_param1); in i2c_dw_set_timings_master()
54 i2c_dw_release_lock(dev); in i2c_dw_set_timings_master()
63 if (!dev->ss_hcnt || !dev->ss_lcnt) { in i2c_dw_set_timings_master()
64 ic_clk = i2c_dw_clk_rate(dev); in i2c_dw_set_timings_master()
65 dev->ss_hcnt = in i2c_dw_set_timings_master()
71 dev->ss_lcnt = in i2c_dw_set_timings_master()
77 dev_dbg(dev->dev, "Standard Mode HCNT:LCNT = %d:%d\n", in i2c_dw_set_timings_master()
78 dev->ss_hcnt, dev->ss_lcnt); in i2c_dw_set_timings_master()
90 if (dev->fp_hcnt && dev->fp_lcnt) { in i2c_dw_set_timings_master()
91 dev->fs_hcnt = dev->fp_hcnt; in i2c_dw_set_timings_master()
92 dev->fs_lcnt = dev->fp_lcnt; in i2c_dw_set_timings_master()
94 ic_clk = i2c_dw_clk_rate(dev); in i2c_dw_set_timings_master()
95 dev->fs_hcnt = in i2c_dw_set_timings_master()
101 dev->fs_lcnt = in i2c_dw_set_timings_master()
113 if (!dev->fs_hcnt || !dev->fs_lcnt) { in i2c_dw_set_timings_master()
114 ic_clk = i2c_dw_clk_rate(dev); in i2c_dw_set_timings_master()
115 dev->fs_hcnt = in i2c_dw_set_timings_master()
121 dev->fs_lcnt = in i2c_dw_set_timings_master()
127 dev_dbg(dev->dev, "Fast Mode%s HCNT:LCNT = %d:%d\n", in i2c_dw_set_timings_master()
128 fp_str, dev->fs_hcnt, dev->fs_lcnt); in i2c_dw_set_timings_master()
131 if ((dev->master_cfg & DW_IC_CON_SPEED_MASK) == in i2c_dw_set_timings_master()
135 dev_err(dev->dev, "High Speed not supported!\n"); in i2c_dw_set_timings_master()
137 dev->master_cfg &= ~DW_IC_CON_SPEED_MASK; in i2c_dw_set_timings_master()
138 dev->master_cfg |= DW_IC_CON_SPEED_FAST; in i2c_dw_set_timings_master()
139 dev->hs_hcnt = 0; in i2c_dw_set_timings_master()
140 dev->hs_lcnt = 0; in i2c_dw_set_timings_master()
141 } else if (!dev->hs_hcnt || !dev->hs_lcnt) { in i2c_dw_set_timings_master()
142 ic_clk = i2c_dw_clk_rate(dev); in i2c_dw_set_timings_master()
143 dev->hs_hcnt = in i2c_dw_set_timings_master()
149 dev->hs_lcnt = in i2c_dw_set_timings_master()
155 dev_dbg(dev->dev, "High Speed Mode HCNT:LCNT = %d:%d\n", in i2c_dw_set_timings_master()
156 dev->hs_hcnt, dev->hs_lcnt); in i2c_dw_set_timings_master()
159 ret = i2c_dw_set_sda_hold(dev); in i2c_dw_set_timings_master()
163 dev_dbg(dev->dev, "Bus speed: %s\n", i2c_freq_mode_string(t->bus_freq_hz)); in i2c_dw_set_timings_master()
169 * @dev: device private data
175 static int i2c_dw_init_master(struct dw_i2c_dev *dev) in i2c_dw_init_master() argument
179 ret = i2c_dw_acquire_lock(dev); in i2c_dw_init_master()
184 __i2c_dw_disable(dev); in i2c_dw_init_master()
187 regmap_write(dev->map, DW_IC_SS_SCL_HCNT, dev->ss_hcnt); in i2c_dw_init_master()
188 regmap_write(dev->map, DW_IC_SS_SCL_LCNT, dev->ss_lcnt); in i2c_dw_init_master()
191 regmap_write(dev->map, DW_IC_FS_SCL_HCNT, dev->fs_hcnt); in i2c_dw_init_master()
192 regmap_write(dev->map, DW_IC_FS_SCL_LCNT, dev->fs_lcnt); in i2c_dw_init_master()
195 if (dev->hs_hcnt && dev->hs_lcnt) { in i2c_dw_init_master()
196 regmap_write(dev->map, DW_IC_HS_SCL_HCNT, dev->hs_hcnt); in i2c_dw_init_master()
197 regmap_write(dev->map, DW_IC_HS_SCL_LCNT, dev->hs_lcnt); in i2c_dw_init_master()
201 if (dev->sda_hold_time) in i2c_dw_init_master()
202 regmap_write(dev->map, DW_IC_SDA_HOLD, dev->sda_hold_time); in i2c_dw_init_master()
204 i2c_dw_configure_fifo_master(dev); in i2c_dw_init_master()
205 i2c_dw_release_lock(dev); in i2c_dw_init_master()
210 static void i2c_dw_xfer_init(struct dw_i2c_dev *dev) in i2c_dw_xfer_init() argument
212 struct i2c_msg *msgs = dev->msgs; in i2c_dw_xfer_init()
217 __i2c_dw_disable(dev); in i2c_dw_xfer_init()
220 if (msgs[dev->msg_write_idx].flags & I2C_M_TEN) { in i2c_dw_xfer_init()
231 regmap_update_bits(dev->map, DW_IC_CON, DW_IC_CON_10BITADDR_MASTER, in i2c_dw_xfer_init()
238 regmap_write(dev->map, DW_IC_TAR, in i2c_dw_xfer_init()
239 msgs[dev->msg_write_idx].addr | ic_tar); in i2c_dw_xfer_init()
242 i2c_dw_disable_int(dev); in i2c_dw_xfer_init()
245 __i2c_dw_enable(dev); in i2c_dw_xfer_init()
248 regmap_read(dev->map, DW_IC_ENABLE_STATUS, &dummy); in i2c_dw_xfer_init()
251 regmap_read(dev->map, DW_IC_CLR_INTR, &dummy); in i2c_dw_xfer_init()
252 regmap_write(dev->map, DW_IC_INTR_MASK, DW_IC_INTR_MASTER_MASK); in i2c_dw_xfer_init()
255 static int i2c_dw_check_stopbit(struct dw_i2c_dev *dev) in i2c_dw_check_stopbit() argument
260 ret = regmap_read_poll_timeout(dev->map, DW_IC_INTR_STAT, val, in i2c_dw_check_stopbit()
264 dev_err(dev->dev, "i2c timeout error %d\n", ret); in i2c_dw_check_stopbit()
269 static int i2c_dw_status(struct dw_i2c_dev *dev) in i2c_dw_status() argument
273 status = i2c_dw_wait_bus_not_busy(dev); in i2c_dw_status()
277 return i2c_dw_check_stopbit(dev); in i2c_dw_status()
286 struct dw_i2c_dev *dev = i2c_get_adapdata(adap); in amd_i2c_dw_xfer_quirk() local
297 regmap_write(dev->map, AMD_UCSI_INTR_REG, AMD_UCSI_INTR_EN); in amd_i2c_dw_xfer_quirk()
299 dev->msgs = msgs; in amd_i2c_dw_xfer_quirk()
300 dev->msgs_num = num_msgs; in amd_i2c_dw_xfer_quirk()
301 i2c_dw_xfer_init(dev); in amd_i2c_dw_xfer_quirk()
302 i2c_dw_disable_int(dev); in amd_i2c_dw_xfer_quirk()
310 regmap_write(dev->map, DW_IC_TX_TL, buf_len - 1); in amd_i2c_dw_xfer_quirk()
322 regmap_write(dev->map, DW_IC_DATA_CMD, 0x100); in amd_i2c_dw_xfer_quirk()
323 regmap_write(dev->map, DW_IC_DATA_CMD, 0x100 | cmd); in amd_i2c_dw_xfer_quirk()
325 regmap_write(dev->map, DW_IC_TX_TL, 2 * (buf_len - 1)); in amd_i2c_dw_xfer_quirk()
326 regmap_write(dev->map, DW_IC_RX_TL, 2 * (buf_len - 1)); in amd_i2c_dw_xfer_quirk()
332 status = i2c_dw_status(dev); in amd_i2c_dw_xfer_quirk()
337 regmap_read(dev->map, DW_IC_DATA_CMD, &val); in amd_i2c_dw_xfer_quirk()
340 status = i2c_dw_check_stopbit(dev); in amd_i2c_dw_xfer_quirk()
345 regmap_write(dev->map, DW_IC_DATA_CMD, *tx_buf++ | cmd); in amd_i2c_dw_xfer_quirk()
349 status = i2c_dw_check_stopbit(dev); in amd_i2c_dw_xfer_quirk()
364 i2c_dw_xfer_msg(struct dw_i2c_dev *dev) in i2c_dw_xfer_msg() argument
366 struct i2c_msg *msgs = dev->msgs; in i2c_dw_xfer_msg()
369 u32 addr = msgs[dev->msg_write_idx].addr; in i2c_dw_xfer_msg()
370 u32 buf_len = dev->tx_buf_len; in i2c_dw_xfer_msg()
371 u8 *buf = dev->tx_buf; in i2c_dw_xfer_msg()
377 for (; dev->msg_write_idx < dev->msgs_num; dev->msg_write_idx++) { in i2c_dw_xfer_msg()
378 u32 flags = msgs[dev->msg_write_idx].flags; in i2c_dw_xfer_msg()
385 if (msgs[dev->msg_write_idx].addr != addr) { in i2c_dw_xfer_msg()
386 dev_err(dev->dev, in i2c_dw_xfer_msg()
388 dev->msg_err = -EINVAL; in i2c_dw_xfer_msg()
392 if (!(dev->status & STATUS_WRITE_IN_PROGRESS)) { in i2c_dw_xfer_msg()
394 buf = msgs[dev->msg_write_idx].buf; in i2c_dw_xfer_msg()
395 buf_len = msgs[dev->msg_write_idx].len; in i2c_dw_xfer_msg()
401 if ((dev->master_cfg & DW_IC_CON_RESTART_EN) && in i2c_dw_xfer_msg()
402 (dev->msg_write_idx > 0)) in i2c_dw_xfer_msg()
406 regmap_read(dev->map, DW_IC_TXFLR, &flr); in i2c_dw_xfer_msg()
407 tx_limit = dev->tx_fifo_depth - flr; in i2c_dw_xfer_msg()
409 regmap_read(dev->map, DW_IC_RXFLR, &flr); in i2c_dw_xfer_msg()
410 rx_limit = dev->rx_fifo_depth - flr; in i2c_dw_xfer_msg()
428 if (dev->msg_write_idx == dev->msgs_num - 1 && in i2c_dw_xfer_msg()
437 if (msgs[dev->msg_write_idx].flags & I2C_M_RD) { in i2c_dw_xfer_msg()
440 if (dev->rx_outstanding >= dev->rx_fifo_depth) in i2c_dw_xfer_msg()
443 regmap_write(dev->map, DW_IC_DATA_CMD, in i2c_dw_xfer_msg()
446 dev->rx_outstanding++; in i2c_dw_xfer_msg()
448 regmap_write(dev->map, DW_IC_DATA_CMD, in i2c_dw_xfer_msg()
454 dev->tx_buf = buf; in i2c_dw_xfer_msg()
455 dev->tx_buf_len = buf_len; in i2c_dw_xfer_msg()
464 dev->status |= STATUS_WRITE_IN_PROGRESS; in i2c_dw_xfer_msg()
467 dev->status &= ~STATUS_WRITE_IN_PROGRESS; in i2c_dw_xfer_msg()
474 if (dev->msg_write_idx == dev->msgs_num) in i2c_dw_xfer_msg()
477 if (dev->msg_err) in i2c_dw_xfer_msg()
480 regmap_write(dev->map, DW_IC_INTR_MASK, intr_mask); in i2c_dw_xfer_msg()
484 i2c_dw_recv_len(struct dw_i2c_dev *dev, u8 len) in i2c_dw_recv_len() argument
486 struct i2c_msg *msgs = dev->msgs; in i2c_dw_recv_len()
487 u32 flags = msgs[dev->msg_read_idx].flags; in i2c_dw_recv_len()
494 dev->tx_buf_len = len - min_t(u8, len, dev->rx_outstanding); in i2c_dw_recv_len()
495 msgs[dev->msg_read_idx].len = len; in i2c_dw_recv_len()
496 msgs[dev->msg_read_idx].flags &= ~I2C_M_RECV_LEN; in i2c_dw_recv_len()
502 i2c_dw_read(struct dw_i2c_dev *dev) in i2c_dw_read() argument
504 struct i2c_msg *msgs = dev->msgs; in i2c_dw_read()
507 for (; dev->msg_read_idx < dev->msgs_num; dev->msg_read_idx++) { in i2c_dw_read()
511 if (!(msgs[dev->msg_read_idx].flags & I2C_M_RD)) in i2c_dw_read()
514 if (!(dev->status & STATUS_READ_IN_PROGRESS)) { in i2c_dw_read()
515 len = msgs[dev->msg_read_idx].len; in i2c_dw_read()
516 buf = msgs[dev->msg_read_idx].buf; in i2c_dw_read()
518 len = dev->rx_buf_len; in i2c_dw_read()
519 buf = dev->rx_buf; in i2c_dw_read()
522 regmap_read(dev->map, DW_IC_RXFLR, &rx_valid); in i2c_dw_read()
525 u32 flags = msgs[dev->msg_read_idx].flags; in i2c_dw_read()
527 regmap_read(dev->map, DW_IC_DATA_CMD, &tmp); in i2c_dw_read()
531 len = i2c_dw_recv_len(dev, tmp); in i2c_dw_read()
534 dev->rx_outstanding--; in i2c_dw_read()
538 dev->status |= STATUS_READ_IN_PROGRESS; in i2c_dw_read()
539 dev->rx_buf_len = len; in i2c_dw_read()
540 dev->rx_buf = buf; in i2c_dw_read()
543 dev->status &= ~STATUS_READ_IN_PROGRESS; in i2c_dw_read()
553 struct dw_i2c_dev *dev = i2c_get_adapdata(adap); in i2c_dw_xfer() local
556 dev_dbg(dev->dev, "%s: msgs: %d\n", __func__, num); in i2c_dw_xfer()
558 pm_runtime_get_sync(dev->dev); in i2c_dw_xfer()
565 if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU) { in i2c_dw_xfer()
570 reinit_completion(&dev->cmd_complete); in i2c_dw_xfer()
571 dev->msgs = msgs; in i2c_dw_xfer()
572 dev->msgs_num = num; in i2c_dw_xfer()
573 dev->cmd_err = 0; in i2c_dw_xfer()
574 dev->msg_write_idx = 0; in i2c_dw_xfer()
575 dev->msg_read_idx = 0; in i2c_dw_xfer()
576 dev->msg_err = 0; in i2c_dw_xfer()
577 dev->status = STATUS_IDLE; in i2c_dw_xfer()
578 dev->abort_source = 0; in i2c_dw_xfer()
579 dev->rx_outstanding = 0; in i2c_dw_xfer()
581 ret = i2c_dw_acquire_lock(dev); in i2c_dw_xfer()
585 ret = i2c_dw_wait_bus_not_busy(dev); in i2c_dw_xfer()
590 i2c_dw_xfer_init(dev); in i2c_dw_xfer()
593 if (!wait_for_completion_timeout(&dev->cmd_complete, adap->timeout)) { in i2c_dw_xfer()
594 dev_err(dev->dev, "controller timed out\n"); in i2c_dw_xfer()
596 i2c_recover_bus(&dev->adapter); in i2c_dw_xfer()
597 i2c_dw_init_master(dev); in i2c_dw_xfer()
610 __i2c_dw_disable_nowait(dev); in i2c_dw_xfer()
612 if (dev->msg_err) { in i2c_dw_xfer()
613 ret = dev->msg_err; in i2c_dw_xfer()
618 if (likely(!dev->cmd_err && !dev->status)) { in i2c_dw_xfer()
624 if (dev->cmd_err == DW_IC_ERR_TX_ABRT) { in i2c_dw_xfer()
625 ret = i2c_dw_handle_tx_abort(dev); in i2c_dw_xfer()
629 if (dev->status) in i2c_dw_xfer()
630 dev_err(dev->dev, in i2c_dw_xfer()
636 i2c_dw_release_lock(dev); in i2c_dw_xfer()
639 pm_runtime_mark_last_busy(dev->dev); in i2c_dw_xfer()
640 pm_runtime_put_autosuspend(dev->dev); in i2c_dw_xfer()
654 static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev) in i2c_dw_read_clear_intrbits() argument
670 regmap_read(dev->map, DW_IC_INTR_STAT, &stat); in i2c_dw_read_clear_intrbits()
680 regmap_read(dev->map, DW_IC_CLR_RX_UNDER, &dummy); in i2c_dw_read_clear_intrbits()
682 regmap_read(dev->map, DW_IC_CLR_RX_OVER, &dummy); in i2c_dw_read_clear_intrbits()
684 regmap_read(dev->map, DW_IC_CLR_TX_OVER, &dummy); in i2c_dw_read_clear_intrbits()
686 regmap_read(dev->map, DW_IC_CLR_RD_REQ, &dummy); in i2c_dw_read_clear_intrbits()
692 regmap_read(dev->map, DW_IC_TX_ABRT_SOURCE, &dev->abort_source); in i2c_dw_read_clear_intrbits()
693 regmap_read(dev->map, DW_IC_CLR_TX_ABRT, &dummy); in i2c_dw_read_clear_intrbits()
696 regmap_read(dev->map, DW_IC_CLR_RX_DONE, &dummy); in i2c_dw_read_clear_intrbits()
698 regmap_read(dev->map, DW_IC_CLR_ACTIVITY, &dummy); in i2c_dw_read_clear_intrbits()
700 ((dev->rx_outstanding == 0) || (stat & DW_IC_INTR_RX_FULL))) in i2c_dw_read_clear_intrbits()
701 regmap_read(dev->map, DW_IC_CLR_STOP_DET, &dummy); in i2c_dw_read_clear_intrbits()
703 regmap_read(dev->map, DW_IC_CLR_START_DET, &dummy); in i2c_dw_read_clear_intrbits()
705 regmap_read(dev->map, DW_IC_CLR_GEN_CALL, &dummy); in i2c_dw_read_clear_intrbits()
714 static int i2c_dw_irq_handler_master(struct dw_i2c_dev *dev) in i2c_dw_irq_handler_master() argument
718 stat = i2c_dw_read_clear_intrbits(dev); in i2c_dw_irq_handler_master()
720 if (!(dev->status & STATUS_ACTIVE)) { in i2c_dw_irq_handler_master()
728 regmap_write(dev->map, DW_IC_INTR_MASK, 0); in i2c_dw_irq_handler_master()
733 dev->cmd_err |= DW_IC_ERR_TX_ABRT; in i2c_dw_irq_handler_master()
734 dev->status = STATUS_IDLE; in i2c_dw_irq_handler_master()
735 dev->rx_outstanding = 0; in i2c_dw_irq_handler_master()
741 regmap_write(dev->map, DW_IC_INTR_MASK, 0); in i2c_dw_irq_handler_master()
746 i2c_dw_read(dev); in i2c_dw_irq_handler_master()
749 i2c_dw_xfer_msg(dev); in i2c_dw_irq_handler_master()
758 if (((stat & (DW_IC_INTR_TX_ABRT | DW_IC_INTR_STOP_DET)) || dev->msg_err) && in i2c_dw_irq_handler_master()
759 (dev->rx_outstanding == 0)) in i2c_dw_irq_handler_master()
760 complete(&dev->cmd_complete); in i2c_dw_irq_handler_master()
761 else if (unlikely(dev->flags & ACCESS_INTR_MASK)) { in i2c_dw_irq_handler_master()
763 regmap_read(dev->map, DW_IC_INTR_MASK, &stat); in i2c_dw_irq_handler_master()
764 i2c_dw_disable_int(dev); in i2c_dw_irq_handler_master()
765 regmap_write(dev->map, DW_IC_INTR_MASK, stat); in i2c_dw_irq_handler_master()
773 struct dw_i2c_dev *dev = dev_id; in i2c_dw_isr() local
776 regmap_read(dev->map, DW_IC_ENABLE, &enabled); in i2c_dw_isr()
777 regmap_read(dev->map, DW_IC_RAW_INTR_STAT, &stat); in i2c_dw_isr()
778 dev_dbg(dev->dev, "enabled=%#x stat=%#x\n", enabled, stat); in i2c_dw_isr()
782 i2c_dw_irq_handler_master(dev); in i2c_dw_isr()
787 void i2c_dw_configure_master(struct dw_i2c_dev *dev) in i2c_dw_configure_master() argument
789 struct i2c_timings *t = &dev->timings; in i2c_dw_configure_master()
791 dev->functionality = I2C_FUNC_10BIT_ADDR | DW_IC_DEFAULT_FUNCTIONALITY; in i2c_dw_configure_master()
793 dev->master_cfg = DW_IC_CON_MASTER | DW_IC_CON_SLAVE_DISABLE | in i2c_dw_configure_master()
796 dev->mode = DW_IC_MASTER; in i2c_dw_configure_master()
800 dev->master_cfg |= DW_IC_CON_SPEED_STD; in i2c_dw_configure_master()
803 dev->master_cfg |= DW_IC_CON_SPEED_HIGH; in i2c_dw_configure_master()
806 dev->master_cfg |= DW_IC_CON_SPEED_FAST; in i2c_dw_configure_master()
813 struct dw_i2c_dev *dev = i2c_get_adapdata(adap); in i2c_dw_prepare_recovery() local
815 i2c_dw_disable(dev); in i2c_dw_prepare_recovery()
816 reset_control_assert(dev->rst); in i2c_dw_prepare_recovery()
817 i2c_dw_prepare_clk(dev, false); in i2c_dw_prepare_recovery()
822 struct dw_i2c_dev *dev = i2c_get_adapdata(adap); in i2c_dw_unprepare_recovery() local
824 i2c_dw_prepare_clk(dev, true); in i2c_dw_unprepare_recovery()
825 reset_control_deassert(dev->rst); in i2c_dw_unprepare_recovery()
826 i2c_dw_init_master(dev); in i2c_dw_unprepare_recovery()
829 static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev) in i2c_dw_init_recovery_info() argument
831 struct i2c_bus_recovery_info *rinfo = &dev->rinfo; in i2c_dw_init_recovery_info()
832 struct i2c_adapter *adap = &dev->adapter; in i2c_dw_init_recovery_info()
835 gpio = devm_gpiod_get_optional(dev->dev, "scl", GPIOD_OUT_HIGH); in i2c_dw_init_recovery_info()
841 gpio = devm_gpiod_get_optional(dev->dev, "sda", GPIOD_IN); in i2c_dw_init_recovery_info()
851 dev_info(dev->dev, "running with gpio recovery mode! scl%s", in i2c_dw_init_recovery_info()
857 static int amd_i2c_adap_quirk(struct dw_i2c_dev *dev) in amd_i2c_adap_quirk() argument
859 struct i2c_adapter *adap = &dev->adapter; in amd_i2c_adap_quirk()
862 pm_runtime_get_noresume(dev->dev); in amd_i2c_adap_quirk()
865 dev_err(dev->dev, "Failed to add adapter: %d\n", ret); in amd_i2c_adap_quirk()
866 pm_runtime_put_noidle(dev->dev); in amd_i2c_adap_quirk()
871 int i2c_dw_probe_master(struct dw_i2c_dev *dev) in i2c_dw_probe_master() argument
873 struct i2c_adapter *adap = &dev->adapter; in i2c_dw_probe_master()
877 init_completion(&dev->cmd_complete); in i2c_dw_probe_master()
879 dev->init = i2c_dw_init_master; in i2c_dw_probe_master()
880 dev->disable = i2c_dw_disable; in i2c_dw_probe_master()
881 dev->disable_int = i2c_dw_disable_int; in i2c_dw_probe_master()
883 ret = i2c_dw_init_regmap(dev); in i2c_dw_probe_master()
887 ret = i2c_dw_set_timings_master(dev); in i2c_dw_probe_master()
891 ret = i2c_dw_set_fifo_size(dev); in i2c_dw_probe_master()
895 ret = dev->init(dev); in i2c_dw_probe_master()
904 adap->dev.parent = dev->dev; in i2c_dw_probe_master()
905 i2c_set_adapdata(adap, dev); in i2c_dw_probe_master()
907 if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU) in i2c_dw_probe_master()
908 return amd_i2c_adap_quirk(dev); in i2c_dw_probe_master()
910 if (dev->flags & ACCESS_NO_IRQ_SUSPEND) { in i2c_dw_probe_master()
916 ret = i2c_dw_acquire_lock(dev); in i2c_dw_probe_master()
920 i2c_dw_disable_int(dev); in i2c_dw_probe_master()
921 i2c_dw_release_lock(dev); in i2c_dw_probe_master()
923 ret = devm_request_irq(dev->dev, dev->irq, i2c_dw_isr, irq_flags, in i2c_dw_probe_master()
924 dev_name(dev->dev), dev); in i2c_dw_probe_master()
926 dev_err(dev->dev, "failure requesting irq %i: %d\n", in i2c_dw_probe_master()
927 dev->irq, ret); in i2c_dw_probe_master()
931 ret = i2c_dw_init_recovery_info(dev); in i2c_dw_probe_master()
941 pm_runtime_get_noresume(dev->dev); in i2c_dw_probe_master()
944 dev_err(dev->dev, "failure adding adapter: %d\n", ret); in i2c_dw_probe_master()
945 pm_runtime_put_noidle(dev->dev); in i2c_dw_probe_master()