From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Meng Yi <meng.yi@nxp.com>
Cc: Jianwei Wang <jianwei.wang.chn@gmail.com>,
Xiubo Li <lixiubo@cmss.chinamobile.com>,
Emil Velikov <emil.l.velikov@gmail.com>,
Huan Wang <alison.wang@nxp.com>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Subject: Re: [PATCH v3 1/2] drm: bridge: Add sii902x driver
Date: Fri, 22 Apr 2016 13:32:58 +0200 [thread overview]
Message-ID: <20160422133258.360b6918@bbrezillon> (raw)
In-Reply-To: <HE1PR04MB1051B8D87B3B70F03C4CECFAEC6F0@HE1PR04MB1051.eurprd04.prod.outlook.com>
Hi Meng,
On Fri, 22 Apr 2016 09:58:34 +0000
Meng Yi <meng.yi@nxp.com> wrote:
> Hi Boris,
>
> > -----Original Message-----
> > From: Boris Brezillon [mailto:boris.brezillon@free-electrons.com]
> > +
>
> > +static int sii902x_bridge_attach(struct drm_bridge *bridge) {
> > + const struct drm_connector_funcs *funcs = &sii902x_connector_funcs;
> > + struct sii902x *sii902x = bridge_to_sii902x(bridge);
> > + struct drm_device *drm = bridge->dev;
> > + int ret;
> > +
> > + drm_connector_helper_add(&sii902x->connector,
> > + &sii902x_connector_helper_funcs);
> > +
> > + if (drm_core_check_feature(drm, DRIVER_ATOMIC))
> > + funcs = &sii902x_atomic_connector_funcs;
> > +
> > + ret = drm_connector_init(drm, &sii902x->connector, funcs,
> > + DRM_MODE_CONNECTOR_HDMIA);
> > + if (ret)
> > + return ret;
> > +
>
>
> I think drm_connector_register should be used here, or drmlib can't find this connector.
Hm, I think this should be left to the DRM master device
(some of them already call drm_connector_register_all() at the end of
their ->probe() function).
>
>
> > + if (sii902x->i2c->irq > 0)
> > + sii902x->connector.polled = DRM_CONNECTOR_POLL_HPD;
> > + else
> > + sii902x->connector.polled =
> > DRM_CONNECTOR_POLL_CONNECT;
> > +
> > + drm_mode_connector_attach_encoder(&sii902x->connector,
> > +bridge->encoder);
> > +
> > + return 0;
> > +}
> > +
>
> ...
> > +
> > +static int sii902x_probe(struct i2c_client *client,
> > + const struct i2c_device_id *id)
> > +{
> > + struct device *dev = &client->dev;
> > + unsigned int status = 0;
> > + struct sii902x *sii902x;
> > + u8 chipid[4];
> > + int ret;
> > +
> > + sii902x = devm_kzalloc(dev, sizeof(*sii902x), GFP_KERNEL);
> > + if (!sii902x)
> > + return -ENOMEM;
> > +
> > + sii902x->i2c = client;
> > + sii902x->regmap = devm_regmap_init_i2c(client,
> > &sii902x_regmap_config);
> > + if (IS_ERR(sii902x->regmap))
> > + return PTR_ERR(sii902x->regmap);
> > +
> > + sii902x->reset_gpio = devm_gpiod_get(dev, "reset",
> > GPIOD_OUT_LOW);
> > + if (IS_ERR(sii902x->reset_gpio)) {
> > + dev_err(dev, "Failed to retrieve/request reset gpio: %ld\n",
> > + PTR_ERR(sii902x->reset_gpio));
> > + return PTR_ERR(sii902x->reset_gpio);
>
>
> Maybe we can use "warning" instead of "dev_err" if there is no "reset_gpio" , because some board using CPLD to manage the reset order , they can't reset the HDMI chip independently.
Sure, since it's optional maybe we should use dev_info().
Thanks for your review.
Regards,
Boris
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-04-22 11:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 14:14 [PATCH v3 1/2] drm: bridge: Add sii902x driver Boris Brezillon
2016-03-16 14:14 ` [PATCH v3 2/2] drm: bridge: add sii902x DT bindings doc Boris Brezillon
2016-04-22 9:58 ` [PATCH v3 1/2] drm: bridge: Add sii902x driver Meng Yi
2016-04-22 11:32 ` Boris Brezillon [this message]
2016-05-02 11:05 ` Maxime Ripard
2016-05-03 9:39 ` Boris Brezillon
2016-05-03 9:53 ` Daniel Vetter
2016-05-03 10:03 ` Boris Brezillon
2016-05-03 12:54 ` Daniel Vetter
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=20160422133258.360b6918@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=alison.wang@nxp.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=jianwei.wang.chn@gmail.com \
--cc=lixiubo@cmss.chinamobile.com \
--cc=meng.yi@nxp.com \
--cc=nicolas.ferre@atmel.com \
--cc=plagnioj@jcrosoft.com \
/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