Patchwork [Maverick,SRU,5/6] UBUNTU - ARM: igepv2: Add i2c eeprom driver to read EDID

login
register
mail settings
Submitter Mathieu Poirier
Date Oct. 11, 2010, 4:37 p.m.
Message ID <1286815044.3125.36.camel@black>
Download mbox | patch
Permalink /patch/67441/
State Accepted
Delegated to: Brad Figg
Headers show

Comments

Mathieu Poirier - Oct. 11, 2010, 4:37 p.m.
SRU Justification:

Impact: This patch is part of a series of fix for the IGEPv2 board. The
monitor's EDID information needs to be exported to userspace for
application such as 'decode-edid' and 'parse-edid' to decode.

Fix: To do this a 3rd "i2c_board_info" instance is declared and
initialized in "igep2_i2c_init", part of the board initialization
sequence.

Testcase: Without this patch, 'decode-edid' and 'parse-edid' will return
error messages. Otherwise the monitor' specific EDID information is
displayed.


>From b6f76df83460c0b8b34f25061f244ae3f0cc6c5e Mon Sep 17 00:00:00 2001
From: Enric Balletbo i Serra <eballetbo@gmail.com>
Date: Mon, 11 Oct 2010 10:14:10 -0600
Subject: [PATCH 5/6] UBUNTU - ARM: igepv2: Add i2c eeprom driver to read EDID

Add i2c eeprom driver to access monitor EDID binary information
from user space, something that is required by 'decode-edid' and
'parse-edid'.

This work was tested by the community and also been submitted here:
http://marc.info/?l=linux-omap&m=128628829819054&w=2

BugLink: https://bugs.launchpad.net/bugs/654594

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Mathieu J Poirier <mathieu.poirier@canonical.com>
---
 arch/arm/mach-omap2/board-igep0020.c |   33 ++++++++++++++++++++++++---------
 1 files changed, 24 insertions(+), 9 deletions(-)
