Lines Matching defs:i2c
155 struct dw_hdmi_i2c *i2c;
301 dev_info(hdmi->dev, "Attempting to unwedge stuck i2c bus\n");
304 * This is a huge hack to workaround a problem where the dw_hdmi i2c
313 * 3. Immediately jump to remux the pin as dw_hdmi i2c again.
344 struct dw_hdmi_i2c *i2c = hdmi->i2c;
347 stat = wait_for_completion_timeout(&i2c->cmp, HZ / 10);
354 stat = wait_for_completion_timeout(&i2c->cmp, HZ / 10);
360 if (i2c->stat & HDMI_IH_I2CM_STAT0_ERROR)
369 struct dw_hdmi_i2c *i2c = hdmi->i2c;
372 if (!i2c->is_regaddr) {
374 i2c->slave_reg = 0x00;
375 i2c->is_regaddr = true;
379 reinit_completion(&i2c->cmp);
381 hdmi_writeb(hdmi, i2c->slave_reg++, HDMI_I2CM_ADDRESS);
382 if (i2c->is_segment)
395 i2c->is_segment = false;
403 struct dw_hdmi_i2c *i2c = hdmi->i2c;
406 if (!i2c->is_regaddr) {
408 i2c->slave_reg = buf[0];
411 i2c->is_regaddr = true;
415 reinit_completion(&i2c->cmp);
418 hdmi_writeb(hdmi, i2c->slave_reg++, HDMI_I2CM_ADDRESS);
434 struct dw_hdmi_i2c *i2c = hdmi->i2c;
458 mutex_lock(&i2c->lock);
467 i2c->is_regaddr = false;
470 i2c->is_segment = false;
476 i2c->is_segment = true;
498 mutex_unlock(&i2c->lock);
516 struct dw_hdmi_i2c *i2c;
519 i2c = devm_kzalloc(hdmi->dev, sizeof(*i2c), GFP_KERNEL);
520 if (!i2c)
523 mutex_init(&i2c->lock);
524 init_completion(&i2c->cmp);
526 adap = &i2c->adap;
537 devm_kfree(hdmi->dev, i2c);
541 hdmi->i2c = i2c;
2921 struct dw_hdmi_i2c *i2c = hdmi->i2c;
2930 i2c->stat = stat;
2932 complete(&i2c->cmp);
2943 if (hdmi->i2c)
3179 * Even if we are using a separate i2c adapter doing this doesn't
3227 ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
3483 if (hdmi->i2c)
3484 i2c_del_adapter(&hdmi->i2c->adap);