From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z3Lf4-0004aC-3w for barebox@lists.infradead.org; Fri, 12 Jun 2015 09:54:08 +0000 From: Sascha Hauer Date: Fri, 12 Jun 2015 11:53:38 +0200 Message-Id: <1434102821-10555-3-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1434102821-10555-1-git-send-email-s.hauer@pengutronix.de> References: <1434102821-10555-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 3/6] video: Add PWM backlight support To: Barebox List This adds a backlight driver for backlights controlled by a PWM. Signed-off-by: Sascha Hauer --- drivers/video/Kconfig | 8 ++ drivers/video/Makefile | 1 + drivers/video/backlight-pwm.c | 199 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 208 insertions(+) create mode 100644 drivers/video/backlight-pwm.c diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index e108d8a..8e6ae99 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -97,4 +97,12 @@ config DRIVER_VIDEO_BACKLIGHT bool "Add backlight support" help Enable this for backlight support. + +config DRIVER_VIDEO_BACKLIGHT_PWM + bool "PWM backlight support" + depends on PWM + depends on DRIVER_VIDEO_BACKLIGHT + help + Enable this to get support for backlight devices driven by a PWM. + endif diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 0655b0f..76fad5c 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -2,6 +2,7 @@ obj-$(CONFIG_VIDEO) += fb.o obj-$(CONFIG_DRIVER_VIDEO_EDID) += edid.o obj-$(CONFIG_OFDEVICE) += of_display_timing.o obj-$(CONFIG_DRIVER_VIDEO_BACKLIGHT) += backlight.o +obj-$(CONFIG_DRIVER_VIDEO_BACKLIGHT_PWM) += backlight-pwm.o obj-$(CONFIG_DRIVER_VIDEO_ATMEL) += atmel_lcdfb.o atmel_lcdfb_core.o obj-$(CONFIG_DRIVER_VIDEO_ATMEL_HLCD) += atmel_hlcdfb.o atmel_lcdfb_core.o diff --git a/drivers/video/backlight-pwm.c b/drivers/video/backlight-pwm.c new file mode 100644 index 0000000..ae0b0ca --- /dev/null +++ b/drivers/video/backlight-pwm.c @@ -0,0 +1,199 @@ +/* + * pwm backlight support for barebox + * + * (C) Copyright 2014 Sascha Hauer, Pengutronix + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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. + * + */ +#include +#include +#include +#include