All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 2/3] sunxi: video: Add video driver for H3 SoC
Date: Mon, 19 Dec 2016 14:28:01 +0100	[thread overview]
Message-ID: <20161219132801.hgukch6fserrwzen@lukather> (raw)
In-Reply-To: <3839414.Q9P98NFul8@jernej-laptop>

Hi,

On Wed, Dec 14, 2016 at 11:11:19PM +0100, Jernej ?krabec wrote:
> > > While I took Rockchip HDMI code for reference, it can't be easily reused.
> > > First of, it uses DT nodes. I guess I could write DT binding or modify
> > > existing driver to work without it.
> > 
> > Like we discussed in the other part of the thread, I think the latter
> > would be easier to deal with.
> 
> I forgot to mention that it also uses driver model. The way I would go with 
> this is to split out common code to dwc_hdmi.c and have platform dependant 
> drivers for Rockchip, Allwinner, etc. Basically the same way as it is done in 
> Linux.

That sounds reasonable.

> > > Thirdly, and in my opinion most annoying, Rockchip driver uses 32
> > > bit aligned registers, but H3 does not. This also means a lot of
> > > work to make it more generic.
> > 
> > How does Linux deal with that? Would just using some kind of accessors
> > that would abstract that away from the driver help, or is it more
> > complicated?
> 
> Yes, Linux driver checks "reg-io-width" property and selects accessors 
> accordingly. I suppose I could do similar, save function pointer in a driver 
> private data. I suppose it is ok that platform specific code initializes this 
> private data?

Something like passing a flag stored in the platform data (and/or read
from DT for the relevant cases) to a generic accessor would also be a
solution, without the need for everyone to implement its accessors.

> > > Actually, H3 is more similar to i.MX6 HDMI in this regard, but
> > > driver's code is scattered throughout multiple files (search for
> > > mxc_hdmi.h inclusion). It is certainly doable, but it will take much
> > > more time.  Basically, U-Boot already has two drivers for DWC HDMI
> > > and with this patch it will get third. Merging all three
> > > implementations into one would be very tedious, but very desirable
> > > goal. I must state that I didn't really try to understand i.MX6 HDMI
> > > code at all, so I don't now how hard it would be to pull it out.
> > 
> > I'm not sure that merging a third and saying that it would be up to
> > the fourth to do the work is reasonable. It's just hiding an issue
> > under the carpet, but I don't see how it will be easier for the next
> > person to work on that. Quite the opposite actually.
> 
> True. I wonder if Renesas already prepared U-Boot DWC HDMI driver...
> 
> Do you think it makes sense to put all files related to Allwinner
> video drivers to sunxi subfolder? There will be at least 4 .c files
> according to my plan and even more in the future (at least for TV
> out driver).

On principle, I don't see anything wrong with that.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161219/09aefe0a/attachment.sig>

  reply	other threads:[~2016-12-19 13:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13  0:36 [U-Boot] [RFC PATCH 0/3] sunxi: video: Add support for HDMI output on H3 Jernej Skrabec
2016-12-13  0:36 ` [U-Boot] [RFC PATCH 1/3] sunxi: Add clocks for DE2/HDMI/TCON Jernej Skrabec
2016-12-13 15:18   ` Maxime Ripard
2016-12-13 19:20     ` Jernej Škrabec
2016-12-14  2:39       ` Chen-Yu Tsai
2016-12-13  0:36 ` [U-Boot] [RFC PATCH 2/3] sunxi: video: Add video driver for H3 SoC Jernej Skrabec
2016-12-13 15:40   ` Maxime Ripard
2016-12-13 16:33     ` Chen-Yu Tsai
2016-12-13 20:13     ` Jernej Škrabec
2016-12-14 10:28       ` Maxime Ripard
2016-12-14 22:11         ` Jernej Škrabec
2016-12-19 13:28           ` Maxime Ripard [this message]
2017-02-05 22:23   ` Rask Ingemann Lambertsen
2016-12-13  0:36 ` [U-Boot] [RFC PATCH 3/3] sunxi: Enable H3 video driver in defconfigs Jernej Skrabec
2016-12-13 20:28 ` [U-Boot] [RFC PATCH 0/3] sunxi: video: Add support for HDMI output on H3 Simon Glass
2016-12-13 21:16   ` [U-Boot] [linux-sunxi] " Icenowy Zheng
2016-12-14  3:02     ` Chen-Yu Tsai
2016-12-14  9:25       ` Maxime Ripard
2016-12-14  9:37         ` Alexander Graf
2016-12-14  9:51           ` Emmanuel Vadot
2016-12-20 10:47           ` Maxime Ripard
2016-12-14  8:37   ` [U-Boot] " Hans de Goede
2016-12-14  9:24     ` Maxime Ripard
2016-12-17 22:47     ` Simon Glass
2017-02-05 22:14 ` Rask Ingemann Lambertsen

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=20161219132801.hgukch6fserrwzen@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=u-boot@lists.denx.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 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.