Home
last modified time | relevance | path

Searched refs:i2c (Results 1 – 25 of 1546) sorted by relevance

12345678910>>...62

/drivers/i2c/busses/
Di2c-pxa.c272 #define _IBMR(i2c) ((i2c)->reg_ibmr) argument
273 #define _IDBR(i2c) ((i2c)->reg_idbr) argument
274 #define _ICR(i2c) ((i2c)->reg_icr) argument
275 #define _ISR(i2c) ((i2c)->reg_isr) argument
276 #define _ISAR(i2c) ((i2c)->reg_isar) argument
277 #define _ILCR(i2c) ((i2c)->reg_ilcr) argument
278 #define _IWCR(i2c) ((i2c)->reg_iwcr) argument
353 static void i2c_pxa_show_state(struct pxa_i2c *i2c, int lno, const char *fname) in i2c_pxa_show_state() argument
355 dev_dbg(&i2c->adap.dev, "state:%s:%d: ISR=%08x, ICR=%08x, IBMR=%02x\n", fname, lno, in i2c_pxa_show_state()
356 readl(_ISR(i2c)), readl(_ICR(i2c)), readl(_IBMR(i2c))); in i2c_pxa_show_state()
[all …]
Di2c-xiic.c235 #define xiic_tx_space(i2c) ((i2c)->tx_msg->len - (i2c)->tx_pos) argument
236 #define xiic_rx_space(i2c) ((i2c)->rx_msg->len - (i2c)->rx_pos) argument
238 static int xiic_start_xfer(struct xiic_i2c *i2c, struct i2c_msg *msgs, int num);
239 static void __xiic_start_xfer(struct xiic_i2c *i2c);
249 static inline void xiic_setreg8(struct xiic_i2c *i2c, int reg, u8 value) in xiic_setreg8() argument
251 if (i2c->endianness == LITTLE) in xiic_setreg8()
252 iowrite8(value, i2c->base + reg); in xiic_setreg8()
254 iowrite8(value, i2c->base + reg + 3); in xiic_setreg8()
257 static inline u8 xiic_getreg8(struct xiic_i2c *i2c, int reg) in xiic_getreg8() argument
261 if (i2c->endianness == LITTLE) in xiic_getreg8()
[all …]
Di2c-s3c2410.c136 static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat);
166 static inline void s3c24xx_i2c_master_complete(struct s3c24xx_i2c *i2c, int ret) in s3c24xx_i2c_master_complete() argument
168 dev_dbg(i2c->dev, "master_complete %d\n", ret); in s3c24xx_i2c_master_complete()
170 i2c->msg_ptr = 0; in s3c24xx_i2c_master_complete()
171 i2c->msg = NULL; in s3c24xx_i2c_master_complete()
172 i2c->msg_idx++; in s3c24xx_i2c_master_complete()
173 i2c->msg_num = 0; in s3c24xx_i2c_master_complete()
175 i2c->msg_idx = ret; in s3c24xx_i2c_master_complete()
177 if (!(i2c->quirks & QUIRK_POLL)) in s3c24xx_i2c_master_complete()
178 wake_up(&i2c->wait); in s3c24xx_i2c_master_complete()
[all …]
DMakefile7 obj-$(CONFIG_I2C_SCMI) += i2c-scmi.o
10 obj-$(CONFIG_I2C_CCGX_UCSI) += i2c-ccgx-ucsi.o
13 obj-$(CONFIG_I2C_ALI1535) += i2c-ali1535.o
14 obj-$(CONFIG_I2C_ALI1563) += i2c-ali1563.o
15 obj-$(CONFIG_I2C_ALI15X3) += i2c-ali15x3.o
16 obj-$(CONFIG_I2C_AMD756) += i2c-amd756.o
17 obj-$(CONFIG_I2C_AMD756_S4882) += i2c-amd756-s4882.o
18 obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o
19 obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
20 obj-$(CONFIG_I2C_I801) += i2c-i801.o
[all …]
Di2c-img-scb.c414 static void img_i2c_writel(struct img_i2c *i2c, u32 offset, u32 value) in img_i2c_writel() argument
416 writel(value, i2c->base + offset); in img_i2c_writel()
419 static u32 img_i2c_readl(struct img_i2c *i2c, u32 offset) in img_i2c_readl() argument
421 return readl(i2c->base + offset); in img_i2c_readl()
436 static void img_i2c_wr_rd_fence(struct img_i2c *i2c) in img_i2c_wr_rd_fence() argument
438 if (i2c->need_wr_rd_fence) { in img_i2c_wr_rd_fence()
439 img_i2c_writel(i2c, SCB_CORE_REV_REG, 0); in img_i2c_wr_rd_fence()
440 img_i2c_writel(i2c, SCB_CORE_REV_REG, 0); in img_i2c_wr_rd_fence()
444 static void img_i2c_switch_mode(struct img_i2c *i2c, enum img_i2c_mode mode) in img_i2c_switch_mode() argument
446 i2c->mode = mode; in img_i2c_switch_mode()
[all …]
Di2c-jz4780.c171 static inline unsigned short jz4780_i2c_readw(struct jz4780_i2c *i2c, in jz4780_i2c_readw() argument
174 return readw(i2c->iomem + offset); in jz4780_i2c_readw()
177 static inline void jz4780_i2c_writew(struct jz4780_i2c *i2c, in jz4780_i2c_writew() argument
180 writew(val, i2c->iomem + offset); in jz4780_i2c_writew()
183 static int jz4780_i2c_disable(struct jz4780_i2c *i2c) in jz4780_i2c_disable() argument
188 jz4780_i2c_writew(i2c, JZ4780_I2C_ENB, 0); in jz4780_i2c_disable()
191 regval = jz4780_i2c_readw(i2c, JZ4780_I2C_ENSTA); in jz4780_i2c_disable()
198 dev_err(&i2c->adap.dev, "disable failed: ENSTA=0x%04x\n", regval); in jz4780_i2c_disable()
202 static int jz4780_i2c_enable(struct jz4780_i2c *i2c) in jz4780_i2c_enable() argument
207 jz4780_i2c_writew(i2c, JZ4780_I2C_ENB, 1); in jz4780_i2c_enable()
[all …]
Di2c-digicolor.c71 static void dc_i2c_cmd(struct dc_i2c *i2c, u8 cmd) in dc_i2c_cmd() argument
73 writeb_relaxed(cmd | II_COMMAND_GO, i2c->regs + II_COMMAND); in dc_i2c_cmd()
86 static void dc_i2c_data(struct dc_i2c *i2c, u8 data) in dc_i2c_data() argument
88 writeb_relaxed(data, i2c->regs + II_DATA); in dc_i2c_data()
91 static void dc_i2c_write_byte(struct dc_i2c *i2c, u8 byte) in dc_i2c_write_byte() argument
93 dc_i2c_data(i2c, byte); in dc_i2c_write_byte()
94 dc_i2c_cmd(i2c, II_CMD_SEND_ACK); in dc_i2c_write_byte()
97 static void dc_i2c_write_buf(struct dc_i2c *i2c) in dc_i2c_write_buf() argument
99 dc_i2c_write_byte(i2c, i2c->msg->buf[i2c->msgbuf_ptr++]); in dc_i2c_write_buf()
102 static void dc_i2c_next_read(struct dc_i2c *i2c) in dc_i2c_next_read() argument
[all …]
Di2c-ocores.c49 void (*setreg)(struct ocores_i2c *i2c, int reg, u8 value);
50 u8 (*getreg)(struct ocores_i2c *i2c, int reg);
89 static void oc_setreg_8(struct ocores_i2c *i2c, int reg, u8 value) in oc_setreg_8() argument
91 iowrite8(value, i2c->base + (reg << i2c->reg_shift)); in oc_setreg_8()
94 static void oc_setreg_16(struct ocores_i2c *i2c, int reg, u8 value) in oc_setreg_16() argument
96 iowrite16(value, i2c->base + (reg << i2c->reg_shift)); in oc_setreg_16()
99 static void oc_setreg_32(struct ocores_i2c *i2c, int reg, u8 value) in oc_setreg_32() argument
101 iowrite32(value, i2c->base + (reg << i2c->reg_shift)); in oc_setreg_32()
104 static void oc_setreg_16be(struct ocores_i2c *i2c, int reg, u8 value) in oc_setreg_16be() argument
106 iowrite16be(value, i2c->base + (reg << i2c->reg_shift)); in oc_setreg_16be()
[all …]
Di2c-synquacer.c149 static inline int is_lastmsg(struct synquacer_i2c *i2c) in is_lastmsg() argument
151 return i2c->msg_idx >= (i2c->msg_num - 1); in is_lastmsg()
154 static inline int is_msglast(struct synquacer_i2c *i2c) in is_msglast() argument
156 return i2c->msg_ptr == (i2c->msg->len - 1); in is_msglast()
159 static inline int is_msgend(struct synquacer_i2c *i2c) in is_msgend() argument
161 return i2c->msg_ptr >= i2c->msg->len; in is_msgend()
164 static inline unsigned long calc_timeout_ms(struct synquacer_i2c *i2c, in calc_timeout_ms() argument
177 static void synquacer_i2c_stop(struct synquacer_i2c *i2c, int ret) in synquacer_i2c_stop() argument
184 writeb(0, i2c->base + SYNQUACER_I2C_REG_BCR); in synquacer_i2c_stop()
186 i2c->state = STATE_IDLE; in synquacer_i2c_stop()
[all …]
Di2c-lpc2k.c83 static void i2c_lpc2k_reset(struct lpc2k_i2c *i2c) in i2c_lpc2k_reset() argument
86 writel(LPC24XX_CLEAR_ALL, i2c->base + LPC24XX_I2CONCLR); in i2c_lpc2k_reset()
87 writel(0, i2c->base + LPC24XX_I2ADDR); in i2c_lpc2k_reset()
88 writel(LPC24XX_I2EN, i2c->base + LPC24XX_I2CONSET); in i2c_lpc2k_reset()
91 static int i2c_lpc2k_clear_arb(struct lpc2k_i2c *i2c) in i2c_lpc2k_clear_arb() argument
99 writel(LPC24XX_STO, i2c->base + LPC24XX_I2CONSET); in i2c_lpc2k_clear_arb()
102 while (readl(i2c->base + LPC24XX_I2STAT) != M_I2C_IDLE) { in i2c_lpc2k_clear_arb()
105 i2c_lpc2k_reset(i2c); in i2c_lpc2k_clear_arb()
115 static void i2c_lpc2k_pump_msg(struct lpc2k_i2c *i2c) in i2c_lpc2k_pump_msg() argument
124 status = readl(i2c->base + LPC24XX_I2STAT); in i2c_lpc2k_pump_msg()
[all …]
Di2c-exynos5.c258 static void exynos5_i2c_clr_pend_irq(struct exynos5_i2c *i2c) in exynos5_i2c_clr_pend_irq() argument
260 writel(readl(i2c->regs + HSI2C_INT_STATUS), in exynos5_i2c_clr_pend_irq()
261 i2c->regs + HSI2C_INT_STATUS); in exynos5_i2c_clr_pend_irq()
274 static int exynos5_i2c_set_timing(struct exynos5_i2c *i2c, bool hs_timings) in exynos5_i2c_set_timing() argument
286 unsigned int clkin = clk_get_rate(i2c->clk); in exynos5_i2c_set_timing()
287 unsigned int op_clk = hs_timings ? i2c->op_clock : in exynos5_i2c_set_timing()
288 (i2c->op_clock >= I2C_MAX_FAST_MODE_PLUS_FREQ) ? I2C_MAX_STANDARD_MODE_FREQ : in exynos5_i2c_set_timing()
289 i2c->op_clock; in exynos5_i2c_set_timing()
306 if (i2c->variant->hw == I2C_TYPE_EXYNOSAUTOV9) { in exynos5_i2c_set_timing()
307 div = ((clkin / (16 * i2c->op_clock)) - 1); in exynos5_i2c_set_timing()
[all …]
Di2c-mpc.c112 void (*setup)(struct device_node *node, struct mpc_i2c *i2c, u32 clock);
115 static inline void writeccr(struct mpc_i2c *i2c, u32 x) in writeccr() argument
117 writeb(x, i2c->base + MPC_I2C_CR); in writeccr()
125 static void mpc_i2c_fixup(struct mpc_i2c *i2c) in mpc_i2c_fixup() argument
131 writeccr(i2c, 0); in mpc_i2c_fixup()
132 writeb(0, i2c->base + MPC_I2C_SR); /* clear any status bits */ in mpc_i2c_fixup()
133 writeccr(i2c, CCR_MEN | CCR_MSTA); /* START */ in mpc_i2c_fixup()
134 readb(i2c->base + MPC_I2C_DR); /* init xfer */ in mpc_i2c_fixup()
137 writeccr(i2c, CCR_MEN | CCR_MSTA | CCR_RSTA); /* delay SDA */ in mpc_i2c_fixup()
138 readb(i2c->base + MPC_I2C_DR); in mpc_i2c_fixup()
[all …]
Di2c-mt65xx.c541 static u16 mtk_i2c_readw(struct mtk_i2c *i2c, enum I2C_REGS_OFFSET reg) in mtk_i2c_readw() argument
543 return readw(i2c->base + i2c->dev_comp->regs[reg]); in mtk_i2c_readw()
546 static void mtk_i2c_writew(struct mtk_i2c *i2c, u16 val, in mtk_i2c_writew() argument
549 writew(val, i2c->base + i2c->dev_comp->regs[reg]); in mtk_i2c_writew()
552 static void mtk_i2c_init_hw(struct mtk_i2c *i2c) in mtk_i2c_init_hw() argument
558 mtk_i2c_writew(i2c, I2C_CHN_CLR_FLAG, OFFSET_START); in mtk_i2c_init_hw()
559 intr_stat_reg = mtk_i2c_readw(i2c, OFFSET_INTR_STAT); in mtk_i2c_init_hw()
560 mtk_i2c_writew(i2c, intr_stat_reg, OFFSET_INTR_STAT); in mtk_i2c_init_hw()
562 if (i2c->dev_comp->apdma_sync) { in mtk_i2c_init_hw()
563 writel(I2C_DMA_WARM_RST, i2c->pdmabase + OFFSET_RST); in mtk_i2c_init_hw()
[all …]
Di2c-meson.c108 void (*set_clk_div)(struct meson_i2c *i2c, unsigned int freq);
111 static void meson_i2c_set_mask(struct meson_i2c *i2c, int reg, u32 mask, in meson_i2c_set_mask() argument
116 data = readl(i2c->regs + reg); in meson_i2c_set_mask()
119 writel(data, i2c->regs + reg); in meson_i2c_set_mask()
122 static void meson_i2c_reset_tokens(struct meson_i2c *i2c) in meson_i2c_reset_tokens() argument
124 i2c->tokens[0] = 0; in meson_i2c_reset_tokens()
125 i2c->tokens[1] = 0; in meson_i2c_reset_tokens()
126 i2c->num_tokens = 0; in meson_i2c_reset_tokens()
129 static void meson_i2c_add_token(struct meson_i2c *i2c, int token) in meson_i2c_add_token() argument
131 if (i2c->num_tokens < 8) in meson_i2c_add_token()
[all …]
Di2c-octeon-core.c26 struct octeon_i2c *i2c = dev_id; in octeon_i2c_isr() local
28 i2c->int_disable(i2c); in octeon_i2c_isr()
29 wake_up(&i2c->queue); in octeon_i2c_isr()
34 static bool octeon_i2c_test_iflg(struct octeon_i2c *i2c) in octeon_i2c_test_iflg() argument
36 return (octeon_i2c_ctl_read(i2c) & TWSI_CTL_IFLG); in octeon_i2c_test_iflg()
45 static int octeon_i2c_wait(struct octeon_i2c *i2c) in octeon_i2c_wait() argument
53 if (i2c->broken_irq_mode) { in octeon_i2c_wait()
54 u64 end = get_jiffies_64() + i2c->adap.timeout; in octeon_i2c_wait()
56 while (!octeon_i2c_test_iflg(i2c) && in octeon_i2c_wait()
60 return octeon_i2c_test_iflg(i2c) ? 0 : -ETIMEDOUT; in octeon_i2c_wait()
[all …]
Di2c-mxs.c69 #define MXS_I2C_DATA(i2c) ((i2c->dev_type == MXS_I2C_V1) ? 0x60 : 0xa0) argument
71 #define MXS_I2C_DEBUG0_CLR(i2c) ((i2c->dev_type == MXS_I2C_V1) ? 0x78 : 0xb8) argument
132 static int mxs_i2c_reset(struct mxs_i2c_dev *i2c) in mxs_i2c_reset() argument
134 int ret = stmp_reset_block(i2c->regs); in mxs_i2c_reset()
145 writel(i2c->timing0, i2c->regs + MXS_I2C_TIMING0); in mxs_i2c_reset()
146 writel(i2c->timing1, i2c->regs + MXS_I2C_TIMING1); in mxs_i2c_reset()
147 writel(i2c->timing2, i2c->regs + MXS_I2C_TIMING2); in mxs_i2c_reset()
149 writel(MXS_I2C_IRQ_MASK << 8, i2c->regs + MXS_I2C_CTRL1_SET); in mxs_i2c_reset()
154 static void mxs_i2c_dma_finish(struct mxs_i2c_dev *i2c) in mxs_i2c_dma_finish() argument
156 if (i2c->dma_read) { in mxs_i2c_dma_finish()
[all …]
Di2c-rk3x.c226 static inline void i2c_writel(struct rk3x_i2c *i2c, u32 value, in i2c_writel() argument
229 writel(value, i2c->regs + offset); in i2c_writel()
232 static inline u32 i2c_readl(struct rk3x_i2c *i2c, unsigned int offset) in i2c_readl() argument
234 return readl(i2c->regs + offset); in i2c_readl()
238 static inline void rk3x_i2c_clean_ipd(struct rk3x_i2c *i2c) in rk3x_i2c_clean_ipd() argument
240 i2c_writel(i2c, REG_INT_ALL, REG_IPD); in rk3x_i2c_clean_ipd()
247 static void rk3x_i2c_start(struct rk3x_i2c *i2c) in rk3x_i2c_start() argument
249 u32 val = i2c_readl(i2c, REG_CON) & REG_CON_TUNING_MASK; in rk3x_i2c_start()
251 i2c_writel(i2c, REG_INT_START, REG_IEN); in rk3x_i2c_start()
254 val |= REG_CON_EN | REG_CON_MOD(i2c->mode) | REG_CON_START; in rk3x_i2c_start()
[all …]
Di2c-octeon-platdrv.c38 static void octeon_i2c_int_enable(struct octeon_i2c *i2c) in octeon_i2c_int_enable() argument
40 octeon_i2c_write_int(i2c, TWSI_INT_CORE_EN); in octeon_i2c_int_enable()
44 static void octeon_i2c_int_disable(struct octeon_i2c *i2c) in octeon_i2c_int_disable() argument
47 octeon_i2c_write_int(i2c, 0); in octeon_i2c_int_disable()
57 static void octeon_i2c_int_enable78(struct octeon_i2c *i2c) in octeon_i2c_int_enable78() argument
59 atomic_inc_return(&i2c->int_enable_cnt); in octeon_i2c_int_enable78()
60 enable_irq(i2c->irq); in octeon_i2c_int_enable78()
78 static void octeon_i2c_int_disable78(struct octeon_i2c *i2c) in octeon_i2c_int_disable78() argument
80 __octeon_i2c_irq_disable(&i2c->int_enable_cnt, i2c->irq); in octeon_i2c_int_disable78()
90 static void octeon_i2c_hlc_int_enable78(struct octeon_i2c *i2c) in octeon_i2c_hlc_int_enable78() argument
[all …]
Di2c-thunderx-pcidrv.c40 static void thunder_i2c_int_enable(struct octeon_i2c *i2c) in thunder_i2c_int_enable() argument
43 i2c->twsi_base + TWSI_INT_ENA_W1S); in thunder_i2c_int_enable()
49 static void thunder_i2c_int_disable(struct octeon_i2c *i2c) in thunder_i2c_int_disable() argument
52 i2c->twsi_base + TWSI_INT_ENA_W1C); in thunder_i2c_int_disable()
55 static void thunder_i2c_hlc_int_enable(struct octeon_i2c *i2c) in thunder_i2c_hlc_int_enable() argument
58 i2c->twsi_base + TWSI_INT_ENA_W1S); in thunder_i2c_hlc_int_enable()
61 static void thunder_i2c_hlc_int_disable(struct octeon_i2c *i2c) in thunder_i2c_hlc_int_disable() argument
64 i2c->twsi_base + TWSI_INT_ENA_W1C); in thunder_i2c_hlc_int_disable()
84 static void thunder_i2c_clock_enable(struct device *dev, struct octeon_i2c *i2c) in thunder_i2c_clock_enable() argument
90 i2c->clk = clk_get(dev, NULL); in thunder_i2c_clock_enable()
[all …]
Di2c-pca-platform.c41 struct i2c_pca_pf_data *i2c = pd; in i2c_pca_pf_readbyte8() local
42 return ioread8(i2c->reg_base + reg); in i2c_pca_pf_readbyte8()
47 struct i2c_pca_pf_data *i2c = pd; in i2c_pca_pf_readbyte16() local
48 return ioread8(i2c->reg_base + reg * 2); in i2c_pca_pf_readbyte16()
53 struct i2c_pca_pf_data *i2c = pd; in i2c_pca_pf_readbyte32() local
54 return ioread8(i2c->reg_base + reg * 4); in i2c_pca_pf_readbyte32()
59 struct i2c_pca_pf_data *i2c = pd; in i2c_pca_pf_writebyte8() local
60 iowrite8(val, i2c->reg_base + reg); in i2c_pca_pf_writebyte8()
65 struct i2c_pca_pf_data *i2c = pd; in i2c_pca_pf_writebyte16() local
66 iowrite8(val, i2c->reg_base + reg * 2); in i2c_pca_pf_writebyte16()
[all …]
Di2c-mchp-pci1xxxx.c334 static int set_sys_lock(struct pci1xxxx_i2c *i2c) in set_sys_lock() argument
336 void __iomem *p = i2c->i2c_base + SMB_GPR_LOCK_REG; in set_sys_lock()
347 static int release_sys_lock(struct pci1xxxx_i2c *i2c) in release_sys_lock() argument
349 void __iomem *p = i2c->i2c_base + SMB_GPR_LOCK_REG; in release_sys_lock()
364 static void pci1xxxx_ack_high_level_intr(struct pci1xxxx_i2c *i2c, u16 intr_msk) in pci1xxxx_ack_high_level_intr() argument
366 writew(intr_msk, i2c->i2c_base + SMBUS_GEN_INT_STAT_REG_OFF); in pci1xxxx_ack_high_level_intr()
369 static void pci1xxxx_i2c_configure_smbalert_pin(struct pci1xxxx_i2c *i2c, in pci1xxxx_i2c_configure_smbalert_pin() argument
372 void __iomem *p = i2c->i2c_base + SMBALERT_MST_PAD_CTRL_REG_OFF; in pci1xxxx_i2c_configure_smbalert_pin()
385 static void pci1xxxx_i2c_send_start_stop(struct pci1xxxx_i2c *i2c, bool start) in pci1xxxx_i2c_send_start_stop() argument
387 void __iomem *p = i2c->i2c_base + SMB_CORE_CMD_REG_OFF1; in pci1xxxx_i2c_send_start_stop()
[all …]
Di2c-mt7621.c70 static int mtk_i2c_wait_idle(struct mtk_i2c *i2c) in mtk_i2c_wait_idle() argument
75 ret = readl_relaxed_poll_timeout(i2c->base + REG_SM0CTL1_REG, in mtk_i2c_wait_idle()
79 dev_dbg(i2c->dev, "idle err(%d)\n", ret); in mtk_i2c_wait_idle()
84 static void mtk_i2c_reset(struct mtk_i2c *i2c) in mtk_i2c_reset() argument
88 ret = device_reset(i2c->adap.dev.parent); in mtk_i2c_reset()
90 dev_err(i2c->dev, "I2C reset failed!\n"); in mtk_i2c_reset()
96 iowrite32(((i2c->clk_div << 16) & SM0CTL0_CLK_DIV_MASK) | SM0CTL0_EN | in mtk_i2c_reset()
97 SM0CTL0_SCL_STRETCH, i2c->base + REG_SM0CTL0_REG); in mtk_i2c_reset()
98 iowrite32(0, i2c->base + REG_SM0CFG2_REG); in mtk_i2c_reset()
101 static void mtk_i2c_dump_reg(struct mtk_i2c *i2c) in mtk_i2c_dump_reg() argument
[all …]
Di2c-kempld.c82 static int kempld_i2c_process(struct kempld_i2c_data *i2c) in kempld_i2c_process() argument
84 struct kempld_device_data *pld = i2c->pld; in kempld_i2c_process()
86 struct i2c_msg *msg = i2c->msg; in kempld_i2c_process()
93 if (i2c->state == STATE_DONE || i2c->state == STATE_ERROR) { in kempld_i2c_process()
96 if (i2c->state == STATE_ERROR) in kempld_i2c_process()
103 i2c->state = STATE_ERROR; in kempld_i2c_process()
108 if (i2c->state == STATE_INIT) { in kempld_i2c_process()
112 i2c->state = STATE_ADDR; in kempld_i2c_process()
115 if (i2c->state == STATE_ADDR) { in kempld_i2c_process()
117 if (i2c->msg->flags & I2C_M_TEN) { in kempld_i2c_process()
[all …]
/drivers/media/pci/netup_unidvb/
Dnetup_unidvb_i2c.c65 irqreturn_t netup_i2c_interrupt(struct netup_i2c *i2c) in netup_i2c_interrupt() argument
71 spin_lock_irqsave(&i2c->lock, flags); in netup_i2c_interrupt()
72 reg = readw(&i2c->regs->twi_ctrl0_stat); in netup_i2c_interrupt()
73 writew(reg & ~TWI_IRQEN, &i2c->regs->twi_ctrl0_stat); in netup_i2c_interrupt()
74 dev_dbg(i2c->adap.dev.parent, in netup_i2c_interrupt()
77 dev_dbg(i2c->adap.dev.parent, in netup_i2c_interrupt()
79 i2c->state = STATE_DONE; in netup_i2c_interrupt()
83 dev_dbg(i2c->adap.dev.parent, in netup_i2c_interrupt()
85 i2c->state = STATE_ERROR; in netup_i2c_interrupt()
89 dev_dbg(i2c->adap.dev.parent, in netup_i2c_interrupt()
[all …]
/drivers/media/pci/ddbridge/
Dddbridge-i2c.c31 static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd) in ddb_i2c_cmd() argument
33 struct ddb *dev = i2c->dev; in ddb_i2c_cmd()
37 ddbwritel(dev, (adr << 9) | cmd, i2c->regs + I2C_COMMAND); in ddb_i2c_cmd()
38 stat = wait_for_completion_timeout(&i2c->completion, HZ); in ddb_i2c_cmd()
39 val = ddbreadl(dev, i2c->regs + I2C_COMMAND); in ddb_i2c_cmd()
42 dev->nr, i2c->nr, i2c->link); in ddb_i2c_cmd()
47 if (i2c->link) { in ddb_i2c_cmd()
49 DDB_LINK_TAG(i2c->link) | in ddb_i2c_cmd()
53 i2c->link, listat); in ddb_i2c_cmd()
59 i2c->regs + I2C_MONITOR); in ddb_i2c_cmd()
[all …]

12345678910>>...62