You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
(1) |
Apr
(104) |
May
(81) |
Jun
(248) |
Jul
(133) |
Aug
(33) |
Sep
(53) |
Oct
(82) |
Nov
(166) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(121) |
Feb
(42) |
Mar
(39) |
Apr
(84) |
May
(87) |
Jun
(58) |
Jul
(97) |
Aug
(130) |
Sep
(32) |
Oct
(139) |
Nov
(108) |
Dec
(216) |
2003 |
Jan
(299) |
Feb
(136) |
Mar
(392) |
Apr
(141) |
May
(137) |
Jun
(107) |
Jul
(94) |
Aug
(262) |
Sep
(300) |
Oct
(216) |
Nov
(72) |
Dec
(94) |
2004 |
Jan
(174) |
Feb
(192) |
Mar
(215) |
Apr
(314) |
May
(319) |
Jun
(293) |
Jul
(205) |
Aug
(161) |
Sep
(192) |
Oct
(226) |
Nov
(308) |
Dec
(89) |
2005 |
Jan
(127) |
Feb
(269) |
Mar
(588) |
Apr
(106) |
May
(77) |
Jun
(77) |
Jul
(161) |
Aug
(239) |
Sep
(86) |
Oct
(112) |
Nov
(153) |
Dec
(145) |
2006 |
Jan
(87) |
Feb
(57) |
Mar
(129) |
Apr
(109) |
May
(102) |
Jun
(232) |
Jul
(97) |
Aug
(69) |
Sep
(67) |
Oct
(69) |
Nov
(214) |
Dec
(82) |
2007 |
Jan
(133) |
Feb
(307) |
Mar
(121) |
Apr
(171) |
May
(229) |
Jun
(156) |
Jul
(185) |
Aug
(160) |
Sep
(122) |
Oct
(130) |
Nov
(78) |
Dec
(27) |
2008 |
Jan
(105) |
Feb
(137) |
Mar
(146) |
Apr
(148) |
May
(239) |
Jun
(208) |
Jul
(157) |
Aug
(244) |
Sep
(119) |
Oct
(125) |
Nov
(189) |
Dec
(225) |
2009 |
Jan
(157) |
Feb
(139) |
Mar
(106) |
Apr
(130) |
May
(246) |
Jun
(189) |
Jul
(128) |
Aug
(127) |
Sep
(88) |
Oct
(86) |
Nov
(216) |
Dec
(9) |
2010 |
Jan
(5) |
Feb
|
Mar
(11) |
Apr
(31) |
May
(3) |
Jun
|
Jul
(7) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:33:35
|
On Thu, 4 Jun 2009 20:52:40 +0300 Imre Deak <imr...@no...> wrote: > From: Jouni Hogander <jou...@no...> > > Without wakeup enable omap doesn't wake up on dispc interrupts. This > causes problems in a case where mpu is in sleep state and dispc > interrupt fires. > > Signed-off-by: Jouni Hogander <jou...@no...> > Signed-off-by: Tony Lindgren <to...@at...> > Signed-off-by: Imre Deak <imr...@no...> > --- > drivers/video/omap/dispc.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > Acked-by: Krzysztof Helt <krz...@wp...> ---------------------------------------------------------------------- Nowa akcja Pepsi - nagrody za kody spod nakretek. Zarejestruj sie! http://link.interia.pl/f21cc |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:33:06
|
On Thu, 4 Jun 2009 20:52:39 +0300 Imre Deak <imr...@no...> wrote: > From: Jouni Hogander <jou...@no...> > > Leaving interface clocks enabled causes dss pwrdm to stay in active > state when mpu is in active state. This fix puts dss to sleep state > when it is not needed. > > Earlier version broke framebuffer on 24xx. This is fixed by enabling > clocks before trying to access DISPC_IRQSTATUS register. > > Signed-off-by: Jouni Hogander <jou...@no...> > Signed-off-by: Tony Lindgren <to...@at...> > Signed-off-by: Imre Deak <imr...@no...> > --- Acked-by: Krzysztof Helt <krz...@wp...> ---------------------------------------------------------------------- Dobra czy zla wiadomosc? Zawsze warto oszczedzac. Teraz 5,5%. Sprawdz > http://link.interia.pl/f21b0 |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:32:15
|
On Thu, 4 Jun 2009 20:52:37 +0300 Imre Deak <imr...@no...> wrote: > From: Rodrigo Vivi <rod...@op...> > > The LCD controller (EPSON S1D13744) supports rotation (0, 90, 180 > and 270 degrees) on hardware just setting the bits 0 and 1 of 0x28 > register (LCD Panel Configuration Register). Now it is possible to > use this caps only setting the angle degree on var rotate of > fb_var_screeninfo using the FBIOPUT_VSCREENINFO ioctl. > > Signed-off-by: Rodrigo Vivi <rod...@op...> > Signed-off-by: Tony Lindgren <to...@at...> > Fixed-by: Siarhei Siamashka <sia...@no...> > Signed-off-by: Imre Deak <imr...@no...> > --- > drivers/video/omap/blizzard.c | 91 +++++++++++++++++++++++++++++++++++-- > drivers/video/omap/omapfb_main.c | 52 ++++++++++++++++------ > 2 files changed, 124 insertions(+), 19 deletions(-) > Acked-by: Krzysztof Helt <krz...@wp...> ---------------------------------------------------------------------- Przekaz dalej wiadomosc: Zawsze warto oszczedzac. Teraz 5,5%! Sprawdz > http://link.interia.pl/f21b1 |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:32:10
|
On Thu, 4 Jun 2009 20:52:38 +0300 Imre Deak <imr...@no...> wrote: > - value and register offset was swapped in a dispc write > - DISPC_CONTROL register was used instead of DISPC_SYSCONFIG > - FIFO size bit field had incorrect length for OMAP3 > > Signed-off-by: Tony Lindgren <to...@at...> > Fixed-by: arun <aru...@mi...> > Fixed-by: Kalle Jokiniemi <ext...@no...> > Fixed-by: Andrzej Zaborowski <ba...@za...> > Signed-off-by: Imre Deak <imr...@no...> > --- > drivers/video/omap/dispc.c | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > Acked-by: Krzysztof Helt <krz...@wp...> ---------------------------------------------------------------------- Wejdz i kliknij na Swoj znak zodiaku! http://link.interia.pl/f21b8 |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:29:42
|
On Thu, 4 Jun 2009 20:52:36 +0300 Imre Deak <imr...@no...> wrote: > From: Stanley.Miao <sta...@wi...> > > Add glue to control the OMAP_LDP LCD as a frame buffer device > using the existing dispc.c driver under omapfb. > > Patch updated for mainline kernel. Note that the > drivers/video/omap should be updated to pass omap_lcd_config > in platform_data. The patch should also be updated to compile > if twl4030 is not selected, and eventually to use the regulator > framework. > > Signed-off-by: Stanley.Miao <sta...@wi...> > Signed-off-by: Tony Lindgren <to...@at...> > Fixed-by: Jarkko Nikula <jar...@gm...> > Fixed-by: Tony Lindgren <to...@at...> > CC: lin...@li... > Signed-off-by: Imre Deak <imr...@no...> > --- > arch/arm/configs/omap_ldp_defconfig | 54 +++++++++- > drivers/video/omap/Kconfig | 4 + > drivers/video/omap/Makefile | 1 + > drivers/video/omap/lcd_ldp.c | 200 +++++++++++++++++++++++++++++++++++ > 4 files changed, 257 insertions(+), 2 deletions(-) > create mode 100644 drivers/video/omap/lcd_ldp.c > > diff --git a/arch/arm/configs/omap_ldp_defconfig b/arch/arm/configs/omap_ldp_defconfig > index 679a4a3..b9c4891 100644 > --- a/arch/arm/configs/omap_ldp_defconfig > +++ b/arch/arm/configs/omap_ldp_defconfig > @@ -690,6 +690,7 @@ CONFIG_GPIOLIB=y > # CONFIG_GPIO_MAX732X is not set > # CONFIG_GPIO_PCA953X is not set > # CONFIG_GPIO_PCF857X is not set > +CONFIG_GPIO_TWL4030=y > > # > # PCI GPIO expanders: > @@ -742,6 +743,7 @@ CONFIG_SSB_POSSIBLE=y > # CONFIG_MFD_SM501 is not set > # CONFIG_HTC_EGPIO is not set > # CONFIG_HTC_PASIC3 is not set > +CONFIG_TWL4030_CORE=y > # CONFIG_MFD_TMIO is not set > # CONFIG_MFD_T7L66XB is not set > # CONFIG_MFD_TC6387XB is not set > @@ -767,8 +769,46 @@ CONFIG_DAB=y > # > # CONFIG_VGASTATE is not set > CONFIG_VIDEO_OUTPUT_CONTROL=m > -# CONFIG_FB is not set > -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set > +CONFIG_FB=y > +CONFIG_FIRMWARE_EDID=y > +# CONFIG_FB_DDC is not set > +# CONFIG_FB_BOOT_VESA_SUPPORT is not set > +CONFIG_FB_CFB_FILLRECT=y > +CONFIG_FB_CFB_COPYAREA=y > +CONFIG_FB_CFB_IMAGEBLIT=y > +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set > +# CONFIG_FB_SYS_FILLRECT is not set > +# CONFIG_FB_SYS_COPYAREA is not set > +# CONFIG_FB_SYS_IMAGEBLIT is not set > +# CONFIG_FB_FOREIGN_ENDIAN is not set > +# CONFIG_FB_SYS_FOPS is not set > +# CONFIG_FB_SVGALIB is not set > +# CONFIG_FB_MACMODES is not set > +# CONFIG_FB_BACKLIGHT is not set > +CONFIG_FB_MODE_HELPERS=y > +CONFIG_FB_TILEBLITTING=y > + > +# > +# Frame buffer hardware drivers > +# > +# CONFIG_FB_S1D13XXX is not set > +# CONFIG_FB_VIRTUAL is not set > +# CONFIG_FB_METRONOME is not set > +CONFIG_FB_OMAP=y > +CONFIG_FB_OMAP_LCD_VGA=y > +# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set > +# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set > +CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=4 > +CONFIG_BACKLIGHT_LCD_SUPPORT=y > +CONFIG_LCD_CLASS_DEVICE=y > +# CONFIG_LCD_LTV350QV is not set > +# CONFIG_LCD_ILI9320 is not set > +# CONFIG_LCD_TDO24M is not set > +# CONFIG_LCD_VGG2432A4 is not set > +CONFIG_LCD_PLATFORM=y > +CONFIG_BACKLIGHT_CLASS_DEVICE=y > +# CONFIG_BACKLIGHT_CORGI is not set > +# CONFIG_BACKLIGHT_GENERIC is not set > > # > # Display device support > @@ -780,6 +820,16 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m > # > # CONFIG_VGA_CONSOLE is not set > CONFIG_DUMMY_CONSOLE=y > +CONFIG_FRAMEBUFFER_CONSOLE=y > +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set > +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set > +# CONFIG_FONTS is not set > +CONFIG_FONT_8x8=y > +CONFIG_FONT_8x16=y > +CONFIG_LOGO=y > +CONFIG_LOGO_LINUX_MONO=y > +CONFIG_LOGO_LINUX_VGA16=y > +CONFIG_LOGO_LINUX_CLUT224=y > CONFIG_SOUND=y > CONFIG_SND=y > # CONFIG_SND_SEQUENCER is not set > diff --git a/drivers/video/omap/Kconfig b/drivers/video/omap/Kconfig > index eb05e09..2bffc07 100644 > --- a/drivers/video/omap/Kconfig > +++ b/drivers/video/omap/Kconfig > @@ -7,6 +7,10 @@ config FB_OMAP > help > Frame buffer driver for OMAP based boards. > > +config FB_OMAP_LCD_VGA > + bool "Use LCD in VGA mode" > + depends on MACH_OMAP_3430SDP || MACH_OMAP_LDP > + > choice > depends on FB_OMAP && MACH_OVERO > prompt "Screen resolution" > diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile > index 0d2996a..b63b198 100644 > --- a/drivers/video/omap/Makefile > +++ b/drivers/video/omap/Makefile > @@ -29,6 +29,7 @@ objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o > objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o > objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o > objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_2430sdp.o > +objs-y$(CONFIG_MACH_OMAP_LDP) += lcd_ldp.o > objs-y$(CONFIG_MACH_OMAP2EVM) += lcd_omap2evm.o > objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o > objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o > diff --git a/drivers/video/omap/lcd_ldp.c b/drivers/video/omap/lcd_ldp.c > new file mode 100644 > index 0000000..8925230 > --- /dev/null > +++ b/drivers/video/omap/lcd_ldp.c > @@ -0,0 +1,200 @@ > +/* > + * LCD panel support for the TI LDP board > + * > + * Copyright (C) 2007 WindRiver > + * Author: Stanley Miao <sta...@wi...> > + * > + * Derived from drivers/video/omap/lcd-2430sdp.c > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License as published by the > + * Free Software Foundation; either version 2 of the License, or (at your > + * option) any later version. > + * > + * This program is distributed in the hope that it will be useful, but > + * WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License along > + * with this program; if not, write to the Free Software Foundation, Inc., > + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > + */ > + > +#include <linux/module.h> > +#include <linux/platform_device.h> > +#include <linux/delay.h> > +#include <linux/i2c/twl4030.h> > + > +#include <mach/gpio.h> > +#include <mach/mux.h> > +#include <mach/omapfb.h> > +#include <asm/mach-types.h> > + > +#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES) > +#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES) > + > +#define LCD_PANEL_RESET_GPIO 55 > +#define LCD_PANEL_QVGA_GPIO 56 > + > +#ifdef CONFIG_FB_OMAP_LCD_VGA > +#define LCD_XRES 480 > +#define LCD_YRES 640 > +#define LCD_PIXCLOCK_MAX 41700 > +#else > +#define LCD_XRES 240 > +#define LCD_YRES 320 > +#define LCD_PIXCLOCK_MAX 185186 > +#endif > + > +#define PM_RECEIVER TWL4030_MODULE_PM_RECEIVER > +#define ENABLE_VAUX2_DEDICATED 0x09 > +#define ENABLE_VAUX2_DEV_GRP 0x20 > +#define ENABLE_VAUX3_DEDICATED 0x03 > +#define ENABLE_VAUX3_DEV_GRP 0x20 > + > +#define ENABLE_VPLL2_DEDICATED 0x05 > +#define ENABLE_VPLL2_DEV_GRP 0xE0 > +#define TWL4030_VPLL2_DEV_GRP 0x33 > +#define TWL4030_VPLL2_DEDICATED 0x36 > + > +#define t2_out(c, r, v) twl4030_i2c_write_u8(c, r, v) > + > + > +static int ldp_panel_init(struct lcd_panel *panel, > + struct omapfb_device *fbdev) > +{ > + gpio_request(LCD_PANEL_RESET_GPIO, "lcd reset"); > + gpio_request(LCD_PANEL_QVGA_GPIO, "lcd qvga"); > + gpio_request(LCD_PANEL_ENABLE_GPIO, "lcd panel"); > + gpio_request(LCD_PANEL_BACKLIGHT_GPIO, "lcd backlight"); > + > + gpio_direction_output(LCD_PANEL_QVGA_GPIO, 0); > + gpio_direction_output(LCD_PANEL_RESET_GPIO, 0); > + gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0); > + gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0); > + > +#ifdef CONFIG_FB_OMAP_LCD_VGA > + gpio_set_value(LCD_PANEL_QVGA_GPIO, 0); > +#else > + gpio_set_value(LCD_PANEL_QVGA_GPIO, 1); > +#endif > + gpio_set_value(LCD_PANEL_RESET_GPIO, 1); > + > + return 0; > +} > + > +static void ldp_panel_cleanup(struct lcd_panel *panel) > +{ > + gpio_free(LCD_PANEL_RESET_GPIO); > + gpio_free(LCD_PANEL_QVGA_GPIO); > + gpio_free(LCD_PANEL_ENABLE_GPIO); > + gpio_free(LCD_PANEL_BACKLIGHT_GPIO); > +} > + > +static int ldp_panel_enable(struct lcd_panel *panel) > +{ > + if (0 != t2_out(PM_RECEIVER, ENABLE_VPLL2_DEDICATED, > + TWL4030_VPLL2_DEDICATED)) > + return -EIO; > + if (0 != t2_out(PM_RECEIVER, ENABLE_VPLL2_DEV_GRP, > + TWL4030_VPLL2_DEV_GRP)) > + return -EIO; > + > + gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1); > + gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 1); > + > + if (0 != t2_out(PM_RECEIVER, ENABLE_VAUX3_DEDICATED, > + TWL4030_VAUX3_DEDICATED)) > + return -EIO; > + if (0 != t2_out(PM_RECEIVER, ENABLE_VAUX3_DEV_GRP, > + TWL4030_VAUX3_DEV_GRP)) > + return -EIO; > + > + return 0; > +} > + > +static void ldp_panel_disable(struct lcd_panel *panel) > +{ > + gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0); > + gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0); > + > + t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEDICATED); > + t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEV_GRP); > + mdelay(4); Use the msleep() instead of the mdelay(). > +} > + > +static unsigned long ldp_panel_get_caps(struct lcd_panel *panel) > +{ > + return 0; > +} > + > +struct lcd_panel ldp_panel = { > + .name = "ldp", > + .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | > + OMAP_LCDC_INV_HSYNC, > + > + .bpp = 16, > + .data_lines = 18, > + .x_res = LCD_XRES, > + .y_res = LCD_YRES, > + .hsw = 3, /* hsync_len (4) - 1 */ > + .hfp = 3, /* right_margin (4) - 1 */ > + .hbp = 39, /* left_margin (40) - 1 */ > + .vsw = 1, /* vsync_len (2) - 1 */ > + .vfp = 2, /* lower_margin */ > + .vbp = 7, /* upper_margin (8) - 1 */ > + > + .pixel_clock = LCD_PIXCLOCK_MAX, > + > + .init = ldp_panel_init, > + .cleanup = ldp_panel_cleanup, > + .enable = ldp_panel_enable, > + .disable = ldp_panel_disable, > + .get_caps = ldp_panel_get_caps, > +}; > + > +static int ldp_panel_probe(struct platform_device *pdev) > +{ > + omapfb_register_panel(&ldp_panel); > + return 0; > +} > + > +static int ldp_panel_remove(struct platform_device *pdev) > +{ > + return 0; > +} > + > +static int ldp_panel_suspend(struct platform_device *pdev, pm_message_t mesg) > +{ > + return 0; > +} > + > +static int ldp_panel_resume(struct platform_device *pdev) > +{ > + return 0; > +} > + > +struct platform_driver ldp_panel_driver = { > + .probe = ldp_panel_probe, > + .remove = ldp_panel_remove, > + .suspend = ldp_panel_suspend, > + .resume = ldp_panel_resume, > + .driver = { > + .name = "ldp_lcd", > + .owner = THIS_MODULE, > + }, > +}; > + > +static int __init ldp_panel_drv_init(void) > +{ > + return platform_driver_register(&ldp_panel_driver); > +} > + > +static void __exit ldp_panel_drv_exit(void) > +{ > + platform_driver_unregister(&ldp_panel_driver); > +} > + > +module_init(ldp_panel_drv_init); > +module_exit(ldp_panel_drv_exit); > -- > 1.6.3.1 > > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Linux-fbdev-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel > ---------------------------------------------------------------------- Chcesz miec nawigacje GPS ? Zamow lub przedluz umowe na neostrade, a nawigacja bedzie Twoja. Kliknij na link po szczegoly! http://link.interia.pl/f219a |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:28:36
|
On Thu, 4 Jun 2009 20:52:35 +0300 Imre Deak <imr...@no...> wrote: > From: Steve Sakoman <st...@sa...> > > Signed-off-by: Steve Sakoman <st...@sa...> > Signed-off-by: Tony Lindgren <to...@at...> > Signed-off-by: Imre Deak <imr...@no...> > --- > drivers/video/omap/Kconfig | 21 +++++ > drivers/video/omap/Makefile | 1 + > drivers/video/omap/lcd_overo.c | 179 ++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 201 insertions(+), 0 deletions(-) > create mode 100644 drivers/video/omap/lcd_overo.c > Acked-by: Krzysztof Helt <krz...@wp...> ---------------------------------------------------------------------- Chcesz miec nawigacje GPS ? Zamow lub przedluz umowe na neostrade, a nawigacja bedzie Twoja. Kliknij na link po szczegoly! http://link.interia.pl/f219a |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:27:07
|
On Thu, 4 Jun 2009 20:52:34 +0300 Imre Deak <imr...@no...> wrote: > From: Koen Kooi <ko...@op...> > > The default resolution is 1024x768@24bit > > This version addresses the comments from Felipe Balbi adn Arun Edarath > > Signed-off-by: Koen Kooi <ko...@op...> > Signed-off-by: Tony Lindgren <to...@at...> > Fixed-by: Felipe Contreras <fel...@gm...> > Fixed-by: Steve Sakoman <st...@sa...> > Fixed-by: Jarkko Nikula <jar...@gm...> > Fixed-by: David Brownell <dbr...@us...> > CC: lin...@li... > Signed-off-by: Imre Deak <imr...@no...> > --- > arch/arm/configs/omap3_beagle_defconfig | 47 +++++++++++- > drivers/video/omap/Makefile | 1 + > drivers/video/omap/lcd_omap3beagle.c | 133 +++++++++++++++++++++++++++++++ > 3 files changed, 180 insertions(+), 1 deletions(-) > create mode 100644 drivers/video/omap/lcd_omap3beagle.c > > diff --git a/arch/arm/configs/omap3_beagle_defconfig b/arch/arm/configs/omap3_beagle_defconfig > index 4c6fb7e..c4726f0 100644 > --- a/arch/arm/configs/omap3_beagle_defconfig > +++ b/arch/arm/configs/omap3_beagle_defconfig > @@ -769,7 +769,33 @@ CONFIG_DAB=y > # > # CONFIG_VGASTATE is not set > # CONFIG_VIDEO_OUTPUT_CONTROL is not set > -# CONFIG_FB is not set > +CONFIG_FB=y > +# CONFIG_FIRMWARE_EDID is not set > +# CONFIG_FB_DDC is not set > +CONFIG_FB_CFB_FILLRECT=y > +CONFIG_FB_CFB_COPYAREA=y > +CONFIG_FB_CFB_IMAGEBLIT=y > +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set > +# CONFIG_FB_SYS_FILLRECT is not set > +# CONFIG_FB_SYS_COPYAREA is not set > +# CONFIG_FB_SYS_IMAGEBLIT is not set > +# CONFIG_FB_FOREIGN_ENDIAN is not set > +# CONFIG_FB_SYS_FOPS is not set > +# CONFIG_FB_SVGALIB is not set > +# CONFIG_FB_MACMODES is not set > +# CONFIG_FB_BACKLIGHT is not set > +# CONFIG_FB_MODE_HELPERS is not set > +# CONFIG_FB_TILEBLITTING is not set > + > +# > +# Frame buffer hardware drivers > +# > +# CONFIG_FB_S1D13XXX is not set > +# CONFIG_FB_VIRTUAL is not set > +CONFIG_FB_OMAP=y > +# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set > +# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set > +CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2 > # CONFIG_BACKLIGHT_LCD_SUPPORT is not set > > # > @@ -782,6 +808,25 @@ CONFIG_DAB=y > # > # CONFIG_VGA_CONSOLE is not set > CONFIG_DUMMY_CONSOLE=y > +CONFIG_FRAMEBUFFER_CONSOLE=y > +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set > +CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y > +CONFIG_FONTS=y > +CONFIG_FONT_8x8=y > +CONFIG_FONT_8x16=y > +# CONFIG_FONT_6x11 is not set > +# CONFIG_FONT_7x14 is not set > +# CONFIG_FONT_PEARL_8x8 is not set > +# CONFIG_FONT_ACORN_8x8 is not set > +# CONFIG_FONT_MINI_4x6 is not set > +# CONFIG_FONT_SUN8x16 is not set > +# CONFIG_FONT_SUN12x22 is not set > +# CONFIG_FONT_10x18 is not set > +# CONFIG_LOGO is not set > + > +# > +# Sound > +# > # CONFIG_SOUND is not set > # CONFIG_HID_SUPPORT is not set > CONFIG_USB_SUPPORT=y > diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile > index 4345157..9ff1815 100644 > --- a/drivers/video/omap/Makefile > +++ b/drivers/video/omap/Makefile > @@ -31,6 +31,7 @@ objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o > objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_2430sdp.o > objs-y$(CONFIG_MACH_OMAP2EVM) += lcd_omap2evm.o > objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o > +objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o > objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o > > omapfb-objs := $(objs-yy) > diff --git a/drivers/video/omap/lcd_omap3beagle.c b/drivers/video/omap/lcd_omap3beagle.c > new file mode 100644 > index 0000000..40454dc > --- /dev/null > +++ b/drivers/video/omap/lcd_omap3beagle.c > @@ -0,0 +1,133 @@ > +/* > + * LCD panel support for the TI OMAP3 Beagle board > + * > + * Author: Koen Kooi <ko...@op...> > + * > + * Derived from drivers/video/omap/lcd-omap3evm.c > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License as published by the > + * Free Software Foundation; either version 2 of the License, or (at your > + * option) any later version. > + * > + * This program is distributed in the hope that it will be useful, but > + * WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License along > + * with this program; if not, write to the Free Software Foundation, Inc., > + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > + */ > + > +#include <linux/module.h> > +#include <linux/platform_device.h> > +#include <linux/gpio.h> > +#include <linux/i2c/twl4030.h> > + > +#include <mach/mux.h> > +#include <mach/omapfb.h> > +#include <asm/mach-types.h> > + > +#define LCD_PANEL_ENABLE_GPIO 170 > + > +#define LCD_XRES 1024 > +#define LCD_YRES 768 > +#define LCD_PIXCLOCK 64000 /* in kHz */ > + Used once and well documented by the assignment. > +static int omap3beagle_panel_init(struct lcd_panel *panel, > + struct omapfb_device *fbdev) > +{ > + gpio_request(LCD_PANEL_ENABLE_GPIO, "LCD enable"); > + return 0; > +} > + > +static void omap3beagle_panel_cleanup(struct lcd_panel *panel) > +{ Should the requested gpio be freed? > +} > + > +static int omap3beagle_panel_enable(struct lcd_panel *panel) > +{ > + gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1); > + return 0; > +} > + > +static void omap3beagle_panel_disable(struct lcd_panel *panel) > +{ > + gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0); > +} > + > +static unsigned long omap3beagle_panel_get_caps(struct lcd_panel *panel) > +{ > + return 0; > +} > + > +struct lcd_panel omap3beagle_panel = { > + .name = "omap3beagle", > + .config = OMAP_LCDC_PANEL_TFT, > + > + .bpp = 16, > + .data_lines = 24, > + .x_res = LCD_XRES, > + .y_res = LCD_YRES, > + .hsw = 3, /* hsync_len (4) - 1 */ > + .hfp = 3, /* right_margin (4) - 1 */ > + .hbp = 39, /* left_margin (40) - 1 */ > + .vsw = 1, /* vsync_len (2) - 1 */ > + .vfp = 2, /* lower_margin */ > + .vbp = 7, /* upper_margin (8) - 1 */ > + > + .pixel_clock = LCD_PIXCLOCK, > + > + .init = omap3beagle_panel_init, > + .cleanup = omap3beagle_panel_cleanup, > + .enable = omap3beagle_panel_enable, > + .disable = omap3beagle_panel_disable, > + .get_caps = omap3beagle_panel_get_caps, > +}; > + > +static int omap3beagle_panel_probe(struct platform_device *pdev) > +{ > + omapfb_register_panel(&omap3beagle_panel); > + return 0; > +} > + > +static int omap3beagle_panel_remove(struct platform_device *pdev) > +{ > + return 0; > +} > + > +static int omap3beagle_panel_suspend(struct platform_device *pdev, > + pm_message_t mesg) > +{ > + return 0; > +} > + > +static int omap3beagle_panel_resume(struct platform_device *pdev) > +{ > + return 0; > +} > + > +struct platform_driver omap3beagle_panel_driver = { > + .probe = omap3beagle_panel_probe, > + .remove = omap3beagle_panel_remove, > + .suspend = omap3beagle_panel_suspend, > + .resume = omap3beagle_panel_resume, > + .driver = { > + .name = "omap3beagle_lcd", > + .owner = THIS_MODULE, > + }, > +}; > + > +static int __init omap3beagle_panel_drv_init(void) > +{ > + return platform_driver_register(&omap3beagle_panel_driver); > +} > + > +static void __exit omap3beagle_panel_drv_exit(void) > +{ > + platform_driver_unregister(&omap3beagle_panel_driver); > +} > + > +module_init(omap3beagle_panel_drv_init); > +module_exit(omap3beagle_panel_drv_exit); > -- > 1.6.3.1 > > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Linux-fbdev-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel > ---------------------------------------------------------------------- Sprawdz wiadomosci z Twojego regionu! Kliknij >>> http://link.interia.pl/f21ba |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:27:05
|
On Thu, 4 Jun 2009 20:52:32 +0300 Imre Deak <imr...@no...> wrote: > From: Kevin Hilman <kh...@mv...> > > The 3430SDP uses the same panel as the 2430SDP. The main difference > are in the GPIO lines used for panel enable and backlight, and the > VAUX register/commands sent to the TWL4030 power subsystem. > > Also, some misc. whitespace cleanups. > > Signed-off-by: Kevin Hilman <kh...@mv...> > Signed-off-by: Tony Lindgren <to...@at...> > Fixed-by: Tony Lindgren <to...@at...> > CC: lin...@li... > Signed-off-by: Imre Deak <imr...@no...> > --- Acked-by: Krzysztof Helt <krz...@wp...> ---------------------------------------------------------------------- Dobra czy zla wiadomosc? Zawsze warto oszczedzac. Teraz 5,5%. Sprawdz > http://link.interia.pl/f21b0 |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:26:50
|
On Thu, 4 Jun 2009 20:52:33 +0300 Imre Deak <imr...@no...> wrote: > From: Steve Sakoman <st...@sa...> > > Add LCD support for OMAP3 EVM > > Backlight support by Arun C <aru...@mi...> > > Signed-off-by: Steve Sakoman <st...@sa...> > Acked-by: Syed Mohammed Khasim <kh...@ti...> > Signed-off-by: Tony Lindgren <to...@at...> > Fixed-by: Jarkko Nikula <jar...@gm...> > Fixed-by: David Brownell <dbr...@us...> > Signed-off-by: Imre Deak <imr...@no...> > --- > drivers/video/omap/Makefile | 1 + > drivers/video/omap/lcd_omap3evm.c | 191 +++++++++++++++++++++++++++++++++++++ > 2 files changed, 192 insertions(+), 0 deletions(-) > create mode 100644 drivers/video/omap/lcd_omap3evm.c > > diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile > index 96d2d43..4345157 100644 > --- a/drivers/video/omap/Makefile > +++ b/drivers/video/omap/Makefile > @@ -30,6 +30,7 @@ objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o > objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o > objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_2430sdp.o > objs-y$(CONFIG_MACH_OMAP2EVM) += lcd_omap2evm.o > +objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o > objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o > > omapfb-objs := $(objs-yy) > diff --git a/drivers/video/omap/lcd_omap3evm.c b/drivers/video/omap/lcd_omap3evm.c > new file mode 100644 > index 0000000..1c3d814 > --- /dev/null > +++ b/drivers/video/omap/lcd_omap3evm.c > @@ -0,0 +1,191 @@ > +/* > + * LCD panel support for the TI OMAP3 EVM board > + * > + * Author: Steve Sakoman <st...@sa...> > + * > + * Derived from drivers/video/omap/lcd-apollon.c > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License as published by the > + * Free Software Foundation; either version 2 of the License, or (at your > + * option) any later version. > + * > + * This program is distributed in the hope that it will be useful, but > + * WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License along > + * with this program; if not, write to the Free Software Foundation, Inc., > + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > + */ > + > +#include <linux/module.h> > +#include <linux/platform_device.h> > +#include <linux/gpio.h> > +#include <linux/i2c/twl4030.h> > + > +#include <mach/mux.h> > +#include <mach/omapfb.h> > +#include <asm/mach-types.h> > + > +#define LCD_PANEL_ENABLE_GPIO 153 > +#define LCD_PANEL_LR 2 > +#define LCD_PANEL_UD 3 > +#define LCD_PANEL_INI 152 > +#define LCD_PANEL_QVGA 154 > +#define LCD_PANEL_RESB 155 > + > +#define LCD_XRES 480 > +#define LCD_YRES 640 > +#define LCD_PIXCLOCK 26000 /* in kHz */ > + You can drop defines used only once. There are no such defines for other panels. > +#define ENABLE_VDAC_DEDICATED 0x03 > +#define ENABLE_VDAC_DEV_GRP 0x20 > +#define ENABLE_VPLL2_DEDICATED 0x05 > +#define ENABLE_VPLL2_DEV_GRP 0xE0 > + > +#define TWL_LED_LEDEN 0x00 > +#define TWL_PWMA_PWMAON 0x00 > +#define TWL_PWMA_PWMAOFF 0x01 > + > +static unsigned int bklight_level; > + > +static int omap3evm_panel_init(struct lcd_panel *panel, > + struct omapfb_device *fbdev) > +{ > + gpio_request(LCD_PANEL_LR, "LCD lr"); > + gpio_request(LCD_PANEL_UD, "LCD ud"); > + gpio_request(LCD_PANEL_INI, "LCD ini"); > + gpio_request(LCD_PANEL_RESB, "LCD resb"); > + gpio_request(LCD_PANEL_QVGA, "LCD qvga"); > + > + gpio_direction_output(LCD_PANEL_RESB, 1); > + gpio_direction_output(LCD_PANEL_INI, 1); > + gpio_direction_output(LCD_PANEL_QVGA, 0); > + gpio_direction_output(LCD_PANEL_LR, 1); > + gpio_direction_output(LCD_PANEL_UD, 1); > + > + twl4030_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_LEDEN); > + twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x01, TWL_PWMA_PWMAON); > + twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x02, TWL_PWMA_PWMAOFF); > + bklight_level = 100; > + > + return 0; > +} > + > +static void omap3evm_panel_cleanup(struct lcd_panel *panel) > +{ Should the requested gpios be freed? > +} > + > +static int omap3evm_panel_enable(struct lcd_panel *panel) > +{ > + gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0); > + return 0; > +} > + > +static void omap3evm_panel_disable(struct lcd_panel *panel) > +{ > + gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1); > +} > + > +static unsigned long omap3evm_panel_get_caps(struct lcd_panel *panel) > +{ > + return 0; > +} > + > +static int omap3evm_bklight_setlevel(struct lcd_panel *panel, > + unsigned int level) > +{ > + u8 c; > + if ((level >= 0) && (level <= 100)) { > + c = (125 * (100 - level)) / 100 + 2; > + twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, c, TWL_PWMA_PWMAOFF); > + bklight_level = level; > + } > + return 0; > +} > + > +static unsigned int omap3evm_bklight_getlevel(struct lcd_panel *panel) > +{ > + return bklight_level; > +} > + > +static unsigned int omap3evm_bklight_getmaxlevel(struct lcd_panel *panel) > +{ > + return 100; > +} > + > +struct lcd_panel omap3evm_panel = { > + .name = "omap3evm", > + .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | > + OMAP_LCDC_INV_HSYNC, > + > + .bpp = 16, > + .data_lines = 18, > + .x_res = LCD_XRES, > + .y_res = LCD_YRES, > + .hsw = 3, /* hsync_len (4) - 1 */ > + .hfp = 3, /* right_margin (4) - 1 */ > + .hbp = 39, /* left_margin (40) - 1 */ > + .vsw = 1, /* vsync_len (2) - 1 */ > + .vfp = 2, /* lower_margin */ > + .vbp = 7, /* upper_margin (8) - 1 */ > + > + .pixel_clock = LCD_PIXCLOCK, > + > + .init = omap3evm_panel_init, > + .cleanup = omap3evm_panel_cleanup, > + .enable = omap3evm_panel_enable, > + .disable = omap3evm_panel_disable, > + .get_caps = omap3evm_panel_get_caps, > + .set_bklight_level = omap3evm_bklight_setlevel, > + .get_bklight_level = omap3evm_bklight_getlevel, > + .get_bklight_max = omap3evm_bklight_getmaxlevel, > +}; > + > +static int omap3evm_panel_probe(struct platform_device *pdev) > +{ > + omapfb_register_panel(&omap3evm_panel); > + return 0; > +} > + > +static int omap3evm_panel_remove(struct platform_device *pdev) > +{ > + return 0; > +} > + > +static int omap3evm_panel_suspend(struct platform_device *pdev, > + pm_message_t mesg) > +{ > + return 0; > +} > + > +static int omap3evm_panel_resume(struct platform_device *pdev) > +{ > + return 0; > +} > + > +struct platform_driver omap3evm_panel_driver = { > + .probe = omap3evm_panel_probe, > + .remove = omap3evm_panel_remove, > + .suspend = omap3evm_panel_suspend, > + .resume = omap3evm_panel_resume, > + .driver = { > + .name = "omap3evm_lcd", > + .owner = THIS_MODULE, > + }, > +}; > + > +static int __init omap3evm_panel_drv_init(void) > +{ > + return platform_driver_register(&omap3evm_panel_driver); > +} > + > +static void __exit omap3evm_panel_drv_exit(void) > +{ > + platform_driver_unregister(&omap3evm_panel_driver); > +} > + > +module_init(omap3evm_panel_drv_init); > +module_exit(omap3evm_panel_drv_exit); > -- > 1.6.3.1 > > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Linux-fbdev-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel > ---------------------------------------------------------------------- Wejdz i kliknij na Swoj znak zodiaku! http://link.interia.pl/f21b8 |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:23:48
|
On Thu, 4 Jun 2009 20:52:31 +0300 Imre Deak <imr...@no...> wrote: > From: arun c <aru...@gm...> > > omap2evm LCD supports VGA and QVGA resolution, by default its in VGA mode. > > Signed-off-by: Arun C <aru...@mi...> > Signed-off-by: Tony Lindgren <to...@at...> > Fixed-by: Jarkko Nikula <jar...@gm...> > Fixed-by: David Brownell <dbr...@us...> > Signed-off-by: Imre Deak <imr...@no...> > --- > drivers/video/omap/Makefile | 1 + > drivers/video/omap/lcd_omap2evm.c | 189 +++++++++++++++++++++++++++++++++++++ > 2 files changed, 190 insertions(+), 0 deletions(-) > create mode 100644 drivers/video/omap/lcd_omap2evm.c > > diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile > index 7a37b03..c2475e3 100644 > --- a/drivers/video/omap/Makefile > +++ b/drivers/video/omap/Makefile > @@ -27,6 +27,7 @@ objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o > > objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o > objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o > +objs-y$(CONFIG_MACH_OMAP2EVM) += lcd_omap2evm.o > objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o > > omapfb-objs := $(objs-yy) diff --git a/drivers/video/omap/lcd_omap2evm.c b/drivers/video/omap/lcd_omap2evm.c new file mode 100644 index 0000000..2fc46c2 --- /dev/null +++ b/drivers/video/omap/lcd_omap2evm.c @@ -0,0 +1,189 @@ +/* + * LCD panel support for the MISTRAL OMAP2EVM board + * + * Author: Arun C <aru...@mi...> + * + * Derived from drivers/video/omap/lcd_omap3evm.c + * Derived from drivers/video/omap/lcd-apollon.c + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/gpio.h> +#include <linux/i2c/twl4030.h> + +#include <mach/mux.h> +#include <mach/omapfb.h> +#include <asm/mach-types.h> + +#define LCD_PANEL_ENABLE_GPIO 154 +#define LCD_PANEL_LR 128 +#define LCD_PANEL_UD 129 +#define LCD_PANEL_INI 152 +#define LCD_PANEL_QVGA 148 +#define LCD_PANEL_RESB 153 + +#define LCD_XRES 480 +#define LCD_YRES 640 +#define LCD_PIXCLOCK_MAX 20000 /* in kHz */ You can drop defines used only once. There are no such defines for some other panels in your patches. + +#define TWL_LED_LEDEN 0x00 +#define TWL_PWMA_PWMAON 0x00 +#define TWL_PWMA_PWMAOFF 0x01 + +static unsigned int bklight_level; + +static int omap2evm_panel_init(struct lcd_panel *panel, + struct omapfb_device *fbdev) +{ + gpio_request(LCD_PANEL_ENABLE_GPIO, "LCD enable"); + gpio_request(LCD_PANEL_LR, "LCD lr"); + gpio_request(LCD_PANEL_UD, "LCD ud"); + gpio_request(LCD_PANEL_INI, "LCD ini"); + gpio_request(LCD_PANEL_QVGA, "LCD qvga"); + gpio_request(LCD_PANEL_RESB, "LCD resb"); + + gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1); + gpio_direction_output(LCD_PANEL_RESB, 1); + gpio_direction_output(LCD_PANEL_INI, 1); + gpio_direction_output(LCD_PANEL_QVGA, 0); + gpio_direction_output(LCD_PANEL_LR, 1); + gpio_direction_output(LCD_PANEL_UD, 1); + + twl4030_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_LEDEN); + twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x01, TWL_PWMA_PWMAON); + twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x02, TWL_PWMA_PWMAOFF); + bklight_level = 100; + + return 0; +} + +static void omap2evm_panel_cleanup(struct lcd_panel *panel) +{ Should the requested gpios be freed? +} + +static int omap2evm_panel_enable(struct lcd_panel *panel) +{ + gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0); + return 0; +} + +static void omap2evm_panel_disable(struct lcd_panel *panel) +{ + gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1); +} + +static unsigned long omap2evm_panel_get_caps(struct lcd_panel *panel) +{ + return 0; +} + +static int omap2evm_bklight_setlevel(struct lcd_panel *panel, + unsigned int level) +{ + u8 c; + if ((level >= 0) && (level <= 100)) { + c = (125 * (100 - level)) / 100 + 2; + twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, c, TWL_PWMA_PWMAOFF); + bklight_level = level; + } + return 0; +} + +static unsigned int omap2evm_bklight_getlevel(struct lcd_panel *panel) +{ + return bklight_level; +} + +static unsigned int omap2evm_bklight_getmaxlevel(struct lcd_panel *panel) +{ + return 100; +} + +struct lcd_panel omap2evm_panel = { + .name = "omap2evm", + .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | + OMAP_LCDC_INV_HSYNC, + + .bpp = 16, + .data_lines = 18, + .x_res = LCD_XRES, + .y_res = LCD_YRES, + .hsw = 3, + .hfp = 0, + .hbp = 28, + .vsw = 2, + .vfp = 1, + .vbp = 0, + + .pixel_clock = LCD_PIXCLOCK_MAX, + + .init = omap2evm_panel_init, + .cleanup = omap2evm_panel_cleanup, + .enable = omap2evm_panel_enable, + .disable = omap2evm_panel_disable, + .get_caps = omap2evm_panel_get_caps, + .set_bklight_level = omap2evm_bklight_setlevel, + .get_bklight_level = omap2evm_bklight_getlevel, + .get_bklight_max = omap2evm_bklight_getmaxlevel, +}; + +static int omap2evm_panel_probe(struct platform_device *pdev) +{ + omapfb_register_panel(&omap2evm_panel); + return 0; +} + +static int omap2evm_panel_remove(struct platform_device *pdev) +{ + return 0; +} + +static int omap2evm_panel_suspend(struct platform_device *pdev, + pm_message_t mesg) +{ + return 0; +} + +static int omap2evm_panel_resume(struct platform_device *pdev) +{ + return 0; +} + +struct platform_driver omap2evm_panel_driver = { + .probe = omap2evm_panel_probe, + .remove = omap2evm_panel_remove, + .suspend = omap2evm_panel_suspend, + .resume = omap2evm_panel_resume, + .driver = { + .name = "omap2evm_lcd", + .owner = THIS_MODULE, + }, +}; + +static int __init omap2evm_panel_drv_init(void) +{ + return platform_driver_register(&omap2evm_panel_driver); +} + +static void __exit omap2evm_panel_drv_exit(void) +{ + platform_driver_unregister(&omap2evm_panel_driver); +} + +module_init(omap2evm_panel_drv_init); +module_exit(omap2evm_panel_drv_exit); -- 1.6.3.1 ---------------------------------------------------------------------- Interia.pl w Twojej kieszeni! Kliknij >>>http://link.interia.pl/f21b8 |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:21:44
|
On Thu, 4 Jun 2009 20:52:30 +0300 Imre Deak <imr...@no...> wrote: > From: Hunyue Yau <hy...@mv...> > > Add glue to control the 2430SDP LCD as a frame buffer device > using the existing dispc.c driver under omapfb. > > Signed-off-by: Hunyue Yau <hy...@mv...> > Signed-off-by: Kevin Hilman <kh...@mv...> > Signed-off-by: Tony Lindgren <to...@at...> > Fixed-by: Kevin Hilman <kh...@mv...> > Fixed-by: Sergio Aguirre <saa...@ti...> > Fixed-by: Francisco Alecrim <fra...@in...> > Fixed-by: Tony Lindgren <to...@at...> > Fixed-by: David Brownell <dbr...@us...> > Signed-off-by: Imre Deak <imr...@no...> > --- > drivers/video/omap/Makefile | 1 + > drivers/video/omap/lcd_2430sdp.c | 196 ++++++++++++++++++++++++++++++++++++++ > 2 files changed, 197 insertions(+), 0 deletions(-) > create mode 100644 drivers/video/omap/lcd_2430sdp.c > > diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile > index 2bf94ad..7a37b03 100644 > --- a/drivers/video/omap/Makefile > +++ b/drivers/video/omap/Makefile > @@ -26,6 +26,7 @@ objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o > objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o > > objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o > +objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o > objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o > > omapfb-objs := $(objs-yy) diff --git a/drivers/video/omap/lcd_2430sdp.c b/drivers/video/omap/lcd_2430sdp.c new file mode 100644 index 0000000..5bcbb8d --- /dev/null +++ b/drivers/video/omap/lcd_2430sdp.c @@ -0,0 +1,196 @@ +/* + * LCD panel support for the TI 2430SDP board + * + * Copyright (C) 2007 MontaVista + * Author: Hunyue Yau <hy...@mv...> + * + * Derived from drivers/video/omap/lcd-apollon.c + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/delay.h> +#include <linux/gpio.h> +#include <linux/i2c/twl4030.h> + +#include <mach/mux.h> +#include <mach/omapfb.h> +#include <asm/mach-types.h> + +#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91 +#define SDP2430_LCD_PANEL_ENABLE_GPIO 154 +#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 24 +#define SDP3430_LCD_PANEL_ENABLE_GPIO 28 + +static unsigned backlight_gpio; +static unsigned enable_gpio; + +#define LCD_PANEL_BACKLIGHT_GPIO 91 +#define LCD_PANEL_ENABLE_GPIO 154 +#define LCD_PIXCLOCK_MAX 5400 /* freq 5.4 MHz */ +#define PM_RECEIVER TWL4030_MODULE_PM_RECEIVER +#define ENABLE_VAUX2_DEDICATED 0x09 +#define ENABLE_VAUX2_DEV_GRP 0x20 + + +#define t2_out(c, r, v) twl4030_i2c_write_u8(c, r, v) + + +static int sdp2430_panel_init(struct lcd_panel *panel, + struct omapfb_device *fbdev) +{ + if (machine_is_omap_3430sdp()) { + enable_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO; + backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO; + } else { + enable_gpio = SDP2430_LCD_PANEL_ENABLE_GPIO; + backlight_gpio = SDP2430_LCD_PANEL_BACKLIGHT_GPIO; + } The same assingments in both clauses. No if() is required. + + gpio_request(enable_gpio, "LCD enable"); /* LCD panel */ + gpio_request(backlight_gpio, "LCD bl"); /* LCD backlight */ + gpio_direction_output(enable_gpio, 0); + gpio_direction_output(backlight_gpio, 0); + + return 0; +} + +static void sdp2430_panel_cleanup(struct lcd_panel *panel) +{ Should the requested gpios be freed? +} + +static int sdp2430_panel_enable(struct lcd_panel *panel) +{ + u8 ded_val, ded_reg; + u8 grp_val, grp_reg; + + if (machine_is_omap_3430sdp()) { + ded_reg = TWL4030_VAUX3_DEDICATED; + ded_val = ENABLE_VAUX3_DEDICATED; + grp_reg = TWL4030_VAUX3_DEV_GRP; + grp_val = ENABLE_VAUX3_DEV_GRP; + + if (omap_rev() > OMAP3430_REV_ES1_0) { + t2_out(PM_RECEIVER, ENABLE_VPLL2_DEDICATED, + TWL4030_VPLL2_DEDICATED); + t2_out(PM_RECEIVER, ENABLE_VPLL2_DEV_GRP, + TWL4030_VPLL2_DEV_GRP); + } + } else { + ded_reg = TWL4030_VAUX2_DEDICATED; + ded_val = ENABLE_VAUX2_DEDICATED; + grp_reg = TWL4030_VAUX2_DEV_GRP; + grp_val = ENABLE_VAUX2_DEV_GRP; + } Again, please put the same assingments outside the if () clause. + + gpio_set_value(enable_gpio, 1); + gpio_set_value(backlight_gpio, 1); + + if (0 != t2_out(PM_RECEIVER, ded_val, ded_reg)) + return -EIO; + if (0 != t2_out(PM_RECEIVER, grp_val, grp_reg)) + return -EIO; + + return 0; +} + +static void sdp2430_panel_disable(struct lcd_panel *panel) +{ + gpio_set_value(enable_gpio, 0); + gpio_set_value(backlight_gpio, 0); + if (omap_rev() > OMAP3430_REV_ES1_0) { + t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEDICATED); + t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEV_GRP); + mdelay(4); + } +} Please use msleep() instead of the mdelay(). + +static unsigned long sdp2430_panel_get_caps(struct lcd_panel *panel) +{ + return 0; +} + +struct lcd_panel sdp2430_panel = { + .name = "sdp2430", + .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | + OMAP_LCDC_INV_HSYNC, + + .bpp = 16, + .data_lines = 16, + .x_res = 240, + .y_res = 320, + .hsw = 3, /* hsync_len (4) - 1 */ + .hfp = 3, /* right_margin (4) - 1 */ + .hbp = 39, /* left_margin (40) - 1 */ + .vsw = 1, /* vsync_len (2) - 1 */ + .vfp = 2, /* lower_margin */ + .vbp = 7, /* upper_margin (8) - 1 */ + + .pixel_clock = LCD_PIXCLOCK_MAX, + + .init = sdp2430_panel_init, + .cleanup = sdp2430_panel_cleanup, + .enable = sdp2430_panel_enable, + .disable = sdp2430_panel_disable, + .get_caps = sdp2430_panel_get_caps, +}; + +static int sdp2430_panel_probe(struct platform_device *pdev) +{ + omapfb_register_panel(&sdp2430_panel); + return 0; +} + +static int sdp2430_panel_remove(struct platform_device *pdev) +{ + return 0; +} + +static int sdp2430_panel_suspend(struct platform_device *pdev, + pm_message_t mesg) +{ + return 0; +} + +static int sdp2430_panel_resume(struct platform_device *pdev) +{ + return 0; +} + +struct platform_driver sdp2430_panel_driver = { + .probe = sdp2430_panel_probe, + .remove = sdp2430_panel_remove, + .suspend = sdp2430_panel_suspend, There is small indentation defect before the '='. + .resume = sdp2430_panel_resume, + .driver = { + .name = "sdp2430_lcd", + .owner = THIS_MODULE, + }, +}; + +static int __init sdp2430_panel_drv_init(void) +{ + return platform_driver_register(&sdp2430_panel_driver); +} + +static void __exit sdp2430_panel_drv_exit(void) +{ + platform_driver_unregister(&sdp2430_panel_driver); +} + +module_init(sdp2430_panel_drv_init); +module_exit(sdp2430_panel_drv_exit); -- 1.6.3.1 ---------------------------------------------------------------------- Dobra czy zla wiadomosc? Zawsze warto oszczedzac. Teraz 5,5%. Sprawdz > http://link.interia.pl/f21b0 |
From: Krzysztof H. <krz...@po...> - 2009-06-14 21:20:58
|
On Thu, 4 Jun 2009 20:52:29 +0300 Imre Deak <imr...@no...> wrote: > From: Jonathan McDowell <no...@ea...> > > This is an updated version of the LCD driver for the Amstrad Delta to > take into account the recent changes to the omapfb infrastructure. The > Delta features a 480x320 12 bit DSTN panel. > > Signed-off-by: Jonathan McDowell <no...@ea...> > Signed-off-by: Tony Lindgren <to...@at...> > Signed-off-by: Imre Deak <imr...@no...> > --- Acked-by: Krzysztof Helt <krz...@wp...> ---------------------------------------------------------------------- Masz juz dosc wysokich rachunkow? Wygraj nowa mozliwosc komunikacji! Sprawdz >>> http://link.interia.pl/f21d2 |
From: Jan B. <jbu...@gm...> - 2009-06-12 10:27:17
|
Tobias Jakobi schrieb: > Andrew Morton wrote: > >> hm, 2.6.27->2.6.30 is a large hop. >> > Hi Andrew! > > Yeah, I know. I was going to build a 2.6.29 though, since the fglrx > driver seems to have some problems with the 30 one. > I'm going to check then if the problem also occurs with 29. > I used the 29 before with uvesafb: There it was not a problem. Seems to be a regression between 29 and 30. > > >> Perhaps you were using vesafb in 2.6.27 and you're now using uvesafb? >> >> > Nope, I can assure you that. :) > The 27 kernel has uvesafb activated and is also using it. In fact I just > used make oldconfig to port the 27 config over to 30 (I'm not using any > distro tools for kernel compiling, just plain make). > > Greets, > Tobias > > |
From: Tobias J. <liq...@gm...> - 2009-06-12 08:41:24
|
Andrew Morton wrote: > > hm, 2.6.27->2.6.30 is a large hop. Hi Andrew! Yeah, I know. I was going to build a 2.6.29 though, since the fglrx driver seems to have some problems with the 30 one. I'm going to check then if the problem also occurs with 29. > > Perhaps you were using vesafb in 2.6.27 and you're now using uvesafb? > Nope, I can assure you that. :) The 27 kernel has uvesafb activated and is also using it. In fact I just used make oldconfig to port the 27 config over to 30 (I'm not using any distro tools for kernel compiling, just plain make). Greets, Tobias |
From: Andrew M. <ak...@li...> - 2009-06-11 23:05:11
|
(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface). On Thu, 11 Jun 2009 18:42:30 GMT bug...@bu... wrote: > http://bugzilla.kernel.org/show_bug.cgi?id=13509 > > Summary: VT switch causes system to lockup > Product: Drivers > Version: 2.5 > Kernel Version: 2.6.30-gentoo-r1 > Platform: All > OS/Version: Linux > Tree: Mainline > Status: NEW > Severity: high > Priority: P1 > Component: Console/Framebuffers > AssignedTo: jsi...@in... > ReportedBy: liq...@gm... > Regression: Yes > > > Hi there, > > I just updated my amd64 system from a 2.6.27 kernel to a fresh 2.6.30-gentoo-r1 > one. The system boots fine, but as soon as I switch to another VT the whole > system lockups. > > The screen just freezes, still showing the old content of VT1. ACPI buttons > don't work, and ctrl-alt-del doesn't cause a restart. I haven't tried remote > ssh login yet, nor magic SysRq (going to do this next). > > To emphasize this: Just doing work on the first console is perfectly fine - the > system is rockstable this way. So it's not some instability that is triggered > by the VT switch. > > Anyway, I'm using uvesafb here (gfx card is a integrated Radeon HD 3200). > More informations to follow. hm, 2.6.27->2.6.30 is a large hop. Perhaps you were using vesafb in 2.6.27 and you're now using uvesafb? |
From: Kristoffer E. <kri...@gm...> - 2009-06-11 21:06:32
|
On Tue, 9 Jun 2009 17:58:07 -0700 Andrew Morton <ak...@li...> wrote: > On Sat, 6 Jun 2009 14:10:37 +0200 > Kristoffer Ericson <kri...@gm...> wrote: > > > This patch adds accelerated bitblt functions to s1d13xxx based > > video chipsets, more specificly functions copyarea and fillrect. > > It has only been tested and activated for 13506 chipsets > > but is expected to work for the majority of s1d13xxx based chips. > > This patch also cleans up the driver with respect of whitespaces > > and other formatting issues. We update the current status > > comments. > > > > Was I sent half a patch? > Sorry for late reply! I must have missed appending the changes in s1d13xxx.h. Do you want a resend of the complete patch or just whats missing? Here are the missing lines: diff --git a/include/video/s1d13xxxfb.h b/include/video/s1d13xxxfb.h index c3b2a2a..f0736cf 100644 --- a/include/video/s1d13xxxfb.h +++ b/include/video/s1d13xxxfb.h @@ -136,6 +136,15 @@ #define S1DREG_DELAYOFF 0xFFFE #define S1DREG_DELAYON 0xFFFF +#define BBLT_FIFO_EMPTY 0x00 +#define BBLT_FIFO_NOT_EMPTY 0x40 +#define BBLT_FIFO_NOT_FULL 0x30 +#define BBLT_FIFO_HALF_FULL 0x20 +#define BBLT_FIFO_FULL 0x10 + +#define BBLT_SOLID_FILL 0x0c + + /* Note: all above defines should go in separate header files when implementing other S1D13xxx chip support. */ > > drivers/video/s1d13xxxfb.c: In function 'bltbit_fifo_status': > drivers/video/s1d13xxxfb.c:470: error: 'BBLT_FIFO_EMPTY' undeclared (first use in this function) > drivers/video/s1d13xxxfb.c:470: error: (Each undeclared identifier is reported only once > drivers/video/s1d13xxxfb.c:470: error: for each function it appears in.) > drivers/video/s1d13xxxfb.c:474: error: 'BBLT_FIFO_FULL' undeclared (first use in this function) > drivers/video/s1d13xxxfb.c:478: error: 'BBLT_FIFO_NOT_FULL' undeclared (first use in this function) > drivers/video/s1d13xxxfb.c: In function 's1d13xxxfb_bitblt_solidfill': > drivers/video/s1d13xxxfb.c:640: error: 'BBLT_SOLID_FILL' undeclared (first use in this function) -- Kristoffer Ericson <kri...@gm...> |
From: Imre D. <imr...@no...> - 2009-06-11 12:02:18
|
Hi, the following pull request is for the patchset updated based on your comments: The following changes since commit 07a2039b8eb0af4ff464efd3dfd95de5c02648c6: Linus Torvalds (1): Linux 2.6.30 are available in the git repository at: git://koowaldah.org/people/imre/linux-2.6-fb master Daniel Stone (1): omapfb: dispc: Allow multiple external IRQ handlers Hunyue Yau (1): omapfb: Add support for the 2430SDP LCD Imre Deak (5): omapfb: Add support for MIPI-DCS compatible LCDs N770: Enable LCD MIPI-DCS in Kconfig omapfb: dispc: Various typo fixes omapfb: Add FB manual update option to Kconfig omapfb: HWA742: fix pointer to be const Jonathan McDowell (1): omapfb: Add support for the Amstrad Delta LCD Jouni Hogander (2): omapfb: dispc: Disable iface clocks along with func clocks omapfb: dispc: Enable wake up capability Jouni Högander (1): omapfb: suspend/resume only if FB device is already initialized Kevin Hilman (1): omapfb: Add support for the 3430SDP LCD Koen Kooi (1): omapfb: Add support for the OMAP3 Beagle DVI output Kyungmin Park (1): omapfb: Add support for the Apollon LCD Rodrigo Vivi (1): omapfb: Add support for rotation on the Blizzard LCD ctrl Stanley.Miao (1): omapfb: Add support for the ZOOM MDK LCD Steve Sakoman (2): omapfb: Add support for the OMAP3 EVM LCD omapfb: Add support for the Gumstix Overo LCD arun c (2): omapfb: Add support for the OMAP2EVM LCD omapfb: Fix coding style / remove dead line arch/arm/configs/n770_defconfig | 2 +- arch/arm/configs/omap3_beagle_defconfig | 47 ++- arch/arm/configs/omap_3430sdp_defconfig | 39 ++- arch/arm/configs/omap_ldp_defconfig | 54 +++- arch/arm/plat-omap/include/mach/lcd_mipid.h | 5 + arch/arm/plat-omap/include/mach/omapfb.h | 4 +- drivers/video/omap/Kconfig | 82 +++- drivers/video/omap/Makefile | 12 + drivers/video/omap/blizzard.c | 91 ++++- drivers/video/omap/dispc.c | 130 ++++--- drivers/video/omap/dispc.h | 7 +- drivers/video/omap/hwa742.c | 2 +- drivers/video/omap/lcd_2430sdp.c | 200 +++++++++ drivers/video/omap/lcd_ams_delta.c | 137 ++++++ drivers/video/omap/lcd_apollon.c | 138 ++++++ drivers/video/omap/lcd_ldp.c | 200 +++++++++ drivers/video/omap/lcd_mipid.c | 625 +++++++++++++++++++++++++++ drivers/video/omap/lcd_omap2evm.c | 189 ++++++++ drivers/video/omap/lcd_omap3beagle.c | 133 ++++++ drivers/video/omap/lcd_omap3evm.c | 191 ++++++++ drivers/video/omap/lcd_overo.c | 179 ++++++++ drivers/video/omap/omapfb_main.c | 64 ++- drivers/video/omap/rfbi.c | 7 +- 23 files changed, 2424 insertions(+), 114 deletions(-) create mode 100644 drivers/video/omap/lcd_2430sdp.c create mode 100644 drivers/video/omap/lcd_ams_delta.c create mode 100644 drivers/video/omap/lcd_apollon.c create mode 100644 drivers/video/omap/lcd_ldp.c create mode 100644 drivers/video/omap/lcd_mipid.c create mode 100644 drivers/video/omap/lcd_omap2evm.c create mode 100644 drivers/video/omap/lcd_omap3beagle.c create mode 100644 drivers/video/omap/lcd_omap3evm.c create mode 100644 drivers/video/omap/lcd_overo.c --Imre |
From: Imre D. <imr...@no...> - 2009-06-10 14:50:04
|
Fixed-by: Mike Wege <ext...@no...> Fixed-by: Arnaud Patard <arn...@rt...> Fixed-by: Timo Savola <ts...@mo...> Fixed-by: Hiroshi DOYU <Hir...@no...> Fixed-by: Trilok Soni <son...@gm...> Signed-off-by: Imre Deak <imr...@so...> Signed-off-by: Juha Yrjola <juh...@so...> --- arch/arm/plat-omap/include/mach/lcd_mipid.h | 5 + drivers/video/omap/Kconfig | 8 + drivers/video/omap/Makefile | 1 + drivers/video/omap/lcd_mipid.c | 625 +++++++++++++++++++++++++++ 4 files changed, 639 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap/lcd_mipid.c diff --git a/arch/arm/plat-omap/include/mach/lcd_mipid.h b/arch/arm/plat-omap/include/mach/lcd_mipid.h index f8fbc48..8e52c65 100644 --- a/arch/arm/plat-omap/include/mach/lcd_mipid.h +++ b/arch/arm/plat-omap/include/mach/lcd_mipid.h @@ -16,7 +16,12 @@ enum mipid_test_result { struct mipid_platform_data { int nreset_gpio; int data_lines; + void (*shutdown)(struct mipid_platform_data *pdata); + void (*set_bklight_level)(struct mipid_platform_data *pdata, + int level); + int (*get_bklight_level)(struct mipid_platform_data *pdata); + int (*get_bklight_max)(struct mipid_platform_data *pdata); }; #endif diff --git a/drivers/video/omap/Kconfig b/drivers/video/omap/Kconfig index 4440885..574453f 100644 --- a/drivers/video/omap/Kconfig +++ b/drivers/video/omap/Kconfig @@ -7,6 +7,14 @@ config FB_OMAP help Frame buffer driver for OMAP based boards. +config FB_OMAP_LCD_MIPID + bool "MIPI DBI-C/DCS compatible LCD support" + depends on FB_OMAP && SPI_MASTER + help + Say Y here if you want to have support for LCDs compatible with + the Mobile Industry Processor Interface DBI-C/DCS + specification. (Supported LCDs: Philips LPH8923, Sharp LS041Y3) + config FB_OMAP_BOOTLOADER_INIT bool "Check bootloader initialization" depends on FB_OMAP diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile index d053498..d86d54a 100644 --- a/drivers/video/omap/Makefile +++ b/drivers/video/omap/Makefile @@ -25,6 +25,7 @@ objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o +objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o omapfb-objs := $(objs-yy) diff --git a/drivers/video/omap/lcd_mipid.c b/drivers/video/omap/lcd_mipid.c new file mode 100644 index 0000000..918ee89 --- /dev/null +++ b/drivers/video/omap/lcd_mipid.c @@ -0,0 +1,625 @@ +/* + * LCD driver for MIPI DBI-C / DCS compatible LCDs + * + * Copyright (C) 2006 Nokia Corporation + * Author: Imre Deak <imr...@no...> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +#include <linux/device.h> +#include <linux/delay.h> +#include <linux/workqueue.h> +#include <linux/spi/spi.h> + +#include <mach/omapfb.h> +#include <mach/lcd_mipid.h> + +#define MIPID_MODULE_NAME "lcd_mipid" + +#define MIPID_CMD_READ_DISP_ID 0x04 +#define MIPID_CMD_READ_RED 0x06 +#define MIPID_CMD_READ_GREEN 0x07 +#define MIPID_CMD_READ_BLUE 0x08 +#define MIPID_CMD_READ_DISP_STATUS 0x09 +#define MIPID_CMD_RDDSDR 0x0F +#define MIPID_CMD_SLEEP_IN 0x10 +#define MIPID_CMD_SLEEP_OUT 0x11 +#define MIPID_CMD_DISP_OFF 0x28 +#define MIPID_CMD_DISP_ON 0x29 + +#define MIPID_ESD_CHECK_PERIOD msecs_to_jiffies(5000) + +#define to_mipid_device(p) container_of(p, struct mipid_device, \ + panel) +struct mipid_device { + int enabled; + int revision; + unsigned int saved_bklight_level; + unsigned long hw_guard_end; /* next value of jiffies + when we can issue the + next sleep in/out command */ + unsigned long hw_guard_wait; /* max guard time in jiffies */ + + struct omapfb_device *fbdev; + struct spi_device *spi; + struct mutex mutex; + struct lcd_panel panel; + + struct workqueue_struct *esd_wq; + struct delayed_work esd_work; + void (*esd_check)(struct mipid_device *m); +}; + +static void mipid_transfer(struct mipid_device *md, int cmd, const u8 *wbuf, + int wlen, u8 *rbuf, int rlen) +{ + struct spi_message m; + struct spi_transfer *x, xfer[4]; + u16 w; + int r; + + BUG_ON(md->spi == NULL); + + spi_message_init(&m); + + memset(xfer, 0, sizeof(xfer)); + x = &xfer[0]; + + cmd &= 0xff; + x->tx_buf = &cmd; + x->bits_per_word = 9; + x->len = 2; + spi_message_add_tail(x, &m); + + if (wlen) { + x++; + x->tx_buf = wbuf; + x->len = wlen; + x->bits_per_word = 9; + spi_message_add_tail(x, &m); + } + + if (rlen) { + x++; + x->rx_buf = &w; + x->len = 1; + spi_message_add_tail(x, &m); + + if (rlen > 1) { + /* Arrange for the extra clock before the first + * data bit. + */ + x->bits_per_word = 9; + x->len = 2; + + x++; + x->rx_buf = &rbuf[1]; + x->len = rlen - 1; + spi_message_add_tail(x, &m); + } + } + + r = spi_sync(md->spi, &m); + if (r < 0) + dev_dbg(&md->spi->dev, "spi_sync %d\n", r); + + if (rlen) + rbuf[0] = w & 0xff; +} + +static inline void mipid_cmd(struct mipid_device *md, int cmd) +{ + mipid_transfer(md, cmd, NULL, 0, NULL, 0); +} + +static inline void mipid_write(struct mipid_device *md, + int reg, const u8 *buf, int len) +{ + mipid_transfer(md, reg, buf, len, NULL, 0); +} + +static inline void mipid_read(struct mipid_device *md, + int reg, u8 *buf, int len) +{ + mipid_transfer(md, reg, NULL, 0, buf, len); +} + +static void set_data_lines(struct mipid_device *md, int data_lines) +{ + u16 par; + + switch (data_lines) { + case 16: + par = 0x150; + break; + case 18: + par = 0x160; + break; + case 24: + par = 0x170; + break; + } + mipid_write(md, 0x3a, (u8 *)&par, 2); +} + +static void send_init_string(struct mipid_device *md) +{ + u16 initpar[] = { 0x0102, 0x0100, 0x0100 }; + + mipid_write(md, 0xc2, (u8 *)initpar, sizeof(initpar)); + set_data_lines(md, md->panel.data_lines); +} + +static void hw_guard_start(struct mipid_device *md, int guard_msec) +{ + md->hw_guard_wait = msecs_to_jiffies(guard_msec); + md->hw_guard_end = jiffies + md->hw_guard_wait; +} + +static void hw_guard_wait(struct mipid_device *md) +{ + unsigned long wait = md->hw_guard_end - jiffies; + + if ((long)wait > 0 && wait <= md->hw_guard_wait) { + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(wait); + } +} + +static void set_sleep_mode(struct mipid_device *md, int on) +{ + int cmd, sleep_time = 50; + + if (on) + cmd = MIPID_CMD_SLEEP_IN; + else + cmd = MIPID_CMD_SLEEP_OUT; + hw_guard_wait(md); + mipid_cmd(md, cmd); + hw_guard_start(md, 120); + /* + * When we enable the panel, it seems we _have_ to sleep + * 120 ms before sending the init string. When disabling the + * panel we'll sleep for the duration of 2 frames, so that the + * controller can still provide the PCLK,HS,VS signals. + */ + if (!on) + sleep_time = 120; + msleep(sleep_time); +} + +static void set_display_state(struct mipid_device *md, int enabled) +{ + int cmd = enabled ? MIPID_CMD_DISP_ON : MIPID_CMD_DISP_OFF; + + mipid_cmd(md, cmd); +} + +static int mipid_set_bklight_level(struct lcd_panel *panel, unsigned int level) +{ + struct mipid_device *md = to_mipid_device(panel); + struct mipid_platform_data *pd = md->spi->dev.platform_data; + + if (pd->get_bklight_max == NULL || pd->set_bklight_level == NULL) + return -ENODEV; + if (level > pd->get_bklight_max(pd)) + return -EINVAL; + if (!md->enabled) { + md->saved_bklight_level = level; + return 0; + } + pd->set_bklight_level(pd, level); + + return 0; +} + +static unsigned int mipid_get_bklight_level(struct lcd_panel *panel) +{ + struct mipid_device *md = to_mipid_device(panel); + struct mipid_platform_data *pd = md->spi->dev.platform_data; + + if (pd->get_bklight_level == NULL) + return -ENODEV; + return pd->get_bklight_level(pd); +} + +static unsigned int mipid_get_bklight_max(struct lcd_panel *panel) +{ + struct mipid_device *md = to_mipid_device(panel); + struct mipid_platform_data *pd = md->spi->dev.platform_data; + + if (pd->get_bklight_max == NULL) + return -ENODEV; + + return pd->get_bklight_max(pd); +} + +static unsigned long mipid_get_caps(struct lcd_panel *panel) +{ + return OMAPFB_CAPS_SET_BACKLIGHT; +} + +static u16 read_first_pixel(struct mipid_device *md) +{ + u16 pixel; + u8 red, green, blue; + + mutex_lock(&md->mutex); + mipid_read(md, MIPID_CMD_READ_RED, &red, 1); + mipid_read(md, MIPID_CMD_READ_GREEN, &green, 1); + mipid_read(md, MIPID_CMD_READ_BLUE, &blue, 1); + mutex_unlock(&md->mutex); + + switch (md->panel.data_lines) { + case 16: + pixel = ((red >> 1) << 11) | (green << 5) | (blue >> 1); + break; + case 24: + /* 24 bit -> 16 bit */ + pixel = ((red >> 3) << 11) | ((green >> 2) << 5) | + (blue >> 3); + break; + default: + pixel = 0; + BUG(); + } + + return pixel; +} + +static int mipid_run_test(struct lcd_panel *panel, int test_num) +{ + struct mipid_device *md = to_mipid_device(panel); + static const u16 test_values[4] = { + 0x0000, 0xffff, 0xaaaa, 0x5555, + }; + int i; + + if (test_num != MIPID_TEST_RGB_LINES) + return MIPID_TEST_INVALID; + + for (i = 0; i < ARRAY_SIZE(test_values); i++) { + int delay; + unsigned long tmo; + + omapfb_write_first_pixel(md->fbdev, test_values[i]); + tmo = jiffies + msecs_to_jiffies(100); + delay = 25; + while (1) { + u16 pixel; + + msleep(delay); + pixel = read_first_pixel(md); + if (pixel == test_values[i]) + break; + if (time_after(jiffies, tmo)) { + dev_err(&md->spi->dev, + "MIPI LCD RGB I/F test failed: " + "expecting %04x, got %04x\n", + test_values[i], pixel); + return MIPID_TEST_FAILED; + } + delay = 10; + } + } + + return 0; +} + +static void ls041y3_esd_recover(struct mipid_device *md) +{ + dev_err(&md->spi->dev, "performing LCD ESD recovery\n"); + set_sleep_mode(md, 1); + set_sleep_mode(md, 0); +} + +static void ls041y3_esd_check_mode1(struct mipid_device *md) +{ + u8 state1, state2; + + mipid_read(md, MIPID_CMD_RDDSDR, &state1, 1); + set_sleep_mode(md, 0); + mipid_read(md, MIPID_CMD_RDDSDR, &state2, 1); + dev_dbg(&md->spi->dev, "ESD mode 1 state1 %02x state2 %02x\n", + state1, state2); + /* Each sleep out command will trigger a self diagnostic and flip + * Bit6 if the test passes. + */ + if (!((state1 ^ state2) & (1 << 6))) + ls041y3_esd_recover(md); +} + +static void ls041y3_esd_check_mode2(struct mipid_device *md) +{ + int i; + u8 rbuf[2]; + static const struct { + int cmd; + int wlen; + u16 wbuf[3]; + } *rd, rd_ctrl[7] = { + { 0xb0, 4, { 0x0101, 0x01fe, } }, + { 0xb1, 4, { 0x01de, 0x0121, } }, + { 0xc2, 4, { 0x0100, 0x0100, } }, + { 0xbd, 2, { 0x0100, } }, + { 0xc2, 4, { 0x01fc, 0x0103, } }, + { 0xb4, 0, }, + { 0x00, 0, }, + }; + + rd = rd_ctrl; + for (i = 0; i < 3; i++, rd++) + mipid_write(md, rd->cmd, (u8 *)rd->wbuf, rd->wlen); + + udelay(10); + mipid_read(md, rd->cmd, rbuf, 2); + rd++; + + for (i = 0; i < 3; i++, rd++) { + udelay(10); + mipid_write(md, rd->cmd, (u8 *)rd->wbuf, rd->wlen); + } + + dev_dbg(&md->spi->dev, "ESD mode 2 state %02x\n", rbuf[1]); + if (rbuf[1] == 0x00) + ls041y3_esd_recover(md); +} + +static void ls041y3_esd_check(struct mipid_device *md) +{ + ls041y3_esd_check_mode1(md); + if (md->revision >= 0x88) + ls041y3_esd_check_mode2(md); +} + +static void mipid_esd_start_check(struct mipid_device *md) +{ + if (md->esd_check != NULL) + queue_delayed_work(md->esd_wq, &md->esd_work, + MIPID_ESD_CHECK_PERIOD); +} + +static void mipid_esd_stop_check(struct mipid_device *md) +{ + if (md->esd_check != NULL) + cancel_rearming_delayed_workqueue(md->esd_wq, &md->esd_work); +} + +static void mipid_esd_work(struct work_struct *work) +{ + struct mipid_device *md = container_of(work, struct mipid_device, + esd_work.work); + + mutex_lock(&md->mutex); + md->esd_check(md); + mutex_unlock(&md->mutex); + mipid_esd_start_check(md); +} + +static int mipid_enable(struct lcd_panel *panel) +{ + struct mipid_device *md = to_mipid_device(panel); + + mutex_lock(&md->mutex); + + if (md->enabled) { + mutex_unlock(&md->mutex); + return 0; + } + set_sleep_mode(md, 0); + md->enabled = 1; + send_init_string(md); + set_display_state(md, 1); + mipid_set_bklight_level(panel, md->saved_bklight_level); + mipid_esd_start_check(md); + + mutex_unlock(&md->mutex); + return 0; +} + +static void mipid_disable(struct lcd_panel *panel) +{ + struct mipid_device *md = to_mipid_device(panel); + + /* + * A final ESD work might be called before returning, + * so do this without holding the lock. + */ + mipid_esd_stop_check(md); + mutex_lock(&md->mutex); + + if (!md->enabled) { + mutex_unlock(&md->mutex); + return; + } + md->saved_bklight_level = mipid_get_bklight_level(panel); + mipid_set_bklight_level(panel, 0); + set_display_state(md, 0); + set_sleep_mode(md, 1); + md->enabled = 0; + + mutex_unlock(&md->mutex); +} + +static int panel_enabled(struct mipid_device *md) +{ + u32 disp_status; + int enabled; + + mipid_read(md, MIPID_CMD_READ_DISP_STATUS, (u8 *)&disp_status, 4); + disp_status = __be32_to_cpu(disp_status); + enabled = (disp_status & (1 << 17)) && (disp_status & (1 << 10)); + dev_dbg(&md->spi->dev, + "LCD panel %senabled by bootloader (status 0x%04x)\n", + enabled ? "" : "not ", disp_status); + return enabled; +} + +static int mipid_init(struct lcd_panel *panel, + struct omapfb_device *fbdev) +{ + struct mipid_device *md = to_mipid_device(panel); + + md->fbdev = fbdev; + md->esd_wq = create_singlethread_workqueue("mipid_esd"); + if (md->esd_wq == NULL) { + dev_err(&md->spi->dev, "can't create ESD workqueue\n"); + return -ENOMEM; + } + INIT_DELAYED_WORK(&md->esd_work, mipid_esd_work); + mutex_init(&md->mutex); + + md->enabled = panel_enabled(md); + + if (md->enabled) + mipid_esd_start_check(md); + else + md->saved_bklight_level = mipid_get_bklight_level(panel); + + return 0; +} + +static void mipid_cleanup(struct lcd_panel *panel) +{ + struct mipid_device *md = to_mipid_device(panel); + + if (md->enabled) + mipid_esd_stop_check(md); + destroy_workqueue(md->esd_wq); +} + +static struct lcd_panel mipid_panel = { + .config = OMAP_LCDC_PANEL_TFT, + + .bpp = 16, + .x_res = 800, + .y_res = 480, + .pixel_clock = 21940, + .hsw = 50, + .hfp = 20, + .hbp = 15, + .vsw = 2, + .vfp = 1, + .vbp = 3, + + .init = mipid_init, + .cleanup = mipid_cleanup, + .enable = mipid_enable, + .disable = mipid_disable, + .get_caps = mipid_get_caps, + .set_bklight_level = mipid_set_bklight_level, + .get_bklight_level = mipid_get_bklight_level, + .get_bklight_max = mipid_get_bklight_max, + .run_test = mipid_run_test, +}; + +static int mipid_detect(struct mipid_device *md) +{ + struct mipid_platform_data *pdata; + u8 display_id[3]; + + pdata = md->spi->dev.platform_data; + if (pdata == NULL) { + dev_err(&md->spi->dev, "missing platform data\n"); + return -ENOENT; + } + + mipid_read(md, MIPID_CMD_READ_DISP_ID, display_id, 3); + dev_dbg(&md->spi->dev, "MIPI display ID: %02x%02x%02x\n", + display_id[0], display_id[1], display_id[2]); + + switch (display_id[0]) { + case 0x45: + md->panel.name = "lph8923"; + break; + case 0x83: + md->panel.name = "ls041y3"; + md->esd_check = ls041y3_esd_check; + break; + default: + md->panel.name = "unknown"; + dev_err(&md->spi->dev, "invalid display ID\n"); + return -ENODEV; + } + + md->revision = display_id[1]; + md->panel.data_lines = pdata->data_lines; + pr_info("omapfb: %s rev %02x LCD detected, %d data lines\n", + md->panel.name, md->revision, md->panel.data_lines); + + return 0; +} + +static int mipid_spi_probe(struct spi_device *spi) +{ + struct mipid_device *md; + int r; + + md = kzalloc(sizeof(*md), GFP_KERNEL); + if (md == NULL) { + dev_err(&spi->dev, "out of memory\n"); + return -ENOMEM; + } + + spi->mode = SPI_MODE_0; + md->spi = spi; + dev_set_drvdata(&spi->dev, md); + md->panel = mipid_panel; + + r = mipid_detect(md); + if (r < 0) + return r; + + omapfb_register_panel(&md->panel); + + return 0; +} + +static int mipid_spi_remove(struct spi_device *spi) +{ + struct mipid_device *md = dev_get_drvdata(&spi->dev); + + mipid_disable(&md->panel); + kfree(md); + + return 0; +} + +static struct spi_driver mipid_spi_driver = { + .driver = { + .name = MIPID_MODULE_NAME, + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + .probe = mipid_spi_probe, + .remove = __devexit_p(mipid_spi_remove), +}; + +static int mipid_drv_init(void) +{ + spi_register_driver(&mipid_spi_driver); + + return 0; +} +module_init(mipid_drv_init); + +static void mipid_drv_cleanup(void) +{ + spi_unregister_driver(&mipid_spi_driver); +} +module_exit(mipid_drv_cleanup); + +MODULE_DESCRIPTION("MIPI display driver"); +MODULE_LICENSE("GPL"); -- 1.6.3.2 |
From: Geert U. <Gee...@so...> - 2009-06-10 14:40:24
|
Signed-off-by: Geert Uytterhoeven <Gee...@so...> Cc: lin...@li... --- drivers/video/ps3fb.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index 1baa1c9..c0af638 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c @@ -1166,7 +1166,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) if (retval < 0) goto err_fb_dealloc; - dev->core.driver_data = info; + ps3_system_bus_set_drvdata(dev, info); dev_info(info->device, "%s %s, using %u KiB of video memory\n", dev_driver_string(info->dev), dev_name(info->dev), @@ -1211,7 +1211,7 @@ err: static int ps3fb_shutdown(struct ps3_system_bus_device *dev) { - struct fb_info *info = dev->core.driver_data; + struct fb_info *info = ps3_system_bus_get_drvdata(dev); u64 xdr_lpar = ps3_mm_phys_to_lpar(__pa(ps3fb_videomemory.address)); dev_dbg(&dev->core, " -> %s:%d\n", __func__, __LINE__); @@ -1232,7 +1232,7 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev) unregister_framebuffer(info); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); - info = dev->core.driver_data = NULL; + ps3_system_bus_set_drvdata(dev, NULL); } iounmap((u8 __force __iomem *)ps3fb.dinfo); lv1_gpu_fb_close(ps3fb.context_handle); -- 1.6.2.4 |
From: Geert U. <Gee...@so...> - 2009-06-10 14:39:54
|
Signed-off-by: Geert Uytterhoeven <Gee...@so...> Cc: lin...@li... --- drivers/video/ps3fb.c | 192 ++++++++++++++++++++++--------------------------- 1 files changed, 86 insertions(+), 106 deletions(-) diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index ce0f873..a745018 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c @@ -956,73 +956,6 @@ static irqreturn_t ps3fb_vsync_interrupt(int irq, void *ptr) } -static int ps3fb_vsync_settings(struct gpu_driver_info *dinfo, - struct device *dev) -{ - int error; - - dev_dbg(dev, "version_driver:%x\n", dinfo->version_driver); - dev_dbg(dev, "irq outlet:%x\n", dinfo->irq.irq_outlet); - dev_dbg(dev, - "version_gpu: %x memory_size: %x ch: %x core_freq: %d " - "mem_freq:%d\n", - dinfo->version_gpu, dinfo->memory_size, dinfo->hardware_channel, - dinfo->nvcore_frequency/1000000, dinfo->memory_frequency/1000000); - - if (dinfo->version_driver != GPU_DRIVER_INFO_VERSION) { - dev_err(dev, "%s: version_driver err:%x\n", __func__, - dinfo->version_driver); - return -EINVAL; - } - - error = ps3_irq_plug_setup(PS3_BINDING_CPU_ANY, dinfo->irq.irq_outlet, - &ps3fb.irq_no); - if (error) { - dev_err(dev, "%s: ps3_alloc_irq failed %d\n", __func__, error); - return error; - } - - error = request_irq(ps3fb.irq_no, ps3fb_vsync_interrupt, IRQF_DISABLED, - DEVICE_NAME, dev); - if (error) { - dev_err(dev, "%s: request_irq failed %d\n", __func__, error); - ps3_irq_plug_destroy(ps3fb.irq_no); - return error; - } - - dinfo->irq.mask = (1 << GPU_INTR_STATUS_VSYNC_1) | - (1 << GPU_INTR_STATUS_FLIP_1); - return 0; -} - -static int ps3fb_xdr_settings(u64 xdr_lpar, struct device *dev) -{ - int status; - - status = lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, - xdr_lpar, ps3fb_videomemory.size, 0); - if (status) { - dev_err(dev, "%s: lv1_gpu_context_iomap failed: %d\n", - __func__, status); - return -ENXIO; - } - dev_dbg(dev, "video:%p ioif:%lx lpar:%llx size:%lx\n", - ps3fb_videomemory.address, GPU_IOIF, xdr_lpar, - ps3fb_videomemory.size); - - status = lv1_gpu_context_attribute(ps3fb.context_handle, - L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP, - xdr_lpar, GPU_CMD_BUF_SIZE, - GPU_IOIF, 0); - if (status) { - dev_err(dev, - "%s: lv1_gpu_context_attribute FB_SETUP failed: %d\n", - __func__, status); - return -ENXIO; - } - return 0; -} - static struct fb_ops ps3fb_ops = { .fb_open = ps3fb_open, .fb_release = ps3fb_release, @@ -1048,38 +981,6 @@ static struct fb_fix_screeninfo ps3fb_fix __initdata = { .accel = FB_ACCEL_NONE, }; -static int ps3fb_set_sync(struct device *dev) -{ - int status; - -#ifdef HEAD_A - status = lv1_gpu_context_attribute(0x0, - L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, - 0, L1GPU_DISPLAY_SYNC_VSYNC, 0, 0); - if (status) { - dev_err(dev, - "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " - "%d\n", - __func__, status); - return -1; - } -#endif -#ifdef HEAD_B - status = lv1_gpu_context_attribute(0x0, - L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, - 1, L1GPU_DISPLAY_SYNC_VSYNC, 0, 0); - - if (status) { - dev_err(dev, - "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " - "%d\n", - __func__, status); - return -1; - } -#endif - return 0; -} - static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) { struct fb_info *info; @@ -1091,6 +992,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) u64 lpar_reports = 0; u64 lpar_reports_size = 0; u64 xdr_lpar; + struct gpu_driver_info *dinfo; void *fb_start; int status; struct task_struct *task; @@ -1116,7 +1018,31 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) atomic_set(&ps3fb.ext_flip, 0); /* for flip with vsync */ init_waitqueue_head(&ps3fb.wait_vsync); - ps3fb_set_sync(&dev->core); +#ifdef HEAD_A + status = lv1_gpu_context_attribute(0x0, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, + 0, L1GPU_DISPLAY_SYNC_VSYNC, 0, 0); + if (status) { + dev_err(&dev->core, + "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " + "%d\n", + __func__, status); + goto err; + } +#endif +#ifdef HEAD_B + status = lv1_gpu_context_attribute(0x0, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, + 1, L1GPU_DISPLAY_SYNC_VSYNC, 0, 0); + + if (status) { + dev_err(&dev->core, + "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " + "%d\n", + __func__, status); + goto err; + } +#endif max_ps3fb_size = _ALIGN_UP(GPU_IOIF, 256*1024*1024) - GPU_IOIF; if (ps3fb_videomemory.size > max_ps3fb_size) { @@ -1147,23 +1073,76 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) } /* vsync interrupt */ - ps3fb.dinfo = (void __force *)ioremap(lpar_driver_info, 128 * 1024); - if (!ps3fb.dinfo) { + dinfo = (void __force *)ioremap(lpar_driver_info, 128 * 1024); + if (!dinfo) { dev_err(&dev->core, "%s: ioremap failed\n", __func__); goto err_gpu_context_free; } - retval = ps3fb_vsync_settings(ps3fb.dinfo, &dev->core); - if (retval) + ps3fb.dinfo = dinfo; + dev_dbg(&dev->core, "version_driver:%x\n", dinfo->version_driver); + dev_dbg(&dev->core, "irq outlet:%x\n", dinfo->irq.irq_outlet); + dev_dbg(&dev->core, "version_gpu: %x memory_size: %x ch: %x " + "core_freq: %d mem_freq:%d\n", dinfo->version_gpu, + dinfo->memory_size, dinfo->hardware_channel, + dinfo->nvcore_frequency/1000000, + dinfo->memory_frequency/1000000); + + if (dinfo->version_driver != GPU_DRIVER_INFO_VERSION) { + dev_err(&dev->core, "%s: version_driver err:%x\n", __func__, + dinfo->version_driver); + retval = -EINVAL; goto err_iounmap_dinfo; + } + + retval = ps3_irq_plug_setup(PS3_BINDING_CPU_ANY, dinfo->irq.irq_outlet, + &ps3fb.irq_no); + if (retval) { + dev_err(&dev->core, "%s: ps3_alloc_irq failed %d\n", __func__, + retval); + goto err_iounmap_dinfo; + } + + retval = request_irq(ps3fb.irq_no, ps3fb_vsync_interrupt, + IRQF_DISABLED, DEVICE_NAME, &dev->core); + if (retval) { + dev_err(&dev->core, "%s: request_irq failed %d\n", __func__, + retval); + goto err_destroy_plug; + } + + dinfo->irq.mask = (1 << GPU_INTR_STATUS_VSYNC_1) | + (1 << GPU_INTR_STATUS_FLIP_1); /* Clear memory to prevent kernel info leakage into userspace */ memset(ps3fb_videomemory.address, 0, ps3fb_videomemory.size); xdr_lpar = ps3_mm_phys_to_lpar(__pa(ps3fb_videomemory.address)); - retval = ps3fb_xdr_settings(xdr_lpar, &dev->core); - if (retval) + + status = lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, + xdr_lpar, ps3fb_videomemory.size, 0); + if (status) { + dev_err(&dev->core, "%s: lv1_gpu_context_iomap failed: %d\n", + __func__, status); + retval = -ENXIO; + goto err_free_irq; + } + + dev_dbg(&dev->core, "video:%p ioif:%lx lpar:%llx size:%lx\n", + ps3fb_videomemory.address, GPU_IOIF, xdr_lpar, + ps3fb_videomemory.size); + + status = lv1_gpu_context_attribute(ps3fb.context_handle, + L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP, + xdr_lpar, GPU_CMD_BUF_SIZE, + GPU_IOIF, 0); + if (status) { + dev_err(&dev->core, + "%s: lv1_gpu_context_attribute FB_SETUP failed: %d\n", + __func__, status); + retval = -ENXIO; goto err_free_irq; + } info = framebuffer_alloc(sizeof(struct ps3fb_par), &dev->core); if (!info) @@ -1234,6 +1213,7 @@ err_framebuffer_release: framebuffer_release(info); err_free_irq: free_irq(ps3fb.irq_no, &dev->core); +err_destroy_plug: ps3_irq_plug_destroy(ps3fb.irq_no); err_iounmap_dinfo: iounmap((u8 __force __iomem *)ps3fb.dinfo); -- 1.6.2.4 |
From: Geert U. <Gee...@so...> - 2009-06-10 14:39:35
|
Signed-off-by: Geert Uytterhoeven <Gee...@so...> Cc: lin...@li... Cc: Jim Paris <ji...@jt...> Cc: Jens Axboe <ax...@ke...> --- arch/powerpc/include/asm/ps3.h | 3 - arch/powerpc/include/asm/ps3gpu.h | 78 ++++++++++++++++++++++++++++++++++++ arch/powerpc/platforms/ps3/setup.c | 1 + drivers/block/ps3vram.c | 21 +++------ drivers/ps3/ps3av_cmd.c | 3 +- drivers/video/ps3fb.c | 72 ++++++++++----------------------- 6 files changed, 110 insertions(+), 68 deletions(-) create mode 100644 arch/powerpc/include/asm/ps3gpu.h diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h index cdb6fd8..b9e4987 100644 --- a/arch/powerpc/include/asm/ps3.h +++ b/arch/powerpc/include/asm/ps3.h @@ -520,7 +520,4 @@ void ps3_sync_irq(int node); u32 ps3_get_hw_thread_id(int cpu); u64 ps3_get_spe_id(void *arg); -/* mutex synchronizing GPU accesses and video mode changes */ -extern struct mutex ps3_gpu_mutex; - #endif diff --git a/arch/powerpc/include/asm/ps3gpu.h b/arch/powerpc/include/asm/ps3gpu.h new file mode 100644 index 0000000..1037efa --- /dev/null +++ b/arch/powerpc/include/asm/ps3gpu.h @@ -0,0 +1,78 @@ +/* + * PS3 GPU declarations. + * + * Copyright 2009 Sony Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. + * If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _ASM_POWERPC_PS3GPU_H +#define _ASM_POWERPC_PS3GPU_H + +#include <linux/mutex.h> + +#include <asm/lv1call.h> + + +#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC 0x101 +#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP 0x102 + +#define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP 0x600 +#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601 +#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC 0x602 + +#define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION (1ULL << 32) + +#define L1GPU_DISPLAY_SYNC_HSYNC 1 +#define L1GPU_DISPLAY_SYNC_VSYNC 2 + + +/* mutex synchronizing GPU accesses and video mode changes */ +extern struct mutex ps3_gpu_mutex; + + +static inline int lv1_gpu_display_sync(u64 context_handle, u64 head, + u64 ddr_offset) +{ + return lv1_gpu_context_attribute(context_handle, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, + head, ddr_offset, 0, 0); +} + +static inline int lv1_gpu_display_flip(u64 context_handle, u64 head, + u64 ddr_offset) +{ + return lv1_gpu_context_attribute(context_handle, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, + head, ddr_offset, 0, 0); +} + +static inline int lv1_gpu_fb_setup(u64 context_handle, u64 xdr_lpar, + u64 xdr_size, u64 ioif_offset) +{ + return lv1_gpu_context_attribute(context_handle, + L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP, + xdr_lpar, xdr_size, ioif_offset, 0); +} + +static inline int lv1_gpu_fb_blit(u64 context_handle, u64 ddr_offset, + u64 ioif_offset, u64 sync_width, u64 pitch) +{ + return lv1_gpu_context_attribute(context_handle, + L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT, + ddr_offset, ioif_offset, sync_width, + pitch); +} + +#endif /* _ASM_POWERPC_PS3GPU_H */ diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 1a7b5ae..149bea2 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c @@ -32,6 +32,7 @@ #include <asm/udbg.h> #include <asm/prom.h> #include <asm/lv1call.h> +#include <asm/ps3gpu.h> #include "platform.h" diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index 4418d59..7d1c742 100644 --- a/drivers/block/ps3vram.c +++ b/drivers/block/ps3vram.c @@ -17,6 +17,7 @@ #include <asm/iommu.h> #include <asm/lv1call.h> #include <asm/ps3.h> +#include <asm/ps3gpu.h> #define DEVICE_NAME "ps3vram" @@ -46,8 +47,6 @@ #define NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN 0x0000030c #define NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY 0x00000104 -#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601 - #define CACHE_PAGE_PRESENT 1 #define CACHE_PAGE_DIRTY 2 @@ -184,13 +183,10 @@ static void ps3vram_rewind_ring(struct ps3_system_bus_device *dev) priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET; /* asking the HV for a blit will kick the FIFO */ - status = lv1_gpu_context_attribute(priv->context_handle, - L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT, 0, - 0, 0, 0); + status = lv1_gpu_fb_blit(priv->context_handle, 0, 0, 0, 0); if (status) - dev_err(&dev->core, - "%s: lv1_gpu_context_attribute failed %d\n", __func__, - status); + dev_err(&dev->core, "%s: lv1_gpu_fb_blit failed %d\n", + __func__, status); priv->fifo_ptr = priv->fifo_base; } @@ -206,13 +202,10 @@ static void ps3vram_fire_ring(struct ps3_system_bus_device *dev) (priv->fifo_ptr - priv->fifo_base) * sizeof(u32); /* asking the HV for a blit will kick the FIFO */ - status = lv1_gpu_context_attribute(priv->context_handle, - L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT, 0, - 0, 0, 0); + status = lv1_gpu_fb_blit(priv->context_handle, 0, 0, 0, 0); if (status) - dev_err(&dev->core, - "%s: lv1_gpu_context_attribute failed %d\n", __func__, - status); + dev_err(&dev->core, "%s: lv1_gpu_fb_blit failed %d\n", + __func__, status); if ((priv->fifo_ptr - priv->fifo_base) * sizeof(u32) > FIFO_SIZE - 1024) { diff --git a/drivers/ps3/ps3av_cmd.c b/drivers/ps3/ps3av_cmd.c index 716596e..f555fed 100644 --- a/drivers/ps3/ps3av_cmd.c +++ b/drivers/ps3/ps3av_cmd.c @@ -21,9 +21,10 @@ #include <linux/module.h> #include <linux/kernel.h> #include <linux/delay.h> + #include <asm/ps3av.h> -#include <asm/ps3fb.h> #include <asm/ps3.h> +#include <asm/ps3gpu.h> #include "vuart.h" diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index a61c1d8..13c876c 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c @@ -37,21 +37,11 @@ #include <asm/ps3av.h> #include <asm/ps3fb.h> #include <asm/ps3.h> +#include <asm/ps3gpu.h> #define DEVICE_NAME "ps3fb" -#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC 0x101 -#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP 0x102 -#define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP 0x600 -#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601 -#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC 0x602 - -#define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION (1ULL << 32) - -#define L1GPU_DISPLAY_SYNC_HSYNC 1 -#define L1GPU_DISPLAY_SYNC_VSYNC 2 - #define GPU_CMD_BUF_SIZE (2 * 1024 * 1024) #define GPU_FB_START (64 * 1024) #define GPU_IOIF (0x0d000000UL) @@ -463,33 +453,27 @@ static void ps3fb_sync_image(struct device *dev, u64 frame_offset, src_offset += GPU_FB_START; mutex_lock(&ps3_gpu_mutex); - status = lv1_gpu_context_attribute(ps3fb.context_handle, - L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT, - dst_offset, GPU_IOIF + src_offset, - L1GPU_FB_BLIT_WAIT_FOR_COMPLETION | - (width << 16) | height, - line_length); + status = lv1_gpu_fb_blit(ps3fb.context_handle, dst_offset, + GPU_IOIF + src_offset, + L1GPU_FB_BLIT_WAIT_FOR_COMPLETION | + (width << 16) | height, + line_length); mutex_unlock(&ps3_gpu_mutex); if (status) - dev_err(dev, - "%s: lv1_gpu_context_attribute FB_BLIT failed: %d\n", - __func__, status); + dev_err(dev, "%s: lv1_gpu_fb_blit failed: %d\n", __func__, + status); #ifdef HEAD_A - status = lv1_gpu_context_attribute(ps3fb.context_handle, - L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, - 0, frame_offset, 0, 0); + status = lv1_gpu_display_flip(ps3fb.context_handle, 0, frame_offset); if (status) - dev_err(dev, "%s: lv1_gpu_context_attribute FLIP failed: %d\n", - __func__, status); + dev_err(dev, "%s: lv1_gpu_display_flip failed: %d\n", __func__, + status); #endif #ifdef HEAD_B - status = lv1_gpu_context_attribute(ps3fb.context_handle, - L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, - 1, frame_offset, 0, 0); + status = lv1_gpu_display_flip(ps3fb.context_handle, 1, frame_offset); if (status) - dev_err(dev, "%s: lv1_gpu_context_attribute FLIP failed: %d\n", - __func__, status); + dev_err(dev, "%s: lv1_gpu_display_flip failed: %d\n", __func__, + status); #endif } @@ -1020,27 +1004,18 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) init_waitqueue_head(&ps3fb.wait_vsync); #ifdef HEAD_A - status = lv1_gpu_context_attribute(0x0, - L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, - 0, L1GPU_DISPLAY_SYNC_VSYNC, 0, 0); + status = lv1_gpu_display_sync(0x0, 0, L1GPU_DISPLAY_SYNC_VSYNC); if (status) { - dev_err(&dev->core, - "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " - "%d\n", + dev_err(&dev->core, "%s: lv1_gpu_display_sync failed: %d\n", __func__, status); retval = -ENODEV; goto err_close_device; } #endif #ifdef HEAD_B - status = lv1_gpu_context_attribute(0x0, - L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, - 1, L1GPU_DISPLAY_SYNC_VSYNC, 0, 0); - + status = lv1_gpu_display_sync(0x0, 1, L1GPU_DISPLAY_SYNC_VSYNC); if (status) { - dev_err(&dev->core, - "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " - "%d\n", + dev_err(&dev->core, "%s: lv1_gpu_display_sync failed: %d\n", __func__, status); retval = -ENODEV; goto err_close_device; @@ -1070,7 +1045,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) &lpar_reports, &lpar_reports_size); if (status) { dev_err(&dev->core, - "%s: lv1_gpu_context_attribute failed: %d\n", __func__, + "%s: lv1_gpu_context_allocate failed: %d\n", __func__, status); goto err_gpu_memory_free; } @@ -1137,13 +1112,10 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) ps3fb_videomemory.address, GPU_IOIF, xdr_lpar, ps3fb_videomemory.size); - status = lv1_gpu_context_attribute(ps3fb.context_handle, - L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP, - xdr_lpar, GPU_CMD_BUF_SIZE, - GPU_IOIF, 0); + status = lv1_gpu_fb_setup(ps3fb.context_handle, xdr_lpar, + GPU_CMD_BUF_SIZE, GPU_IOIF); if (status) { - dev_err(&dev->core, - "%s: lv1_gpu_context_attribute FB_SETUP failed: %d\n", + dev_err(&dev->core, "%s: lv1_gpu_fb_setup failed: %d\n", __func__, status); retval = -ENXIO; goto err_context_unmap; -- 1.6.2.4 |
From: Geert U. <Gee...@so...> - 2009-06-10 14:39:34
|
During cleanup, use L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE to tear down the setup done by L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP. This allows unloading and reloading of ps3fb while the sound driver keeps the GPU open. Signed-off-by: Geert Uytterhoeven <Gee...@so...> Cc: lin...@li... --- arch/powerpc/include/asm/ps3gpu.h | 8 ++++++++ drivers/video/ps3fb.c | 5 ++++- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/include/asm/ps3gpu.h b/arch/powerpc/include/asm/ps3gpu.h index 1037efa..b2b8959 100644 --- a/arch/powerpc/include/asm/ps3gpu.h +++ b/arch/powerpc/include/asm/ps3gpu.h @@ -31,6 +31,7 @@ #define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP 0x600 #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601 #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC 0x602 +#define L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE 0x603 #define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION (1ULL << 32) @@ -75,4 +76,11 @@ static inline int lv1_gpu_fb_blit(u64 context_handle, u64 ddr_offset, pitch); } +static inline int lv1_gpu_fb_close(u64 context_handle) +{ + return lv1_gpu_context_attribute(context_handle, + L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE, 0, + 0, 0, 0); +} + #endif /* _ASM_POWERPC_PS3GPU_H */ diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index 13c876c..1baa1c9 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c @@ -1123,7 +1123,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) info = framebuffer_alloc(sizeof(struct ps3fb_par), &dev->core); if (!info) - goto err_context_unmap; + goto err_context_fb_close; par = info->par; par->mode_id = ~ps3fb_mode; /* != ps3fb_mode, to trigger change */ @@ -1188,6 +1188,8 @@ err_fb_dealloc: fb_dealloc_cmap(&info->cmap); err_framebuffer_release: framebuffer_release(info); +err_context_fb_close: + lv1_gpu_fb_close(ps3fb.context_handle); err_context_unmap: lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar, ps3fb_videomemory.size, CBE_IOPTE_M); @@ -1233,6 +1235,7 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev) info = dev->core.driver_data = NULL; } iounmap((u8 __force __iomem *)ps3fb.dinfo); + lv1_gpu_fb_close(ps3fb.context_handle); lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar, ps3fb_videomemory.size, CBE_IOPTE_M); lv1_gpu_context_free(ps3fb.context_handle); -- 1.6.2.4 |
From: Geert U. <Gee...@so...> - 2009-06-10 14:39:33
|
From: seb...@gm... <seb...@gm...> Signed-off-by: Geert Uytterhoeven <Gee...@so...> Cc: lin...@li... --- drivers/ps3/ps3av.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c index 235e87f..4e4611e 100644 --- a/drivers/ps3/ps3av.c +++ b/drivers/ps3/ps3av.c @@ -80,12 +80,12 @@ static const struct avset_video_mode { { 0, }, /* auto */ {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_480I, A_N, 720, 480}, {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_480P, A_N, 720, 480}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_60HZ, A_N, 1280, 720}, + {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_60HZ, A_W, 1280, 720}, {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080I_60HZ, A_W, 1920, 1080}, {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080P_60HZ, A_W, 1920, 1080}, {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_576I, A_N, 720, 576}, {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_576P, A_N, 720, 576}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_50HZ, A_N, 1280, 720}, + {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_50HZ, A_W, 1280, 720}, {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080I_50HZ, A_W, 1920, 1080}, {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080P_50HZ, A_W, 1920, 1080}, { RGB8, XRGB, PS3AV_CMD_VIDEO_VID_WXGA, A_W, 1280, 768}, -- 1.6.2.4 |
From: Geert U. <Gee...@so...> - 2009-06-10 14:39:31
|
Signed-off-by: Geert Uytterhoeven <Gee...@so...> Cc: lin...@li... --- drivers/video/ps3fb.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index e00c1df..ce0f873 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c @@ -1247,7 +1247,6 @@ err: static int ps3fb_shutdown(struct ps3_system_bus_device *dev) { - int status; struct fb_info *info = dev->core.driver_data; dev_dbg(&dev->core, " -> %s:%d\n", __func__, __LINE__); @@ -1271,17 +1270,8 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev) info = dev->core.driver_data = NULL; } iounmap((u8 __force __iomem *)ps3fb.dinfo); - - status = lv1_gpu_context_free(ps3fb.context_handle); - if (status) - dev_dbg(&dev->core, "lv1_gpu_context_free failed: %d\n", - status); - - status = lv1_gpu_memory_free(ps3fb.memory_handle); - if (status) - dev_dbg(&dev->core, "lv1_gpu_memory_free failed: %d\n", - status); - + lv1_gpu_context_free(ps3fb.context_handle); + lv1_gpu_memory_free(ps3fb.memory_handle); ps3_close_hv_device(dev); dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__); -- 1.6.2.4 |
From: Geert U. <Gee...@so...> - 2009-06-10 14:39:20
|
- ps3_open_hv_device() returns a standard error value, - Add missing call to ps3_close_hv_device() in the error path. Signed-off-by: Geert Uytterhoeven <Gee...@so...> Cc: lin...@li... --- drivers/video/ps3fb.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index a745018..542ffc3 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c @@ -985,7 +985,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) { struct fb_info *info; struct ps3fb_par *par; - int retval = -ENOMEM; + int retval; u64 ddr_lpar = 0; u64 lpar_dma_control = 0; u64 lpar_driver_info = 0; @@ -1003,8 +1003,8 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) return -ENOMEM; } - status = ps3_open_hv_device(dev); - if (status) { + retval = ps3_open_hv_device(dev); + if (retval) { dev_err(&dev->core, "%s: ps3_open_hv_device failed\n", __func__); goto err; @@ -1027,7 +1027,8 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " "%d\n", __func__, status); - goto err; + retval = -ENODEV; + goto err_close_device; } #endif #ifdef HEAD_B @@ -1040,7 +1041,8 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " "%d\n", __func__, status); - goto err; + retval = -ENODEV; + goto err_close_device; } #endif @@ -1057,7 +1059,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) if (status) { dev_err(&dev->core, "%s: lv1_gpu_memory_allocate failed: %d\n", __func__, status); - goto err; + goto err_close_device; } dev_dbg(&dev->core, "ddr:lpar:0x%llx\n", ddr_lpar); @@ -1221,6 +1223,8 @@ err_gpu_context_free: lv1_gpu_context_free(ps3fb.context_handle); err_gpu_memory_free: lv1_gpu_memory_free(ps3fb.memory_handle); +err_close_device: + ps3_close_hv_device(dev); err: return retval; } -- 1.6.2.4 |