Lee Jones - Oct. 12, 2010, 8:20 a.m.
On 11/10/10 17:37, Mathieu Poirier wrote:
> 
> SRU Justification:
> 
> Impact: This patch is part of a series of fix for the IGEPv2 board. The
> monitor's EDID information needs to be exported to userspace for
> application such as 'decode-edid' and 'parse-edid' to decode.
> 
> Fix: To do this a 3rd "i2c_board_info" instance is declared and
> initialized in "igep2_i2c_init", part of the board initialization
> sequence.
> 
> Testcase: Without this patch, 'decode-edid' and 'parse-edid' will return
> error messages. Otherwise the monitor' specific EDID information is
> displayed.
> 
> 
>>From b6f76df83460c0b8b34f25061f244ae3f0cc6c5e Mon Sep 17 00:00:00 2001
> From: Enric Balletbo i Serra <eballetbo@gmail.com>
> Date: Mon, 11 Oct 2010 10:14:10 -0600
> Subject: [PATCH 5/6] UBUNTU - ARM: igepv2: Add i2c eeprom driver to read EDID
> 
> Add i2c eeprom driver to access monitor EDID binary information
> from user space, something that is required by 'decode-edid' and
> 'parse-edid'.
> 
> This work was tested by the community and also been submitted here:
> http://marc.info/?l=linux-omap&m=128628829819054&w=2
> 
> BugLink: https://bugs.launchpad.net/bugs/654594
> 
> Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> Signed-off-by: Mathieu J Poirier <mathieu.poirier@canonical.com>
> ---
>  arch/arm/mach-omap2/board-igep0020.c |   33 ++++++++++++++++++++++++---------
>  1 files changed, 24 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 1047477..600a40a 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -541,7 +541,7 @@ static struct twl4030_platform_data igep2_twldata = {
>  
>  };
>  
> -static struct i2c_board_info __initdata igep2_i2c_boardinfo[] = {
> +static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = {
>  	{
>  		I2C_BOARD_INFO("twl4030", 0x48),
>  		.flags		= I2C_CLIENT_WAKE,
> @@ -550,14 +550,29 @@ static struct i2c_board_info __initdata igep2_i2c_boardinfo[] = {
>  	},
>  };
>  
> -static int __init igep2_i2c_init(void)
> +static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
> +	{
> +		I2C_BOARD_INFO("eeprom", 0x50),
> +	},
> +};
> +
> +static void __init igep2_i2c_init(void)
>  {
> -	omap_register_i2c_bus(1, 2600, igep2_i2c_boardinfo,
> -			ARRAY_SIZE(igep2_i2c_boardinfo));
> -	/* Bus 3 is attached to the DVI port where devices like the pico DLP
> -	 * projector don't work reliably with 400kHz */
> -	omap_register_i2c_bus(3, 100, NULL, 0);
> -	return 0;
> +	int ret;
> +
> +	ret = omap_register_i2c_bus(1, 2600, igep2_i2c1_boardinfo,
> +		ARRAY_SIZE(igep2_i2c1_boardinfo));
> +	if (ret)
> +		pr_warning("IGEP2: Could not register I2C1 bus (%d)\n", ret);
> +
> +	/*
> +	 * Bus 3 is attached to the DVI port where devices like the pico DLP
> +	 * projector don't work reliably with 400kHz
> +	 */
> +	ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
> +		ARRAY_SIZE(igep2_i2c3_boardinfo));
> +	if (ret)
> +		pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
>  }
>  
>  static struct omap_musb_board_data musb_board_data = {
> @@ -635,7 +650,7 @@ static void __init igep2_init(void)
>  
>  	/* Get IGEP2 hardware revision */
>  	igep2_get_revision();
> -
> +	/* Register I2C busses and drivers */
>  	igep2_i2c_init();
>  	platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
>  	omap_serial_init();

Signed-off-by: Lee Jones <lee.jones@canonical.com>

Patch

diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 1047477..600a40a 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -541,7 +541,7 @@  static struct twl4030_platform_data igep2_twldata = {
 
 };
 
-static struct i2c_board_info __initdata igep2_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = {
 	{
 		I2C_BOARD_INFO("twl4030", 0x48),
 		.flags		= I2C_CLIENT_WAKE,
@@ -550,14 +550,29 @@  static struct i2c_board_info __initdata igep2_i2c_boardinfo[] = {
 	},
 };
 
-static int __init igep2_i2c_init(void)
+static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
+	{
+		I2C_BOARD_INFO("eeprom", 0x50),
+	},
+};
+
+static void __init igep2_i2c_init(void)
 {
-	omap_register_i2c_bus(1, 2600, igep2_i2c_boardinfo,
-			ARRAY_SIZE(igep2_i2c_boardinfo));
-	/* Bus 3 is attached to the DVI port where devices like the pico DLP
-	 * projector don't work reliably with 400kHz */
-	omap_register_i2c_bus(3, 100, NULL, 0);
-	return 0;
+	int ret;
+
+	ret = omap_register_i2c_bus(1, 2600, igep2_i2c1_boardinfo,
+		ARRAY_SIZE(igep2_i2c1_boardinfo));
+	if (ret)
+		pr_warning("IGEP2: Could not register I2C1 bus (%d)\n", ret);
+
+	/*
+	 * Bus 3 is attached to the DVI port where devices like the pico DLP
+	 * projector don't work reliably with 400kHz
+	 */
+	ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
+		ARRAY_SIZE(igep2_i2c3_boardinfo));
+	if (ret)
+		pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
 }
 
 static struct omap_musb_board_data musb_board_data = {
@@ -635,7 +650,7 @@  static void __init igep2_init(void)
 
 	/* Get IGEP2 hardware revision */
 	igep2_get_revision();
-
+	/* Register I2C busses and drivers */
 	igep2_i2c_init();
 	platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
 	omap_serial_init();