lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 05 Feb 2013 17:22:23 -0700
From:	Stephen Warren <swarren@...dotorg.org>
To:	Sean Paul <seanpaul@...omium.org>
CC:	linux-arm-kernel@...ts.infradead.org,
	linux-samsung-soc@...r.kernel.org,
	devicetree-discuss@...ts.ozlabs.org,
	dri-devel@...ts.freedesktop.org, t.stanislaws@...sung.com,
	kgene.kim@...sung.com, linux-kernel@...r.kernel.org,
	tomasz.figa@...il.com, inki.dae@...sung.com,
	sylvester.nawrocki@...il.com, olofj@...omium.org,
	rahul.sharma@...sung.com
Subject: Re: [PATCH v3 1/3] drm/exynos: Get HDMI version from device tree

n 02/05/2013 04:42 PM, Sean Paul wrote:
> Use the compatible string in the device tree to determine which
> registers/functions to use in the HDMI driver. Also changes the
> references from v13 to 4210 and v14 to 4212 to reflect the IP
> block version instead of the HDMI version.

> diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt

Binding looks sane to me.

> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c

>  #ifdef CONFIG_OF
>  static struct of_device_id hdmi_match_types[] = {
>  	{
> -		.compatible = "samsung,exynos5-hdmi",
> -		.data	= (void	*)HDMI_TYPE14,
> +		.compatible = "samsung,exynos4-hdmi",
>  	}, {
>  		/* end node */
>  	}

Why not fill in all the "base" compatible values there (I think you need
this anyway so that DTs don't all have to be compatible with
samsung,exynos4-hdmi), with .data containing the HDMI_VER_EXYNOS*
values, then ...

> @@ -2218,17 +2217,18 @@ static int hdmi_probe(struct platform_device *pdev)

> +
> +	if (of_device_is_compatible(dev->of_node, "samsung,exynos4210-hdmi"))
> +		hdata->version |= HDMI_VER_EXYNOS4210;
> +	if (of_device_is_compatible(dev->of_node, "samsung,exynos4212-hdmi"))
> +		hdata->version |= HDMI_VER_EXYNOS4212;
> +	if (of_device_is_compatible(dev->of_node, "samsung,exynos5250-hdmi"))
> +		hdata->version |= HDMI_VER_EXYNOS5250;

Instead of that, do roughly:

    match = of_match_device(hdmi_match_types, &pdev->dev);
    if (match)
        hdata->version |= (int)match->data;

That way, it's all table-based. Any future additions to
hdmi_match_types[] won't require another if statement to be added to
probe().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