From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fV9TM-0005RF-Sc for barebox@lists.infradead.org; Tue, 19 Jun 2018 05:46:34 +0000 Received: by mail-pg0-x244.google.com with SMTP id w12-v6so8627093pgc.6 for ; Mon, 18 Jun 2018 22:46:22 -0700 (PDT) From: Andrey Smirnov Date: Mon, 18 Jun 2018 22:46:09 -0700 Message-Id: <20180619054609.31226-1-andrew.smirnov@gmail.com> 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] video: Port RAVE SP backlight driver from Linux kernel To: barebox@lists.infradead.org Cc: Andrey Smirnov This is a minimal port of a kernel commit 6552d3141064 ("backlight: Add RAVE SP backlight driver"). All of the changes were kept to a minimum and limited to impedance matching between Barebox/Linux driver API. Signed-off-by: Andrey Smirnov --- drivers/video/Kconfig | 7 +++ drivers/video/Makefile | 2 + drivers/video/rave-sp-backlight.c | 72 +++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 drivers/video/rave-sp-backlight.c diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 1dcae48f8..79de32cf8 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -124,6 +124,13 @@ config DRIVER_VIDEO_BACKLIGHT_PWM help Enable this to get support for backlight devices driven by a PWM. +config BACKLIGHT_RAVE_SP + tristate "RAVE SP Backlight driver" + depends on RAVE_SP_CORE + depends on DRIVER_VIDEO_BACKLIGHT + help + Support for backlight control on RAVE SP device. + comment "Video encoder chips" config DRIVER_VIDEO_MTL017 diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 081e4463d..01fabe880 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -23,3 +23,5 @@ obj-$(CONFIG_DRIVER_VIDEO_SIMPLEFB) += simplefb.o obj-$(CONFIG_DRIVER_VIDEO_IMX_IPUV3) += imx-ipu-v3/ obj-$(CONFIG_DRIVER_VIDEO_EFI_GOP) += efi_gop.o obj-$(CONFIG_DRIVER_VIDEO_FB_SSD1307) += ssd1307fb.o +obj-$(CONFIG_BACKLIGHT_RAVE_SP) += rave-sp-backlight.o + diff --git a/drivers/video/rave-sp-backlight.c b/drivers/video/rave-sp-backlight.c new file mode 100644 index 000000000..88ec86e73 --- /dev/null +++ b/drivers/video/rave-sp-backlight.c @@ -0,0 +1,72 @@ +/* + * LCD Backlight driver for RAVE SP + * + * Copyright (C) 2018 Zodiac Inflight Innovations + * + * 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, see . + */ + +#include +#include +#include +#include