ARM: at91: atmel_lcdc: add DT support
Subsystems (6)
cover ARM: at91: atmel_lcdc: add DT support
HI,
The following patch series add the DT support of the Atmel LCDC controler and update the 9263 and 9g45 Atmel Reference board
At the same time some cleanup is done on the drivers implementation as we was using the internal data struct as platform data
The following changes since commit d920129d817acc5f7ebfadeb7ecbce70ab161f6c:
ARM: at91/avr32/atmel_lcdfb: add platform device-id table (2013-04-11 21:00:56 +0800)
are available in the git repository at:
git://github.com/at91linux/linux-at91.git j/for-3.10_atmel_lcd_dt
for you to fetch changes up to 6354e161060c2d90f0935d14d037e2f126b8c6e5:
ARM: at91: sam9263ek: add dt lcd support (2013-04-11 21:18:21 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (8):
video: atmel_lcdfb: fix platform data struct
video: atmel_lcdfb: introduce atmel_lcdfb_power_control
video: atmel_lcdfb: pass the pdata as params
video: atmel_lcdfb: add device tree suport
ARM: at91: sam9g45: add lcd support
ARM: at91: sam9263: add fb dt support
ARM: at91: at9sam9m10g45ek: add dt lcd support
ARM: at91: sam9263ek: add dt lcd support
Documentation/devicetree/bindings/video/atmel,lcdc.txt | 75 +++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/at91sam9263.dtsi | 39 ++++++++++++++++++++ arch/arm/boot/dts/at91sam9263ek.dts | 30 +++++++++++++++ arch/arm/boot/dts/at91sam9g45.dtsi | 47 +++++++++++++++++++++++ arch/arm/boot/dts/at91sam9m10g45ek.dts | 29 +++++++++++++++ arch/arm/mach-at91/at91sam9261_devices.c | 6 +-- arch/arm/mach-at91/at91sam9263_devices.c | 6 +-- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +-- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +-- arch/arm/mach-at91/board-sam9261ek.c | 10 ++--- arch/arm/mach-at91/board-sam9263ek.c | 6 +-- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 6 +-- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 8 ++-- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 ++-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/Kconfig | 2 + drivers/video/atmel_lcdfb.c | 342 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------- include/video/atmel_lcdc.h | 26 ++----------- 27 files changed, 547 insertions(+), 135 deletions(-) create mode 100644 Documentation/devicetree/bindings/video/atmel,lcdc.txt
Best Regards,
J.
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
Today we mix pdata and drivers data in the struct atmel_lcdfb_info Fix it and introduce a new struct atmel_lcdfb_pdata for platform data only
--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)
arch/arm/mach-at91/at91sam9261_devices.c +3 -3
@@ -465,7 +465,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = {
@@ -498,7 +498,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {if (!data) {return ;
@@ -559,7 +559,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); }#else -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {}#endif
arch/arm/mach-at91/at91sam9263_devices.c +3 -3
@@ -832,7 +832,7 @@ void __init at91_add_device_can(struct at91_can_data *data) {} #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = {
@@ -859,7 +859,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {if (!data)return ;
@@ -891,7 +891,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); }#else -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {}#endif
arch/arm/mach-at91/at91sam9g45_devices.c +3 -3
@@ -965,7 +965,7 @@ void __init at91_add_device_isi(struct isi_platform_data *data, #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = {
@@ -991,7 +991,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {if (!data)return ;
@@ -1037,7 +1037,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); }#else -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {}#endif
arch/arm/mach-at91/at91sam9rl_devices.c +3 -3
@@ -498,7 +498,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data) {} #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = {
@@ -525,7 +525,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {if (!data) {return ;
@@ -557,7 +557,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); }#else -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {}#endif
arch/arm/mach-at91/board-sam9261ek.c +3 -3
@@ -405,7 +405,7 @@ static void at91_lcdc_stn_power_control(int on) } } -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .default_bpp =1 , .default_dmacon =ATMEL_LCDC_DMAEN , .default_lcdcon2 =AT91SAM9261_DEFAULT_STN_LCDCON2 ,
@@ -460,7 +460,7 @@ static void at91_lcdc_tft_power_control(int on)at91_set_gpio_value (AT91_PIN_PA12 ,1 );/* power down */ } -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN ,
@@ -475,7 +475,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {#endif #else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;#endif
arch/arm/mach-at91/board-sam9263ek.c +2 -2
@@ -281,7 +281,7 @@ static void at91_lcdc_power_control(int on) }/* Driver datas */ -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN ,
@@ -292,7 +292,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { };#else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;#endif
arch/arm/mach-at91/board-sam9m10g45ek.c +2 -2
@@ -284,7 +284,7 @@ static struct fb_monspecs at91fb_default_monspecs = { | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)/* Driver datas */ -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp =32 , .default_dmacon =ATMEL_LCDC_DMAEN ,
@@ -295,7 +295,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { };#else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;#endif
arch/arm/mach-at91/board-sam9rlek.c +2 -2
@@ -179,7 +179,7 @@ static void at91_lcdc_power_control(int on) }/* Driver datas */ -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN ,
@@ -191,7 +191,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { };#else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;#endif
arch/arm/mach-at91/board.h +2 -2
@@ -107,8 +107,8 @@ extern void __init at91_add_device_pwm(u32 mask);extern void __init at91_add_device_ssc (unsigned id,unsigned pins);/* LCD Controller */ -struct atmel_lcdfb_info ; -extern void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data); +struct atmel_lcdfb_pdata ; +extern void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data);/* AC97 */ extern void __init at91_add_device_ac97 (struct ac97c_platform_data *data);
arch/avr32/boards/atngw100/evklcd10x.c +3 -3
@@ -58,7 +58,7 @@ static struct fb_monspecs __initdata atevklcd10x_default_monspecs = { .dclkmax = 28330000, }; -static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
@@ -96,7 +96,7 @@ static struct fb_monspecs __initdata atevklcd10x_default_monspecs = { .dclkmax = 7000000, }; -static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
@@ -134,7 +134,7 @@ static struct fb_monspecs __initdata atevklcd10x_default_monspecs = { .dclkmax = 6400000, }; -static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
arch/avr32/boards/atngw100/mrmt.c +2 -2
@@ -83,7 +83,7 @@ static struct fb_monspecs __initdata lcd_fb_default_monspecs = { .dclkmax = 9260000, }; -static struct atmel_lcdfb_info __initdata rmt_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata rmt_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
@@ -126,7 +126,7 @@ static struct fb_monspecs __initdata lcd_fb_default_monspecs = { .dclkmax = 9260000, }; -static struct atmel_lcdfb_info __initdata rmt_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata rmt_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
arch/avr32/boards/atstk1000/atstk1000.h +1 -1
@@ -10,7 +10,7 @@#ifndef __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H#define __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H -extern struct atmel_lcdfb_info atstk1000_lcdc_data; +extern struct atmel_lcdfb_pdata atstk1000_lcdc_data;void atstk1000_setup_j2_leds (void );
arch/avr32/boards/atstk1000/setup.c +1 -1
@@ -55,7 +55,7 @@ static struct fb_monspecs __initdata atstk1000_default_monspecs = { .dclkmax = 30000000, }; -struct atmel_lcdfb_info __initdata atstk1000_lcdc_data = { +struct atmel_lcdfb_pdata __initdata atstk1000_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
arch/avr32/boards/favr-32/setup.c +1 -1
@@ -125,7 +125,7 @@ static struct fb_monspecs __initdata favr32_default_monspecs = { .dclkmax = 28000000, }; -struct atmel_lcdfb_info __initdata favr32_lcdc_data = { +struct atmel_lcdfb_pdata __initdata favr32_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
arch/avr32/boards/hammerhead/setup.c +1 -1
@@ -77,7 +77,7 @@ static struct fb_monspecs __initdata hammerhead_hda350t_monspecs = { .dclkmax = 10000000, }; -struct atmel_lcdfb_info __initdata hammerhead_lcdc_data = { +struct atmel_lcdfb_pdata __initdata hammerhead_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
arch/avr32/boards/merisc/display.c +1 -1
@@ -45,7 +45,7 @@ static struct fb_monspecs merisc_fb_monspecs = { .dclkmax = 30000000, }; -struct atmel_lcdfb_info merisc_lcdc_data = { +struct atmel_lcdfb_pdata merisc_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
arch/avr32/boards/mimc200/setup.c +2 -2
@@ -8,7 +8,7 @@* published by the Free Software Foundation. */ -extern struct atmel_lcdfb_info mimc200_lcdc_data; +extern struct atmel_lcdfb_pdata mimc200_lcdc_data;#include <linux/clk.h> #include <linux/etherdevice.h>
@@ -71,7 +71,7 @@ static struct fb_monspecs __initdata mimc200_default_monspecs = { .dclkmax = 25200000, }; -struct atmel_lcdfb_info __initdata mimc200_lcdc_data = { +struct atmel_lcdfb_pdata __initdata mimc200_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
arch/avr32/mach-at32ap/at32ap700x.c +4 -4
@@ -1437,7 +1437,7 @@ fail:* LCDC * -------------------------------------------------------------------- */ #if defined(CONFIG_CPU_AT32AP7000) || defined(CONFIG_CPU_AT32AP7002) -static struct atmel_lcdfb_info atmel_lcdfb0_data; +static struct atmel_lcdfb_pdata atmel_lcdfb0_data; static struct resource atmel_lcdfb0_resource[] = { { .start = 0xff000000,
@@ -1465,12 +1465,12 @@ static struct clk atmel_lcdfb0_pixclk = { };struct platform_device *__init -at32_add_device_lcdc (unsigned int id,struct atmel_lcdfb_info *data, +at32_add_device_lcdc (unsigned int id,struct atmel_lcdfb_pdata *data,unsigned long fbmem_start,unsigned long fbmem_len,u64 pin_mask) {struct platform_device *pdev; -struct atmel_lcdfb_info *info; +struct atmel_lcdfb_pdata *info;struct fb_monspecs *monspecs;struct fb_videomode *modedb;unsigned int modedb_size;
@@ -1527,7 +1527,7 @@ at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, } info = pdev->dev.platform_data; -memcpy (info, data,sizeof (struct atmel_lcdfb_info )); +memcpy (info, data,sizeof (struct atmel_lcdfb_pdata )); info->default_monspecs = monspecs; pdev->name ="at32ap-lcdfb" ;
arch/avr32/mach-at32ap/include/mach/board.h +2 -2
@@ -44,9 +44,9 @@ struct platform_device * at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n);void at32_spi_setup_slaves (unsigned int bus_num,struct spi_board_info *b,unsigned int n); -struct atmel_lcdfb_info ; +struct atmel_lcdfb_pdata ;struct platform_device * -at32_add_device_lcdc (unsigned int id,struct atmel_lcdfb_info *data, +at32_add_device_lcdc (unsigned int id,struct atmel_lcdfb_pdata *data,unsigned long fbmem_start,unsigned long fbmem_len,u64 pin_mask);
drivers/video/atmel_lcdfb.c +67 -37
255 lines not on this page · raw message
include/video/atmel_lcdc.h +1 -23
@@ -31,39 +31,17 @@#define ATMEL_LCDC_WIRING_BGR 0#define ATMEL_LCDC_WIRING_RGB 1 -struct atmel_lcdfb_config ;/* LCD Controller info data structure, stored in device platform_data */ -struct atmel_lcdfb_info { -spinlock_t lock; -struct fb_info *info; -void __iomem *mmio; -int irq_base; -struct work_struct task; - +struct atmel_lcdfb_pdata {unsigned int guard_time; -unsigned int smem_len; -struct platform_device *pdev; -struct clk *bus_clk; -struct clk *lcdc_clk; - -#ifdef CONFIG_BACKLIGHT_ATMEL_LCDC -struct backlight_device *backlight; -u8 bl_power; -#endif bool lcdcon_is_backlight; -bool lcdcon_pol_negative; -u8 saved_lcdcon; -u8 default_bpp;u8 lcd_wiring_mode;unsigned int default_lcdcon2;unsigned int default_dmacon;void (*atmel_lcdfb_power_control)(int on);struct fb_monspecs *default_monspecs; -u32 pseudo_palette[16 ]; - -struct atmel_lcdfb_config *config; };#define ATMEL_LCDC_DMABADDR1 0x00
Signature · 1 line
1.7.10.4
PATCH 2/8 video: atmel_lcdfb: introduce atmel_lcdfb_power_control
to simplify the check on the presence of the callback
--- drivers/video/atmel_lcdfb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/video/atmel_lcdfb.c +11 -11
@@ -283,6 +283,13 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo)init_backlight (sinfo); } +static inline void atmel_lcdfb_power_control (struct atmel_lcdfb_info *sinfo,int on) +{ +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; + +if (pdata->atmel_lcdfb_power_control) + pdata->atmel_lcdfb_power_control (on); +}static struct fb_fix_screeninfo atmel_lcdfb_fix__initdata = { .type =FB_TYPE_PACKED_PIXELS ,
@@ -1114,8 +1121,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)fb_add_videomode (&fbmode, &info->modelist);/* Power up the LCDC screen */ -if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (1 ); +atmel_lcdfb_power_control (sinfo,1 );dev_info (dev,"fb%d: Atmel LCDC at 0x%08lx (mapped at %p), irq %d\n" , info->node, info->fix.mmio_start, sinfo->mmio, sinfo->irq_base);
@@ -1169,8 +1175,7 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)cancel_work_sync (&sinfo->task);exit_backlight (sinfo); -if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (0 ); +atmel_lcdfb_power_control (sinfo,0 );unregister_framebuffer (info);atmel_lcdfb_stop_clock (sinfo);clk_put (sinfo->lcdc_clk);
@@ -1198,7 +1203,6 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg) {struct fb_info *info =platform_get_drvdata (pdev);struct atmel_lcdfb_info *sinfo = info->par; -struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;/* * We don't want to handle interrupts while the clock is
@@ -1208,9 +1212,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg) sinfo->saved_lcdcon =lcdc_readl (sinfo,ATMEL_LCDC_CONTRAST_CTR );lcdc_writel (sinfo,ATMEL_LCDC_CONTRAST_CTR ,0 ); -if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (0 ); - +atmel_lcdfb_power_control (sinfo,0 );atmel_lcdfb_stop (sinfo);atmel_lcdfb_stop_clock (sinfo);
@@ -1221,12 +1223,10 @@ static int atmel_lcdfb_resume(struct platform_device *pdev) {struct fb_info *info =platform_get_drvdata (pdev);struct atmel_lcdfb_info *sinfo = info->par; -struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;atmel_lcdfb_start_clock (sinfo);atmel_lcdfb_start (sinfo); -if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (1 ); +atmel_lcdfb_power_control (sinfo,1 );lcdc_writel (sinfo,ATMEL_LCDC_CONTRAST_CTR , sinfo->saved_lcdcon);/* Enable FIFO & DMA errors */
Signature · 1 line
1.7.10.4
PATCH 2/8 video: atmel_lcdfb: introduce atmel_lcdfb_power_control
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 5 lines
to simplify the check on the presence of the callback
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>
Simple and nice
Quoted 77 lines
Cc Andrew Morton <[email protected]>--- drivers/video/atmel_lcdfb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)drivers/video/atmel_lcdfb.c +11
-11@@ -283,6 +283,13 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo)init_backlight (sinfo); } +static inline void atmel_lcdfb_power_control (struct atmel_lcdfb_info *sinfo,int on) +{ +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; + +if (pdata->atmel_lcdfb_power_control) + pdata->atmel_lcdfb_power_control (on); +}static struct fb_fix_screeninfo atmel_lcdfb_fix__initdata = { .type =FB_TYPE_PACKED_PIXELS ,@@ -1114,8 +1121,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)fb_add_videomode (&fbmode, &info->modelist);/* Power up the LCDC screen */ -if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (1 ); +atmel_lcdfb_power_control (sinfo,1 );dev_info (dev,"fb%d: Atmel LCDC at 0x%08lx (mapped at %p), irq %d\n" , info->node, info->fix.mmio_start, sinfo->mmio, sinfo->irq_base);@@ -1169,8 +1175,7 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)cancel_work_sync (&sinfo->task);exit_backlight (sinfo); -if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (0 ); +atmel_lcdfb_power_control (sinfo,0 );unregister_framebuffer (info);atmel_lcdfb_stop_clock (sinfo);clk_put (sinfo->lcdc_clk);@@ -1198,7 +1203,6 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg) {struct fb_info *info =platform_get_drvdata (pdev);struct atmel_lcdfb_info *sinfo = info->par; -struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;/* * We don't want to handle interrupts while the clock is @@ -1208,9 +1212,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg) sinfo->saved_lcdcon =lcdc_readl (sinfo,ATMEL_LCDC_CONTRAST_CTR );lcdc_writel (sinfo,ATMEL_LCDC_CONTRAST_CTR ,0 ); -if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (0 ); - +atmel_lcdfb_power_control (sinfo,0 );atmel_lcdfb_stop (sinfo);atmel_lcdfb_stop_clock (sinfo);@@ -1221,12 +1223,10 @@ static int atmel_lcdfb_resume(struct platform_device *pdev) {struct fb_info *info =platform_get_drvdata (pdev);struct atmel_lcdfb_info *sinfo = info->par; -struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;atmel_lcdfb_start_clock (sinfo);atmel_lcdfb_start (sinfo); -if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (1 ); +atmel_lcdfb_power_control (sinfo,1 );lcdc_writel (sinfo,ATMEL_LCDC_CONTRAST_CTR , sinfo->saved_lcdcon);/* Enable FIFO & DMA errors */
Signature · 1 line
Nicolas Ferre
PATCH 3/8 video: atmel_lcdfb: pass the pdata as params
In reply to Jean-Christophe PLAGNIOL-VILLARDso we can use have list gpio as example (probe via DT)
--- arch/arm/mach-at91/board-sam9261ek.c | 4 ++-- arch/arm/mach-at91/board-sam9263ek.c | 2 +- arch/arm/mach-at91/board-sam9rlek.c | 2 +- arch/avr32/boards/atngw100/evklcd10x.c | 2 +- drivers/video/atmel_lcdfb.c | 2 +- include/video/atmel_lcdc.h | 4 +++- 6 files changed, 9 insertions(+), 7 deletions(-)
arch/arm/mach-at91/board-sam9261ek.c +2 -2
@@ -393,7 +393,7 @@ static struct fb_monspecs at91fb_default_stn_monspecs = { | ATMEL_LCDC_IFWIDTH_4 \ | ATMEL_LCDC_SCANMOD_SINGLE) -static void at91_lcdc_stn_power_control (int on) +static void at91_lcdc_stn_power_control (struct atmel_lcdfb_pdata *pdata,int on) {/* backlight */ if (on) {/* power up */
@@ -452,7 +452,7 @@ static struct fb_monspecs at91fb_default_tft_monspecs = { | ATMEL_LCDC_DISTYPE_TFT \ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) -static void at91_lcdc_tft_power_control (int on) +static void at91_lcdc_tft_power_control (struct atmel_lcdfb_pdata *pdata,int on) {if (on)at91_set_gpio_value (AT91_PIN_PA12 ,0 );/* power up */
arch/arm/mach-at91/board-sam9263ek.c +1 -1
@@ -275,7 +275,7 @@ static struct fb_monspecs at91fb_default_monspecs = { | ATMEL_LCDC_DISTYPE_TFT \ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) -static void at91_lcdc_power_control (int on) +static void at91_lcdc_power_control (struct atmel_lcdfb_pdata *pdata,int on) {at91_set_gpio_value (AT91_PIN_PA30 , on); }
arch/arm/mach-at91/board-sam9rlek.c +1 -1
@@ -170,7 +170,7 @@ static struct fb_monspecs at91fb_default_monspecs = { | ATMEL_LCDC_DISTYPE_TFT \ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) -static void at91_lcdc_power_control (int on) +static void at91_lcdc_power_control (struct atmel_lcdfb_pdata *pdata,int on) {if (on)at91_set_gpio_value (AT91_PIN_PC1 ,0 );/* power up */
arch/avr32/boards/atngw100/evklcd10x.c +1 -1
@@ -145,7 +145,7 @@ static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { };#endif -static void atevklcd10x_lcdc_power_control (int on) +static void atevklcd10x_lcdc_power_control (struct atmel_lcdfb_pdata *pdata,int on) {gpio_set_value (GPIO_PIN_PB (15 ), on); }
drivers/video/atmel_lcdfb.c +1 -1
@@ -288,7 +288,7 @@ static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, intstruct atmel_lcdfb_pdata *pdata = &sinfo->pdata;if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (on); + pdata->atmel_lcdfb_power_control (pdata, on); }static struct fb_fix_screeninfo atmel_lcdfb_fix__initdata = {
include/video/atmel_lcdc.h +3 -1
@@ -40,8 +40,10 @@ struct atmel_lcdfb_pdata {u8 lcd_wiring_mode;unsigned int default_lcdcon2;unsigned int default_dmacon; -void (*atmel_lcdfb_power_control)(int on); +void (*atmel_lcdfb_power_control)(struct atmel_lcdfb_pdata *pdata,int on);struct fb_monspecs *default_monspecs; + +struct list_head pwr_gpios; };#define ATMEL_LCDC_DMABADDR1 0x00
Signature · 1 line
1.7.10.4
PATCH 3/8 video: atmel_lcdfb: pass the pdata as params
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 1 line
so we can use have list gpio as example (probe via DT)
Please refine the commit message: I do not understand.
After reading the patch, it seems obvious that more explanations are needed in the message.
Quoted 104 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>--- arch/arm/mach-at91/board-sam9261ek.c | 4 ++-- arch/arm/mach-at91/board-sam9263ek.c | 2 +- arch/arm/mach-at91/board-sam9rlek.c | 2 +- arch/avr32/boards/atngw100/evklcd10x.c | 2 +- drivers/video/atmel_lcdfb.c | 2 +- include/video/atmel_lcdc.h | 4 +++- 6 files changed, 9 insertions(+), 7 deletions(-)arch/arm/mach-at91/board-sam9261ek.c +2
-2@@ -393,7 +393,7 @@ static struct fb_monspecs at91fb_default_stn_monspecs = { | ATMEL_LCDC_IFWIDTH_4 \ | ATMEL_LCDC_SCANMOD_SINGLE) -static void at91_lcdc_stn_power_control (int on) +static void at91_lcdc_stn_power_control (struct atmel_lcdfb_pdata *pdata,int on) {/* backlight */ if (on) {/* power up */ @@ -452,7 +452,7 @@ static struct fb_monspecs at91fb_default_tft_monspecs = { | ATMEL_LCDC_DISTYPE_TFT \ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) -static void at91_lcdc_tft_power_control (int on) +static void at91_lcdc_tft_power_control (struct atmel_lcdfb_pdata *pdata,int on) {if (on)at91_set_gpio_value (AT91_PIN_PA12 ,0 );/* power up */ arch/arm/mach-at91/board-sam9263ek.c +1
-1@@ -275,7 +275,7 @@ static struct fb_monspecs at91fb_default_monspecs = { | ATMEL_LCDC_DISTYPE_TFT \ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) -static void at91_lcdc_power_control (int on) +static void at91_lcdc_power_control (struct atmel_lcdfb_pdata *pdata,int on) {at91_set_gpio_value (AT91_PIN_PA30 , on); }arch/arm/mach-at91/board-sam9rlek.c +1
-1@@ -170,7 +170,7 @@ static struct fb_monspecs at91fb_default_monspecs = { | ATMEL_LCDC_DISTYPE_TFT \ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) -static void at91_lcdc_power_control (int on) +static void at91_lcdc_power_control (struct atmel_lcdfb_pdata *pdata,int on) {if (on)at91_set_gpio_value (AT91_PIN_PC1 ,0 );/* power up */ arch/avr32/boards/atngw100/evklcd10x.c +1
-1@@ -145,7 +145,7 @@ static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { };#endif -static void atevklcd10x_lcdc_power_control (int on) +static void atevklcd10x_lcdc_power_control (struct atmel_lcdfb_pdata *pdata,int on) {gpio_set_value (GPIO_PIN_PB (15 ), on); }drivers/video/atmel_lcdfb.c +1
-1@@ -288,7 +288,7 @@ static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, intstruct atmel_lcdfb_pdata *pdata = &sinfo->pdata;if (pdata->atmel_lcdfb_power_control) - pdata->atmel_lcdfb_power_control (on); + pdata->atmel_lcdfb_power_control (pdata, on); }static struct fb_fix_screeninfo atmel_lcdfb_fix__initdata = {include/video/atmel_lcdc.h +3
-1@@ -40,8 +40,10 @@ struct atmel_lcdfb_pdata {u8 lcd_wiring_mode;unsigned int default_lcdcon2;unsigned int default_dmacon; -void (*atmel_lcdfb_power_control)(int on); +void (*atmel_lcdfb_power_control)(struct atmel_lcdfb_pdata *pdata,int on);struct fb_monspecs *default_monspecs; + +struct list_head pwr_gpios; };#define ATMEL_LCDC_DMABADDR1 0x00
Signature · 1 line
Nicolas Ferre
PATCH 4/8 video: atmel_lcdfb: add device tree suport
In reply to Jean-Christophe PLAGNIOL-VILLARDget display timings from device tree
Use videomode helpers to get display timings and configurations from device tree
--- .../devicetree/bindings/video/atmel,lcdc.txt | 75 ++++++ drivers/video/Kconfig | 2 + drivers/video/atmel_lcdfb.c | 244 +++++++++++++++++--- 3 files changed, 289 insertions(+), 32 deletions(-) create mode 100644 Documentation/devicetree/bindings/video/atmel,lcdc.txt
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +75 -0
@@ -0,0 +1,75 @@ +Atmel LCDC Framebuffer +----------------------------------------------------- + +Required properties: +- compatible : + "atmel,at91sam9261-lcdc" , + "atmel,at91sam9263-lcdc" , + "atmel,at91sam9g10-lcdc" , + "atmel,at91sam9g45-lcdc" , + "atmel,at91sam9g45es-lcdc" , + "atmel,at91sam9rl-lcdc" , + "atmel,at32ap-lcdc" +- reg : Should contain 1 register ranges(address and length) +- interrupts : framebuffer controller interrupt +- display: a phandle pointing to the display node + +Required nodes: +- display: a display node is required to initialize the lcd panel + This should be in the board dts. +- default-mode: a videomode within the display with timing parameters + as specified below. + +Example: + + fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9g45-lcdc"; + reg = <0x00500000 0x1000>; + interrupts = <23 3 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + display = <&display0>; + status = "okay"; + #address-cells = <1>; + #size-cells = <1>; + + }; + +Atmel LCDC Display +----------------------------------------------------- +Required properties (as per of_videomode_helper): + + - atmel,dmacon: dma controler configuration + - atmel,lcdcon2: lcd controler configuration + - atmel,guard-time: lcd guard time (Delay in frame periods) + - bits-per-pixel: lcd panel bit-depth. + +Optional properties (as per of_videomode_helper): + - atmel,lcdcon-backlight: enable backlight + - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG" + - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed) + +Example: + display0: display { + bits-per-pixel = <32>; + atmel,lcdcon-backlight; + atmel,dmacon = <0x1>; + atmel,lcdcon2 = <0x80008002>; + atmel,guard-time = <9>; + atmel,lcd-wiring-mode = <1>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hback-porch = <1>; + hfront-porch = <1>; + vback-porch = <40>; + vfront-porch = <1>; + hsync-len = <45>; + vsync-len = <1>; + }; + }; + };
drivers/video/Kconfig +2 -0
@@ -1018,6 +1018,8 @@ config FB_ATMEL select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_MODE_HELPERS + select OF_VIDEOMODE help This enables support for the AT91/AT32 LCD Controller.
drivers/video/atmel_lcdfb.c +212 -32
320 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 4/8 video: atmel_lcdfb: add device tree suport
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 3 lines
get display timings from device tree
Use videomode helpers to get display timings and configurations from device tree
2 sentences? Simply elaborate the 2nd one and it will be good.
Documentation/devicetree/bindings/video/atmel,lcdc.txt
Quoted 16 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>--- .../devicetree/bindings/video/atmel,lcdc.txt | 75 ++++++ drivers/video/Kconfig | 2 + drivers/video/atmel_lcdfb.c | 244 +++++++++++++++++--- 3 files changed, 289 insertions(+), 32 deletions(-) create mode 100644 Documentation/devicetree/bindings/video/atmel,lcdc.txtDocumentation/devicetree/bindings/video/atmel,lcdc.txt new file +0
-0
Why lcdc? I would have preferred atmel,lcdfb, like the driver's name: it is even more self-explanatory...
Quoted 31 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +30
-0@@ -0,0 +1,75 @@ +Atmel LCDC Framebuffer +----------------------------------------------------- + +Required properties: +- compatible : + "atmel,at91sam9261-lcdc" , + "atmel,at91sam9263-lcdc" , + "atmel,at91sam9g10-lcdc" , + "atmel,at91sam9g45-lcdc" , + "atmel,at91sam9g45es-lcdc" , + "atmel,at91sam9rl-lcdc" , + "atmel,at32ap-lcdc" +- reg : Should contain 1 register ranges(address and length) +- interrupts : framebuffer controller interrupt +- display: a phandle pointing to the display node + +Required nodes: +- display: a display node is required to initialize the lcd panel + This should be in the board dts. +- default-mode: a videomode within the display with timing parameters + as specified below. + +Example: + + fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9g45-lcdc"; + reg = <0x00500000 0x1000>; + interrupts = <23 3 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>;
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 40
Quoted 10 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +10
-0+ display = <&display0>; + status = "okay"; + #address-cells = <1>; + #size-cells = <1>; + + }; + +Atmel LCDC Display +----------------------------------------------------- +Required properties (as per of_videomode_helper):
Can you please point somewhere to the documentation:Documentation/devicetree/bindings/video/display-timing.txt
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 42
Quoted 1 line
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +1
-0+ - atmel,dmacon: dma controler configuration
Typo: controller.
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 43
Quoted 1 line
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +1
-0+ - atmel,lcdcon2: lcd controler configuration
Ditto
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 44
Quoted 1 line
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +1
-0+ - atmel,guard-time: lcd guard time (Delay in frame periods)
periods -> period, no?
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 49
Quoted 5 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +5
-0+ - bits-per-pixel: lcd panel bit-depth. + +Optional properties (as per of_videomode_helper): + - atmel,lcdcon-backlight: enable backlight + - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
Is it a sting, or a number (as seen below)? If it is a number, please tell how to choose the index.
Quoted 44 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +26
-0+ - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed) + +Example: + display0: display { + bits-per-pixel = <32>; + atmel,lcdcon-backlight; + atmel,dmacon = <0x1>; + atmel,lcdcon2 = <0x80008002>; + atmel,guard-time = <9>; + atmel,lcd-wiring-mode = <1>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hback-porch = <1>; + hfront-porch = <1>; + vback-porch = <40>; + vfront-porch = <1>; + hsync-len = <45>; + vsync-len = <1>; + }; + }; + };drivers/video/Kconfig +2
-0@@ -1018,6 +1018,8 @@ config FB_ATMEL select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_MODE_HELPERS + select OF_VIDEOMODE help This enables support for the AT91/AT32 LCD Controller.drivers/video/atmel_lcdfb.c +0
-0
drivers/video/atmel_lcdfb.c line 26
Quoted 7 lines
drivers/video/atmel_lcdfb.c +3
-0@@ -20,7 +20,11 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/of_gpio.h> #include <video/of_display_timing.h>
As said in patch 1/8, this one belongs to this 4/8 patch.
Quoted 73 lines
drivers/video/atmel_lcdfb.c +59
-0+#include <video/videomode.h> #include <mach/cpu.h> #include <asm/gpio.h> @@ -59,6 +63,13 @@ struct atmel_lcdfb_info {struct atmel_lcdfb_config *config; }; +struct atmel_lcdfb_power_ctrl_gpio { +int gpio; +int active_low; + +struct list_head list; +}; +#define lcdc_readl (sinfo, reg) __raw_readl((sinfo)->mmio+(reg))#define lcdc_writel (sinfo, reg, val) __raw_writel((val), (sinfo)->mmio+(reg))@@ -945,16 +956,187 @@ static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)clk_disable (sinfo->lcdc_clk); } +#ifdef CONFIG_OF +static const struct of_device_id atmel_lcdfb_dt_ids[] = { + { .compatible ="atmel,at91sam9261-lcdc" , .data = &at91sam9261_config, }, + { .compatible ="atmel,at91sam9263-lcdc" , .data = &at91sam9263_config, }, + { .compatible ="atmel,at91sam9g10-lcdc" , .data = &at91sam9g10_config, }, + { .compatible ="atmel,at91sam9g45-lcdc" , .data = &at91sam9g45_config, }, + { .compatible ="atmel,at91sam9g45es-lcdc" , .data = &at91sam9g45es_config, }, + { .compatible ="atmel,at91sam9rl-lcdc" , .data = &at91sam9rl_config, }, + { .compatible ="atmel,at32ap-lcdc" , .data = &at32ap_config, }, + {/* sentinel */ } +}; + +MODULE_DEVICE_TABLE (of, atmel_lcdfb_dt_ids); + +static const char *atmel_lcdfb_wiring_modes[] = { + [ATMEL_LCDC_WIRING_BGR ] ="BRG" , + [ATMEL_LCDC_WIRING_RGB ] ="RGB" , +}; + +const int atmel_lcdfb_get_of_wiring_modes (struct device_node *np) +{ +const char *mode; +int err, i; + + err =of_property_read_string (np,"atmel,lcd-wiring-mode" , &mode); +if (err <0 ) +return ATMEL_LCDC_WIRING_BGR ; + +for (i =0 ; i <ARRAY_SIZE (atmel_lcdfb_wiring_modes); i++) +if (!strcasecmp (mode, atmel_lcdfb_wiring_modes[i])) +return i; + +return -ENODEV ; +} + +static void atmel_lcdfb_power_control_gpio (struct atmel_lcdfb_pdata *pdata,int on) +{ +struct atmel_lcdfb_power_ctrl_gpio *og; + +list_for_each_entry (og, &pdata->pwr_gpios, list) +gpio_set_value (og->gpio, on); +} + +static int atmel_lcdfb_of_init (struct atmel_lcdfb_info *sinfo) +{ +struct fb_info *info = sinfo->info; +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; +struct fb_var_screeninfo *var = &info->var; +struct device *dev = &sinfo->pdev->dev; +struct device_node *np =dev->of_node; +struct device_node *display_np;
drivers/video/atmel_lcdfb.c static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo) · line 1019
Quoted 10 lines
drivers/video/atmel_lcdfb.c +10
-0+struct device_node *timings_np; +struct display_timings *timings; +enum of_gpio_flags flags; +struct atmel_lcdfb_power_ctrl_gpio *og; +bool is_gpio_power = false; +int ret = -ENOENT ; +int i, gpio; + + sinfo->config = (struct atmel_lcdfb_config *) +of_match_device (atmel_lcdfb_dt_ids, dev)->data;
Please split it in 2 steps, otherwise the day that the drivers doesn't find the device in dt_ids table, it hangs here with an Oops.
Quoted 18 lines
drivers/video/atmel_lcdfb.c +18
-0+ + display_np =of_parse_phandle (np,"display" ,0 ); +if (!display_np) { +dev_err (dev,"failed to find display phandle\n" ); +return -ENOENT ; + } + + ret =of_property_read_u32 (display_np,"bits-per-pixel" , &var->bits_per_pixel); +if (ret <0 ) { +dev_err (dev,"failed to get property bits-per-pixel\n" ); + goto put_display_node; + } + + ret =of_property_read_u32 (display_np,"atmel,guard-time" , &pdata->guard_time); +if (ret <0 ) { +dev_err (dev,"failed to get property atmel,guard-time\n" ); + goto put_display_node; + }
drivers/video/atmel_lcdfb.c static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo) · line 1047
Quoted 10 lines
drivers/video/atmel_lcdfb.c +10
-0+ + ret =of_property_read_u32 (display_np,"atmel,lcdcon2" , &pdata->default_lcdcon2); +if (ret <0 ) { +dev_err (dev,"failed to get property atmel,lcdcon2\n" ); + goto put_display_node; + } + + ret =of_property_read_u32 (display_np,"atmel,dmacon" , &pdata->default_dmacon); +if (ret <0 ) { +dev_err (dev,"failed to get property bits-per-pixel\n" );
No, wrong error message.
Quoted 212 lines
drivers/video/atmel_lcdfb.c +112
-32+ goto put_display_node; + } + + ret = -ENOMEM ; +for (i =0 ; i <of_gpio_named_count (display_np,"atmel,power-control-gpio" ); i++) { + gpio =of_get_named_gpio_flags (display_np,"atmel,power-control-gpio" , + i, &flags); +if (gpio <0 ) +continue ; + + og =devm_kzalloc (dev,sizeof (*og),GFP_KERNEL ); +if (!og) + goto put_display_node; + + og->gpio = gpio; + og->active_low = flags &OF_GPIO_ACTIVE_LOW ; + is_gpio_power = true; + ret =devm_gpio_request (dev, gpio,"lcd-power-control-gpio" ); +if (ret) { +dev_err (dev,"request gpio %d failed\n" , gpio); + goto put_display_node; + } + + ret =gpio_direction_output (gpio, og->active_low); +if (ret) { +dev_err (dev,"set direction output gpio %d failed\n" , gpio); + goto put_display_node; + } + } + +if (is_gpio_power) + pdata->atmel_lcdfb_power_control = atmel_lcdfb_power_control_gpio; + + ret =atmel_lcdfb_get_of_wiring_modes (display_np); +if (ret <0 ) { +dev_err (dev,"invalid atmel,lcd-wiring-mode\n" ); + goto put_display_node; + } + pdata->lcd_wiring_mode = ret; + + pdata->lcdcon_is_backlight =of_property_read_bool (display_np,"atmel,lcdcon-backlight" ); + + timings =of_get_display_timings (display_np); +if (!timings) { +dev_err (dev,"failed to get display timings\n" ); + goto put_display_node; + } + + timings_np =of_find_node_by_name (display_np,"display-timings" ); +if (!timings_np) { +dev_err (dev,"failed to find display-timings node\n" ); + goto put_display_node; + } + +for (i =0 ; i <of_get_child_count (timings_np); i++) { +struct videomode vm; +struct fb_videomode fb_vm; + + ret =videomode_from_timing (timings, &vm, i); +if (ret <0 ) + goto put_timings_node; + ret =fb_videomode_from_videomode (&vm, &fb_vm); +if (ret <0 ) + goto put_timings_node; + +fb_add_videomode (&fb_vm, &info->modelist); + } + +return 0 ; + +put_timings_node: +of_node_put (timings_np); +put_display_node: +of_node_put (display_np); +return ret; +} +#else +static int atmel_lcdfb_of_init (struct atmel_lcdfb_info *sinfo) +{ +return 0 ; +} +#endif static int __init atmel_lcdfb_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct fb_info *info;struct atmel_lcdfb_info *sinfo; -struct atmel_lcdfb_pdata *pdata; -struct fb_videomode fbmode; +struct atmel_lcdfb_pdata *pdata =NULL ;struct resource *regs =NULL ;struct resource *map =NULL ; +struct fb_modelist *modelist;int ret;dev_dbg (dev,"%s BEGIN\n" , __func__);@@ -967,17 +1149,35 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) } sinfo = info->par; + sinfo->pdev = pdev; + sinfo->info = info; + +INIT_LIST_HEAD (&info->modelist); -if (dev->platform_data) { - pdata = (struct atmel_lcdfb_pdata *)dev->platform_data; +if (pdev->dev.of_node) { + ret =atmel_lcdfb_of_init (sinfo); +if (ret) + goto free_info; + }else if (dev->platform_data) { +struct fb_monspecs *monspecs; +int i; + + pdata = dev->platform_data; + monspecs = pdata->default_monspecs; sinfo->pdata = *pdata; + +for (i =0 ; i < monspecs->modedb_len; i++) +fb_add_videomode (&monspecs->modedb[i], &info->modelist); + + sinfo->config =atmel_lcdfb_get_config (pdev); + + info->var.bits_per_pixel = pdata->default_bpp ? pdata->default_bpp :16 ; +memcpy (&info->monspecs, pdata->default_monspecs,sizeof (info->monspecs)); }else {dev_err (dev,"cannot get default configuration\n" ); goto free_info; } - sinfo->info = info; - sinfo->pdev = pdev; - sinfo->config =atmel_lcdfb_get_config (pdev); +if (!sinfo->config) goto free_info;@@ -986,7 +1186,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) info->pseudo_palette = sinfo->pseudo_palette; info->fbops = &atmel_lcdfb_ops; -memcpy (&info->monspecs, pdata->default_monspecs,sizeof (info->monspecs)); info->fix = atmel_lcdfb_fix;/* Enable LCDC Clocks */ @@ -1002,14 +1201,11 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) }atmel_lcdfb_start_clock (sinfo); - ret =fb_find_mode (&info->var, info,NULL , info->monspecs.modedb, - info->monspecs.modedb_len, info->monspecs.modedb, - pdata->default_bpp); -if (!ret) { -dev_err (dev,"no suitable video mode found\n" ); - goto stop_clk; - } + modelist =list_first_entry (&info->modelist, + struct fb_modelist, list); +fb_videomode_to_var (&info->var, &modelist->mode); +atmel_lcdfb_check_var (&info->var, info); regs =platform_get_resource (pdev,IORESOURCE_MEM ,0 );if (!regs) {@@ -1093,18 +1289,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) goto unregister_irqs; } -/* -* This makes sure that our colour bitfield -* descriptors are correctly initialised. -*/ -atmel_lcdfb_check_var (&info->var, info); - - ret =fb_set_var (info, &info->var); -if (ret) { -dev_warn (dev,"unable to set display parameters\n" ); - goto free_cmap; - } -dev_set_drvdata (dev, info);/* @@ -1116,10 +1300,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) goto reset_drvdata; } -/* add selected videomode to modelist */ -fb_var_to_videomode (&fbmode, &info->var); -fb_add_videomode (&fbmode, &info->modelist); -/* Power up the LCDC screen */ atmel_lcdfb_power_control (sinfo,1 );@@ -1130,7 +1310,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) reset_drvdata:dev_set_drvdata (dev,NULL ); -free_cmap:fb_dealloc_cmap (&info->cmap); unregister_irqs:cancel_work_sync (&sinfo->task);@@ -1249,6 +1428,7 @@ static struct platform_driver atmel_lcdfb_driver = { .driver = { .name = "atmel_lcdfb", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(atmel_lcdfb_dt_ids), }, };
Signature · 1 line
Nicolas Ferre
PATCH 4/8 video: atmel_lcdfb: add device tree suport
Quoted 18 lines · Nicolas Ferre
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 3 lines
get display timings from device tree
Use videomode helpers to get display timings and configurations from device tree2 sentences? Simply elaborate the 2nd one and it will be good.
Quoted 11 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>--- .../devicetree/bindings/video/atmel,lcdc.txt | 75 ++++++ drivers/video/Kconfig | 2 + drivers/video/atmel_lcdfb.c | 244 +++++++++++++++++--- 3 files changed, 289 insertions(+), 32 deletions(-) create mode 100644 Documentation/devicetree/bindings/video/atmel,lcdc.txt
Quoted 8 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt
Quoted 5 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +0
-0Why lcdc? I would have preferred atmel,lcdfb, like the driver's name: it is even more self-explanatory...
we do not describe drivers but IP
Quoted 50 lines
Quoted 32 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +30
-0@@ -0,0 +1,75 @@ +Atmel LCDC Framebuffer +----------------------------------------------------- + +Required properties: +- compatible : + "atmel,at91sam9261-lcdc" , + "atmel,at91sam9263-lcdc" , + "atmel,at91sam9g10-lcdc" , + "atmel,at91sam9g45-lcdc" , + "atmel,at91sam9g45es-lcdc" , + "atmel,at91sam9rl-lcdc" , + "atmel,at32ap-lcdc" +- reg : Should contain 1 register ranges(address and length) +- interrupts : framebuffer controller interrupt +- display: a phandle pointing to the display node + +Required nodes: +- display: a display node is required to initialize the lcd panel + This should be in the board dts. +- default-mode: a videomode within the display with timing parameters + as specified below. + +Example: + + fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9g45-lcdc"; + reg = <0x00500000 0x1000>; + interrupts = <23 3 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>;Documentation/devicetree/bindings/video/atmel,lcdc.txt line 40
Quoted 10 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +10
-0+ display = <&display0>; + status = "okay"; + #address-cells = <1>; + #size-cells = <1>; + + }; + +Atmel LCDC Display +----------------------------------------------------- +Required properties (as per of_videomode_helper):Can you please point somewhere to the documentation:
Documentation/devicetree/bindings/video/display-timing.txtDocumentation/devicetree/bindings/video/atmel,lcdc.txt line 42
Quoted 1 line
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +1
-0+ - atmel,dmacon: dma controler configurationTypo: controller.
Quoted 7 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 43
Quoted 1 line
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +1
-0+ - atmel,lcdcon2: lcd controler configurationDitto
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 44
Quoted 1 line
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +1
-0+ - atmel,guard-time: lcd guard time (Delay in frame periods)periods -> period, no?
no it's periods even in the datasheet
Quoted 9 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 49
Quoted 6 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +5
-0+ - bits-per-pixel: lcd panel bit-depth. + +Optional properties (as per of_videomode_helper): + - atmel,lcdcon-backlight: enable backlight + - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"Is it a sting, or a number (as seen below)? If it is a number, please tell how to choose the index.
String
Quoted 134 lines
Quoted 46 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +26
-0+ - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed) + +Example: + display0: display { + bits-per-pixel = <32>; + atmel,lcdcon-backlight; + atmel,dmacon = <0x1>; + atmel,lcdcon2 = <0x80008002>; + atmel,guard-time = <9>; + atmel,lcd-wiring-mode = <1>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hback-porch = <1>; + hfront-porch = <1>; + vback-porch = <40>; + vfront-porch = <1>; + hsync-len = <45>; + vsync-len = <1>; + }; + }; + };drivers/video/Kconfig +2
-0@@ -1018,6 +1018,8 @@ config FB_ATMEL select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_MODE_HELPERS + select OF_VIDEOMODE help This enables support for the AT91/AT32 LCD Controller.drivers/video/atmel_lcdfb.c +0
-0drivers/video/atmel_lcdfb.c line 26
Quoted 7 lines
drivers/video/atmel_lcdfb.c +3
-0@@ -20,7 +20,11 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/of_gpio.h> #include <video/of_display_timing.h> As said in patch 1/8, this one belongs to this 4/8 patch.
Quoted 78 lines
drivers/video/atmel_lcdfb.c +64
-0+#include <video/videomode.h> #include <mach/cpu.h> #include <asm/gpio.h> @@ -59,6 +63,13 @@ struct atmel_lcdfb_info {struct atmel_lcdfb_config *config; }; +struct atmel_lcdfb_power_ctrl_gpio { +int gpio; +int active_low; + +struct list_head list; +}; +#define lcdc_readl (sinfo, reg) __raw_readl((sinfo)->mmio+(reg))#define lcdc_writel (sinfo, reg, val) __raw_writel((val), (sinfo)->mmio+(reg))@@ -945,16 +956,187 @@ static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)clk_disable (sinfo->lcdc_clk); } +#ifdef CONFIG_OF +static const struct of_device_id atmel_lcdfb_dt_ids[] = { + { .compatible ="atmel,at91sam9261-lcdc" , .data = &at91sam9261_config, }, + { .compatible ="atmel,at91sam9263-lcdc" , .data = &at91sam9263_config, }, + { .compatible ="atmel,at91sam9g10-lcdc" , .data = &at91sam9g10_config, }, + { .compatible ="atmel,at91sam9g45-lcdc" , .data = &at91sam9g45_config, }, + { .compatible ="atmel,at91sam9g45es-lcdc" , .data = &at91sam9g45es_config, }, + { .compatible ="atmel,at91sam9rl-lcdc" , .data = &at91sam9rl_config, }, + { .compatible ="atmel,at32ap-lcdc" , .data = &at32ap_config, }, + {/* sentinel */ } +}; + +MODULE_DEVICE_TABLE (of, atmel_lcdfb_dt_ids); + +static const char *atmel_lcdfb_wiring_modes[] = { + [ATMEL_LCDC_WIRING_BGR ] ="BRG" , + [ATMEL_LCDC_WIRING_RGB ] ="RGB" , +}; + +const int atmel_lcdfb_get_of_wiring_modes (struct device_node *np) +{ +const char *mode; +int err, i; + + err =of_property_read_string (np,"atmel,lcd-wiring-mode" , &mode); +if (err <0 ) +return ATMEL_LCDC_WIRING_BGR ; + +for (i =0 ; i <ARRAY_SIZE (atmel_lcdfb_wiring_modes); i++) +if (!strcasecmp (mode, atmel_lcdfb_wiring_modes[i])) +return i; + +return -ENODEV ; +} + +static void atmel_lcdfb_power_control_gpio (struct atmel_lcdfb_pdata *pdata,int on) +{ +struct atmel_lcdfb_power_ctrl_gpio *og; + +list_for_each_entry (og, &pdata->pwr_gpios, list) +gpio_set_value (og->gpio, on); +} + +static int atmel_lcdfb_of_init (struct atmel_lcdfb_info *sinfo) +{ +struct fb_info *info = sinfo->info; +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; +struct fb_var_screeninfo *var = &info->var; +struct device *dev = &sinfo->pdev->dev; +struct device_node *np =dev->of_node; +struct device_node *display_np; +struct device_node *timings_np; +struct display_timings *timings; +enum of_gpio_flags flags; +struct atmel_lcdfb_power_ctrl_gpio *og; +bool is_gpio_power = false;
Quoted 8 lines
drivers/video/atmel_lcdfb.c static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo) · line 1019
Quoted 5 lines
drivers/video/atmel_lcdfb.c +5
-0+int ret = -ENOENT ; +int i, gpio; + + sinfo->config = (struct atmel_lcdfb_config *) +of_match_device (atmel_lcdfb_dt_ids, dev)->data;Please split it in 2 steps, otherwise the day that the drivers doesn't find the device in
dt_idstable, it hangs here with an Oops.
no as you will never end here in this case
Quoted 248 lines
Quoted 19 lines
drivers/video/atmel_lcdfb.c +18
-0+ + display_np =of_parse_phandle (np,"display" ,0 ); +if (!display_np) { +dev_err (dev,"failed to find display phandle\n" ); +return -ENOENT ; + } + + ret =of_property_read_u32 (display_np,"bits-per-pixel" , &var->bits_per_pixel); +if (ret <0 ) { +dev_err (dev,"failed to get property bits-per-pixel\n" ); + goto put_display_node; + } + + ret =of_property_read_u32 (display_np,"atmel,guard-time" , &pdata->guard_time); +if (ret <0 ) { +dev_err (dev,"failed to get property atmel,guard-time\n" ); + goto put_display_node; + }drivers/video/atmel_lcdfb.c static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo) · line 1047
Quoted 10 lines
drivers/video/atmel_lcdfb.c +10
-0+ + ret =of_property_read_u32 (display_np,"atmel,lcdcon2" , &pdata->default_lcdcon2); +if (ret <0 ) { +dev_err (dev,"failed to get property atmel,lcdcon2\n" ); + goto put_display_node; + } + + ret =of_property_read_u32 (display_np,"atmel,dmacon" , &pdata->default_dmacon); +if (ret <0 ) { +dev_err (dev,"failed to get property bits-per-pixel\n" );No, wrong error message.
Quoted 212 lines
drivers/video/atmel_lcdfb.c +112
-32+ goto put_display_node; + } + + ret = -ENOMEM ; +for (i =0 ; i <of_gpio_named_count (display_np,"atmel,power-control-gpio" ); i++) { + gpio =of_get_named_gpio_flags (display_np,"atmel,power-control-gpio" , + i, &flags); +if (gpio <0 ) +continue ; + + og =devm_kzalloc (dev,sizeof (*og),GFP_KERNEL ); +if (!og) + goto put_display_node; + + og->gpio = gpio; + og->active_low = flags &OF_GPIO_ACTIVE_LOW ; + is_gpio_power = true; + ret =devm_gpio_request (dev, gpio,"lcd-power-control-gpio" ); +if (ret) { +dev_err (dev,"request gpio %d failed\n" , gpio); + goto put_display_node; + } + + ret =gpio_direction_output (gpio, og->active_low); +if (ret) { +dev_err (dev,"set direction output gpio %d failed\n" , gpio); + goto put_display_node; + } + } + +if (is_gpio_power) + pdata->atmel_lcdfb_power_control = atmel_lcdfb_power_control_gpio; + + ret =atmel_lcdfb_get_of_wiring_modes (display_np); +if (ret <0 ) { +dev_err (dev,"invalid atmel,lcd-wiring-mode\n" ); + goto put_display_node; + } + pdata->lcd_wiring_mode = ret; + + pdata->lcdcon_is_backlight =of_property_read_bool (display_np,"atmel,lcdcon-backlight" ); + + timings =of_get_display_timings (display_np); +if (!timings) { +dev_err (dev,"failed to get display timings\n" ); + goto put_display_node; + } + + timings_np =of_find_node_by_name (display_np,"display-timings" ); +if (!timings_np) { +dev_err (dev,"failed to find display-timings node\n" ); + goto put_display_node; + } + +for (i =0 ; i <of_get_child_count (timings_np); i++) { +struct videomode vm; +struct fb_videomode fb_vm; + + ret =videomode_from_timing (timings, &vm, i); +if (ret <0 ) + goto put_timings_node; + ret =fb_videomode_from_videomode (&vm, &fb_vm); +if (ret <0 ) + goto put_timings_node; + +fb_add_videomode (&fb_vm, &info->modelist); + } + +return 0 ; + +put_timings_node: +of_node_put (timings_np); +put_display_node: +of_node_put (display_np); +return ret; +} +#else +static int atmel_lcdfb_of_init (struct atmel_lcdfb_info *sinfo) +{ +return 0 ; +} +#endif static int __init atmel_lcdfb_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct fb_info *info;struct atmel_lcdfb_info *sinfo; -struct atmel_lcdfb_pdata *pdata; -struct fb_videomode fbmode; +struct atmel_lcdfb_pdata *pdata =NULL ;struct resource *regs =NULL ;struct resource *map =NULL ; +struct fb_modelist *modelist;int ret;dev_dbg (dev,"%s BEGIN\n" , __func__);@@ -967,17 +1149,35 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) } sinfo = info->par; + sinfo->pdev = pdev; + sinfo->info = info; + +INIT_LIST_HEAD (&info->modelist); -if (dev->platform_data) { - pdata = (struct atmel_lcdfb_pdata *)dev->platform_data; +if (pdev->dev.of_node) { + ret =atmel_lcdfb_of_init (sinfo); +if (ret) + goto free_info; + }else if (dev->platform_data) { +struct fb_monspecs *monspecs; +int i; + + pdata = dev->platform_data; + monspecs = pdata->default_monspecs; sinfo->pdata = *pdata; + +for (i =0 ; i < monspecs->modedb_len; i++) +fb_add_videomode (&monspecs->modedb[i], &info->modelist); + + sinfo->config =atmel_lcdfb_get_config (pdev); + + info->var.bits_per_pixel = pdata->default_bpp ? pdata->default_bpp :16 ; +memcpy (&info->monspecs, pdata->default_monspecs,sizeof (info->monspecs)); }else {dev_err (dev,"cannot get default configuration\n" ); goto free_info; } - sinfo->info = info; - sinfo->pdev = pdev; - sinfo->config =atmel_lcdfb_get_config (pdev); +if (!sinfo->config) goto free_info;@@ -986,7 +1186,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) info->pseudo_palette = sinfo->pseudo_palette; info->fbops = &atmel_lcdfb_ops; -memcpy (&info->monspecs, pdata->default_monspecs,sizeof (info->monspecs)); info->fix = atmel_lcdfb_fix;/* Enable LCDC Clocks */ @@ -1002,14 +1201,11 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) }atmel_lcdfb_start_clock (sinfo); - ret =fb_find_mode (&info->var, info,NULL , info->monspecs.modedb, - info->monspecs.modedb_len, info->monspecs.modedb, - pdata->default_bpp); -if (!ret) { -dev_err (dev,"no suitable video mode found\n" ); - goto stop_clk; - } + modelist =list_first_entry (&info->modelist, + struct fb_modelist, list); +fb_videomode_to_var (&info->var, &modelist->mode); +atmel_lcdfb_check_var (&info->var, info); regs =platform_get_resource (pdev,IORESOURCE_MEM ,0 );if (!regs) {@@ -1093,18 +1289,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) goto unregister_irqs; } -/* -* This makes sure that our colour bitfield -* descriptors are correctly initialised. -*/ -atmel_lcdfb_check_var (&info->var, info); - - ret =fb_set_var (info, &info->var); -if (ret) { -dev_warn (dev,"unable to set display parameters\n" ); - goto free_cmap; - } -dev_set_drvdata (dev, info);/* @@ -1116,10 +1300,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) goto reset_drvdata; } -/* add selected videomode to modelist */ -fb_var_to_videomode (&fbmode, &info->var); -fb_add_videomode (&fbmode, &info->modelist); -/* Power up the LCDC screen */ atmel_lcdfb_power_control (sinfo,1 );@@ -1130,7 +1310,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) reset_drvdata:dev_set_drvdata (dev,NULL ); -free_cmap:fb_dealloc_cmap (&info->cmap); unregister_irqs:cancel_work_sync (&sinfo->task);@@ -1249,6 +1428,7 @@ static struct platform_driver atmel_lcdfb_driver = { .driver = { .name = "atmel_lcdfb", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(atmel_lcdfb_dt_ids), }, };Signature · 1 line
Nicolas Ferre
PATCH 4/8 video: atmel_lcdfb: add device tree suport
On 04/16/2013 03:44 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 27 lines · Nicolas Ferre
Quoted 18 lines
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 3 lines
get display timings from device tree
Use videomode helpers to get display timings and configurations from device tree2 sentences? Simply elaborate the 2nd one and it will be good.
Quoted 11 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>--- .../devicetree/bindings/video/atmel,lcdc.txt | 75 ++++++ drivers/video/Kconfig | 2 + drivers/video/atmel_lcdfb.c | 244 +++++++++++++++++--- 3 files changed, 289 insertions(+), 32 deletions(-) create mode 100644 Documentation/devicetree/bindings/video/atmel,lcdc.txtQuoted 8 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt
Quoted 5 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +0
-0Why lcdc? I would have preferred atmel,lcdfb, like the driver's name: it is even more self-explanatory...
Quoted 1 line
we do not describe drivers but IP
fine, but in
static const struct platform_device_id atmel_lcdfb_devtypes, we use "xxx-lcdfb" type...
Quoted 67 lines
Quoted 50 lines
Quoted 32 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +30
-0@@ -0,0 +1,75 @@ +Atmel LCDC Framebuffer +----------------------------------------------------- + +Required properties: +- compatible : + "atmel,at91sam9261-lcdc" , + "atmel,at91sam9263-lcdc" , + "atmel,at91sam9g10-lcdc" , + "atmel,at91sam9g45-lcdc" , + "atmel,at91sam9g45es-lcdc" , + "atmel,at91sam9rl-lcdc" , + "atmel,at32ap-lcdc" +- reg : Should contain 1 register ranges(address and length) +- interrupts : framebuffer controller interrupt +- display: a phandle pointing to the display node + +Required nodes: +- display: a display node is required to initialize the lcd panel + This should be in the board dts. +- default-mode: a videomode within the display with timing parameters + as specified below. + +Example: + + fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9g45-lcdc"; + reg = <0x00500000 0x1000>; + interrupts = <23 3 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>;Documentation/devicetree/bindings/video/atmel,lcdc.txt line 40
Quoted 10 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +10
-0+ display = <&display0>; + status = "okay"; + #address-cells = <1>; + #size-cells = <1>; + + }; + +Atmel LCDC Display +----------------------------------------------------- +Required properties (as per of_videomode_helper):Can you please point somewhere to the documentation:
Documentation/devicetree/bindings/video/display-timing.txtDocumentation/devicetree/bindings/video/atmel,lcdc.txt line 42
Quoted 1 line
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +1
-0+ - atmel,dmacon: dma controler configurationTypo: controller.
Quoted 7 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 43
Quoted 1 line
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +1
-0+ - atmel,lcdcon2: lcd controler configurationDitto
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 44
Quoted 1 line
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +1
-0+ - atmel,guard-time: lcd guard time (Delay in frame periods)periods -> period, no?
no it's periods even in the datasheet
Quoted 9 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 49
Quoted 6 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +5
-0+ - bits-per-pixel: lcd panel bit-depth. + +Optional properties (as per of_videomode_helper): + - atmel,lcdcon-backlight: enable backlight + - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"Is it a sting, or a number (as seen below)? If it is a number, please tell how to choose the index.
Quoted 1 line
String
Okay: so tell it in the description and correct the example below.
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 59
Quoted 10 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +10
-0+ - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed) + +Example: + display0: display { + bits-per-pixel = <32>; + atmel,lcdcon-backlight; + atmel,dmacon = <0x1>; + atmel,lcdcon2 = <0x80008002>; + atmel,guard-time = <9>; + atmel,lcd-wiring-mode = <1>;
Here ----------------------------------^^^^
Quoted 130 lines
Quoted 122 lines
Quoted 34 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +16
-0+ + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hback-porch = <1>; + hfront-porch = <1>; + vback-porch = <40>; + vfront-porch = <1>; + hsync-len = <45>; + vsync-len = <1>; + }; + }; + };drivers/video/Kconfig +2
-0@@ -1018,6 +1018,8 @@ config FB_ATMEL select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_MODE_HELPERS + select OF_VIDEOMODE help This enables support for the AT91/AT32 LCD Controller.drivers/video/atmel_lcdfb.c +0
-0drivers/video/atmel_lcdfb.c line 26
Quoted 7 lines
drivers/video/atmel_lcdfb.c +3
-0@@ -20,7 +20,11 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/of_gpio.h> #include <video/of_display_timing.h> As said in patch 1/8, this one belongs to this 4/8 patch.
Quoted 78 lines
drivers/video/atmel_lcdfb.c +64
-0+#include <video/videomode.h> #include <mach/cpu.h> #include <asm/gpio.h> @@ -59,6 +63,13 @@ struct atmel_lcdfb_info {struct atmel_lcdfb_config *config; }; +struct atmel_lcdfb_power_ctrl_gpio { +int gpio; +int active_low; + +struct list_head list; +}; +#define lcdc_readl (sinfo, reg) __raw_readl((sinfo)->mmio+(reg))#define lcdc_writel (sinfo, reg, val) __raw_writel((val), (sinfo)->mmio+(reg))@@ -945,16 +956,187 @@ static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)clk_disable (sinfo->lcdc_clk); } +#ifdef CONFIG_OF +static const struct of_device_id atmel_lcdfb_dt_ids[] = { + { .compatible ="atmel,at91sam9261-lcdc" , .data = &at91sam9261_config, }, + { .compatible ="atmel,at91sam9263-lcdc" , .data = &at91sam9263_config, }, + { .compatible ="atmel,at91sam9g10-lcdc" , .data = &at91sam9g10_config, }, + { .compatible ="atmel,at91sam9g45-lcdc" , .data = &at91sam9g45_config, }, + { .compatible ="atmel,at91sam9g45es-lcdc" , .data = &at91sam9g45es_config, }, + { .compatible ="atmel,at91sam9rl-lcdc" , .data = &at91sam9rl_config, }, + { .compatible ="atmel,at32ap-lcdc" , .data = &at32ap_config, }, + {/* sentinel */ } +}; + +MODULE_DEVICE_TABLE (of, atmel_lcdfb_dt_ids); + +static const char *atmel_lcdfb_wiring_modes[] = { + [ATMEL_LCDC_WIRING_BGR ] ="BRG" , + [ATMEL_LCDC_WIRING_RGB ] ="RGB" , +}; + +const int atmel_lcdfb_get_of_wiring_modes (struct device_node *np) +{ +const char *mode; +int err, i; + + err =of_property_read_string (np,"atmel,lcd-wiring-mode" , &mode); +if (err <0 ) +return ATMEL_LCDC_WIRING_BGR ; + +for (i =0 ; i <ARRAY_SIZE (atmel_lcdfb_wiring_modes); i++) +if (!strcasecmp (mode, atmel_lcdfb_wiring_modes[i])) +return i; + +return -ENODEV ; +} + +static void atmel_lcdfb_power_control_gpio (struct atmel_lcdfb_pdata *pdata,int on) +{ +struct atmel_lcdfb_power_ctrl_gpio *og; + +list_for_each_entry (og, &pdata->pwr_gpios, list) +gpio_set_value (og->gpio, on); +} + +static int atmel_lcdfb_of_init (struct atmel_lcdfb_info *sinfo) +{ +struct fb_info *info = sinfo->info; +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; +struct fb_var_screeninfo *var = &info->var; +struct device *dev = &sinfo->pdev->dev; +struct device_node *np =dev->of_node; +struct device_node *display_np; +struct device_node *timings_np; +struct display_timings *timings; +enum of_gpio_flags flags; +struct atmel_lcdfb_power_ctrl_gpio *og; +bool is_gpio_power = false;Quoted 8 lines
drivers/video/atmel_lcdfb.c static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo) · line 1019
Quoted 5 lines
drivers/video/atmel_lcdfb.c +5
-0+int ret = -ENOENT ; +int i, gpio; + + sinfo->config = (struct atmel_lcdfb_config *) +of_match_device (atmel_lcdfb_dt_ids, dev)->data;Please split it in 2 steps, otherwise the day that the drivers doesn't find the device in
dt_idstable, it hangs here with an Oops.
Quoted 1 line
no as you will never end here in this case
Ok, I see.
Quoted 250 lines
Quoted 248 lines
Quoted 19 lines
drivers/video/atmel_lcdfb.c +18
-0+ + display_np =of_parse_phandle (np,"display" ,0 ); +if (!display_np) { +dev_err (dev,"failed to find display phandle\n" ); +return -ENOENT ; + } + + ret =of_property_read_u32 (display_np,"bits-per-pixel" , &var->bits_per_pixel); +if (ret <0 ) { +dev_err (dev,"failed to get property bits-per-pixel\n" ); + goto put_display_node; + } + + ret =of_property_read_u32 (display_np,"atmel,guard-time" , &pdata->guard_time); +if (ret <0 ) { +dev_err (dev,"failed to get property atmel,guard-time\n" ); + goto put_display_node; + }drivers/video/atmel_lcdfb.c static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo) · line 1047
Quoted 10 lines
drivers/video/atmel_lcdfb.c +10
-0+ + ret =of_property_read_u32 (display_np,"atmel,lcdcon2" , &pdata->default_lcdcon2); +if (ret <0 ) { +dev_err (dev,"failed to get property atmel,lcdcon2\n" ); + goto put_display_node; + } + + ret =of_property_read_u32 (display_np,"atmel,dmacon" , &pdata->default_dmacon); +if (ret <0 ) { +dev_err (dev,"failed to get property bits-per-pixel\n" );No, wrong error message.
Quoted 212 lines
drivers/video/atmel_lcdfb.c +112
-32+ goto put_display_node; + } + + ret = -ENOMEM ; +for (i =0 ; i <of_gpio_named_count (display_np,"atmel,power-control-gpio" ); i++) { + gpio =of_get_named_gpio_flags (display_np,"atmel,power-control-gpio" , + i, &flags); +if (gpio <0 ) +continue ; + + og =devm_kzalloc (dev,sizeof (*og),GFP_KERNEL ); +if (!og) + goto put_display_node; + + og->gpio = gpio; + og->active_low = flags &OF_GPIO_ACTIVE_LOW ; + is_gpio_power = true; + ret =devm_gpio_request (dev, gpio,"lcd-power-control-gpio" ); +if (ret) { +dev_err (dev,"request gpio %d failed\n" , gpio); + goto put_display_node; + } + + ret =gpio_direction_output (gpio, og->active_low); +if (ret) { +dev_err (dev,"set direction output gpio %d failed\n" , gpio); + goto put_display_node; + } + } + +if (is_gpio_power) + pdata->atmel_lcdfb_power_control = atmel_lcdfb_power_control_gpio; + + ret =atmel_lcdfb_get_of_wiring_modes (display_np); +if (ret <0 ) { +dev_err (dev,"invalid atmel,lcd-wiring-mode\n" ); + goto put_display_node; + } + pdata->lcd_wiring_mode = ret; + + pdata->lcdcon_is_backlight =of_property_read_bool (display_np,"atmel,lcdcon-backlight" ); + + timings =of_get_display_timings (display_np); +if (!timings) { +dev_err (dev,"failed to get display timings\n" ); + goto put_display_node; + } + + timings_np =of_find_node_by_name (display_np,"display-timings" ); +if (!timings_np) { +dev_err (dev,"failed to find display-timings node\n" ); + goto put_display_node; + } + +for (i =0 ; i <of_get_child_count (timings_np); i++) { +struct videomode vm; +struct fb_videomode fb_vm; + + ret =videomode_from_timing (timings, &vm, i); +if (ret <0 ) + goto put_timings_node; + ret =fb_videomode_from_videomode (&vm, &fb_vm); +if (ret <0 ) + goto put_timings_node; + +fb_add_videomode (&fb_vm, &info->modelist); + } + +return 0 ; + +put_timings_node: +of_node_put (timings_np); +put_display_node: +of_node_put (display_np); +return ret; +} +#else +static int atmel_lcdfb_of_init (struct atmel_lcdfb_info *sinfo) +{ +return 0 ; +} +#endif static int __init atmel_lcdfb_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct fb_info *info;struct atmel_lcdfb_info *sinfo; -struct atmel_lcdfb_pdata *pdata; -struct fb_videomode fbmode; +struct atmel_lcdfb_pdata *pdata =NULL ;struct resource *regs =NULL ;struct resource *map =NULL ; +struct fb_modelist *modelist;int ret;dev_dbg (dev,"%s BEGIN\n" , __func__);@@ -967,17 +1149,35 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) } sinfo = info->par; + sinfo->pdev = pdev; + sinfo->info = info; + +INIT_LIST_HEAD (&info->modelist); -if (dev->platform_data) { - pdata = (struct atmel_lcdfb_pdata *)dev->platform_data; +if (pdev->dev.of_node) { + ret =atmel_lcdfb_of_init (sinfo); +if (ret) + goto free_info; + }else if (dev->platform_data) { +struct fb_monspecs *monspecs; +int i; + + pdata = dev->platform_data; + monspecs = pdata->default_monspecs; sinfo->pdata = *pdata; + +for (i =0 ; i < monspecs->modedb_len; i++) +fb_add_videomode (&monspecs->modedb[i], &info->modelist); + + sinfo->config =atmel_lcdfb_get_config (pdev); + + info->var.bits_per_pixel = pdata->default_bpp ? pdata->default_bpp :16 ; +memcpy (&info->monspecs, pdata->default_monspecs,sizeof (info->monspecs)); }else {dev_err (dev,"cannot get default configuration\n" ); goto free_info; } - sinfo->info = info; - sinfo->pdev = pdev; - sinfo->config =atmel_lcdfb_get_config (pdev); +if (!sinfo->config) goto free_info;@@ -986,7 +1186,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) info->pseudo_palette = sinfo->pseudo_palette; info->fbops = &atmel_lcdfb_ops; -memcpy (&info->monspecs, pdata->default_monspecs,sizeof (info->monspecs)); info->fix = atmel_lcdfb_fix;/* Enable LCDC Clocks */ @@ -1002,14 +1201,11 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) }atmel_lcdfb_start_clock (sinfo); - ret =fb_find_mode (&info->var, info,NULL , info->monspecs.modedb, - info->monspecs.modedb_len, info->monspecs.modedb, - pdata->default_bpp); -if (!ret) { -dev_err (dev,"no suitable video mode found\n" ); - goto stop_clk; - } + modelist =list_first_entry (&info->modelist, + struct fb_modelist, list); +fb_videomode_to_var (&info->var, &modelist->mode); +atmel_lcdfb_check_var (&info->var, info); regs =platform_get_resource (pdev,IORESOURCE_MEM ,0 );if (!regs) {@@ -1093,18 +1289,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) goto unregister_irqs; } -/* -* This makes sure that our colour bitfield -* descriptors are correctly initialised. -*/ -atmel_lcdfb_check_var (&info->var, info); - - ret =fb_set_var (info, &info->var); -if (ret) { -dev_warn (dev,"unable to set display parameters\n" ); - goto free_cmap; - } -dev_set_drvdata (dev, info);/* @@ -1116,10 +1300,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) goto reset_drvdata; } -/* add selected videomode to modelist */ -fb_var_to_videomode (&fbmode, &info->var); -fb_add_videomode (&fbmode, &info->modelist); -/* Power up the LCDC screen */ atmel_lcdfb_power_control (sinfo,1 );@@ -1130,7 +1310,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) reset_drvdata:dev_set_drvdata (dev,NULL ); -free_cmap:fb_dealloc_cmap (&info->cmap); unregister_irqs:cancel_work_sync (&sinfo->task);@@ -1249,6 +1428,7 @@ static struct platform_driver atmel_lcdfb_driver = { .driver = { .name = "atmel_lcdfb", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(atmel_lcdfb_dt_ids), }, };Signature · 1 line
Nicolas Ferre
Signature · 1 line
Nicolas Ferre
PATCH 4/8 video: atmel_lcdfb: add device tree suport
In reply to Jean-Christophe PLAGNIOL-VILLARD2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 61 lines
get display timings from device tree
Use videomode helpers to get display timings and configurations from device treeSigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>--- .../devicetree/bindings/video/atmel,lcdc.txt | 75 ++++++ drivers/video/Kconfig | 2 + drivers/video/atmel_lcdfb.c | 244 +++++++++++++++++--- 3 files changed, 289 insertions(+), 32 deletions(-) create mode 100644 Documentation/devicetree/bindings/video/atmel,lcdc.txtDocumentation/devicetree/bindings/video/atmel,lcdc.txt new file +40
-0@@ -0,0 +1,75 @@ +Atmel LCDC Framebuffer +----------------------------------------------------- + +Required properties: +- compatible : + "atmel,at91sam9261-lcdc" , + "atmel,at91sam9263-lcdc" , + "atmel,at91sam9g10-lcdc" , + "atmel,at91sam9g45-lcdc" , + "atmel,at91sam9g45es-lcdc" , + "atmel,at91sam9rl-lcdc" , + "atmel,at32ap-lcdc" +- reg : Should contain 1 register ranges(address and length) +- interrupts : framebuffer controller interrupt +- display: a phandle pointing to the display node + +Required nodes: +- display: a display node is required to initialize the lcd panel + This should be in the board dts. +- default-mode: a videomode within the display with timing parameters + as specified below. + +Example: + + fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9g45-lcdc"; + reg = <0x00500000 0x1000>; + interrupts = <23 3 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + display = <&display0>; + status = "okay"; + #address-cells = <1>; + #size-cells = <1>; + + }; + +Atmel LCDC Display +----------------------------------------------------- +Required properties (as per of_videomode_helper):
Documentation/devicetree/bindings/video/atmel,lcdc.txt line 50
Quoted 10 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +10
-0+ + - atmel,dmacon: dma controler configuration + - atmel,lcdcon2: lcd controler configuration + - atmel,guard-time: lcd guard time (Delay in frame periods) + - bits-per-pixel: lcd panel bit-depth. + +Optional properties (as per of_videomode_helper): + - atmel,lcdcon-backlight: enable backlight + - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG" + - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)
still on lcdcon_pol_negative, we can add something like that:
- atmel,lcdcon-pwm-pulse-low: Output PWM pulses are low level (high
level if not set)
Quoted 192 lines
Documentation/devicetree/bindings/video/atmel,lcdc.txt new file +25
-0+ +Example: + display0: display { + bits-per-pixel = <32>; + atmel,lcdcon-backlight; + atmel,dmacon = <0x1>; + atmel,lcdcon2 = <0x80008002>; + atmel,guard-time = <9>; + atmel,lcd-wiring-mode = <1>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hback-porch = <1>; + hfront-porch = <1>; + vback-porch = <40>; + vfront-porch = <1>; + hsync-len = <45>; + vsync-len = <1>; + }; + }; + };drivers/video/Kconfig +2
-0@@ -1018,6 +1018,8 @@ config FB_ATMEL select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_MODE_HELPERS + select OF_VIDEOMODE help This enables support for the AT91/AT32 LCD Controller.drivers/video/atmel_lcdfb.c +131
-0@@ -20,7 +20,11 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/of_gpio.h> #include <video/of_display_timing.h> +#include <video/videomode.h> #include <mach/cpu.h> #include <asm/gpio.h> @@ -59,6 +63,13 @@ struct atmel_lcdfb_info {struct atmel_lcdfb_config *config; }; +struct atmel_lcdfb_power_ctrl_gpio { +int gpio; +int active_low; + +struct list_head list; +}; +#define lcdc_readl (sinfo, reg) __raw_readl((sinfo)->mmio+(reg))#define lcdc_writel (sinfo, reg, val) __raw_writel((val), (sinfo)->mmio+(reg))@@ -945,16 +956,187 @@ static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)clk_disable (sinfo->lcdc_clk); } +#ifdef CONFIG_OF +static const struct of_device_id atmel_lcdfb_dt_ids[] = { + { .compatible ="atmel,at91sam9261-lcdc" , .data = &at91sam9261_config, }, + { .compatible ="atmel,at91sam9263-lcdc" , .data = &at91sam9263_config, }, + { .compatible ="atmel,at91sam9g10-lcdc" , .data = &at91sam9g10_config, }, + { .compatible ="atmel,at91sam9g45-lcdc" , .data = &at91sam9g45_config, }, + { .compatible ="atmel,at91sam9g45es-lcdc" , .data = &at91sam9g45es_config, }, + { .compatible ="atmel,at91sam9rl-lcdc" , .data = &at91sam9rl_config, }, + { .compatible ="atmel,at32ap-lcdc" , .data = &at32ap_config, }, + {/* sentinel */ } +}; + +MODULE_DEVICE_TABLE (of, atmel_lcdfb_dt_ids); + +static const char *atmel_lcdfb_wiring_modes[] = { + [ATMEL_LCDC_WIRING_BGR ] ="BRG" , + [ATMEL_LCDC_WIRING_RGB ] ="RGB" , +}; + +const int atmel_lcdfb_get_of_wiring_modes (struct device_node *np) +{ +const char *mode; +int err, i; + + err =of_property_read_string (np,"atmel,lcd-wiring-mode" , &mode); +if (err <0 ) +return ATMEL_LCDC_WIRING_BGR ; + +for (i =0 ; i <ARRAY_SIZE (atmel_lcdfb_wiring_modes); i++) +if (!strcasecmp (mode, atmel_lcdfb_wiring_modes[i])) +return i; + +return -ENODEV ; +} + +static void atmel_lcdfb_power_control_gpio (struct atmel_lcdfb_pdata *pdata,int on) +{ +struct atmel_lcdfb_power_ctrl_gpio *og; + +list_for_each_entry (og, &pdata->pwr_gpios, list) +gpio_set_value (og->gpio, on); +} + +static int atmel_lcdfb_of_init (struct atmel_lcdfb_info *sinfo) +{ +struct fb_info *info = sinfo->info; +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; +struct fb_var_screeninfo *var = &info->var; +struct device *dev = &sinfo->pdev->dev; +struct device_node *np =dev->of_node; +struct device_node *display_np; +struct device_node *timings_np; +struct display_timings *timings; +enum of_gpio_flags flags; +struct atmel_lcdfb_power_ctrl_gpio *og; +bool is_gpio_power = false; +int ret = -ENOENT ; +int i, gpio; + + sinfo->config = (struct atmel_lcdfb_config *) +of_match_device (atmel_lcdfb_dt_ids, dev)->data; + + display_np =of_parse_phandle (np,"display" ,0 ); +if (!display_np) { +dev_err (dev,"failed to find display phandle\n" ); +return -ENOENT ; + } + + ret =of_property_read_u32 (display_np,"bits-per-pixel" , &var->bits_per_pixel); +if (ret <0 ) { +dev_err (dev,"failed to get property bits-per-pixel\n" ); + goto put_display_node; + } + + ret =of_property_read_u32 (display_np,"atmel,guard-time" , &pdata->guard_time); +if (ret <0 ) { +dev_err (dev,"failed to get property atmel,guard-time\n" ); + goto put_display_node; + } + + ret =of_property_read_u32 (display_np,"atmel,lcdcon2" , &pdata->default_lcdcon2); +if (ret <0 ) { +dev_err (dev,"failed to get property atmel,lcdcon2\n" ); + goto put_display_node; + } + + ret =of_property_read_u32 (display_np,"atmel,dmacon" , &pdata->default_dmacon); +if (ret <0 ) { +dev_err (dev,"failed to get property bits-per-pixel\n" ); + goto put_display_node; + } + + ret = -ENOMEM ; +for (i =0 ; i <of_gpio_named_count (display_np,"atmel,power-control-gpio" ); i++) { + gpio =of_get_named_gpio_flags (display_np,"atmel,power-control-gpio" , + i, &flags); +if (gpio <0 ) +continue ; + + og =devm_kzalloc (dev,sizeof (*og),GFP_KERNEL ); +if (!og) + goto put_display_node; + + og->gpio = gpio; + og->active_low = flags &OF_GPIO_ACTIVE_LOW ; + is_gpio_power = true; + ret =devm_gpio_request (dev, gpio,"lcd-power-control-gpio" ); +if (ret) { +dev_err (dev,"request gpio %d failed\n" , gpio); + goto put_display_node; + } + + ret =gpio_direction_output (gpio, og->active_low); +if (ret) { +dev_err (dev,"set direction output gpio %d failed\n" , gpio); + goto put_display_node; + } + } + +if (is_gpio_power)
drivers/video/atmel_lcdfb.c static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo) · line 1088
Quoted 10 lines
drivers/video/atmel_lcdfb.c +10
-0+ pdata->atmel_lcdfb_power_control = atmel_lcdfb_power_control_gpio; + + ret =atmel_lcdfb_get_of_wiring_modes (display_np); +if (ret <0 ) { +dev_err (dev,"invalid atmel,lcd-wiring-mode\n" ); + goto put_display_node; + } + pdata->lcd_wiring_mode = ret; + + pdata->lcdcon_is_backlight =of_property_read_bool (display_np,"atmel,lcdcon-backlight" );
and here, something like:pdata->lcdcon_pol_negative = of_property_read_bool(display_np, "atmel,lcdcon-pwm-pulse-low");
would be nice
Regards,
Richard.
PATCH 5/8 ARM: at91: sam9g45: add lcd support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/boot/dts/at91sam9g45.dtsi | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
arch/arm/boot/dts/at91sam9g45.dtsi +47 -0
@@ -322,6 +322,42 @@ }; }; + fb { + pinctrl_fb: fb-0 { + atmel,pins = + <4 0 0x1 0x0 /* PE0 periph A */ + 4 2 0x1 0x0 /* PE2 periph A */ + 4 3 0x1 0x0 /* PE3 periph A */ + 4 4 0x1 0x0 /* PE4 periph A */ + 4 5 0x1 0x0 /* PE5 periph A */ + 4 6 0x1 0x0 /* PE6 periph A */ + 4 7 0x1 0x0 /* PE7 periph A */ + 4 8 0x1 0x0 /* PE8 periph A */ + 4 9 0x1 0x0 /* PE9 periph A */ + 4 10 0x1 0x0 /* PE10 periph A */ + 4 11 0x1 0x0 /* PE11 periph A */ + 4 12 0x1 0x0 /* PE12 periph A */ + 4 13 0x1 0x0 /* PE13 periph A */ + 4 14 0x1 0x0 /* PE14 periph A */ + 4 15 0x1 0x0 /* PE15 periph A */ + 4 16 0x1 0x0 /* PE16 periph A */ + 4 17 0x1 0x0 /* PE17 periph A */ + 4 18 0x1 0x0 /* PE18 periph A */ + 4 19 0x1 0x0 /* PE19 periph A */ + 4 20 0x1 0x0 /* PE20 periph A */ + 4 21 0x1 0x0 /* PE21 periph A */ + 4 22 0x1 0x0 /* PE22 periph A */ + 4 23 0x1 0x0 /* PE23 periph A */ + 4 24 0x1 0x0 /* PE24 periph A */ + 4 25 0x1 0x0 /* PE25 periph A */ + 4 26 0x1 0x0 /* PE26 periph A */ + 4 27 0x1 0x0 /* PE27 periph A */ + 4 28 0x1 0x0 /* PE28 periph A */ + 4 29 0x1 0x0 /* PE29 periph A */ + 4 30 0x1 0x0>; /* PE30 periph A */ + }; + }; + pioA: gpio at fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>;
@@ -533,6 +569,17 @@ }; }; + fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9g45-lcdc"; + reg = <0x00500000 0x1000>; + interrupts = <23 3 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + }; + nand0: nand at 40000000 { compatible = "atmel,at91rm9200-nand"; #address-cells = <1>;
Signature · 1 line
1.7.10.4
PATCH 5/8 ARM: at91: sam9g45: add lcd support
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 37 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>--- arch/arm/boot/dts/at91sam9g45.dtsi | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)arch/arm/boot/dts/at91sam9g45.dtsi +23
-0@@ -322,6 +322,42 @@ }; }; + fb { + pinctrl_fb: fb-0 { + atmel,pins = + <4 0 0x1 0x0 /* PE0 periph A */ + 4 2 0x1 0x0 /* PE2 periph A */ + 4 3 0x1 0x0 /* PE3 periph A */ + 4 4 0x1 0x0 /* PE4 periph A */ + 4 5 0x1 0x0 /* PE5 periph A */ + 4 6 0x1 0x0 /* PE6 periph A */ + 4 7 0x1 0x0 /* PE7 periph A */ + 4 8 0x1 0x0 /* PE8 periph A */ + 4 9 0x1 0x0 /* PE9 periph A */ + 4 10 0x1 0x0 /* PE10 periph A */ + 4 11 0x1 0x0 /* PE11 periph A */ + 4 12 0x1 0x0 /* PE12 periph A */ + 4 13 0x1 0x0 /* PE13 periph A */ + 4 14 0x1 0x0 /* PE14 periph A */ + 4 15 0x1 0x0 /* PE15 periph A */ + 4 16 0x1 0x0 /* PE16 periph A */ + 4 17 0x1 0x0 /* PE17 periph A */ + 4 18 0x1 0x0 /* PE18 periph A */ + 4 19 0x1 0x0 /* PE19 periph A */ + 4 20 0x1 0x0 /* PE20 periph A */
arch/arm/boot/dts/at91sam9g45.dtsi line 357
Quoted 10 lines
arch/arm/boot/dts/at91sam9g45.dtsi +10
-0+ 4 21 0x1 0x0 /* PE21 periph A */ + 4 22 0x1 0x0 /* PE22 periph A */ + 4 23 0x1 0x0 /* PE23 periph A */ + 4 24 0x1 0x0 /* PE24 periph A */ + 4 25 0x1 0x0 /* PE25 periph A */ + 4 26 0x1 0x0 /* PE26 periph A */ + 4 27 0x1 0x0 /* PE27 periph A */ + 4 28 0x1 0x0 /* PE28 periph A */ + 4 29 0x1 0x0 /* PE29 periph A */ + 4 30 0x1 0x0>; /* PE30 periph A */
Verified, correct.
arch/arm/boot/dts/at91sam9g45.dtsi line 573
Quoted 12 lines
arch/arm/boot/dts/at91sam9g45.dtsi +5
-0+ }; + }; + pioA: gpio at fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>;@@ -533,6 +569,17 @@ }; }; + fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9g45-lcdc";
If we change to "atmel,at91sam9g45-lcdfb", we will have to change this as-well.
arch/arm/boot/dts/at91sam9g45.dtsi line 580
Quoted 8 lines
arch/arm/boot/dts/at91sam9g45.dtsi +7
-0+ reg = <0x00500000 0x1000>; + interrupts = <23 3 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>;
I do not think we need these 2 properties: is a "reg" property existing in child nodes?
Quoted 6 lines
arch/arm/boot/dts/at91sam9g45.dtsi +2
-0+ }; + nand0: nand at 40000000 { compatible = "atmel,at91rm9200-nand";#address-cells = <1>;
Signature · 1 line
Nicolas Ferre
PATCH 5/8 ARM: at91: sam9g45: add lcd support
In reply to Jean-Christophe PLAGNIOL-VILLARDOn 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 54 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>--- arch/arm/boot/dts/at91sam9g45.dtsi | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)arch/arm/boot/dts/at91sam9g45.dtsi +36
-0@@ -322,6 +322,42 @@ }; }; + fb { + pinctrl_fb: fb-0 { + atmel,pins = + <4 0 0x1 0x0 /* PE0 periph A */ + 4 2 0x1 0x0 /* PE2 periph A */ + 4 3 0x1 0x0 /* PE3 periph A */ + 4 4 0x1 0x0 /* PE4 periph A */ + 4 5 0x1 0x0 /* PE5 periph A */ + 4 6 0x1 0x0 /* PE6 periph A */ + 4 7 0x1 0x0 /* PE7 periph A */ + 4 8 0x1 0x0 /* PE8 periph A */ + 4 9 0x1 0x0 /* PE9 periph A */ + 4 10 0x1 0x0 /* PE10 periph A */ + 4 11 0x1 0x0 /* PE11 periph A */ + 4 12 0x1 0x0 /* PE12 periph A */ + 4 13 0x1 0x0 /* PE13 periph A */ + 4 14 0x1 0x0 /* PE14 periph A */ + 4 15 0x1 0x0 /* PE15 periph A */ + 4 16 0x1 0x0 /* PE16 periph A */ + 4 17 0x1 0x0 /* PE17 periph A */ + 4 18 0x1 0x0 /* PE18 periph A */ + 4 19 0x1 0x0 /* PE19 periph A */ + 4 20 0x1 0x0 /* PE20 periph A */ + 4 21 0x1 0x0 /* PE21 periph A */ + 4 22 0x1 0x0 /* PE22 periph A */ + 4 23 0x1 0x0 /* PE23 periph A */ + 4 24 0x1 0x0 /* PE24 periph A */ + 4 25 0x1 0x0 /* PE25 periph A */ + 4 26 0x1 0x0 /* PE26 periph A */ + 4 27 0x1 0x0 /* PE27 periph A */ + 4 28 0x1 0x0 /* PE28 periph A */ + 4 29 0x1 0x0 /* PE29 periph A */ + 4 30 0x1 0x0>; /* PE30 periph A */ + }; + }; + pioA: gpio at fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>;
arch/arm/boot/dts/at91sam9g45.dtsi line 575
Quoted 7 lines
arch/arm/boot/dts/at91sam9g45.dtsi +4
-0@@ -533,6 +569,17 @@ }; }; + fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9g45-lcdc"; + reg = <0x00500000 0x1000>; + interrupts = <23 3 0>;
Error: here, it is <23 4 0>
Quoted 11 lines
arch/arm/boot/dts/at91sam9g45.dtsi +7
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + }; + nand0: nand at 40000000 { compatible = "atmel,at91rm9200-nand"; #address-cells = <1>;
Signature · 1 line
Nicolas Ferre
PATCH 5/8 ARM: at91: sam9g45: add lcd support
On 04/16/2013 04:00 PM, Nicolas Ferre :
Quoted 58 lines
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 57 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>--- arch/arm/boot/dts/at91sam9g45.dtsi | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)arch/arm/boot/dts/at91sam9g45.dtsi +36
-0@@ -322,6 +322,42 @@ }; }; + fb { + pinctrl_fb: fb-0 { + atmel,pins = + <4 0 0x1 0x0 /* PE0 periph A */ + 4 2 0x1 0x0 /* PE2 periph A */ + 4 3 0x1 0x0 /* PE3 periph A */ + 4 4 0x1 0x0 /* PE4 periph A */ + 4 5 0x1 0x0 /* PE5 periph A */ + 4 6 0x1 0x0 /* PE6 periph A */ + 4 7 0x1 0x0 /* PE7 periph A */ + 4 8 0x1 0x0 /* PE8 periph A */ + 4 9 0x1 0x0 /* PE9 periph A */ + 4 10 0x1 0x0 /* PE10 periph A */ + 4 11 0x1 0x0 /* PE11 periph A */ + 4 12 0x1 0x0 /* PE12 periph A */ + 4 13 0x1 0x0 /* PE13 periph A */ + 4 14 0x1 0x0 /* PE14 periph A */ + 4 15 0x1 0x0 /* PE15 periph A */ + 4 16 0x1 0x0 /* PE16 periph A */ + 4 17 0x1 0x0 /* PE17 periph A */ + 4 18 0x1 0x0 /* PE18 periph A */ + 4 19 0x1 0x0 /* PE19 periph A */ + 4 20 0x1 0x0 /* PE20 periph A */ + 4 21 0x1 0x0 /* PE21 periph A */ + 4 22 0x1 0x0 /* PE22 periph A */ + 4 23 0x1 0x0 /* PE23 periph A */ + 4 24 0x1 0x0 /* PE24 periph A */ + 4 25 0x1 0x0 /* PE25 periph A */ + 4 26 0x1 0x0 /* PE26 periph A */ + 4 27 0x1 0x0 /* PE27 periph A */ + 4 28 0x1 0x0 /* PE28 periph A */ + 4 29 0x1 0x0 /* PE29 periph A */ + 4 30 0x1 0x0>; /* PE30 periph A */ + }; + }; + pioA: gpio at fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>;@@ -533,6 +569,17 @@ }; };
Quoted 6 lines
arch/arm/boot/dts/at91sam9g45.dtsi line 575
Quoted 4 lines
arch/arm/boot/dts/at91sam9g45.dtsi +4
-0+ fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9g45-lcdc"; + reg = <0x00500000 0x1000>; + interrupts = <23 3 0>;Error: here, it is <23 4 0>
Collecting all the remarks, we end-up with:
<23 4 3>
Quoted 13 lines
Quoted 11 lines
arch/arm/boot/dts/at91sam9g45.dtsi +7
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + }; + nand0: nand at 40000000 { compatible = "atmel,at91rm9200-nand"; #address-cells = <1>;
Signature · 1 line
Nicolas Ferre
PATCH 6/8 ARM: at91: sam9263: add fb dt support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/boot/dts/at91sam9263.dtsi | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
arch/arm/boot/dts/at91sam9263.dtsi +39 -0
@@ -303,6 +303,34 @@ }; }; + fb { + pinctrl_fb: fb-0 { + atmel,pins = + <2 1 0x1 0x0 /* PC1 periph A */ + 2 2 0x1 0x0 /* PC2 periph A */ + 2 3 0x1 0x0 /* PC3 periph A */ + 1 9 0x2 0x0 /* PB9 periph B */ + 2 6 0x1 0x0 /* PC6 periph A */ + 2 7 0x1 0x0 /* PC7 periph A */ + 2 8 0x1 0x0 /* PC8 periph A */ + 2 9 0x1 0x0 /* PC9 periph A */ + 2 10 0x1 0x0 /* PC10 periph A */ + 2 11 0x1 0x0 /* PC11 periph A */ + 2 14 0x1 0x0 /* PC14 periph A */ + 2 15 0x1 0x0 /* PC15 periph A */ + 2 16 0x1 0x0 /* PC16 periph A */ + 2 12 0x2 0x0 /* PC12 periph B */ + 2 18 0x1 0x0 /* PC18 periph A */ + 2 19 0x1 0x0 /* PC19 periph A */ + 2 22 0x1 0x0 /* PC22 periph A */ + 2 23 0x1 0x0 /* PC23 periph A */ + 2 24 0x1 0x0 /* PC24 periph A */ + 2 17 0x2 0x0 /* PC17 periph B */ + 2 26 0x1 0x0 /* PC26 periph A */ + 2 27 0x1 0x0>; /* PC27 periph A */ + }; + }; + pioA: gpio at fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>;
@@ -464,6 +492,17 @@ }; }; + fb0: fb at 0x00500000 { + compatible = "atmel,at91sam9263-lcdc"; + reg = <0x00700000 0x1000>; + interrupts = <26 3 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + }; + nand0: nand at 40000000 { compatible = "atmel,at91rm9200-nand"; #address-cells = <1>;
Signature · 1 line
1.7.10.4
PATCH 6/8 ARM: at91: sam9263: add fb dt support
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 29 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>--- arch/arm/boot/dts/at91sam9263.dtsi | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)arch/arm/boot/dts/at91sam9263.dtsi +15
-0@@ -303,6 +303,34 @@ }; }; + fb { + pinctrl_fb: fb-0 { + atmel,pins = + <2 1 0x1 0x0 /* PC1 periph A */ + 2 2 0x1 0x0 /* PC2 periph A */ + 2 3 0x1 0x0 /* PC3 periph A */ + 1 9 0x2 0x0 /* PB9 periph B */ + 2 6 0x1 0x0 /* PC6 periph A */ + 2 7 0x1 0x0 /* PC7 periph A */ + 2 8 0x1 0x0 /* PC8 periph A */ + 2 9 0x1 0x0 /* PC9 periph A */ + 2 10 0x1 0x0 /* PC10 periph A */ + 2 11 0x1 0x0 /* PC11 periph A */ + 2 14 0x1 0x0 /* PC14 periph A */ + 2 15 0x1 0x0 /* PC15 periph A */
arch/arm/boot/dts/at91sam9263.dtsi line 330
Quoted 10 lines
arch/arm/boot/dts/at91sam9263.dtsi +10
-0+ 2 16 0x1 0x0 /* PC16 periph A */ + 2 12 0x2 0x0 /* PC12 periph B */ + 2 18 0x1 0x0 /* PC18 periph A */ + 2 19 0x1 0x0 /* PC19 periph A */ + 2 22 0x1 0x0 /* PC22 periph A */ + 2 23 0x1 0x0 /* PC23 periph A */ + 2 24 0x1 0x0 /* PC24 periph A */ + 2 17 0x2 0x0 /* PC17 periph B */ + 2 26 0x1 0x0 /* PC26 periph A */ + 2 27 0x1 0x0>; /* PC27 periph A */
Verified, okay.
arch/arm/boot/dts/at91sam9263.dtsi line 495
Quoted 11 lines
arch/arm/boot/dts/at91sam9263.dtsi +4
-0+ }; + }; + pioA: gpio at fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>;@@ -464,6 +492,17 @@ }; }; + fb0: fb at 0x00500000 {
No, it is 0x700000
arch/arm/boot/dts/at91sam9263.dtsi line 497
Quoted 2 lines
arch/arm/boot/dts/at91sam9263.dtsi +2
-0+ compatible = "atmel,at91sam9263-lcdc"; + reg = <0x00700000 0x1000>;
Ditto.
arch/arm/boot/dts/at91sam9263.dtsi line 498
Quoted 1 line
arch/arm/boot/dts/at91sam9263.dtsi +1
-0+ interrupts = <26 3 0>;
<26 4 0> here.
arch/arm/boot/dts/at91sam9263.dtsi line 503
Quoted 5 lines
arch/arm/boot/dts/at91sam9263.dtsi +5
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>;
Ditto in 9g45 case.
Quoted 6 lines
arch/arm/boot/dts/at91sam9263.dtsi +2
-0+ }; + nand0: nand at 40000000 { compatible = "atmel,at91rm9200-nand"; #address-cells = <1>;
Signature · 1 line
Nicolas Ferre
PATCH 6/8 ARM: at91: sam9263: add fb dt support
Quoted 57 lines · Nicolas Ferre
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 29 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>--- arch/arm/boot/dts/at91sam9263.dtsi | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)arch/arm/boot/dts/at91sam9263.dtsi +15
-0@@ -303,6 +303,34 @@ }; }; + fb { + pinctrl_fb: fb-0 { + atmel,pins = + <2 1 0x1 0x0 /* PC1 periph A */ + 2 2 0x1 0x0 /* PC2 periph A */ + 2 3 0x1 0x0 /* PC3 periph A */ + 1 9 0x2 0x0 /* PB9 periph B */ + 2 6 0x1 0x0 /* PC6 periph A */ + 2 7 0x1 0x0 /* PC7 periph A */ + 2 8 0x1 0x0 /* PC8 periph A */ + 2 9 0x1 0x0 /* PC9 periph A */ + 2 10 0x1 0x0 /* PC10 periph A */ + 2 11 0x1 0x0 /* PC11 periph A */ + 2 14 0x1 0x0 /* PC14 periph A */ + 2 15 0x1 0x0 /* PC15 periph A */arch/arm/boot/dts/at91sam9263.dtsi line 330
Quoted 10 lines
arch/arm/boot/dts/at91sam9263.dtsi +10
-0+ 2 16 0x1 0x0 /* PC16 periph A */ + 2 12 0x2 0x0 /* PC12 periph B */ + 2 18 0x1 0x0 /* PC18 periph A */ + 2 19 0x1 0x0 /* PC19 periph A */ + 2 22 0x1 0x0 /* PC22 periph A */ + 2 23 0x1 0x0 /* PC23 periph A */ + 2 24 0x1 0x0 /* PC24 periph A */ + 2 17 0x2 0x0 /* PC17 periph B */ + 2 26 0x1 0x0 /* PC26 periph A */ + 2 27 0x1 0x0>; /* PC27 periph A */Verified, okay.
arch/arm/boot/dts/at91sam9263.dtsi line 495
Quoted 11 lines
arch/arm/boot/dts/at91sam9263.dtsi +4
-0+ }; + }; + pioA: gpio at fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>;@@ -464,6 +492,17 @@ }; }; + fb0: fb at 0x00500000 {No, it is
0x700000
Quoted 8 lines
arch/arm/boot/dts/at91sam9263.dtsi line 497
Quoted 2 lines
arch/arm/boot/dts/at91sam9263.dtsi +2
-0+ compatible = "atmel,at91sam9263-lcdc"; + reg = <0x00700000 0x1000>;Ditto.
arch/arm/boot/dts/at91sam9263.dtsi line 498
Quoted 1 line
arch/arm/boot/dts/at91sam9263.dtsi +1
-0+ interrupts = <26 3 0>;<26 4 0> here.
no lcd is 3 even in c
and even 3 could be slow in some big lcd case
Quoted 20 lines
arch/arm/boot/dts/at91sam9263.dtsi line 503
Quoted 7 lines
arch/arm/boot/dts/at91sam9263.dtsi +5
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>;Ditto in 9g45 case.
Quoted 6 lines
arch/arm/boot/dts/at91sam9263.dtsi +2
-0+ }; + nand0: nand at 40000000 { compatible = "atmel,at91rm9200-nand"; #address-cells = <1>;Signature · 1 line
Nicolas Ferre
PATCH 6/8 ARM: at91: sam9263: add fb dt support
On 04/16/2013 04:13 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 63 lines · Nicolas Ferre
Quoted 62 lines
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 29 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>--- arch/arm/boot/dts/at91sam9263.dtsi | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)arch/arm/boot/dts/at91sam9263.dtsi +15
-0@@ -303,6 +303,34 @@ }; }; + fb { + pinctrl_fb: fb-0 { + atmel,pins = + <2 1 0x1 0x0 /* PC1 periph A */ + 2 2 0x1 0x0 /* PC2 periph A */ + 2 3 0x1 0x0 /* PC3 periph A */ + 1 9 0x2 0x0 /* PB9 periph B */ + 2 6 0x1 0x0 /* PC6 periph A */ + 2 7 0x1 0x0 /* PC7 periph A */ + 2 8 0x1 0x0 /* PC8 periph A */ + 2 9 0x1 0x0 /* PC9 periph A */ + 2 10 0x1 0x0 /* PC10 periph A */ + 2 11 0x1 0x0 /* PC11 periph A */ + 2 14 0x1 0x0 /* PC14 periph A */ + 2 15 0x1 0x0 /* PC15 periph A */arch/arm/boot/dts/at91sam9263.dtsi line 330
Quoted 10 lines
arch/arm/boot/dts/at91sam9263.dtsi +10
-0+ 2 16 0x1 0x0 /* PC16 periph A */ + 2 12 0x2 0x0 /* PC12 periph B */ + 2 18 0x1 0x0 /* PC18 periph A */ + 2 19 0x1 0x0 /* PC19 periph A */ + 2 22 0x1 0x0 /* PC22 periph A */ + 2 23 0x1 0x0 /* PC23 periph A */ + 2 24 0x1 0x0 /* PC24 periph A */ + 2 17 0x2 0x0 /* PC17 periph B */ + 2 26 0x1 0x0 /* PC26 periph A */ + 2 27 0x1 0x0>; /* PC27 periph A */Verified, okay.
arch/arm/boot/dts/at91sam9263.dtsi line 495
Quoted 11 lines
arch/arm/boot/dts/at91sam9263.dtsi +4
-0+ }; + }; + pioA: gpio at fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>;@@ -464,6 +492,17 @@ }; }; + fb0: fb at 0x00500000 {No, it is
0x700000arch/arm/boot/dts/at91sam9263.dtsi line 497
Quoted 2 lines
arch/arm/boot/dts/at91sam9263.dtsi +2
-0+ compatible = "atmel,at91sam9263-lcdc"; + reg = <0x00700000 0x1000>;Ditto.
Quoted 6 lines
Quoted 3 lines
arch/arm/boot/dts/at91sam9263.dtsi line 498
Quoted 1 line
arch/arm/boot/dts/at91sam9263.dtsi +1
-0+ interrupts = <26 3 0>;<26 4 0> here.
no lcd is 3 even in c
and even 3 could be slow in some big lcd case
No, you mean the priority, but priority is encoded as the 3rd cell. So, we end up with:
<26 4 3>
(I agree with the 3)
Quoted 10 lines
Quoted 10 lines
arch/arm/boot/dts/at91sam9263.dtsi line 503
Quoted 7 lines
arch/arm/boot/dts/at91sam9263.dtsi +5
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>;Ditto in 9g45 case.
Quoted 11 lines
Quoted 10 lines
Quoted 6 lines
arch/arm/boot/dts/at91sam9263.dtsi +2
-0+ }; + nand0: nand at 40000000 { compatible = "atmel,at91rm9200-nand"; #address-cells = <1>;Signature · 1 line
Nicolas Ferre
Bye,
Signature · 1 line
Nicolas Ferre
PATCH 6/8 ARM: at91: sam9263: add fb dt support
Quoted 69 lines · Nicolas Ferre
On 04/16/2013 04:13 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 68 lines · Nicolas Ferre
Quoted 57 lines
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 29 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>--- arch/arm/boot/dts/at91sam9263.dtsi | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)arch/arm/boot/dts/at91sam9263.dtsi +15
-0@@ -303,6 +303,34 @@ }; }; + fb { + pinctrl_fb: fb-0 { + atmel,pins = + <2 1 0x1 0x0 /* PC1 periph A */ + 2 2 0x1 0x0 /* PC2 periph A */ + 2 3 0x1 0x0 /* PC3 periph A */ + 1 9 0x2 0x0 /* PB9 periph B */ + 2 6 0x1 0x0 /* PC6 periph A */ + 2 7 0x1 0x0 /* PC7 periph A */ + 2 8 0x1 0x0 /* PC8 periph A */ + 2 9 0x1 0x0 /* PC9 periph A */ + 2 10 0x1 0x0 /* PC10 periph A */ + 2 11 0x1 0x0 /* PC11 periph A */ + 2 14 0x1 0x0 /* PC14 periph A */ + 2 15 0x1 0x0 /* PC15 periph A */arch/arm/boot/dts/at91sam9263.dtsi line 330
Quoted 10 lines
arch/arm/boot/dts/at91sam9263.dtsi +10
-0+ 2 16 0x1 0x0 /* PC16 periph A */ + 2 12 0x2 0x0 /* PC12 periph B */ + 2 18 0x1 0x0 /* PC18 periph A */ + 2 19 0x1 0x0 /* PC19 periph A */ + 2 22 0x1 0x0 /* PC22 periph A */ + 2 23 0x1 0x0 /* PC23 periph A */ + 2 24 0x1 0x0 /* PC24 periph A */ + 2 17 0x2 0x0 /* PC17 periph B */ + 2 26 0x1 0x0 /* PC26 periph A */ + 2 27 0x1 0x0>; /* PC27 periph A */Verified, okay.
arch/arm/boot/dts/at91sam9263.dtsi line 495
Quoted 11 lines
arch/arm/boot/dts/at91sam9263.dtsi +4
-0+ }; + }; + pioA: gpio at fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>;@@ -464,6 +492,17 @@ }; }; + fb0: fb at 0x00500000 {No, it is
0x700000Quoted 8 lines
arch/arm/boot/dts/at91sam9263.dtsi line 497
Quoted 2 lines
arch/arm/boot/dts/at91sam9263.dtsi +2
-0+ compatible = "atmel,at91sam9263-lcdc"; + reg = <0x00700000 0x1000>;Ditto.
arch/arm/boot/dts/at91sam9263.dtsi line 498
Quoted 1 line
arch/arm/boot/dts/at91sam9263.dtsi +1
-0+ interrupts = <26 3 0>;<26 4 0> here.
no lcd is 3 even in c
Quoted 8 lines
Quoted 1 line
and even 3 could be slow in some big lcd case
No, you mean the priority, but priority is encoded as the 3rd cell. So, we end up with:
<26 4 3>
(I agree with the 3)
I hate those magic number
so this is the las patch to go in with as soon as the macro for dts are in I free the at91 dts and switch to it
Quoted 27 lines
Quoted 12 lines
Quoted 12 lines
arch/arm/boot/dts/at91sam9263.dtsi line 503
Quoted 9 lines
arch/arm/boot/dts/at91sam9263.dtsi +5
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fb>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>;Ditto in 9g45 case.
Quoted 11 lines
Quoted 10 lines
Quoted 6 lines
arch/arm/boot/dts/at91sam9263.dtsi +2
-0+ }; + nand0: nand at 40000000 { compatible = "atmel,at91rm9200-nand"; #address-cells = <1>;Signature · 1 line
Nicolas FerreBye,
Signature · 1 line
Nicolas Ferre
PATCH 7/8 ARM: at91: at9sam9m10g45ek: add dt lcd support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/boot/dts/at91sam9m10g45ek.dts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
arch/arm/boot/dts/at91sam9m10g45ek.dts +29 -0
@@ -104,6 +104,35 @@ }; }; + fb0: fb at 0x00500000 { + display = <&display0>; + status = "okay"; + + display0: display { + bits-per-pixel = <32>; + atmel,lcdcon-backlight; + atmel,dmacon = <0x1>; + atmel,lcdcon2 = <0x80008002>; + atmel,guard-time = <9>; + atmel,lcd-wiring-mode = "RGB"; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hback-porch = <1>; + hfront-porch = <1>; + vback-porch = <40>; + vfront-porch = <1>; + hsync-len = <45>; + vsync-len = <1>; + }; + }; + }; + }; + nand0: nand at 40000000 { nand-bus-width = <8>; nand-ecc-mode = "soft";
Signature · 1 line
1.7.10.4
PATCH 7/8 ARM: at91: at9sam9m10g45ek: add dt lcd support
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 33 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>--- arch/arm/boot/dts/at91sam9m10g45ek.dts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)arch/arm/boot/dts/at91sam9m10g45ek.dts +19
-0@@ -104,6 +104,35 @@ }; }; + fb0: fb at 0x00500000 { + display = <&display0>; + status = "okay"; + + display0: display { + bits-per-pixel = <32>; + atmel,lcdcon-backlight; + atmel,dmacon = <0x1>; + atmel,lcdcon2 = <0x80008002>; + atmel,guard-time = <9>; + atmel,lcd-wiring-mode = "RGB"; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hback-porch = <1>;
arch/arm/boot/dts/at91sam9m10g45ek.dts line 135
Quoted 10 lines
arch/arm/boot/dts/at91sam9m10g45ek.dts +10
-0+ hfront-porch = <1>; + vback-porch = <40>; + vfront-porch = <1>; + hsync-len = <45>; + vsync-len = <1>; + }; + }; + }; + }; +
Seems good.
Quoted 4 lines
arch/arm/boot/dts/at91sam9m10g45ek.dts +0
-0nand0: nand at 40000000 { nand-bus-width = <8>; nand-ecc-mode = "soft";
Signature · 1 line
Nicolas Ferre
PATCH 8/8 ARM: at91: sam9263ek: add dt lcd support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/boot/dts/at91sam9263ek.dts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm/boot/dts/at91sam9263ek.dts +30 -0
@@ -81,6 +81,36 @@ }; }; + fb0: fb at 0x00500000 { + display = <&display0>; + status = "okay"; + + display0: display { + bits-per-pixel = <16>; + atmel,lcdcon-backlight; + atmel,dmacon = <0x1>; + atmel,lcdcon2 = <0x80008002>; + atmel,guard-time = <1>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <4965000>; + hactive = <240>; + vactive = <320>; + hback-porch = <1>; + hfront-porch = <33>; + vback-porch = <1>; + vfront-porch = <0>; + hsync-len = <5>; + vsync-len = <1>; + hsync-active = <1>; + vsync-active = <1>; + }; + }; + }; + }; + nand0: nand at 40000000 { nand-bus-width = <8>; nand-ecc-mode = "soft";
Signature · 1 line
1.7.10.4
PATCH 8/8 ARM: at91: sam9263ek: add dt lcd support
On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 11 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>--- arch/arm/boot/dts/at91sam9263ek.dts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)arch/arm/boot/dts/at91sam9263ek.dts +0
-0
arch/arm/boot/dts/at91sam9263ek.dts line 84
Quoted 4 lines
arch/arm/boot/dts/at91sam9263ek.dts +1
-0@@ -81,6 +81,36 @@ }; }; + fb0: fb at 0x00500000 {
Ditto: Not good address: 0x700000
Quoted 18 lines
arch/arm/boot/dts/at91sam9263ek.dts +18
-0+ display = <&display0>; + status = "okay"; + + display0: display { + bits-per-pixel = <16>; + atmel,lcdcon-backlight; + atmel,dmacon = <0x1>; + atmel,lcdcon2 = <0x80008002>; + atmel,guard-time = <1>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <4965000>; + hactive = <240>; + vactive = <320>; + hback-porch = <1>; + hfront-porch = <33>;
arch/arm/boot/dts/at91sam9263ek.dts line 112
Quoted 10 lines
arch/arm/boot/dts/at91sam9263ek.dts +10
-0+ vback-porch = <1>; + vfront-porch = <0>; + hsync-len = <5>; + vsync-len = <1>; + hsync-active = <1>; + vsync-active = <1>; + }; + }; + }; + };
Otherwise, seems good.
Quoted 5 lines
arch/arm/boot/dts/at91sam9263ek.dts +1
-0+ nand0: nand at 40000000 { nand-bus-width = <8>; nand-ecc-mode = "soft";
Signature · 1 line
Nicolas Ferre
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 8 lines · Jean-Christophe PLAGNIOL-VILLARD
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>
For the AVR32 bits
Quoted 15 lines
--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +-
Quoted 8 lines
arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)
<snipp diff>
Signature · 1 line
HcE
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
In reply to Jean-Christophe PLAGNIOL-VILLARDOn 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 466 lines
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)arch/arm/mach-at91/at91sam9261_devices.c +3
-3@@ -465,7 +465,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = {@@ -498,7 +498,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {if (!data) {return ;@@ -559,7 +559,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); }#else -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {}#endif arch/arm/mach-at91/at91sam9263_devices.c +3
-3@@ -832,7 +832,7 @@ void __init at91_add_device_can(struct at91_can_data *data) {} #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = {@@ -859,7 +859,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {if (!data)return ;@@ -891,7 +891,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); }#else -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {}#endif arch/arm/mach-at91/at91sam9g45_devices.c +3
-3@@ -965,7 +965,7 @@ void __init at91_add_device_isi(struct isi_platform_data *data, #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = {@@ -991,7 +991,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {if (!data)return ;@@ -1037,7 +1037,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); }#else -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {}#endif arch/arm/mach-at91/at91sam9rl_devices.c +3
-3@@ -498,7 +498,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data) {} #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = {@@ -525,7 +525,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {if (!data) {return ;@@ -557,7 +557,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); }#else -void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data) {}#endif arch/arm/mach-at91/board-sam9261ek.c +3
-3@@ -405,7 +405,7 @@ static void at91_lcdc_stn_power_control(int on) } } -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .default_bpp =1 , .default_dmacon =ATMEL_LCDC_DMAEN , .default_lcdcon2 =AT91SAM9261_DEFAULT_STN_LCDCON2 ,@@ -460,7 +460,7 @@ static void at91_lcdc_tft_power_control(int on)at91_set_gpio_value (AT91_PIN_PA12 ,1 );/* power down */ } -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN ,@@ -475,7 +475,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {#endif #else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;#endif arch/arm/mach-at91/board-sam9263ek.c +2
-2@@ -281,7 +281,7 @@ static void at91_lcdc_power_control(int on) }/* Driver datas */ -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN ,@@ -292,7 +292,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { };#else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;#endif arch/arm/mach-at91/board-sam9m10g45ek.c +2
-2@@ -284,7 +284,7 @@ static struct fb_monspecs at91fb_default_monspecs = { | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)/* Driver datas */ -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp =32 , .default_dmacon =ATMEL_LCDC_DMAEN ,@@ -295,7 +295,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { };#else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;#endif arch/arm/mach-at91/board-sam9rlek.c +2
-2@@ -179,7 +179,7 @@ static void at91_lcdc_power_control(int on) }/* Driver datas */ -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN ,@@ -191,7 +191,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { };#else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;#endif arch/arm/mach-at91/board.h +2
-2@@ -107,8 +107,8 @@ extern void __init at91_add_device_pwm(u32 mask);extern void __init at91_add_device_ssc (unsigned id,unsigned pins);/* LCD Controller */ -struct atmel_lcdfb_info ; -extern void __init at91_add_device_lcdc (struct atmel_lcdfb_info *data); +struct atmel_lcdfb_pdata ; +extern void __init at91_add_device_lcdc (struct atmel_lcdfb_pdata *data);/* AC97 */ extern void __init at91_add_device_ac97 (struct ac97c_platform_data *data);arch/avr32/boards/atngw100/evklcd10x.c +3
-3@@ -58,7 +58,7 @@ static struct fb_monspecs __initdata atevklcd10x_default_monspecs = { .dclkmax = 28330000, }; -static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT@@ -96,7 +96,7 @@ static struct fb_monspecs __initdata atevklcd10x_default_monspecs = { .dclkmax = 7000000, }; -static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT@@ -134,7 +134,7 @@ static struct fb_monspecs __initdata atevklcd10x_default_monspecs = { .dclkmax = 6400000, }; -static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFTarch/avr32/boards/atngw100/mrmt.c +2
-2@@ -83,7 +83,7 @@ static struct fb_monspecs __initdata lcd_fb_default_monspecs = { .dclkmax = 9260000, }; -static struct atmel_lcdfb_info __initdata rmt_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata rmt_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT@@ -126,7 +126,7 @@ static struct fb_monspecs __initdata lcd_fb_default_monspecs = { .dclkmax = 9260000, }; -static struct atmel_lcdfb_info __initdata rmt_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata rmt_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFTarch/avr32/boards/atstk1000/atstk1000.h +1
-1@@ -10,7 +10,7 @@#ifndef __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H#define __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H -extern struct atmel_lcdfb_info atstk1000_lcdc_data; +extern struct atmel_lcdfb_pdata atstk1000_lcdc_data;void atstk1000_setup_j2_leds (void );arch/avr32/boards/atstk1000/setup.c +1
-1@@ -55,7 +55,7 @@ static struct fb_monspecs __initdata atstk1000_default_monspecs = { .dclkmax = 30000000, }; -struct atmel_lcdfb_info __initdata atstk1000_lcdc_data = { +struct atmel_lcdfb_pdata __initdata atstk1000_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFTarch/avr32/boards/favr-32/setup.c +1
-1@@ -125,7 +125,7 @@ static struct fb_monspecs __initdata favr32_default_monspecs = { .dclkmax = 28000000, }; -struct atmel_lcdfb_info __initdata favr32_lcdc_data = { +struct atmel_lcdfb_pdata __initdata favr32_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFTarch/avr32/boards/hammerhead/setup.c +1
-1@@ -77,7 +77,7 @@ static struct fb_monspecs __initdata hammerhead_hda350t_monspecs = { .dclkmax = 10000000, }; -struct atmel_lcdfb_info __initdata hammerhead_lcdc_data = { +struct atmel_lcdfb_pdata __initdata hammerhead_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFTarch/avr32/boards/merisc/display.c +1
-1@@ -45,7 +45,7 @@ static struct fb_monspecs merisc_fb_monspecs = { .dclkmax = 30000000, }; -struct atmel_lcdfb_info merisc_lcdc_data = { +struct atmel_lcdfb_pdata merisc_lcdc_data = { .default_bpp =24 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFTarch/avr32/boards/mimc200/setup.c +2
-2@@ -8,7 +8,7 @@* published by the Free Software Foundation. */ -extern struct atmel_lcdfb_info mimc200_lcdc_data; +extern struct atmel_lcdfb_pdata mimc200_lcdc_data;#include <linux/clk.h> #include <linux/etherdevice.h> @@ -71,7 +71,7 @@ static struct fb_monspecs __initdata mimc200_default_monspecs = { .dclkmax = 25200000, }; -struct atmel_lcdfb_info __initdata mimc200_lcdc_data = { +struct atmel_lcdfb_pdata __initdata mimc200_lcdc_data = { .default_bpp =16 , .default_dmacon =ATMEL_LCDC_DMAEN |ATMEL_LCDC_DMA2DEN , .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFTarch/avr32/mach-at32ap/at32ap700x.c +4
-4@@ -1437,7 +1437,7 @@ fail:* LCDC * -------------------------------------------------------------------- */ #if defined(CONFIG_CPU_AT32AP7000) || defined(CONFIG_CPU_AT32AP7002) -static struct atmel_lcdfb_info atmel_lcdfb0_data; +static struct atmel_lcdfb_pdata atmel_lcdfb0_data; static struct resource atmel_lcdfb0_resource[] = { { .start = 0xff000000,@@ -1465,12 +1465,12 @@ static struct clk atmel_lcdfb0_pixclk = { };struct platform_device *__init -at32_add_device_lcdc (unsigned int id,struct atmel_lcdfb_info *data, +at32_add_device_lcdc (unsigned int id,struct atmel_lcdfb_pdata *data,unsigned long fbmem_start,unsigned long fbmem_len,u64 pin_mask) {struct platform_device *pdev; -struct atmel_lcdfb_info *info; +struct atmel_lcdfb_pdata *info;struct fb_monspecs *monspecs;struct fb_videomode *modedb;unsigned int modedb_size;@@ -1527,7 +1527,7 @@ at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, } info = pdev->dev.platform_data; -memcpy (info, data,sizeof (struct atmel_lcdfb_info )); +memcpy (info, data,sizeof (struct atmel_lcdfb_pdata )); info->default_monspecs = monspecs; pdev->name ="at32ap-lcdfb" ;arch/avr32/mach-at32ap/include/mach/board.h +2
-2@@ -44,9 +44,9 @@ struct platform_device * at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n);void at32_spi_setup_slaves (unsigned int bus_num,struct spi_board_info *b,unsigned int n); -struct atmel_lcdfb_info ; +struct atmel_lcdfb_pdata ;struct platform_device * -at32_add_device_lcdc (unsigned int id,struct atmel_lcdfb_info *data, +at32_add_device_lcdc (unsigned int id,struct atmel_lcdfb_pdata *data,unsigned long fbmem_start,unsigned long fbmem_len,u64 pin_mask);drivers/video/atmel_lcdfb.c +0
-0
drivers/video/atmel_lcdfb.c line 23
Quoted 4 lines
drivers/video/atmel_lcdfb.c +1
-0@@ -20,12 +20,45 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <video/of_display_timing.h>
I am not sure this one is useful for this patch, maybe place it in the 4/8 one.
drivers/video/atmel_lcdfb.c line 36
Quoted 12 lines
drivers/video/atmel_lcdfb.c +7
-0#include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> +struct atmel_lcdfb_config { +bool have_alt_pixclock; +bool have_hozval; +bool have_intensity_bit; +}; + +/* LCD Controller info data structure, stored in device platform_data */
Is comment still relevant?
Quoted 264 lines
drivers/video/atmel_lcdfb.c +59
-37+struct atmel_lcdfb_info { +spinlock_t lock; +struct fb_info *info; +void __iomem *mmio; +int irq_base; +struct work_struct task; + +unsigned int smem_len; +struct platform_device *pdev; +struct clk *bus_clk; +struct clk *lcdc_clk; + +struct backlight_device *backlight; +u8 bl_power; +bool lcdcon_pol_negative; +u8 saved_lcdcon; + +u32 pseudo_palette[16 ]; +bool have_intensity_bit; + +struct atmel_lcdfb_pdata pdata; + +struct atmel_lcdfb_config *config; +}; +#define lcdc_readl (sinfo, reg) __raw_readl((sinfo)->mmio+(reg))#define lcdc_writel (sinfo, reg, val) __raw_writel((val), (sinfo)->mmio+(reg))@@ -34,12 +67,6 @@#define ATMEL_LCDC_DMA_BURST_LEN 8/* words */ #define ATMEL_LCDC_FIFO_SIZE 512/* words */ -struct atmel_lcdfb_config { -bool have_alt_pixclock; -bool have_hozval; -bool have_intensity_bit; -}; -static struct atmel_lcdfb_config at91sam9261_config = { .have_hozval = true, .have_intensity_bit = true,@@ -242,6 +269,8 @@ static void exit_backlight(struct atmel_lcdfb_info *sinfo)static void init_contrast (struct atmel_lcdfb_info *sinfo) { +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; +/* contrast pwm can be 'inverted' */ if (sinfo->lcdcon_pol_negative) contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE );@@ -250,7 +279,7 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo)lcdc_writel (sinfo,ATMEL_LCDC_CONTRAST_CTR , contrast_ctr);lcdc_writel (sinfo,ATMEL_LCDC_CONTRAST_VAL ,ATMEL_LCDC_CVAL_DEFAULT ); -if (sinfo->lcdcon_is_backlight) +if (pdata->lcdcon_is_backlight)init_backlight (sinfo); }@@ -293,9 +322,11 @@ static unsigned long compute_hozval(struct atmel_lcdfb_info *sinfo,static void atmel_lcdfb_stop_nowait (struct atmel_lcdfb_info *sinfo) { +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; +/* Turn off the LCD controller and the DMA controller */ lcdc_writel (sinfo,ATMEL_LCDC_PWRCON , - sinfo->guard_time <<ATMEL_LCDC_GUARDT_OFFSET ); + pdata->guard_time <<ATMEL_LCDC_GUARDT_OFFSET );/* Wait for the LCDC core to become idle */ while (lcdc_readl (sinfo,ATMEL_LCDC_PWRCON ) &ATMEL_LCDC_BUSY )@@ -315,9 +346,11 @@ static void atmel_lcdfb_stop(struct atmel_lcdfb_info *sinfo)static void atmel_lcdfb_start (struct atmel_lcdfb_info *sinfo) { -lcdc_writel (sinfo,ATMEL_LCDC_DMACON , sinfo->default_dmacon); +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; + +lcdc_writel (sinfo,ATMEL_LCDC_DMACON , pdata->default_dmacon);lcdc_writel (sinfo,ATMEL_LCDC_PWRCON , - (sinfo->guard_time <<ATMEL_LCDC_GUARDT_OFFSET ) + (pdata->guard_time <<ATMEL_LCDC_GUARDT_OFFSET ) |ATMEL_LCDC_PWR ); }@@ -418,6 +451,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, {struct device *dev = info->device;struct atmel_lcdfb_info *sinfo = info->par; +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;unsigned long clk_value_khz; clk_value_khz =clk_get_rate (sinfo->lcdc_clk) /1000 ;@@ -501,7 +535,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,else var->green.length =6 ; -if (sinfo->lcd_wiring_mode ==ATMEL_LCDC_WIRING_RGB ) { +if (pdata->lcd_wiring_mode ==ATMEL_LCDC_WIRING_RGB ) {/* RGB:5X5 mode */ var->red.offset = var->green.length +5 ; var->blue.offset =0 ;@@ -518,7 +552,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, var->transp.length =8 ;/* fall through */ case 24 : -if (sinfo->lcd_wiring_mode ==ATMEL_LCDC_WIRING_RGB ) { +if (pdata->lcd_wiring_mode ==ATMEL_LCDC_WIRING_RGB ) {/* RGB:888 mode */ var->red.offset =16 ; var->blue.offset =0 ;@@ -567,6 +601,7 @@ static void atmel_lcdfb_reset(struct atmel_lcdfb_info *sinfo)static int atmel_lcdfb_set_par (struct fb_info *info) {struct atmel_lcdfb_info *sinfo = info->par; +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;unsigned long hozval_linesz;unsigned long value;unsigned long clk_value_khz;@@ -628,7 +663,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)/* Initialize control register 2 */ - value = sinfo->default_lcdcon2; + value = pdata->default_lcdcon2;if (!(info->var.sync &FB_SYNC_HOR_HIGH_ACT )) value |=ATMEL_LCDC_INVLINE_INVERTED ;@@ -732,6 +767,7 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red, unsigned int transp, struct fb_info *info) { struct atmel_lcdfb_info *sinfo = info->par; +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;unsigned int val;u32 *pal;int ret =1 ;@@ -768,8 +804,7 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,*/ }else {/* new style BGR:565 / RGB:565 */ -if (sinfo->lcd_wiring_mode == -ATMEL_LCDC_WIRING_RGB ) { +if (pdata->lcd_wiring_mode ==ATMEL_LCDC_WIRING_RGB ) { val = ((blue >>11 ) &0x001f ); val |= ((red >>0 ) &0xf800 ); }else {@@ -909,7 +944,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct fb_info *info;struct atmel_lcdfb_info *sinfo; -struct atmel_lcdfb_info *pdata_sinfo; +struct atmel_lcdfb_pdata *pdata;struct fb_videomode fbmode;struct resource *regs =NULL ;struct resource *map =NULL ;@@ -927,17 +962,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) sinfo = info->par;if (dev->platform_data) { - pdata_sinfo = (struct atmel_lcdfb_info *)dev->platform_data; - sinfo->default_bpp = pdata_sinfo->default_bpp; - sinfo->default_dmacon = pdata_sinfo->default_dmacon; - sinfo->default_lcdcon2 = pdata_sinfo->default_lcdcon2; - sinfo->default_monspecs = pdata_sinfo->default_monspecs; - sinfo->atmel_lcdfb_power_control = pdata_sinfo->atmel_lcdfb_power_control; - sinfo->guard_time = pdata_sinfo->guard_time; - sinfo->smem_len = pdata_sinfo->smem_len; - sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight; - sinfo->lcdcon_pol_negative = pdata_sinfo->lcdcon_pol_negative; - sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode; + pdata = (struct atmel_lcdfb_pdata *)dev->platform_data; + sinfo->pdata = *pdata; }else {dev_err (dev,"cannot get default configuration\n" ); goto free_info;@@ -953,7 +979,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) info->pseudo_palette = sinfo->pseudo_palette; info->fbops = &atmel_lcdfb_ops; -memcpy (&info->monspecs, sinfo->default_monspecs,sizeof (info->monspecs)); +memcpy (&info->monspecs, pdata->default_monspecs,sizeof (info->monspecs)); info->fix = atmel_lcdfb_fix;/* Enable LCDC Clocks */ @@ -971,7 +997,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) ret =fb_find_mode (&info->var, info,NULL , info->monspecs.modedb, info->monspecs.modedb_len, info->monspecs.modedb, - sinfo->default_bpp); + pdata->default_bpp);if (!ret) {dev_err (dev,"no suitable video mode found\n" ); goto stop_clk;@@ -1088,8 +1114,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)fb_add_videomode (&fbmode, &info->modelist);/* Power up the LCDC screen */ -if (sinfo->atmel_lcdfb_power_control) - sinfo->atmel_lcdfb_power_control (1 ); +if (pdata->atmel_lcdfb_power_control) + pdata->atmel_lcdfb_power_control (1 );dev_info (dev,"fb%d: Atmel LCDC at 0x%08lx (mapped at %p), irq %d\n" , info->node, info->fix.mmio_start, sinfo->mmio, sinfo->irq_base);@@ -1134,15 +1160,17 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)struct device *dev = &pdev->dev;struct fb_info *info =dev_get_drvdata (dev);struct atmel_lcdfb_info *sinfo; +struct atmel_lcdfb_pdata *pdata;if (!info || !info->par)return 0 ; sinfo = info->par; + pdata = &sinfo->pdata;cancel_work_sync (&sinfo->task);exit_backlight (sinfo); -if (sinfo->atmel_lcdfb_power_control) - sinfo->atmel_lcdfb_power_control (0 ); +if (pdata->atmel_lcdfb_power_control) + pdata->atmel_lcdfb_power_control (0 );unregister_framebuffer (info);atmel_lcdfb_stop_clock (sinfo);clk_put (sinfo->lcdc_clk);@@ -1170,6 +1198,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg) {struct fb_info *info =platform_get_drvdata (pdev);struct atmel_lcdfb_info *sinfo = info->par; +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;/* * We don't want to handle interrupts while the clock is @@ -1179,8 +1208,8 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg) sinfo->saved_lcdcon =lcdc_readl (sinfo,ATMEL_LCDC_CONTRAST_CTR );lcdc_writel (sinfo,ATMEL_LCDC_CONTRAST_CTR ,0 ); -if (sinfo->atmel_lcdfb_power_control) - sinfo->atmel_lcdfb_power_control (0 ); +if (pdata->atmel_lcdfb_power_control) + pdata->atmel_lcdfb_power_control (0 );atmel_lcdfb_stop (sinfo);atmel_lcdfb_stop_clock (sinfo);@@ -1192,11 +1221,12 @@ static int atmel_lcdfb_resume(struct platform_device *pdev) {struct fb_info *info =platform_get_drvdata (pdev);struct atmel_lcdfb_info *sinfo = info->par; +struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;atmel_lcdfb_start_clock (sinfo);atmel_lcdfb_start (sinfo); -if (sinfo->atmel_lcdfb_power_control) - sinfo->atmel_lcdfb_power_control (1 ); +if (pdata->atmel_lcdfb_power_control) + pdata->atmel_lcdfb_power_control (1 );lcdc_writel (sinfo,ATMEL_LCDC_CONTRAST_CTR , sinfo->saved_lcdcon);/* Enable FIFO & DMA errors */ include/video/atmel_lcdc.h +0
-0
include/video/atmel_lcdc.h line 35
Quoted 6 lines
include/video/atmel_lcdc.h +0
-1@@ -31,39 +31,17 @@#define ATMEL_LCDC_WIRING_BGR 0#define ATMEL_LCDC_WIRING_RGB 1 -struct atmel_lcdfb_config ;/* LCD Controller info data structure, stored in device platform_data */
Wrong comment: it is not the "info" data structure, this time.
Quoted 35 lines
include/video/atmel_lcdc.h +1
-22-struct atmel_lcdfb_info { -spinlock_t lock; -struct fb_info *info; -void __iomem *mmio; -int irq_base; -struct work_struct task; - +struct atmel_lcdfb_pdata {unsigned int guard_time; -unsigned int smem_len; -struct platform_device *pdev; -struct clk *bus_clk; -struct clk *lcdc_clk; - -#ifdef CONFIG_BACKLIGHT_ATMEL_LCDC -struct backlight_device *backlight; -u8 bl_power; -#endif bool lcdcon_is_backlight; -bool lcdcon_pol_negative; -u8 saved_lcdcon; -u8 default_bpp;u8 lcd_wiring_mode;unsigned int default_lcdcon2;unsigned int default_dmacon;void (*atmel_lcdfb_power_control)(int on);struct fb_monspecs *default_monspecs; -u32 pseudo_palette[16 ]; - -struct atmel_lcdfb_config *config; };#define ATMEL_LCDC_DMABADDR1 0x00
Signature · 1 line
Nicolas Ferre
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
In reply to Jean-Christophe PLAGNIOL-VILLARD2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 32 lines
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)
[snip]
Quoted 27 lines
drivers/video/atmel_lcdfb.c +13
-0@@ -20,12 +20,45 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <video/of_display_timing.h> #include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> +struct atmel_lcdfb_config { +bool have_alt_pixclock; +bool have_hozval; +bool have_intensity_bit; +}; + +/* LCD Controller info data structure, stored in device platform_data */ +struct atmel_lcdfb_info { +spinlock_t lock; +struct fb_info *info; +void __iomem *mmio; +int irq_base;
drivers/video/atmel_lcdfb.c line 51
Quoted 10 lines
drivers/video/atmel_lcdfb.c +10
-0+struct work_struct task; + +unsigned int smem_len; +struct platform_device *pdev; +struct clk *bus_clk; +struct clk *lcdc_clk; + +struct backlight_device *backlight; +u8 bl_power; +bool lcdcon_pol_negative;
I think lcdcon_pol_negative should be part of pdata, because it really depends on how the PWM is wired on the board.
Regards,
Richard.
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
Quoted 65 lines · Richard Genoud
2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 32 lines
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)[snip]
Quoted 31 lines
drivers/video/atmel_lcdfb.c +17
-0@@ -20,12 +20,45 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <video/of_display_timing.h> #include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> +struct atmel_lcdfb_config { +bool have_alt_pixclock; +bool have_hozval; +bool have_intensity_bit; +}; + +/* LCD Controller info data structure, stored in device platform_data */ +struct atmel_lcdfb_info { +spinlock_t lock; +struct fb_info *info; +void __iomem *mmio; +int irq_base; +struct work_struct task; + +unsigned int smem_len; +struct platform_device *pdev;
Quoted 9 lines
drivers/video/atmel_lcdfb.c line 51
Quoted 6 lines
drivers/video/atmel_lcdfb.c +6
-0+struct clk *bus_clk; +struct clk *lcdc_clk; + +struct backlight_device *backlight; +u8 bl_power; +bool lcdcon_pol_negative;I think
lcdcon_pol_negativeshould be part of pdata, because it really depends on how the PWM is wired on the board.
maybe but no one mainline use it on any pdata for non-dt boars so I did not want to expose it
Best Regatgards,
J.
Quoted 3 lines
Regards,
Richard.
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 76 lines · Richard Genoud
Quoted 65 lines
2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 32 lines
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)[snip]
Quoted 31 lines
drivers/video/atmel_lcdfb.c +17
-0@@ -20,12 +20,45 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <video/of_display_timing.h> #include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> +struct atmel_lcdfb_config { +bool have_alt_pixclock; +bool have_hozval; +bool have_intensity_bit; +}; + +/* LCD Controller info data structure, stored in device platform_data */ +struct atmel_lcdfb_info { +spinlock_t lock; +struct fb_info *info; +void __iomem *mmio; +int irq_base; +struct work_struct task; + +unsigned int smem_len; +struct platform_device *pdev;Quoted 9 lines
drivers/video/atmel_lcdfb.c line 51
Quoted 6 lines
drivers/video/atmel_lcdfb.c +6
-0+struct clk *bus_clk; +struct clk *lcdc_clk; + +struct backlight_device *backlight; +u8 bl_power; +bool lcdcon_pol_negative;I think
lcdcon_pol_negativeshould be part of pdata, because it really depends on how the PWM is wired on the board.
Quoted 2 lines
maybe but no one mainline use it on any pdata for non-dt boars so I did not want to expose it
Well, at least, I'm using it :)
(and I guess that Andreas is using it also, otherwise he wouldn't have introduce it !)
Best regards,
Richard.
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
Quoted 77 lines · Richard Genoud
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 76 lines · Richard Genoud
Quoted 74 lines
2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 32 lines
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)[snip]
Quoted 27 lines
drivers/video/atmel_lcdfb.c +13
-0@@ -20,12 +20,45 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <video/of_display_timing.h> #include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> +struct atmel_lcdfb_config { +bool have_alt_pixclock; +bool have_hozval; +bool have_intensity_bit; +}; + +/* LCD Controller info data structure, stored in device platform_data */ +struct atmel_lcdfb_info { +spinlock_t lock; +struct fb_info *info; +void __iomem *mmio; +int irq_base;drivers/video/atmel_lcdfb.c line 51
Quoted 10 lines
drivers/video/atmel_lcdfb.c +10
-0+struct work_struct task; + +unsigned int smem_len; +struct platform_device *pdev; +struct clk *bus_clk; +struct clk *lcdc_clk; + +struct backlight_device *backlight; +u8 bl_power; +bool lcdcon_pol_negative;I think
lcdcon_pol_negativeshould be part of pdata, because it really depends on how the PWM is wired on the board.
Quoted 5 lines
Quoted 2 lines
maybe but no one mainline use it on any pdata for non-dt boars so I did not want to expose it
Well, at least, I'm using it :)
(and I guess that Andreas is using it also, otherwise he wouldn't have introduce it !)
yes but pdata is for non-dt boards, for dt you can keep it in struct atmel_lcdfb_info and add a property
if non-dt boards want it my answer is I do not care switch to DT
Best Regards,
J.
Quoted 4 lines
Best regards,
Richard.
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 80 lines · Richard Genoud
Quoted 79 lines
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 78 lines · Richard Genoud
Quoted 65 lines
2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 32 lines
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)[snip]
Quoted 31 lines
drivers/video/atmel_lcdfb.c +17
-0@@ -20,12 +20,45 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <video/of_display_timing.h> #include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> +struct atmel_lcdfb_config { +bool have_alt_pixclock; +bool have_hozval; +bool have_intensity_bit; +}; + +/* LCD Controller info data structure, stored in device platform_data */ +struct atmel_lcdfb_info { +spinlock_t lock; +struct fb_info *info; +void __iomem *mmio; +int irq_base; +struct work_struct task; + +unsigned int smem_len; +struct platform_device *pdev;Quoted 9 lines
drivers/video/atmel_lcdfb.c line 51
Quoted 6 lines
drivers/video/atmel_lcdfb.c +6
-0+struct clk *bus_clk; +struct clk *lcdc_clk; + +struct backlight_device *backlight; +u8 bl_power; +bool lcdcon_pol_negative;I think
lcdcon_pol_negativeshould be part of pdata, because it really depends on how the PWM is wired on the board.maybe but no one mainline use it on any pdata for non-dt boars so I did not want to expose it
Quoted 8 lines
Quoted 3 lines
Well, at least, I'm using it :)
(and I guess that Andreas is using it also, otherwise he wouldn't have introduce it !)yes but pdata is for non-dt boards, for dt you can keep it in struct
atmel_lcdfb_infoand add a propertyif non-dt boards want it my answer is I do not care switch to DT
ok (I use a full DT board based on sam9g35)
so I'll add something like sinfo->lcdcon_pol_negative = of_property_read_bool(display_np, "atmel,lcdcon-pwm-pulse-low");
in /atmel_lcdfb.c
But I thought the goal of this patch was to separate driver data from platform specific data, and IMHO, lcdcon_pol_negative is a specificity of the platform.
Best regards,
Richard.
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
Quoted 92 lines · Richard Genoud
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 80 lines · Richard Genoud
Quoted 79 lines
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 78 lines · Richard Genoud
Quoted 65 lines
2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 32 lines
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)[snip]
Quoted 31 lines
drivers/video/atmel_lcdfb.c +17
-0@@ -20,12 +20,45 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <video/of_display_timing.h> #include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> +struct atmel_lcdfb_config { +bool have_alt_pixclock; +bool have_hozval; +bool have_intensity_bit; +}; + +/* LCD Controller info data structure, stored in device platform_data */ +struct atmel_lcdfb_info { +spinlock_t lock; +struct fb_info *info; +void __iomem *mmio; +int irq_base; +struct work_struct task; + +unsigned int smem_len; +struct platform_device *pdev;Quoted 9 lines
drivers/video/atmel_lcdfb.c line 51
Quoted 6 lines
drivers/video/atmel_lcdfb.c +6
-0+struct clk *bus_clk; +struct clk *lcdc_clk; + +struct backlight_device *backlight; +u8 bl_power; +bool lcdcon_pol_negative;I think
lcdcon_pol_negativeshould be part of pdata, because it really depends on how the PWM is wired on the board.maybe but no one mainline use it on any pdata for non-dt boars so I did not want to expose it
Quoted 8 lines
Quoted 3 lines
Well, at least, I'm using it :)
(and I guess that Andreas is using it also, otherwise he wouldn't have introduce it !)yes but pdata is for non-dt boards, for dt you can keep it in struct
atmel_lcdfb_infoand add a propertyif non-dt boards want it my answer is I do not care switch to DT
ok (I use a full DT board based on sam9g35)
Quoted 8 lines
so I'll add something like
sinfo->lcdcon_pol_negative=of_property_read_bool(display_np, "atmel,lcdcon-pwm-pulse-low");
in /atmel_lcdfb.cBut I thought the goal of this patch was to separate driver data from platform specific data, and IMHO,
lcdcon_pol_negativeis a specificity of the platform.
You are right but as non one mainline use it as pdata I choose to drop it and only keep it on the driver as we can still use it for DT
It's a way to force peopoe to switch to DT
Best Regards,
J.
Quoted 3 lines
Best regards,
Richard.
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · Richard Genoud
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 4 lines · Richard Genoud
Quoted 3 lines
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 2 lines · Richard Genoud
Quoted 1 line
2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
<snipp diff>
Quoted 23 lines
Quoted 23 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
+ bool
lcdcon_pol_negative;I think
lcdcon_pol_negativeshould be part of pdata, because it really depends on how the PWM is wired on the board.maybe but no one mainline use it on any pdata for non-dt boars so I did not want to expose it
Quoted 8 lines
Quoted 3 lines
Well, at least, I'm using it :)
(and I guess that Andreas is using it also, otherwise he wouldn't have introduce it !)yes but pdata is for non-dt boards, for dt you can keep it in struct
atmel_lcdfb_infoand add a propertyif non-dt boards want it my answer is I do not care switch to DT
ok (I use a full DT board based on sam9g35)
so I'll add something like
sinfo->lcdcon_pol_negative=of_property_read_bool(display_np, "atmel,lcdcon-pwm-pulse-low");
in /atmel_lcdfb.c
Quoted 8 lines
Quoted 3 lines
But I thought the goal of this patch was to separate driver data from platform specific data, and IMHO,
lcdcon_pol_negativeis a specificity of the platform.You are right but as non one mainline use it as pdata I choose to drop it and only keep it on the driver as we can still use it for DT
It's a way to force peopoe to switch to DT
FYI AVR32 architecture doesn't support device tree, nor is it likely to do so. However there are no users of the PWM output from the LCDC block for the boards in the current kernel, and I doubt new boards will pop.
Signature · 1 line
Hans-Christian Egtvedt
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 98 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 97 lines · Richard Genoud
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 80 lines · Richard Genoud
Quoted 79 lines
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 78 lines · Richard Genoud
Quoted 65 lines
2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 32 lines
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)[snip]
Quoted 31 lines
drivers/video/atmel_lcdfb.c +17
-0@@ -20,12 +20,45 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <video/of_display_timing.h> #include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> +struct atmel_lcdfb_config { +bool have_alt_pixclock; +bool have_hozval; +bool have_intensity_bit; +}; + +/* LCD Controller info data structure, stored in device platform_data */ +struct atmel_lcdfb_info { +spinlock_t lock; +struct fb_info *info; +void __iomem *mmio; +int irq_base; +struct work_struct task; + +unsigned int smem_len; +struct platform_device *pdev;Quoted 9 lines
drivers/video/atmel_lcdfb.c line 51
Quoted 6 lines
drivers/video/atmel_lcdfb.c +6
-0+struct clk *bus_clk; +struct clk *lcdc_clk; + +struct backlight_device *backlight; +u8 bl_power; +bool lcdcon_pol_negative;I think
lcdcon_pol_negativeshould be part of pdata, because it really depends on how the PWM is wired on the board.maybe but no one mainline use it on any pdata for non-dt boars so I did not want to expose it
Quoted 8 lines
Quoted 3 lines
Well, at least, I'm using it :)
(and I guess that Andreas is using it also, otherwise he wouldn't have introduce it !)yes but pdata is for non-dt boards, for dt you can keep it in struct
atmel_lcdfb_infoand add a propertyif non-dt boards want it my answer is I do not care switch to DT
ok (I use a full DT board based on sam9g35)
so I'll add something like
sinfo->lcdcon_pol_negative=of_property_read_bool(display_np, "atmel,lcdcon-pwm-pulse-low");
in /atmel_lcdfb.c
Quoted 8 lines
Quoted 3 lines
But I thought the goal of this patch was to separate driver data from platform specific data, and IMHO,
lcdcon_pol_negativeis a specificity of the platform.You are right but as non one mainline use it as pdata I choose to drop it and only keep it on the driver as we can still use it for DT
It's a way to force peopoe to switch to DT
well, we use it on an avr32 board (not mainlined; though no kernel update planned currently) ... but no way to use DT currently.
Best regards
Andreas Bie?mann
PATCH 1/8 video: atmel_lcdfb: fix platform data struct
Quoted 103 lines · Andreas Bie?mann
Quoted 102 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 100 lines · Richard Genoud
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 80 lines · Richard Genoud
Quoted 79 lines
2013/5/29 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 78 lines · Richard Genoud
Quoted 65 lines
2013/4/11 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:
Quoted 32 lines
Today we mix pdata and drivers data in the struct
atmel_lcdfb_infoFix it and introduce a new structatmel_lcdfb_pdatafor platform data onlySigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Nicolas Ferre <[email protected]>Cc Andrew Morton <[email protected]>Cc Hans-Christian Egtvedt <[email protected]>--- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +-- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 104 +++++++++++++++++---------- include/video/atmel_lcdc.h | 24 +------ 21 files changed, 109 insertions(+), 101 deletions(-)[snip]
Quoted 31 lines
drivers/video/atmel_lcdfb.c +17
-0@@ -20,12 +20,45 @@#include <linux/gfp.h> #include <linux/module.h> #include <linux/platform_data/atmel.h> +#include <video/of_display_timing.h> #include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> +struct atmel_lcdfb_config { +bool have_alt_pixclock; +bool have_hozval; +bool have_intensity_bit; +}; + +/* LCD Controller info data structure, stored in device platform_data */ +struct atmel_lcdfb_info { +spinlock_t lock; +struct fb_info *info; +void __iomem *mmio; +int irq_base; +struct work_struct task; + +unsigned int smem_len; +struct platform_device *pdev;Quoted 9 lines
drivers/video/atmel_lcdfb.c line 51
Quoted 6 lines
drivers/video/atmel_lcdfb.c +6
-0+struct clk *bus_clk; +struct clk *lcdc_clk; + +struct backlight_device *backlight; +u8 bl_power; +bool lcdcon_pol_negative;I think
lcdcon_pol_negativeshould be part of pdata, because it really depends on how the PWM is wired on the board.maybe but no one mainline use it on any pdata for non-dt boars so I did not want to expose it
Quoted 8 lines
Quoted 3 lines
Well, at least, I'm using it :)
(and I guess that Andreas is using it also, otherwise he wouldn't have introduce it !)yes but pdata is for non-dt boards, for dt you can keep it in struct
atmel_lcdfb_infoand add a propertyif non-dt boards want it my answer is I do not care switch to DT
ok (I use a full DT board based on sam9g35)
so I'll add something like
sinfo->lcdcon_pol_negative=of_property_read_bool(display_np, "atmel,lcdcon-pwm-pulse-low");
in /atmel_lcdfb.cBut I thought the goal of this patch was to separate driver data from platform specific data, and IMHO,
lcdcon_pol_negativeis a specificity of the platform.
Quoted 7 lines
Quoted 4 lines
You are right but as non one mainline use it as pdata I choose to drop it and only keep it on the driver as we can still use it for DT
It's a way to force peopoe to switch to DT
well, we use it on an avr32 board (not mainlined; though no kernel update planned currently) ... but no way to use DT currently.
If there is 1 ARV32 user it's an other story
Best Regards,
J.
Quoted 4 lines
Best regards
Andreas Bie?mann