From: jacopo mondi <jacopo@jmondi.org>
To: Peter Rosin <peda@axentia.se>
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
architt@codeaurora.org, a.hajda@samsung.com,
Laurent.pinchart@ideasonboard.com, airlied@linux.ie,
daniel@ffwll.ch, linux-renesas-soc@vger.kernel.org,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/8] drm: bridge: thc63lvd1024: Add support for LVDS mode map
Date: Mon, 23 Apr 2018 09:41:56 +0200 [thread overview]
Message-ID: <20180423074156.GO4235@w540> (raw)
In-Reply-To: <86c2d4c9-8079-9f25-f24a-58c7866a8274@axentia.se>
[-- Attachment #1: Type: text/plain, Size: 2793 bytes --]
Hi Peter,
On Sun, Apr 22, 2018 at 10:02:51PM +0200, Peter Rosin wrote:
> On 2018-04-19 11:31, Jacopo Mondi wrote:
> > The THC63LVD1024 LVDS to RGB bridge supports two different LVDS mapping
> > modes, selectable by means of an external pin.
> >
> > Add support for configurable LVDS input mapping modes, using the newly
> > introduced support for bridge input image formats.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > ---
> > drivers/gpu/drm/bridge/thc63lvd1024.c | 41 +++++++++++++++++++++++++++++++++++
> > 1 file changed, 41 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c
> > index 48527f8..a3071a1 100644
> > --- a/drivers/gpu/drm/bridge/thc63lvd1024.c
> > +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c
> > @@ -10,9 +10,15 @@
> > #include <drm/drm_panel.h>
> >
> > #include <linux/gpio/consumer.h>
> > +#include <linux/of.h>
> > #include <linux/of_graph.h>
> > #include <linux/regulator/consumer.h>
> >
> > +enum thc63_lvds_mapping_mode {
> > + THC63_LVDS_MAP_MODE2,
> > + THC63_LVDS_MAP_MODE1,
> > +};
> > +
> > enum thc63_ports {
> > THC63_LVDS_IN0,
> > THC63_LVDS_IN1,
> > @@ -116,6 +122,37 @@ static int thc63_parse_dt(struct thc63_dev *thc63)
> > return 0;
> > }
> >
> > +static int thc63_set_bus_fmt(struct thc63_dev *thc63)
> > +{
> > + u32 bus_fmt;
> > + u32 map;
> > + int ret;
> > +
> > + ret = of_property_read_u32(thc63->dev->of_node, "thine,map", &map);
> > + if (ret) {
> > + dev_err(thc63->dev,
> > + "Unable to parse property \"thine,map\": %d\n", ret);
> > + return ret;
> > + }
> > +
> > + switch (map) {
> > + case THC63_LVDS_MAP_MODE1:
> > + bus_fmt = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA;
> > + break;
> > + case THC63_LVDS_MAP_MODE2:
> > + bus_fmt = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG;
>
> Why do you assume rgb888/1x7x4 here? It might as well be rgb666/1x7x3
> or rgb101010/1x7x5, no?
I should combine the 'map' pin input mode property with the 'bus_width' one
to find that out probably.
Thanks
j
>
> Cheers,
> Peter
>
> > + break;
> > + default:
> > + dev_err(thc63->dev,
> > + "Invalid value for property \"thine,map\": %u\n", map);
> > + return -EINVAL;
> > + }
> > +
> > + drm_bridge_set_bus_formats(&thc63->bridge, &bus_fmt, 1);
> > +
> > + return 0;
> > +}
> > +
> > static int thc63_gpio_init(struct thc63_dev *thc63)
> > {
> > thc63->oe = devm_gpiod_get_optional(thc63->dev, "oe", GPIOD_OUT_LOW);
> > @@ -166,6 +203,10 @@ static int thc63_probe(struct platform_device *pdev)
> > if (ret)
> > return ret;
> >
> > + ret = thc63_set_bus_fmt(thc63);
> > + if (ret)
> > + return ret;
> > +
> > thc63->bridge.driver_private = thc63;
> > thc63->bridge.of_node = pdev->dev.of_node;
> > thc63->bridge.funcs = &thc63_bridge_func;
> >
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2018-04-23 7:41 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-19 9:31 [PATCH 0/8] drm: bridge: Add support for static image formats Jacopo Mondi
2018-04-19 9:31 ` [PATCH 1/8] " Jacopo Mondi
2018-04-22 20:02 ` Peter Rosin
2018-04-26 18:44 ` jacopo mondi
2018-04-23 9:27 ` Laurent Pinchart
2018-04-26 18:40 ` jacopo mondi
2018-04-26 19:57 ` Laurent Pinchart
2018-04-19 9:31 ` [PATCH 2/8] dt-bindings: display: bridge: thc63lvd1024: Add lvds map property Jacopo Mondi
2018-04-22 20:02 ` Peter Rosin
2018-04-23 7:35 ` jacopo mondi
2018-04-23 11:59 ` Laurent Pinchart
2018-04-23 12:02 ` Laurent Pinchart
2018-04-24 16:37 ` Rob Herring
2018-04-19 9:31 ` [PATCH 3/8] drm: bridge: thc63lvd1024: Add support for LVDS mode map Jacopo Mondi
2018-04-22 20:02 ` Peter Rosin
2018-04-23 7:41 ` jacopo mondi [this message]
2018-04-23 12:12 ` Laurent Pinchart
2018-04-23 12:08 ` Laurent Pinchart
2018-04-19 9:31 ` [PATCH 4/8] arm64: dts: renesas: eagle: Add thc63 LVDS map Jacopo Mondi
2018-04-23 10:29 ` Simon Horman
2018-04-23 13:07 ` Laurent Pinchart
2018-04-19 9:31 ` [PATCH 5/8] media: Add LE version of RGB LVDS formats Jacopo Mondi
2018-04-23 13:06 ` Laurent Pinchart
2018-04-24 7:16 ` jacopo mondi
2018-04-19 9:31 ` [PATCH 6/8] drm: rcar-du: rcar-lvds: Add bridge format support Jacopo Mondi
2018-04-22 20:08 ` Peter Rosin
2018-04-23 7:28 ` jacopo mondi
2018-04-23 7:59 ` Peter Rosin
2018-04-23 8:47 ` jacopo mondi
2018-04-23 12:59 ` Laurent Pinchart
2018-04-19 9:31 ` [PATCH 7/8] drm: panel: Use _LE LVDS formats for data mirroring Jacopo Mondi
2018-04-19 9:31 ` [PATCH 8/8] drm: connector: Remove DRM_BUS_FLAG_DATA_* flags Jacopo Mondi
2018-04-23 21:03 ` Laurent Pinchart
2018-04-24 7:22 ` jacopo mondi
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=20180423074156.GO4235@w540 \
--to=jacopo@jmondi.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=architt@codeaurora.org \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jacopo+renesas@jmondi.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=peda@axentia.se \
/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).