[PATCH 3/3] drm/exynos: Add device tree support for fimc ipp driver

Sylwester Nawrocki s.nawrocki at samsung.com
Mon Apr 22 08:57:06 PDT 2013


On 04/20/2013 06:21 PM, Inki Dae wrote:
>     +static int fimc_parse_dt(struct fimc_context *ctx)
>     +{
>     +       struct device_node *node = ctx->dev->of_node;
>     +
>     +       if (!of_property_read_bool(node, "samsung,lcd-wb"))
>     +               return -ENODEV;
> 
> 
> 
> Isn't the above property really needed? This makes the use of write-back
> feature to be forced. I think some machines might not need this feature so
> their dts files have no that property.
>  So in this case, drm fimc driver probing will be failed. is that correct
> action and your intention?

Sorry, I should have added a comment explaining why it is done like this.

"samsung,lcd-wb" is the hardware property, it should be in DT node of each
FIMC that has data path from LCD to its Writeback input. See [1] for full
binding description.
So for Exynos4, FIMC2, FIMC3 will be now bound to the DRM driver. And FIMC0,
FIMC1 will be bound to the V4L2 camera driver. There is complementary check
there:

if (of_property_read_bool(node, "samsung,lcd-wb"))
	return -ENODEV;

Ideally there should be just one core driver for FIMC IP block, which is
associated with the fimc DT nodes. And switching between DRM and V4L2
should be possible at run-time. I think Media Controller API could be
helpful in that (note it is not V4L2 specific at all).
But this is all not trivial, especially WRT power management.

Before we have that I assume we could stick with using the "samsung,lcd-wb"
property.

>     +       if (of_property_read_u32(node, "clock-frequency",
>     +                                       &ctx->clk_frequency))
>     +               ctx->clk_frequency = FIMC_DEFAULT_LCLK_FREQUENCY;
>     +
>     +       ctx->id = of_alias_get_id(node, "fimc");
>     +       if (ctx->id < 0)
>     +               return -EINVAL;
>     +
>     +       return 0;
>     +}


P.S. Html is frowned upon on the mailing lists, can please fix you mailer
to use plain text ?

[1]
http://git.linuxtv.org/media_tree.git/blob/master:/Documentation/devicetree/bindings/media/samsung-fimc.txt



More information about the dri-devel mailing list