[PATCH v3 2/2] drm: bridge/dw_hdmi: add dw hdmi i2c bus adapter support
From: Russell King - ARM Linux <hidden>
Date: 2015-09-02 22:50:09
Also in:
dri-devel
From: Russell King - ARM Linux <hidden>
Date: 2015-09-02 22:50:09
Also in:
dri-devel
On Wed, Sep 02, 2015 at 03:07:49PM -0700, Doug Anderson wrote:
Hi, On Sun, Aug 30, 2015 at 2:34 PM, Vladimir Zapolskiy [off-list ref] wrote:quoted
+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.
Never copy the of_node from one device to another. That allows the bus matching to unintentionally match the of_node against the wrong driver. Also, is it appropriate to hook non-DDC devices to a DDC bus? I suspect that's asking for trouble. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.