On Sat, 07 Nov 2020 23:39:30 +0100, Sam Ravnborg wrote:
On Fri, Sep 11, 2020 at 03:54:03PM +0200, Michael Tretter wrote:
The phy timings are already shifted to the field position. If the driver is reused on multiple platforms, this exposes the field positions to the platform code.
Store only the timing values in the platform data and shift the value to the field when writing the fields to the registers.
Signed-off-by: Michael Tretter m.tretter@pengutronix.de
This and the following patch smells like the regmap functionality is partly open coded. regmaps supports defining different register layouts and select the correct layout at runtime.
See for example: https://www.collabora.com/news-and-blog/blog/2020/05/27/using-regmaps-to-mak... or https://www.youtube.com/watch?v=0RPDGANArFc
Some parts is not a perfect fit - but using regmaps will make it better as a general and well-known solution is used.
I considered using regmaps, but there was something that didn't work out. Unfortunately, I don't remember, what it actually was. Therefore, it is probably best to use regmaps here.
Michael
@Adrian - see https://lore.kernel.org/dri-devel/20200911135413.3654800-1-m.tretter@pengutr... for the original patch.
Sam