diff mbox

[2/4] davinci: Add support for Sharp LCD035Q3DG01 graphical LCD

Message ID 20090916011419.GB32194@mag.az.mvista.com (mailing list archive)
State Accepted
Headers show

Commit Message

Mark A. Greer Sept. 16, 2009, 1:14 a.m. UTC
From: Mark A. Greer <mgreer@mvista.com>

Add support for the Sharp LCD035Q3DG01 graphical LCD.  This
requires a minor interface change to da8xx_register_lcdc()
so that the board code can pass in the platform_data which
describes the lcd controller that's to be used.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
 arch/arm/mach-davinci/board-da850-evm.c    |    2 +-
 arch/arm/mach-davinci/devices-da8xx.c      |   25 ++++++++++++++-----------
 arch/arm/mach-davinci/include/mach/da8xx.h |    6 +++++-
 3 files changed, 20 insertions(+), 13 deletions(-)

Comments

Sergei Shtylyov Sept. 18, 2009, 4:45 p.m. UTC | #1
Hello.

Mark A. Greer wrote:

> Add support for the Sharp LCD035Q3DG01 graphical LCD.  This
> requires a minor interface change to da8xx_register_lcdc()
> so that the board code can pass in the platform_data which
> describes the lcd controller that's to be used.

> Signed-off-by: Mark A. Greer <mgreer@mvista.com>

[...]

> diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
> index 0102e0a..5595613 100644
> --- a/arch/arm/mach-davinci/devices-da8xx.c
> +++ b/arch/arm/mach-davinci/devices-da8xx.c
> @@ -21,7 +21,6 @@
>  #include <mach/common.h>
>  #include <mach/time.h>
>  #include <mach/da8xx.h>
> -#include <video/da8xx-fb.h>
>  
>  #include "clock.h"
>  
> @@ -381,10 +380,16 @@ static struct lcd_ctrl_config lcd_cfg = {
>  	.raster_order		= 0,
>  };
>  
> -static struct da8xx_lcdc_platform_data da850_evm_lcdc_pdata = {
> -	.manu_name = "sharp",
> -	.controller_data = &lcd_cfg,
> -	.type = "Sharp_LK043T1DG01",
> +struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata = {
> +	.manu_name		= "sharp",
> +	.controller_data	= &lcd_cfg,
> +	.type			= "Sharp_LCD035Q3DG01",
> +};
> +
> +struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata = {
> +	.manu_name		= "sharp",
> +	.controller_data	= &lcd_cfg,
> +	.type			= "Sharp_LK043T1DG01",
>  };

    It's not clear why the platfrom devices are declared here and not in the 
board file...

WBR, Sergei
Sergei Shtylyov Sept. 18, 2009, 4:49 p.m. UTC | #2
Hello, I wrote:

>> Add support for the Sharp LCD035Q3DG01 graphical LCD.  This
>> requires a minor interface change to da8xx_register_lcdc()
>> so that the board code can pass in the platform_data which
>> describes the lcd controller that's to be used.

>> Signed-off-by: Mark A. Greer <mgreer@mvista.com>

> [...]

>> diff --git a/arch/arm/mach-davinci/devices-da8xx.c 
>> b/arch/arm/mach-davinci/devices-da8xx.c
>> index 0102e0a..5595613 100644
>> --- a/arch/arm/mach-davinci/devices-da8xx.c
>> +++ b/arch/arm/mach-davinci/devices-da8xx.c
>> @@ -21,7 +21,6 @@
>>  #include <mach/common.h>
>>  #include <mach/time.h>
>>  #include <mach/da8xx.h>
>> -#include <video/da8xx-fb.h>
>>  
>>  #include "clock.h"
>>  
>> @@ -381,10 +380,16 @@ static struct lcd_ctrl_config lcd_cfg = {
>>      .raster_order        = 0,
>>  };
>>  
>> -static struct da8xx_lcdc_platform_data da850_evm_lcdc_pdata = {
>> -    .manu_name = "sharp",
>> -    .controller_data = &lcd_cfg,
>> -    .type = "Sharp_LK043T1DG01",
>> +struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata = {
>> +    .manu_name        = "sharp",
>> +    .controller_data    = &lcd_cfg,
>> +    .type            = "Sharp_LCD035Q3DG01",
>> +};
>> +
>> +struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata = {
>> +    .manu_name        = "sharp",
>> +    .controller_data    = &lcd_cfg,
>> +    .type            = "Sharp_LK043T1DG01",
>>  };

>    It's not clear why the platfrom devices are declared here and not in 
> the board file...

    Oh, this is already committed... Kevin, could you allow more time on the 
patch feedback next time?

WBR, Sergei
Kevin Hilman Sept. 22, 2009, 5:41 p.m. UTC | #3
Sergei Shtylyov <sshtylyov@ru.mvista.com> writes:

> Hello, I wrote:
>
>>> Add support for the Sharp LCD035Q3DG01 graphical LCD.  This
>>> requires a minor interface change to da8xx_register_lcdc()
>>> so that the board code can pass in the platform_data which
>>> describes the lcd controller that's to be used.
>
>>> Signed-off-by: Mark A. Greer <mgreer@mvista.com>
>
>> [...]
>
>>> diff --git a/arch/arm/mach-davinci/devices-da8xx.c
>>> b/arch/arm/mach-davinci/devices-da8xx.c
>>> index 0102e0a..5595613 100644
>>> --- a/arch/arm/mach-davinci/devices-da8xx.c
>>> +++ b/arch/arm/mach-davinci/devices-da8xx.c
>>> @@ -21,7 +21,6 @@
>>>  #include <mach/common.h>
>>>  #include <mach/time.h>
>>>  #include <mach/da8xx.h>
>>> -#include <video/da8xx-fb.h>
>>>   #include "clock.h"
>>>  @@ -381,10 +380,16 @@ static struct lcd_ctrl_config lcd_cfg = {
>>>      .raster_order        = 0,
>>>  };
>>>  -static struct da8xx_lcdc_platform_data da850_evm_lcdc_pdata = {
>>> -    .manu_name = "sharp",
>>> -    .controller_data = &lcd_cfg,
>>> -    .type = "Sharp_LK043T1DG01",
>>> +struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata = {
>>> +    .manu_name        = "sharp",
>>> +    .controller_data    = &lcd_cfg,
>>> +    .type            = "Sharp_LCD035Q3DG01",
>>> +};
>>> +
>>> +struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata = {
>>> +    .manu_name        = "sharp",
>>> +    .controller_data    = &lcd_cfg,
>>> +    .type            = "Sharp_LK043T1DG01",
>>>  };
>
>>    It's not clear why the platfrom devices are declared here and not
>> in the board file...

I had the same question initially, but assumed they were there so they
could be shared across different boards.

>    Oh, this is already committed... Kevin, could you allow more time
> on the patch feedback next time?

Heh, I've never been accused of applying things too quickly before.
Normally, I'm too slow. ;)

Yes, it's committed to davinci git, but no reason it cant be reworked
before going upstream if needed.

Kevin
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index fbc7aae..da1a6fb 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -377,7 +377,7 @@  static __init void da850_evm_init(void)
 		pr_warning("da850_evm_init: lcd initialization failed: %d\n",
 				ret);
 
-	ret = da8xx_register_lcdc();
+	ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
 	if (ret)
 		pr_warning("da850_evm_init: lcdc registration failed: %d\n",
 				ret);
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 0102e0a..5595613 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -21,7 +21,6 @@ 
 #include <mach/common.h>
 #include <mach/time.h>
 #include <mach/da8xx.h>
-#include <video/da8xx-fb.h>
 
 #include "clock.h"
 
@@ -381,10 +380,16 @@  static struct lcd_ctrl_config lcd_cfg = {
 	.raster_order		= 0,
 };
 
-static struct da8xx_lcdc_platform_data da850_evm_lcdc_pdata = {
-	.manu_name = "sharp",
-	.controller_data = &lcd_cfg,
-	.type = "Sharp_LK043T1DG01",
+struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata = {
+	.manu_name		= "sharp",
+	.controller_data	= &lcd_cfg,
+	.type			= "Sharp_LCD035Q3DG01",
+};
+
+struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata = {
+	.manu_name		= "sharp",
+	.controller_data	= &lcd_cfg,
+	.type			= "Sharp_LK043T1DG01",
 };
 
 static struct resource da8xx_lcdc_resources[] = {
@@ -400,19 +405,17 @@  static struct resource da8xx_lcdc_resources[] = {
 	},
 };
 
-static struct platform_device da850_lcdc_device = {
+static struct platform_device da8xx_lcdc_device = {
 	.name		= "da8xx_lcdc",
 	.id		= 0,
 	.num_resources	= ARRAY_SIZE(da8xx_lcdc_resources),
 	.resource	= da8xx_lcdc_resources,
-	.dev = {
-		.platform_data = &da850_evm_lcdc_pdata,
-	}
 };
 
-int __init da8xx_register_lcdc(void)
+int __init da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata)
 {
-	return platform_device_register(&da850_lcdc_device);
+	da8xx_lcdc_device.dev.platform_data = pdata;
+	return platform_device_register(&da8xx_lcdc_device);
 }
 
 static struct resource da8xx_mmcsd0_resources[] = {
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index ec2821b..375a3f7 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -11,6 +11,8 @@ 
 #ifndef __ASM_ARCH_DAVINCI_DA8XX_H
 #define __ASM_ARCH_DAVINCI_DA8XX_H
 
+#include <video/da8xx-fb.h>
+
 #include <mach/serial.h>
 #include <mach/edma.h>
 #include <mach/i2c.h>
@@ -76,12 +78,14 @@  int da8xx_register_edma(void);
 int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
 int da8xx_register_watchdog(void);
 int da8xx_register_emac(void);
-int da8xx_register_lcdc(void);
+int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);
 int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
 void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata);
 
 extern struct platform_device da8xx_serial_device;
 extern struct emac_platform_data da8xx_emac_pdata;
+extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
+extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
 
 extern const short da830_emif25_pins[];
 extern const short da830_spi0_pins[];