Lines Matching +full:slave +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) 2009 - 2014 Xilinx, Inc.
60 * Normal addressing mode uses [6:0] bits. Extended addressing mode uses [9:0]
62 * is in master mode.
119 #define CDNS_I2C_DATA_INTR_DEPTH (CDNS_I2C_FIFO_DEPTH - 2)
122 #define CDNS_I2C_TRANSFER_SIZE (CDNS_I2C_MAX_TRANSFER_SIZE - 3)
124 #define DRIVER_NAME "cdns-i2c"
135 #define cdns_i2c_readreg(offset) readl_relaxed(id->membase + offset)
136 #define cdns_i2c_writereg(val, offset) writel_relaxed(val, id->membase + offset)
140 * enum cdns_i2c_mode - I2C Controller current operating mode
142 * @CDNS_I2C_MODE_SLAVE: I2C controller operating in slave mode
143 * @CDNS_I2C_MODE_MASTER: I2C Controller operating in master mode
151 * enum cdns_i2c_slave_state - Slave state when I2C is operating in slave mode
153 * @CDNS_I2C_SLAVE_STATE_IDLE: I2C slave idle
154 * @CDNS_I2C_SLAVE_STATE_SEND: I2C slave sending data to master
155 * @CDNS_I2C_SLAVE_STATE_RECV: I2C slave receiving data from master
165 * struct cdns_i2c - I2C device private data structure
187 * @slave: Registered slave instance.
188 * @dev_mode: I2C operating role(master/slave).
189 * @slave_state: I2C Slave state(idle/read/write).
214 struct i2c_client *slave; member
228 * cdns_i2c_clear_bus_hold - Clear bus hold bit
243 (id->curr_recv_count == CDNS_I2C_FIFO_DEPTH + 1)); in cdns_is_holdquirk()
247 static void cdns_i2c_set_mode(enum cdns_i2c_mode mode, struct cdns_i2c *id) in cdns_i2c_set_mode() argument
255 /* Update device mode and state */ in cdns_i2c_set_mode()
256 id->dev_mode = mode; in cdns_i2c_set_mode()
257 id->slave_state = CDNS_I2C_SLAVE_STATE_IDLE; in cdns_i2c_set_mode()
259 switch (mode) { in cdns_i2c_set_mode()
262 cdns_i2c_writereg(id->ctrl_reg_diva_divb | in cdns_i2c_set_mode()
267 * the master mode. With lower values(like 110 us) i2cdetect in cdns_i2c_set_mode()
268 * will not detect any slave and without this delay, the IP will in cdns_i2c_set_mode()
274 /* Enable i2c slave */ in cdns_i2c_set_mode()
275 cdns_i2c_writereg(id->ctrl_reg_diva_divb & in cdns_i2c_set_mode()
279 /* Setting slave address */ in cdns_i2c_set_mode()
280 cdns_i2c_writereg(id->slave->addr & CDNS_I2C_ADDR_MASK, in cdns_i2c_set_mode()
283 /* Enable slave send/receive interrupts */ in cdns_i2c_set_mode()
296 if (id->slave_state == CDNS_I2C_SLAVE_STATE_IDLE) { in cdns_i2c_slave_rcv_data()
297 id->slave_state = CDNS_I2C_SLAVE_STATE_RECV; in cdns_i2c_slave_rcv_data()
298 i2c_slave_event(id->slave, I2C_SLAVE_WRITE_REQUESTED, NULL); in cdns_i2c_slave_rcv_data()
305 while (bytes--) { in cdns_i2c_slave_rcv_data()
307 i2c_slave_event(id->slave, I2C_SLAVE_WRITE_RECEIVED, &data); in cdns_i2c_slave_rcv_data()
316 if (id->slave_state == CDNS_I2C_SLAVE_STATE_IDLE) { in cdns_i2c_slave_send_data()
317 id->slave_state = CDNS_I2C_SLAVE_STATE_SEND; in cdns_i2c_slave_send_data()
318 i2c_slave_event(id->slave, I2C_SLAVE_READ_REQUESTED, &data); in cdns_i2c_slave_send_data()
320 i2c_slave_event(id->slave, I2C_SLAVE_READ_PROCESSED, &data); in cdns_i2c_slave_send_data()
328 * cdns_i2c_slave_isr - Interrupt handler for the I2C device in slave role
332 * the I2C device in slave role.
348 /* Fetch transfer mode (send/receive) */ in cdns_i2c_slave_isr()
358 id->slave_state = CDNS_I2C_SLAVE_STATE_IDLE; in cdns_i2c_slave_isr()
359 i2c_slave_event(id->slave, I2C_SLAVE_STOP, NULL); in cdns_i2c_slave_isr()
368 id->slave_state = CDNS_I2C_SLAVE_STATE_IDLE; in cdns_i2c_slave_isr()
369 i2c_slave_event(id->slave, I2C_SLAVE_STOP, NULL); in cdns_i2c_slave_isr()
376 id->slave_state = CDNS_I2C_SLAVE_STATE_IDLE; in cdns_i2c_slave_isr()
377 i2c_slave_event(id->slave, I2C_SLAVE_STOP, NULL); in cdns_i2c_slave_isr()
386 * cdns_i2c_master_isr - Interrupt handler for the I2C device in master role
406 id->err_status = 0; in cdns_i2c_master_isr()
418 updatetx = id->recv_count > id->curr_recv_count; in cdns_i2c_master_isr()
421 if (id->p_recv_buf && in cdns_i2c_master_isr()
427 if (id->recv_count > 0) { in cdns_i2c_master_isr()
428 *(id->p_recv_buf)++ = in cdns_i2c_master_isr()
430 id->recv_count--; in cdns_i2c_master_isr()
431 id->curr_recv_count--; in cdns_i2c_master_isr()
438 if (id->recv_count <= CDNS_I2C_FIFO_DEPTH && in cdns_i2c_master_isr()
439 !id->bus_hold_flag) in cdns_i2c_master_isr()
443 dev_err(id->adap.dev.parent, in cdns_i2c_master_isr()
445 id->err_status |= CDNS_I2C_IXR_TO; in cdns_i2c_master_isr()
454 * The controller sends NACK to the slave when transfer size in cdns_i2c_master_isr()
457 * maintain transfer size non-zero while performing a large in cdns_i2c_master_isr()
463 (id->curr_recv_count - CDNS_I2C_FIFO_DEPTH)) in cdns_i2c_master_isr()
470 if (((int)(id->recv_count) - CDNS_I2C_FIFO_DEPTH) > in cdns_i2c_master_isr()
474 id->curr_recv_count = CDNS_I2C_TRANSFER_SIZE + in cdns_i2c_master_isr()
477 cdns_i2c_writereg(id->recv_count - in cdns_i2c_master_isr()
480 id->curr_recv_count = id->recv_count; in cdns_i2c_master_isr()
485 if ((isr_status & CDNS_I2C_IXR_COMP) && !id->recv_count) { in cdns_i2c_master_isr()
486 if (!id->bus_hold_flag) in cdns_i2c_master_isr()
495 if ((isr_status & CDNS_I2C_IXR_COMP) && !id->p_recv_buf) { in cdns_i2c_master_isr()
500 if (id->send_count) { in cdns_i2c_master_isr()
501 avail_bytes = CDNS_I2C_FIFO_DEPTH - in cdns_i2c_master_isr()
503 if (id->send_count > avail_bytes) in cdns_i2c_master_isr()
506 bytes_to_send = id->send_count; in cdns_i2c_master_isr()
508 while (bytes_to_send--) { in cdns_i2c_master_isr()
510 (*(id->p_send_buf)++), in cdns_i2c_master_isr()
512 id->send_count--; in cdns_i2c_master_isr()
522 if (!id->send_count && !id->bus_hold_flag) in cdns_i2c_master_isr()
529 id->err_status |= isr_status & CDNS_I2C_IXR_ERR_INTR_MASK; in cdns_i2c_master_isr()
530 if (id->err_status) in cdns_i2c_master_isr()
534 complete(&id->xfer_done); in cdns_i2c_master_isr()
540 * cdns_i2c_isr - Interrupt handler for the I2C device
544 * This function passes the control to slave/master based on current role of
554 if (id->dev_mode == CDNS_I2C_MODE_SLAVE) in cdns_i2c_isr()
561 * cdns_i2c_mrecv - Prepare and start a master receive operation
574 id->p_recv_buf = id->p_msg->buf; in cdns_i2c_mrecv()
575 id->recv_count = id->p_msg->len; in cdns_i2c_mrecv()
577 /* Put the controller in master receive mode and clear the FIFO */ in cdns_i2c_mrecv()
583 * byte, plus one checksum byte if PEC is enabled. p_msg->len will be 2 if in cdns_i2c_mrecv()
586 if (id->p_msg->flags & I2C_M_RECV_LEN) in cdns_i2c_mrecv()
587 id->recv_count = I2C_SMBUS_BLOCK_MAX + id->p_msg->len; in cdns_i2c_mrecv()
589 id->curr_recv_count = id->recv_count; in cdns_i2c_mrecv()
595 if (id->recv_count > CDNS_I2C_FIFO_DEPTH) in cdns_i2c_mrecv()
610 if (id->recv_count > CDNS_I2C_TRANSFER_SIZE) { in cdns_i2c_mrecv()
613 id->curr_recv_count = CDNS_I2C_TRANSFER_SIZE; in cdns_i2c_mrecv()
615 cdns_i2c_writereg(id->recv_count, CDNS_I2C_XFER_SIZE_OFFSET); in cdns_i2c_mrecv()
619 if (!id->bus_hold_flag && in cdns_i2c_mrecv()
620 ((id->p_msg->flags & I2C_M_RECV_LEN) != I2C_M_RECV_LEN) && in cdns_i2c_mrecv()
621 (id->recv_count <= CDNS_I2C_FIFO_DEPTH)) { in cdns_i2c_mrecv()
624 if (id->quirks & CDNS_I2C_BROKEN_HOLD_BIT) in cdns_i2c_mrecv()
629 addr = id->p_msg->addr; in cdns_i2c_mrecv()
639 * writes to slave address register and control register. in cdns_i2c_mrecv()
659 * cdns_i2c_msend - Prepare and start a master send operation
669 id->p_recv_buf = NULL; in cdns_i2c_msend()
670 id->p_send_buf = id->p_msg->buf; in cdns_i2c_msend()
671 id->send_count = id->p_msg->len; in cdns_i2c_msend()
673 /* Set the controller in Master transmit mode and clear the FIFO. */ in cdns_i2c_msend()
682 if (id->send_count > CDNS_I2C_FIFO_DEPTH) in cdns_i2c_msend()
695 avail_bytes = CDNS_I2C_FIFO_DEPTH - in cdns_i2c_msend()
698 if (id->send_count > avail_bytes) in cdns_i2c_msend()
701 bytes_to_send = id->send_count; in cdns_i2c_msend()
703 while (bytes_to_send--) { in cdns_i2c_msend()
704 cdns_i2c_writereg((*(id->p_send_buf)++), CDNS_I2C_DATA_OFFSET); in cdns_i2c_msend()
705 id->send_count--; in cdns_i2c_msend()
712 if (!id->bus_hold_flag && !id->send_count) in cdns_i2c_msend()
714 /* Set the slave address in address register - triggers operation. */ in cdns_i2c_msend()
715 cdns_i2c_writereg(id->p_msg->addr & CDNS_I2C_ADDR_MASK, in cdns_i2c_msend()
722 * cdns_i2c_master_reset - Reset the interface
730 struct cdns_i2c *id = adap->algo_data; in cdns_i2c_master_reset()
756 id->p_msg = msg; in cdns_i2c_process_msg()
757 id->err_status = 0; in cdns_i2c_process_msg()
758 reinit_completion(&id->xfer_done); in cdns_i2c_process_msg()
760 /* Check for the TEN Bit mode on each msg */ in cdns_i2c_process_msg()
762 if (msg->flags & I2C_M_TEN) { in cdns_i2c_process_msg()
773 if (msg->flags & I2C_M_RD) in cdns_i2c_process_msg()
779 msg_timeout = msecs_to_jiffies((1000 * msg->len * BITS_PER_BYTE) / id->i2c_clk); in cdns_i2c_process_msg()
783 if (msg_timeout < adap->timeout) in cdns_i2c_process_msg()
784 msg_timeout = adap->timeout; in cdns_i2c_process_msg()
787 time_left = wait_for_completion_timeout(&id->xfer_done, msg_timeout); in cdns_i2c_process_msg()
790 dev_err(id->adap.dev.parent, in cdns_i2c_process_msg()
792 return -ETIMEDOUT; in cdns_i2c_process_msg()
799 if (id->err_status & CDNS_I2C_IXR_ARB_LOST) in cdns_i2c_process_msg()
800 return -EAGAIN; in cdns_i2c_process_msg()
802 if (msg->flags & I2C_M_RECV_LEN) in cdns_i2c_process_msg()
803 msg->len += min_t(unsigned int, msg->buf[0], I2C_SMBUS_BLOCK_MAX); in cdns_i2c_process_msg()
809 * cdns_i2c_master_xfer - The main i2c transfer function
823 struct cdns_i2c *id = adap->algo_data; in cdns_i2c_master_xfer()
829 ret = pm_runtime_resume_and_get(id->dev); in cdns_i2c_master_xfer()
834 /* Check i2c operating mode and switch if possible */ in cdns_i2c_master_xfer()
835 if (id->dev_mode == CDNS_I2C_MODE_SLAVE) { in cdns_i2c_master_xfer()
836 if (id->slave_state != CDNS_I2C_SLAVE_STATE_IDLE) in cdns_i2c_master_xfer()
837 return -EAGAIN; in cdns_i2c_master_xfer()
839 /* Set mode to master */ in cdns_i2c_master_xfer()
849 ret = readl_relaxed_poll_timeout(id->membase + CDNS_I2C_SR_OFFSET, in cdns_i2c_master_xfer()
854 ret = -EAGAIN; in cdns_i2c_master_xfer()
855 if (id->adap.bus_recovery_info) in cdns_i2c_master_xfer()
860 hold_quirk = !!(id->quirks & CDNS_I2C_BROKEN_HOLD_BIT); in cdns_i2c_master_xfer()
873 for (count = 0; (count < num - 1 && hold_quirk); count++) { in cdns_i2c_master_xfer()
875 dev_warn(adap->dev.parent, in cdns_i2c_master_xfer()
877 ret = -EOPNOTSUPP; in cdns_i2c_master_xfer()
881 id->bus_hold_flag = 1; in cdns_i2c_master_xfer()
886 id->bus_hold_flag = 0; in cdns_i2c_master_xfer()
891 if (count == (num - 1)) in cdns_i2c_master_xfer()
892 id->bus_hold_flag = 0; in cdns_i2c_master_xfer()
899 if (id->err_status) { in cdns_i2c_master_xfer()
902 if (id->err_status & CDNS_I2C_IXR_NACK) { in cdns_i2c_master_xfer()
903 ret = -ENXIO; in cdns_i2c_master_xfer()
906 ret = -EIO; in cdns_i2c_master_xfer()
916 /* Switch i2c mode to slave */ in cdns_i2c_master_xfer()
921 pm_runtime_mark_last_busy(id->dev); in cdns_i2c_master_xfer()
922 pm_runtime_put_autosuspend(id->dev); in cdns_i2c_master_xfer()
927 * cdns_i2c_func - Returns the supported features of the I2C driver
946 static int cdns_reg_slave(struct i2c_client *slave) in cdns_reg_slave() argument
949 struct cdns_i2c *id = container_of(slave->adapter, struct cdns_i2c, in cdns_reg_slave()
952 if (id->slave) in cdns_reg_slave()
953 return -EBUSY; in cdns_reg_slave()
955 if (slave->flags & I2C_CLIENT_TEN) in cdns_reg_slave()
956 return -EAFNOSUPPORT; in cdns_reg_slave()
958 ret = pm_runtime_resume_and_get(id->dev); in cdns_reg_slave()
962 /* Store slave information */ in cdns_reg_slave()
963 id->slave = slave; in cdns_reg_slave()
965 /* Enable I2C slave */ in cdns_reg_slave()
971 static int cdns_unreg_slave(struct i2c_client *slave) in cdns_unreg_slave() argument
973 struct cdns_i2c *id = container_of(slave->adapter, struct cdns_i2c, in cdns_unreg_slave()
976 pm_runtime_put(id->dev); in cdns_unreg_slave()
978 /* Remove slave information */ in cdns_unreg_slave()
979 id->slave = NULL; in cdns_unreg_slave()
998 * cdns_i2c_calc_divs - Calculate clock dividers
1024 return -EINVAL; in cdns_i2c_calc_divs()
1026 last_error = -1; in cdns_i2c_calc_divs()
1032 div_b--; in cdns_i2c_calc_divs()
1039 current_error = ((actual_fscl > fscl) ? (actual_fscl - fscl) : in cdns_i2c_calc_divs()
1040 (fscl - actual_fscl)); in cdns_i2c_calc_divs()
1058 * cdns_i2c_setclk - This function sets the serial clock rate for the I2C device
1078 unsigned long fscl = id->i2c_clk; in cdns_i2c_setclk()
1084 ctrl_reg = id->ctrl_reg; in cdns_i2c_setclk()
1088 id->ctrl_reg = ctrl_reg; in cdns_i2c_setclk()
1091 id->ctrl_reg_diva_divb = ctrl_reg & (CDNS_I2C_CR_DIVA_MASK | in cdns_i2c_setclk()
1098 * cdns_i2c_clk_notifier_cb - Clock rate change callback
1106 * New dividers are written to the HW in the pre- or post change notification
1119 if (pm_runtime_suspended(id->dev)) in cdns_i2c_clk_notifier_cb()
1125 unsigned long input_clk = ndata->new_rate; in cdns_i2c_clk_notifier_cb()
1126 unsigned long fscl = id->i2c_clk; in cdns_i2c_clk_notifier_cb()
1132 dev_warn(id->adap.dev.parent, in cdns_i2c_clk_notifier_cb()
1138 if (ndata->new_rate > ndata->old_rate) in cdns_i2c_clk_notifier_cb()
1139 cdns_i2c_setclk(ndata->new_rate, id); in cdns_i2c_clk_notifier_cb()
1144 id->input_clk = ndata->new_rate; in cdns_i2c_clk_notifier_cb()
1146 if (ndata->new_rate < ndata->old_rate) in cdns_i2c_clk_notifier_cb()
1147 cdns_i2c_setclk(ndata->new_rate, id); in cdns_i2c_clk_notifier_cb()
1151 if (ndata->new_rate > ndata->old_rate) in cdns_i2c_clk_notifier_cb()
1152 cdns_i2c_setclk(ndata->old_rate, id); in cdns_i2c_clk_notifier_cb()
1160 * cdns_i2c_runtime_suspend - Runtime suspend method for the driver
1163 * Put the driver into low power mode.
1171 clk_disable(xi2c->clk); in cdns_i2c_runtime_suspend()
1177 * cdns_i2c_init - Controller initialisation
1185 cdns_i2c_writereg(id->ctrl_reg, CDNS_I2C_CR_OFFSET); in cdns_i2c_init()
1188 * invalid read transaction after HW timeout in master receiver mode. in cdns_i2c_init()
1197 * cdns_i2c_runtime_resume - Runtime resume
1209 ret = clk_enable(xi2c->clk); in cdns_i2c_runtime_resume()
1229 { .compatible = "cdns,i2c-r1p10", .data = &r1p10_i2c_def },
1230 { .compatible = "cdns,i2c-r1p14",},
1236 * cdns_i2c_probe - Platform registration call
1240 * device. User can modify the address mode to 10 bit address mode using the
1252 id = devm_kzalloc(&pdev->dev, sizeof(*id), GFP_KERNEL); in cdns_i2c_probe()
1254 return -ENOMEM; in cdns_i2c_probe()
1256 id->dev = &pdev->dev; in cdns_i2c_probe()
1259 match = of_match_node(cdns_i2c_of_match, pdev->dev.of_node); in cdns_i2c_probe()
1260 if (match && match->data) { in cdns_i2c_probe()
1261 const struct cdns_platform_data *data = match->data; in cdns_i2c_probe()
1262 id->quirks = data->quirks; in cdns_i2c_probe()
1265 id->rinfo.pinctrl = devm_pinctrl_get(&pdev->dev); in cdns_i2c_probe()
1266 if (IS_ERR(id->rinfo.pinctrl)) { in cdns_i2c_probe()
1267 int err = PTR_ERR(id->rinfo.pinctrl); in cdns_i2c_probe()
1269 dev_info(&pdev->dev, "can't get pinctrl, bus recovery not supported\n"); in cdns_i2c_probe()
1270 if (err != -ENODEV) in cdns_i2c_probe()
1273 id->adap.bus_recovery_info = &id->rinfo; in cdns_i2c_probe()
1276 id->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem); in cdns_i2c_probe()
1277 if (IS_ERR(id->membase)) in cdns_i2c_probe()
1278 return PTR_ERR(id->membase); in cdns_i2c_probe()
1283 id->irq = ret; in cdns_i2c_probe()
1285 id->adap.owner = THIS_MODULE; in cdns_i2c_probe()
1286 id->adap.dev.of_node = pdev->dev.of_node; in cdns_i2c_probe()
1287 id->adap.algo = &cdns_i2c_algo; in cdns_i2c_probe()
1288 id->adap.timeout = CDNS_I2C_TIMEOUT; in cdns_i2c_probe()
1289 id->adap.retries = 3; /* Default retry value. */ in cdns_i2c_probe()
1290 id->adap.algo_data = id; in cdns_i2c_probe()
1291 id->adap.dev.parent = &pdev->dev; in cdns_i2c_probe()
1292 init_completion(&id->xfer_done); in cdns_i2c_probe()
1293 snprintf(id->adap.name, sizeof(id->adap.name), in cdns_i2c_probe()
1294 "Cadence I2C at %08lx", (unsigned long)r_mem->start); in cdns_i2c_probe()
1296 id->clk = devm_clk_get(&pdev->dev, NULL); in cdns_i2c_probe()
1297 if (IS_ERR(id->clk)) in cdns_i2c_probe()
1298 return dev_err_probe(&pdev->dev, PTR_ERR(id->clk), in cdns_i2c_probe()
1301 ret = clk_prepare_enable(id->clk); in cdns_i2c_probe()
1303 dev_err(&pdev->dev, "Unable to enable clock.\n"); in cdns_i2c_probe()
1305 pm_runtime_set_autosuspend_delay(id->dev, CNDS_I2C_PM_TIMEOUT); in cdns_i2c_probe()
1306 pm_runtime_use_autosuspend(id->dev); in cdns_i2c_probe()
1307 pm_runtime_set_active(id->dev); in cdns_i2c_probe()
1308 pm_runtime_enable(id->dev); in cdns_i2c_probe()
1310 id->clk_rate_change_nb.notifier_call = cdns_i2c_clk_notifier_cb; in cdns_i2c_probe()
1311 if (clk_notifier_register(id->clk, &id->clk_rate_change_nb)) in cdns_i2c_probe()
1312 dev_warn(&pdev->dev, "Unable to register clock notifier.\n"); in cdns_i2c_probe()
1313 id->input_clk = clk_get_rate(id->clk); in cdns_i2c_probe()
1315 ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency", in cdns_i2c_probe()
1316 &id->i2c_clk); in cdns_i2c_probe()
1317 if (ret || (id->i2c_clk > I2C_MAX_FAST_MODE_FREQ)) in cdns_i2c_probe()
1318 id->i2c_clk = I2C_MAX_STANDARD_MODE_FREQ; in cdns_i2c_probe()
1321 /* Set initial mode to master */ in cdns_i2c_probe()
1322 id->dev_mode = CDNS_I2C_MODE_MASTER; in cdns_i2c_probe()
1323 id->slave_state = CDNS_I2C_SLAVE_STATE_IDLE; in cdns_i2c_probe()
1325 id->ctrl_reg = CDNS_I2C_CR_ACK_EN | CDNS_I2C_CR_NEA | CDNS_I2C_CR_MS; in cdns_i2c_probe()
1327 ret = cdns_i2c_setclk(id->input_clk, id); in cdns_i2c_probe()
1329 dev_err(&pdev->dev, "invalid SCL clock: %u Hz\n", id->i2c_clk); in cdns_i2c_probe()
1330 ret = -EINVAL; in cdns_i2c_probe()
1334 ret = devm_request_irq(&pdev->dev, id->irq, cdns_i2c_isr, 0, in cdns_i2c_probe()
1337 dev_err(&pdev->dev, "cannot get irq %d\n", id->irq); in cdns_i2c_probe()
1342 ret = i2c_add_adapter(&id->adap); in cdns_i2c_probe()
1346 dev_info(&pdev->dev, "%u kHz mmio %08lx irq %d\n", in cdns_i2c_probe()
1347 id->i2c_clk / 1000, (unsigned long)r_mem->start, id->irq); in cdns_i2c_probe()
1352 clk_notifier_unregister(id->clk, &id->clk_rate_change_nb); in cdns_i2c_probe()
1353 clk_disable_unprepare(id->clk); in cdns_i2c_probe()
1354 pm_runtime_disable(&pdev->dev); in cdns_i2c_probe()
1355 pm_runtime_set_suspended(&pdev->dev); in cdns_i2c_probe()
1360 * cdns_i2c_remove - Unregister the device after releasing the resources
1371 pm_runtime_disable(&pdev->dev); in cdns_i2c_remove()
1372 pm_runtime_set_suspended(&pdev->dev); in cdns_i2c_remove()
1373 pm_runtime_dont_use_autosuspend(&pdev->dev); in cdns_i2c_remove()
1375 i2c_del_adapter(&id->adap); in cdns_i2c_remove()
1376 clk_notifier_unregister(id->clk, &id->clk_rate_change_nb); in cdns_i2c_remove()
1377 clk_disable_unprepare(id->clk); in cdns_i2c_remove()