Lines Matching defs:i2c

13 #include <linux/i2c.h>
143 struct dw_hdmi_i2c *i2c;
292 dev_info(hdmi->dev, "Attempting to unwedge stuck i2c bus\n");
295 * This is a huge hack to workaround a problem where the dw_hdmi i2c
304 * 3. Immediately jump to remux the pin as dw_hdmi i2c again.
335 struct dw_hdmi_i2c *i2c = hdmi->i2c;
338 stat = wait_for_completion_timeout(&i2c->cmp, HZ / 10);
345 stat = wait_for_completion_timeout(&i2c->cmp, HZ / 10);
351 if (i2c->stat & HDMI_IH_I2CM_STAT0_ERROR)
360 struct dw_hdmi_i2c *i2c = hdmi->i2c;
363 if (!i2c->is_regaddr) {
365 i2c->slave_reg = 0x00;
366 i2c->is_regaddr = true;
370 reinit_completion(&i2c->cmp);
372 hdmi_writeb(hdmi, i2c->slave_reg++, HDMI_I2CM_ADDRESS);
373 if (i2c->is_segment)
386 i2c->is_segment = false;
394 struct dw_hdmi_i2c *i2c = hdmi->i2c;
397 if (!i2c->is_regaddr) {
399 i2c->slave_reg = buf[0];
402 i2c->is_regaddr = true;
406 reinit_completion(&i2c->cmp);
409 hdmi_writeb(hdmi, i2c->slave_reg++, HDMI_I2CM_ADDRESS);
425 struct dw_hdmi_i2c *i2c = hdmi->i2c;
449 mutex_lock(&i2c->lock);
458 i2c->is_regaddr = false;
461 i2c->is_segment = false;
467 i2c->is_segment = true;
489 mutex_unlock(&i2c->lock);
507 struct dw_hdmi_i2c *i2c;
510 i2c = devm_kzalloc(hdmi->dev, sizeof(*i2c), GFP_KERNEL);
511 if (!i2c)
514 mutex_init(&i2c->lock);
515 init_completion(&i2c->cmp);
517 adap = &i2c->adap;
528 devm_kfree(hdmi->dev, i2c);
532 hdmi->i2c = i2c;
3014 struct dw_hdmi_i2c *i2c = hdmi->i2c;
3023 i2c->stat = stat;
3025 complete(&i2c->cmp);
3036 if (hdmi->i2c)
3272 * Even if we are using a separate i2c adapter doing this doesn't
3377 ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
3651 if (hdmi->i2c)
3652 i2c_del_adapter(&hdmi->i2c->adap);