From: spanda-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
To: Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
nganji-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
hoegsberg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
chandanu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Subject: Re: [PATCH v8 1/4] drm/bridge: add support for sn65dsi86 bridge driver
Date: Wed, 13 Jun 2018 16:36:51 +0530 [thread overview]
Message-ID: <eda4f13e7a7c9be94a22dee2e81fd114@codeaurora.org> (raw)
In-Reply-To: <152876014663.16708.2127612105617872452-n1Xw8LXHxjTHt/MElyovVYaSKrA+ACpX0E9HWUfgJXw@public.gmane.org>
On 2018-06-12 05:05, Stephen Boyd wrote:
> Quoting Sandeep Panda (2018-06-04 22:40:15)
>> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
>> b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
>> new file mode 100644
>> index 0000000..add6e0f
>> --- /dev/null
>> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
>> @@ -0,0 +1,666 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
>> + */
>> +
> [...]
>> +
>> +static const struct regmap_config ti_sn_bridge_regmap_config = {
>> + .reg_bits = 8,
>> + .val_bits = 8,
>> + .volatile_table = &ti_sn_bridge_volatile_table,
>> + .cache_type = REGCACHE_NONE,
>> +};
>> +
>> +static void ti_sn_bridge_write_u16(struct ti_sn_bridge *pdata,
>> + unsigned int reg, u16 val)
>> +{
>> + regmap_write(pdata->regmap, reg, val & 0xFF);
>> + regmap_write(pdata->regmap, reg + 1, val >> 8);
>> +}
>> +
>> +static int __maybe_unused ti_sn_bridge_resume(struct device *dev)
>> +{
>> + struct ti_sn_bridge *pdata = dev_get_drvdata(dev);
>> + int ret = 0;
>
> Please don't assign variables and then reassign them again immediately
> after. It hides use before real initialization bugs.
>
Ok.
>> +
>> + ret = regulator_bulk_enable(SN_REGULATOR_SUPPLY_NUM,
>> pdata->supplies);
> [...]
>> +
>> +static int ti_sn_bridge_probe(struct i2c_client *client,
>> + const struct i2c_device_id *id)
>> +{
>> + struct ti_sn_bridge *pdata;
>> + struct device_node *ddc_node;
>> + struct mipi_dsi_host *host;
>> + struct mipi_dsi_device *dsi;
>> + int ret = 0;
>> + const struct mipi_dsi_device_info info = { .type =
>> "ti_sn_bridge",
>> + .channel = 0,
>> + .node = NULL,
>> + };
>> +
>> + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
>> + DRM_ERROR("device doesn't support I2C\n");
>> + return -ENODEV;
>> + }
>> +
>> + ret = ti_sn_bridge_parse_dsi_host(pdata);
>> + if (ret)
>> + return ret;
>> +
>> + host = of_find_mipi_dsi_host_by_node(pdata->host_node);
>> + if (!host) {
>> + DRM_ERROR("failed to find dsi host\n");
>
> Not sure we want to print an error and then return -EPROBE_DEFER.
> Usually EPROBE_DEFER is silent.
>
>> + ret = -EPROBE_DEFER;
>> + goto err_dsi_host;
>> + }
>> +
> [...]
>> +
>> + /* TODO: setting to 4 lanes always for now */
>> + dsi->lanes = 4;
>> + dsi->format = MIPI_DSI_FMT_RGB888;
>> + dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
>> MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
>> + MIPI_DSI_MODE_EOT_PACKET |
>> MIPI_DSI_MODE_VIDEO_HSE;
>> +
>> + ret = mipi_dsi_attach(dsi);
>> + if (ret < 0) {
>> + DRM_ERROR("failed to attach dsi to host\n");
>> + goto err_dsi_attach;
>> + }
>> + pdata->dsi = dsi;
>> +
>> + pdata->refclk = devm_clk_get(pdata->dev, "refclk");
>
> We need to check for error
>
> if (IS_ERR(pdata->refclk))
>
> And then if it's EPROBE_DEFER I suppose we would bail out, otherwise
> assume it's not present?
Yes found this issue while testing the driver on actual sn65dsi86 HW, i
will fix this in next patchset.
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-06-13 11:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 5:40 [PATCH v8 0/4] Add suppport for sn65dsi86 bridge chip and Innolux 2k edp panel Sandeep Panda
[not found] ` <1528177218-1051-1-git-send-email-spanda-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-06-05 5:40 ` Sandeep Panda
2018-06-05 5:40 ` [PATCH v8 1/4] drm/bridge: add support for sn65dsi86 bridge driver Sandeep Panda
2018-06-05 11:17 ` Vinod
2018-06-05 22:32 ` Sean Paul
2018-06-05 22:59 ` Sean Paul
2018-06-13 11:05 ` spanda-sgV2jX0FEOL9JmXXK+q4OQ
[not found] ` <1528177218-1051-3-git-send-email-spanda-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-06-11 23:35 ` Stephen Boyd
[not found] ` <152876014663.16708.2127612105617872452-n1Xw8LXHxjTHt/MElyovVYaSKrA+ACpX0E9HWUfgJXw@public.gmane.org>
2018-06-13 11:06 ` spanda-sgV2jX0FEOL9JmXXK+q4OQ [this message]
2018-06-05 5:40 ` [PATCH v8 2/4] dt-bindings: drm/bridge: Document sn65dsi86 bridge bindings Sandeep Panda
[not found] ` <1528177218-1051-4-git-send-email-spanda-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-06-05 15:20 ` Rob Herring
2018-06-06 4:50 ` spanda-sgV2jX0FEOL9JmXXK+q4OQ
[not found] ` <75aab08baeecd381f573603a253dbbf1-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-06-12 8:31 ` Stephen Boyd
[not found] ` <152879229054.16708.14050561301794900607-n1Xw8LXHxjTHt/MElyovVYaSKrA+ACpX0E9HWUfgJXw@public.gmane.org>
2018-06-13 11:07 ` spanda-sgV2jX0FEOL9JmXXK+q4OQ
2018-06-12 8:20 ` Stephen Boyd
2018-06-13 11:08 ` spanda-sgV2jX0FEOL9JmXXK+q4OQ
2018-06-05 5:40 ` [PATCH v8 3/4] drm/panel: add Innolux TV123WAM panel driver support Sandeep Panda
[not found] ` <1528177218-1051-5-git-send-email-spanda-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-06-05 22:14 ` Sean Paul
2018-06-05 5:40 ` [PATCH v8 4/4] dt-bindings: drm/panel: Document Innolux TV123WAM panel bindings Sandeep Panda
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=eda4f13e7a7c9be94a22dee2e81fd114@codeaurora.org \
--to=spanda-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=chandanu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=hoegsberg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nganji-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.