From: Sam Ravnborg <sam@ravnborg.org>
To: Vinay Simha BN <simhavcs@gmail.com>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>,
Jonas Karlman <jonas@kwiboo.se>, David Airlie <airlied@linux.ie>,
Neil Armstrong <narmstrong@baylibre.com>,
open list <linux-kernel@vger.kernel.org>,
"open list:DRM DRIVERS" <dri-devel@lists.freedesktop.org>,
Andrzej Hajda <a.hajda@samsung.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH v3 2/2] display/drm/bridge: TC358775 DSI/LVDS driver
Date: Sat, 20 Jun 2020 12:31:06 +0200 [thread overview]
Message-ID: <20200620103106.GA15379@ravnborg.org> (raw)
In-Reply-To: <20200618121902.16841-2-simhavcs@gmail.com>
Hi Vinay.
> +
> +static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id)
> +{
> + struct device *dev = &client->dev;
> + struct drm_panel *panel;
> + struct tc_data *tc;
> + int ret;
> +
> + tc = devm_kzalloc(dev, sizeof(*tc), GFP_KERNEL);
> + if (!tc)
> + return -ENOMEM;
> +
> + tc->dev = dev;
> + tc->i2c = client;
> +
> + ret = drm_of_find_panel_or_bridge(dev->of_node, TC358775_LVDS_OUT0,
> + 0, &panel, NULL);
> + if (ret < 0)
> + return ret;
> + if (!panel)
> + return -ENODEV;
> +
> + panel->connector_type = DRM_MODE_CONNECTOR_LVDS;
The panel is responsible for specifying the connector_type.
It is wrong to let users of panel set it.
Fix the panel and not the bridge driver.
> +
> + tc->panel_bridge = devm_drm_panel_bridge_add(dev, panel);
> + if (IS_ERR(tc->panel_bridge))
> + return PTR_ERR(tc->panel_bridge);
> +
> + ret = tc358775_parse_dt(dev->of_node, tc);
> + if (ret)
> + return ret;
> +
> + tc->vddio = devm_regulator_get(dev, "vddio-supply");
> + if (IS_ERR(tc->vddio)) {
> + ret = PTR_ERR(tc->vddio);
> + dev_err(dev, "vddio-supply not found\n");
> + return ret;
> + }
> +
> + tc->vdd = devm_regulator_get(dev, "vdd-supply");
> + if (IS_ERR(tc->vdd)) {
> + ret = PTR_ERR(tc->vddio);
> + dev_err(dev, "vdd-supply not found\n");
> + return ret;
> + }
> +
> + tc->stby_gpio = devm_gpiod_get(dev, "stby", GPIOD_OUT_HIGH);
> + if (IS_ERR(tc->stby_gpio)) {
> + ret = PTR_ERR(tc->stby_gpio);
> + dev_err(dev, "cannot get stby-gpio %d\n", ret);
> + return ret;
> + }
> +
> + tc->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
> + if (IS_ERR(tc->reset_gpio)) {
> + ret = PTR_ERR(tc->reset_gpio);
> + dev_err(dev, "cannot get reset-gpios %d\n", ret);
> + return ret;
> + }
> +
> + tc->bridge.funcs = &tc_bridge_funcs;
> + tc->bridge.of_node = dev->of_node;
> + drm_bridge_add(&tc->bridge);
> +
> + i2c_set_clientdata(client, tc);
> +
> + return 0;
> +}
> +
Sam
prev parent reply other threads:[~2020-06-20 10:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 12:18 [PATCH v3 1/2] dt-binding: Add DSI/LVDS TC358775 bridge bindings Vinay Simha BN
2020-06-18 12:18 ` [PATCH v3 2/2] display/drm/bridge: TC358775 DSI/LVDS driver Vinay Simha BN
2020-06-19 13:05 ` kernel test robot
2020-06-19 19:18 ` kernel test robot
2020-06-20 4:16 ` [RFC PATCH] display/drm/bridge: tc358775_parse_dt() can be static kernel test robot
2020-06-20 10:31 ` Sam Ravnborg [this message]
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=20200620103106.GA15379@ravnborg.org \
--to=sam@ravnborg.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=narmstrong@baylibre.com \
--cc=simhavcs@gmail.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