linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/2] drm: bridge/dw_hdmi: add dw hdmi i2c bus adapter support
Date: Wed, 2 Sep 2015 23:50:09 +0100	[thread overview]
Message-ID: <20150902225008.GQ21084@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CAD=FV=WvUp7xhsmXJgVzm1Awqej12hNF_QPJhrQq7z=Fa4Nnuw@mail.gmail.com>

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
> <vladimir_zapolskiy@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.

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.

  reply	other threads:[~2015-09-02 22:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-30 21:34 [PATCH v3 2/2] drm: bridge/dw_hdmi: add dw hdmi i2c bus adapter support Vladimir Zapolskiy
2015-08-31  9:22 ` Philipp Zabel
2015-09-02 22:07 ` Doug Anderson
2015-09-02 22:50   ` Russell King - ARM Linux [this message]
2015-09-02 23:00     ` Doug Anderson
2015-09-02 23:04       ` Russell King - ARM Linux
2015-09-02 23:19         ` Doug Anderson
2015-09-16 21:16           ` Vladimir Zapolskiy
2015-09-16 22:02             ` Doug Anderson
2015-09-02 23:43     ` Doug Anderson
2015-09-03  9:19       ` Russell King - ARM Linux
2015-09-03  9:39         ` Thierry Reding
2015-09-03 16:08           ` Doug Anderson
2015-09-08 22:08           ` Wolfram Sang
2015-09-16 20:04 ` Doug Anderson
2015-09-16 20:58   ` Vladimir Zapolskiy
2015-09-16 21:56     ` Doug Anderson
2015-09-16 22:18       ` Russell King - ARM Linux
2015-09-21 14:00         ` Vladimir Zapolskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150902225008.GQ21084@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).