From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Dooks Subject: [patch 5/5] LCD: Add platform_lcd driver. Date: Sun, 22 Jun 2008 22:04:44 +0100 Message-ID: <20080622210615.036067525@fluff.org.uk> References: <20080622210439.018928412@fluff.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1KAWlc-0002y0-0i for linux-fbdev-devel@lists.sourceforge.net; Sun, 22 Jun 2008 14:06:32 -0700 Received: from aeryn.fluff.org.uk ([87.194.8.8] helo=kira.home.fluff.org) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1KAWlb-00018B-0p for linux-fbdev-devel@lists.sourceforge.net; Sun, 22 Jun 2008 14:06:31 -0700 Content-Disposition: inline; filename=simtec/simtec-drivers-fb-backlight-generic.patch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-fbdev-devel-bounces@lists.sourceforge.net Errors-To: linux-fbdev-devel-bounces@lists.sourceforge.net To: linux-fbdev-devel@lists.sourceforge.net, akpm@linux-foundation.org Cc: linux-arm-kernel@lists.arm.linux.org.uk, Ben Dooks Add a platform_lcd driver to allow boards with simple lcd power controls to register themselves easily. Signed-off-by: Ben Dooks Index: linux-2.6.26-rc5-quilt2/include/video/platform_lcd.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.26-rc5-quilt2/include/video/platform_lcd.h 2008-06-12 11:32:17.000000000 +0100 @@ -0,0 +1,21 @@ +/* include/video/platform_lcd.h + * + * Copyright 2008 Simtec Electronics + * Ben Dooks + * + * Generic platform-device LCD power control interface. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + +struct plat_lcd_data; +struct fb_info; + +struct plat_lcd_data { + void (*set_power)(struct plat_lcd_data *, unsigned int power); + int (*match_fb)(struct plat_lcd_data *, struct fb_info *); +}; + Index: linux-2.6.26-rc5-quilt2/drivers/video/backlight/Kconfig =================================================================== --- linux-2.6.26-rc5-quilt2.orig/drivers/video/backlight/Kconfig 2008-06-12 10:49:49.000000000 +0100 +++ linux-2.6.26-rc5-quilt2/drivers/video/backlight/Kconfig 2008-06-12 11:25:22.000000000 +0100 @@ -53,6 +53,13 @@ config LCD_VGG2432A4 If you have a VGG2432A4 panel based on the ILI9320 controller chip then say y to include a power driver for it. +config LCD_PLATFORM + tristate "Platform LCD controls" + depends on LCD_CLASS_DEVICE + help + This driver provides a platform-device registered LCD power + control interface. + # # Backlight # Index: linux-2.6.26-rc5-quilt2/drivers/video/backlight/Makefile =================================================================== --- linux-2.6.26-rc5-quilt2.orig/drivers/video/backlight/Makefile 2008-06-12 10:49:49.000000000 +0100 +++ linux-2.6.26-rc5-quilt2/drivers/video/backlight/Makefile 2008-06-12 11:25:22.000000000 +0100 @@ -3,6 +3,7 @@ obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o obj-$(CONFIG_LCD_ILI9320) += ili9320.o +obj-$(CONFIG_LCD_PLATFORM) += platform_lcd.o obj-$(CONFIG_LCD_VGG2432A4) += vgg2432a4.o obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o Index: linux-2.6.26-rc5-quilt2/drivers/video/backlight/platform_lcd.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.26-rc5-quilt2/drivers/video/backlight/platform_lcd.c 2008-06-12 14:19:55.000000000 +0100 @@ -0,0 +1,172 @@ +/* drivers/video/backlight/platform_lcd.c + * + * Copyright 2008 Simtec Electronics + * Ben Dooks + * + * Generic platform-device LCD power control interface. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + +#include +#include +#include +#include +#include + +#include