Lines Matching +full:i2c +full:- +full:fast +full:- +full:mode

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Synopsys DesignWare I2C adapter driver.
5 * Based on the TI DAVINCI I2C adapter driver.
15 #include <linux/i2c.h>
192 * struct dw_i2c_dev - private i2c-designware data
202 * @slave: represent an I2C slave device
214 * @status: i2c master status, one of STATUS_*
216 * @sw_mask: SW mask of DW_IC_INTR_MASK used in polling mode
217 * @irq: interrupt number for the i2c master
219 * @adapter: i2c subsystem adapter node
225 * @rx_outstanding: current master-rx elements in tx fifo
230 * @fs_hcnt: fast speed HCNT value
231 * @fs_lcnt: fast speed LCNT value
232 * @fp_hcnt: fast plus HCNT value
233 * @fp_lcnt: fast plus LCNT value
239 * -1 if there is no semaphore.
241 * @init: function to initialize the I2C hardware
243 * @mode: operation mode - DW_IC_MASTER or DW_IC_SLAVE
300 int mode; member
349 dev->status |= STATUS_ACTIVE; in __i2c_dw_enable()
350 regmap_write(dev->map, DW_IC_ENABLE, 1); in __i2c_dw_enable()
355 regmap_write(dev->map, DW_IC_ENABLE, 0); in __i2c_dw_disable_nowait()
356 dev->status &= ~STATUS_ACTIVE; in __i2c_dw_disable_nowait()
362 unsigned int val = dev->flags & ACCESS_POLLING ? 0 : intr_mask; in __i2c_dw_write_intr_mask()
364 regmap_write(dev->map, DW_IC_INTR_MASK, val); in __i2c_dw_write_intr_mask()
365 dev->sw_mask = intr_mask; in __i2c_dw_write_intr_mask()
371 if (!(dev->flags & ACCESS_POLLING)) in __i2c_dw_read_intr_mask()
372 regmap_read(dev->map, DW_IC_INTR_MASK, intr_mask); in __i2c_dw_read_intr_mask()
374 *intr_mask = dev->sw_mask; in __i2c_dw_read_intr_mask()
388 static inline int i2c_dw_probe_slave(struct dw_i2c_dev *dev) { return -EINVAL; } in i2c_dw_probe_slave()
393 if (i2c_detect_slave_mode(dev->dev)) in i2c_dw_configure()