[PATCH v3 2/2] drm: bridge/dw_hdmi: add dw hdmi i2c bus adapter support

Doug Anderson dianders at chromium.org
Wed Sep 2 15:07:49 PDT 2015


Hi,

On Sun, Aug 30, 2015 at 2:34 PM, Vladimir Zapolskiy
<vladimir_zapolskiy at mentor.com> wrote:
> +static struct i2c_adapter *dw_hdmi_i2c_adapter(struct dw_hdmi *hdmi)
> +{
> +       struct i2c_adapter *adap;
> +       struct dw_hdmi_i2c *i2c;
> +       int ret;
> +
> +       i2c = devm_kzalloc(hdmi->dev, sizeof(*i2c), GFP_KERNEL);
> +       if (!i2c)
> +               return ERR_PTR(-ENOMEM);
> +
> +       mutex_init(&i2c->lock);
> +       init_completion(&i2c->cmp);
> +
> +       adap = &i2c->adap;
> +       adap->class = I2C_CLASS_DDC;
> +       adap->owner = THIS_MODULE;
> +       adap->dev.parent = hdmi->dev;

I think you may want to add "adap->dev.of_node = hdmi->dev->of_node;"
here.  That will allow device trees to specify the i2c bus by using an
alias.

See <https://chromium-review.googlesource.com/#/c/297040/> where I've
added this line and
<https://chromium-review.googlesource.com/#/c/297041/> where I've used
it.


More information about the dri-devel mailing list