From: Philippe Leduc <ledphilippe@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [RFC 1/1] i.MX: IPUv3: Add parallel display support
Date: Mon, 14 Mar 2016 09:48:27 +0100 [thread overview]
Message-ID: <CABQt-U=YhwADLM2Ldaz8oznSHVWNQxgdme325=9h4Qe1OTg=2w@mail.gmail.com> (raw)
In-Reply-To: <20160229065019.GC9224@pengutronix.de>
Hi,
Thanks for the feedback, I'll fix that ASAP.
Regards,
--
Philippe LEDUC
ledphilippe@gmail.com
2016-02-29 7:50 GMT+01:00 Sascha Hauer <s.hauer@pengutronix.de>:
> Hi Philippe,
>
> Looks good overall, some small points.
>
> On Thu, Feb 25, 2016 at 05:01:20PM +0100, Philippe Leduc wrote:
>> Add a driver compatible with "fsl,imx-parallel-display" in order
>> to enable parallel display with the i.MX IPUv3.
>>
>> Signed-off-by: Philippe Leduc<ledphilippe@gmail.com>
>> --
>> +struct imx_pd {
>> + struct device_d *dev;
>> + struct display_timings *timings;
>> + u32 interface_pix_fmt;
>> + struct vpl vpl;
>> +};
>> +
>> +
>> +
>
> Plese drop multiple blank lines here.
>
>> +static int imx_pd_ioctl(struct vpl *vpl, unsigned int port,
>> + unsigned int cmd, void *data)
>> +{
>> + struct imx_pd *imx_pd = container_of(vpl, struct imx_pd, vpl);
>> + struct ipu_di_mode *mode;
>> + struct display_timings *timings;
>> +
>> + switch (cmd) {
>> + case IMX_IPU_VPL_DI_MODE:
>> + mode = data;
>> +
>> + mode->di_clkflags = IPU_DI_CLKMODE_SYNC;
>> + mode->interface_pix_fmt = imx_pd->interface_pix_fmt;
>> + return 0;
>> +
>> + case VPL_GET_VIDEOMODES:
>> + timings = data;
>> +
>> + timings->num_modes = imx_pd->timings->num_modes;
>> + timings->native_mode = imx_pd->timings->native_mode;
>> + timings->modes = imx_pd->timings->modes;
>> + timings->edid = NULL;
>> + return 0;
>> + }
>> +
>> + return 0;
>> +}
>> +
>> +static int imx_pd_probe(struct device_d *dev)
>> +{
>> + struct device_node *node = dev->device_node;
>> + struct imx_pd *imx_pd;
>> + const char *fmt;
>> + int ret;
>> +
>> + imx_pd = xzalloc(sizeof(*imx_pd));
>> + imx_pd->dev = dev;
>> +
>> + ret = of_property_read_string(node, "interface-pix-fmt", &fmt);
>> + if (!ret) {
>> + if (!strcmp(fmt, "rgb24"))
>> + imx_pd->interface_pix_fmt = V4L2_PIX_FMT_RGB24;
>> + else if (!strcmp(fmt, "rgb565"))
>> + imx_pd->interface_pix_fmt = V4L2_PIX_FMT_RGB565;
>> + else if (!strcmp(fmt, "bgr666"))
>> + imx_pd->interface_pix_fmt = V4L2_PIX_FMT_BGR666;
>
> else? You should probably bail out with an error here.
>
>> + }
>> +
>> + imx_pd->timings = of_get_display_timings(node);
>
> You should check the result. If no display timing is found then barebox
> will crash in the ioctl function.
>
> Sascha
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2016-03-14 8:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 16:01 Philippe Leduc
2016-02-29 6:50 ` Sascha Hauer
2016-03-14 8:48 ` Philippe Leduc [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='CABQt-U=YhwADLM2Ldaz8oznSHVWNQxgdme325=9h4Qe1OTg=2w@mail.gmail.com' \
--to=ledphilippe@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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