diff options
Diffstat (limited to 'drivers/video')
152 files changed, 308 insertions, 3215 deletions
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index 51e0c4be08df..20d96a5ac384 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight driver for Marvell Semiconductor 88PM8606 * * Copyright (C) 2009 Marvell International Ltd. * Haojian Zhuang <haojian.zhuang@marvell.com> - * - * 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 <linux/init.h> diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c index 6a34ab936726..c0d9339cff87 100644 --- a/drivers/video/backlight/apple_bl.c +++ b/drivers/video/backlight/apple_bl.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight Driver for Intel-based Apples * @@ -7,10 +8,6 @@ * Copyright (C) 2006 Felipe Alfaro Solana <felipe_alfaro @linuxmail.org> * Copyright (C) 2007 Julien BLACHE <jb@jblache.org> * - * 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. - * * This driver triggers SMIs which cause the firmware to change the * backlight brightness. This is icky in many ways, but it's impractical to * get at the firmware code in order to figure out what it's actually doing. diff --git a/drivers/video/backlight/arcxcnn_bl.c b/drivers/video/backlight/arcxcnn_bl.c index dec790de72ff..7b1c0a0e6cad 100644 --- a/drivers/video/backlight/arcxcnn_bl.c +++ b/drivers/video/backlight/arcxcnn_bl.c @@ -1,20 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight driver for ArcticSand ARC_X_C_0N_0N Devices * * Copyright 2016 ArcticSand, Inc. * Author : Brian Dodge <bdodge@arcticsand.com> - * - * 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. - * - * 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/>. */ #include <linux/backlight.h> diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index fdb2f7e2c6b5..d344fb03cb86 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * ROHM Semiconductor BD6107 LED Driver * * Copyright (C) 2013 Ideas on board SPRL * * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com> - * - * 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 <linux/backlight.h> diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index f5574060f9c8..68f7592c5060 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * LCD/Backlight Driver for Sharp Zaurus Handhelds (various models) * @@ -8,11 +9,6 @@ * Copyright (c) 2008 Marvell International Ltd. * Converted to SPI device based LCD/Backlight device driver * by Eric Miao <eric.miao@marvell.com> - * - * 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 <linux/module.h> diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index f793738f06fb..62540e4bdedb 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight driver for Dialog Semiconductor DA9030/DA9034 * @@ -6,10 +7,6 @@ * * Copyright (C) 2006-2008 Marvell International Ltd. * Eric Miao <eric.miao@marvell.com> - * - * 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 <linux/kernel.h> diff --git a/drivers/video/backlight/ep93xx_bl.c b/drivers/video/backlight/ep93xx_bl.c index 0067931821c6..4149e0b2f83c 100644 --- a/drivers/video/backlight/ep93xx_bl.c +++ b/drivers/video/backlight/ep93xx_bl.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Driver for the Cirrus EP93xx lcd backlight * * Copyright (c) 2010 H Hartley Sweeten <hsweeten@visionengravers.com> * - * 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. - * * This driver controls the pulse width modulated brightness control output, * BRIGHT, on the Cirrus EP9307, EP9312, and EP9315 processors. */ diff --git a/drivers/video/backlight/generic_bl.c b/drivers/video/backlight/generic_bl.c index 4dea91acea13..8fe63dbc8590 100644 --- a/drivers/video/backlight/generic_bl.c +++ b/drivers/video/backlight/generic_bl.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Generic Backlight Driver * * Copyright (c) 2004-2008 Richard Purdie - * - * 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 <linux/module.h> diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index e470da95d806..b9300f3e1ee6 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * gpio_backlight.c - Simple GPIO-controlled backlight - * - * 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 <linux/backlight.h> diff --git a/drivers/video/backlight/ili9320.c b/drivers/video/backlight/ili9320.c index 2cf39e6d519d..168ac79523d7 100644 --- a/drivers/video/backlight/ili9320.c +++ b/drivers/video/backlight/ili9320.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* drivers/video/backlight/ili9320.c * * ILI9320 LCD controller driver core. @@ -5,10 +6,6 @@ * Copyright 2007 Simtec Electronics * http://armlinux.simtec.co.uk/ * Ben Dooks <ben@simtec.co.uk> - * - * 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 <linux/delay.h> diff --git a/drivers/video/backlight/ili9320.h b/drivers/video/backlight/ili9320.h index 42329e7aa9a8..fc59e389d59a 100644 --- a/drivers/video/backlight/ili9320.h +++ b/drivers/video/backlight/ili9320.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* drivers/video/backlight/ili9320.h * * ILI9320 LCD controller driver core. @@ -6,10 +7,6 @@ * Ben Dooks <ben@simtec.co.uk> * * http://armlinux.simtec.co.uk/ - * - * 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. */ /* Holder for register and value pairs. */ diff --git a/drivers/video/backlight/ipaq_micro_bl.c b/drivers/video/backlight/ipaq_micro_bl.c index 347dc11d4ceb..1123f67c12b3 100644 --- a/drivers/video/backlight/ipaq_micro_bl.c +++ b/drivers/video/backlight/ipaq_micro_bl.c @@ -1,7 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-only /* - * 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. * * iPAQ microcontroller backlight support * Author : Linus Walleij <linus.walleij@linaro.org> diff --git a/drivers/video/backlight/kb3886_bl.c b/drivers/video/backlight/kb3886_bl.c index 96312c3afc07..1dfe13c18925 100644 --- a/drivers/video/backlight/kb3886_bl.c +++ b/drivers/video/backlight/kb3886_bl.c @@ -1,14 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight Driver for the KB3886 Backlight * * Copyright (c) 2007-2008 Claudio Nieder * * Based on corgi_bl.c by Richard Purdie and kb3886 driver by Robert Woerle - * - * 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 <linux/module.h> diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index e6054e2492c5..8554b4aa980c 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * l4f00242t03.c -- support for Epson L4F00242T03 LCD * @@ -5,10 +6,6 @@ * * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com> * Inspired by Marek Vasut work in l4f00242t03.c - * - * 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. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index 75d996490cf0..b04b35d007a2 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -1,11 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Simple driver for Texas Instruments LM3630A Backlight driver chip * Copyright (C) 2012 Texas Instruments -* -* 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 <linux/module.h> #include <linux/slab.h> diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index 086611c7bc03..48c04155a5f9 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c @@ -1,11 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Simple driver for Texas Instruments LM3639 Backlight + Flash LED driver chip * Copyright (C) 2012 Texas Instruments -* -* 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 <linux/module.h> #include <linux/slab.h> diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c index 4237aaa7f269..35bc012b22cc 100644 --- a/drivers/video/backlight/lms283gf05.c +++ b/drivers/video/backlight/lms283gf05.c @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * lms283gf05.c -- support for Samsung LMS283GF05 LCD * * Copyright (c) 2009 Marek Vasut <marek.vasut@gmail.com> - * - * 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 <linux/device.h> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index 73612485ed07..f68920131a4a 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * TI LP855x Backlight Driver * * Copyright (C) 2011 Texas Instruments - * - * 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 <linux/module.h> diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c index cf869ec90cce..ba42f3fe0c73 100644 --- a/drivers/video/backlight/lp8788_bl.c +++ b/drivers/video/backlight/lp8788_bl.c @@ -1,14 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * TI LP8788 MFD - backlight driver * * Copyright 2012 Texas Instruments * * Author: Milo(Woogyom) Kim <milo.kim@ti.com> - * - * 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 <linux/backlight.h> diff --git a/drivers/video/backlight/ltv350qv.c b/drivers/video/backlight/ltv350qv.c index 885612cc1008..5cbf621e48bd 100644 --- a/drivers/video/backlight/ltv350qv.c +++ b/drivers/video/backlight/ltv350qv.c @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Power control for Samsung LTV350QV Quarter VGA LCD Panel * * Copyright (C) 2006, 2007 Atmel Corporation - * - * 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 <linux/delay.h> #include <linux/err.h> diff --git a/drivers/video/backlight/ltv350qv.h b/drivers/video/backlight/ltv350qv.h index 189112e3fc7a..c70890776a94 100644 --- a/drivers/video/backlight/ltv350qv.h +++ b/drivers/video/backlight/ltv350qv.h @@ -1,11 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Register definitions for Samsung LTV350QV Quarter VGA LCD Panel * * Copyright (C) 2006, 2007 Atmel Corporation - * - * 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. */ #ifndef __LTV350QV_H #define __LTV350QV_H diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c index 8ab7297b118a..c6ad73a784e2 100644 --- a/drivers/video/backlight/lv5207lp.c +++ b/drivers/video/backlight/lv5207lp.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Sanyo LV5207LP LED Driver * * Copyright (C) 2013 Ideas on board SPRL * * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com> - * - * 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 <linux/backlight.h> diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c index f3aa6088f1d9..97cc260ff9d1 100644 --- a/drivers/video/backlight/max8925_bl.c +++ b/drivers/video/backlight/max8925_bl.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight driver for Maxim MAX8925 * * Copyright (C) 2009 Marvell International Ltd. * Haojian Zhuang <haojian.zhuang@marvell.com> - * - * 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 <linux/init.h> diff --git a/drivers/video/backlight/ot200_bl.c b/drivers/video/backlight/ot200_bl.c index 3acdb9f646ed..23ee7106c72a 100644 --- a/drivers/video/backlight/ot200_bl.c +++ b/drivers/video/backlight/ot200_bl.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Bachmann electronic GmbH * Christian Gmeiner <christian.gmeiner@gmail.com> * * Backlight driver for ot200 visualisation device from * Bachmann electronic GmbH. - * - * 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 <linux/module.h> diff --git a/drivers/video/backlight/pandora_bl.c b/drivers/video/backlight/pandora_bl.c index 9618766e3866..f946470ce9f6 100644 --- a/drivers/video/backlight/pandora_bl.c +++ b/drivers/video/backlight/pandora_bl.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight driver for Pandora handheld. * Pandora uses TWL4030 PWM0 -> TPS61161 combo for control backlight. * Based on pwm_bl.c * * Copyright 2009,2012 Gražvydas Ignotas <notasas@gmail.com> - * - * 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 <linux/module.h> diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c index 872a3bf21faf..b2bfbf070200 100644 --- a/drivers/video/backlight/platform_lcd.c +++ b/drivers/video/backlight/platform_lcd.c @@ -1,14 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* drivers/video/backlight/platform_lcd.c * * Copyright 2008 Simtec Electronics * Ben Dooks <ben@simtec.co.uk> * * 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 <linux/module.h> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index fb45f866b923..20d379ac8440 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/backlight/pwm_bl.c * * simple PWM based backlight control, board code has to setup * 1) pin configuration so PWM waveforms can output * 2) platform_data being correctly configured - * - * 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 <linux/delay.h> diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c index d414c7a3acf5..2355f00f5773 100644 --- a/drivers/video/backlight/sky81452-backlight.c +++ b/drivers/video/backlight/sky81452-backlight.c @@ -1,20 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * sky81452-backlight.c SKY81452 backlight driver * * Copyright 2014 Skyworks Solutions Inc. * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com> - * - * 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. - * - * 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/>. */ #include <linux/backlight.h> diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index 97067597e6bf..1275e815bd86 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c @@ -1,13 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * LCD / Backlight control code for Sharp SL-6000x (tosa) * * Copyright (c) 2005 Dirk Opfer * Copyright (c) 2007,2008 Dmitry Baryshkov - * - * 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 <linux/kernel.h> diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c index 4dc5ee8debeb..65cb7578776f 100644 --- a/drivers/video/backlight/tosa_lcd.c +++ b/drivers/video/backlight/tosa_lcd.c @@ -1,13 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * LCD / Backlight control code for Sharp SL-6000x (tosa) * * Copyright (c) 2005 Dirk Opfer * Copyright (c) 2007,2008 Dmitry Baryshkov - * - * 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 <linux/kernel.h> diff --git a/drivers/video/backlight/vgg2432a4.c b/drivers/video/backlight/vgg2432a4.c index 242a9948f57f..9bf277ca4ae9 100644 --- a/drivers/video/backlight/vgg2432a4.c +++ b/drivers/video/backlight/vgg2432a4.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* drivers/video/backlight/vgg2432a4.c * * VGG2432A4 (ILI9320) LCD controller driver. @@ -5,10 +6,6 @@ * Copyright 2007 Simtec Electronics * http://armlinux.simtec.co.uk/ * Ben Dooks <ben@simtec.co.uk> - * - * 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 <linux/delay.h> diff --git a/drivers/video/backlight/wm831x_bl.c b/drivers/video/backlight/wm831x_bl.c index 6eab0d6c262a..e55977d54c15 100644 --- a/drivers/video/backlight/wm831x_bl.c +++ b/drivers/video/backlight/wm831x_bl.c @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight driver for Wolfson Microelectronics WM831x PMICs * * Copyright 2009 Wolfson Microelectonics plc - * - * 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 <linux/kernel.h> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 1b2f5f31fb6f..6b2de93bd302 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -31,7 +31,7 @@ menuconfig FB in the /dev directory, i.e. /dev/fb*. You need an utility program called fbset to make full use of frame - buffer devices. Please read <file:Documentation/fb/framebuffer.txt> + buffer devices. Please read <file:Documentation/fb/framebuffer.rst> and the Framebuffer-HOWTO at <http://www.munted.org.uk/programming/Framebuffer-HOWTO-1.3.html> for more information. @@ -241,7 +241,7 @@ config FB_CIRRUS If you have a PCI-based system, this enables support for these chips: GD-543x, GD-544x, GD-5480. - Please read the file <file:Documentation/fb/cirrusfb.txt>. + Please read the file <file:Documentation/fb/cirrusfb.rst>. Say N unless you have such a graphics board or plan to get one before you next recompile the kernel. @@ -289,7 +289,7 @@ config FB_ARMCLCD If you want to compile this as a module (=code which can be inserted into and removed from the running kernel), say M - here and read <file:Documentation/kbuild/modules.txt>. The module + here and read <file:Documentation/kbuild/modules.rst>. The module will be called amba-clcd. config FB_ACORN @@ -332,7 +332,8 @@ config FB_SA1100 config FB_IMX tristate "Freescale i.MX1/21/25/27 LCD support" - depends on FB && ARCH_MXC + depends on FB && HAVE_CLK && HAS_IOMEM + depends on ARCH_MXC || COMPILE_TEST select LCD_CLASS_DEVICE select FB_CFB_FILLRECT select FB_CFB_COPYAREA @@ -614,7 +615,7 @@ config FB_UVESA This driver generally provides more features than vesafb but requires a userspace helper application called 'v86d'. See - <file:Documentation/fb/uvesafb.txt> for more information. + <file:Documentation/fb/uvesafb.rst> for more information. If unsure, say N. @@ -629,7 +630,7 @@ config FB_VESA This is the frame buffer device driver for generic VESA 2.0 compliant graphic cards. The older VESA 1.2 cards are not supported. You will get a boot time penguin logo at no additional cost. Please - read <file:Documentation/fb/vesafb.txt>. If unsure, say Y. + read <file:Documentation/fb/vesafb.rst>. If unsure, say Y. config FB_EFI bool "EFI-based Framebuffer Support" @@ -670,7 +671,8 @@ config FB_HGA config FB_GBE bool "SGI Graphics Backend frame buffer support" - depends on (FB = y) && SGI_IP32 + depends on (FB = y) && HAS_IOMEM + depends on SGI_IP32 || COMPILE_TEST select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -808,7 +810,8 @@ config FB_XVR1000 config FB_PVR2 tristate "NEC PowerVR 2 display support" - depends on FB && SH_DREAMCAST + depends on FB && HAS_IOMEM + depends on SH_DREAMCAST || COMPILE_TEST select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -825,7 +828,7 @@ config FB_PVR2 module load time. The parameters look like "video=pvr2:XXX", where the meaning of XXX can be found at the end of the main source file (<file:drivers/video/pvr2fb.c>). Please see the file - <file:Documentation/fb/pvr2fb.txt>. + <file:Documentation/fb/pvr2fb.rst>. config FB_OPENCORES tristate "OpenCores VGA/LCD core 2.0 framebuffer support" @@ -856,7 +859,8 @@ config FB_S1D13XXX config FB_ATMEL tristate "AT91 LCD Controller support" - depends on FB && OF && HAVE_FB_ATMEL + depends on FB && OF && HAVE_CLK && HAS_IOMEM + depends on HAVE_FB_ATMEL || COMPILE_TEST select FB_BACKLIGHT select FB_CFB_FILLRECT select FB_CFB_COPYAREA @@ -987,7 +991,7 @@ config FB_I810 module will be called i810fb. For more information, please read - <file:Documentation/fb/intel810.txt> + <file:Documentation/fb/intel810.rst> config FB_I810_GTF bool "use VESA Generalized Timing Formula" @@ -1057,7 +1061,7 @@ config FB_INTEL To compile this driver as a module, choose M here: the module will be called intelfb. - For more information, please read <file:Documentation/fb/intelfb.txt> + For more information, please read <file:Documentation/fb/intelfb.rst> config FB_INTEL_DEBUG bool "Intel driver Debug Messages" @@ -1094,7 +1098,7 @@ config FB_MATROX You can pass several parameters to the driver at boot time or at module load time. The parameters look like "video=matroxfb:XXX", and - are described in <file:Documentation/fb/matroxfb.txt>. + are described in <file:Documentation/fb/matroxfb.rst>. config FB_MATROX_MILLENIUM bool "Millennium I/II support" @@ -1245,7 +1249,7 @@ config FB_ATY128 help This driver supports graphics boards with the ATI Rage128 chips. Say Y if you have such a graphics board and read - <file:Documentation/fb/aty128fb.txt>. + <file:Documentation/fb/aty128fb.rst>. To compile this driver as a module, choose M here: the module will be called aty128fb. @@ -1507,7 +1511,7 @@ config FB_VOODOO1 WARNING: Do not use any application that uses the 3D engine (namely glide) while using this driver. - Please read the <file:Documentation/fb/sstfb.txt> for supported + Please read the <file:Documentation/fb/sstfb.rst> for supported options and other important info support. config FB_VT8623 @@ -1539,7 +1543,7 @@ config FB_TRIDENT There are also integrated versions of these chips called CyberXXXX, CyberImage or CyberBlade. These chips are mostly found in laptops but also on some motherboards including early VIA EPIA motherboards. - For more information, read <file:Documentation/fb/tridentfb.txt> + For more information, read <file:Documentation/fb/tridentfb.rst> Say Y if you have such a graphics board. @@ -1729,7 +1733,8 @@ config FB_68328 config FB_PXA168 tristate "PXA168/910 LCD framebuffer support" - depends on FB && (CPU_PXA168 || CPU_PXA910) + depends on FB && HAVE_CLK && HAS_IOMEM + depends on CPU_PXA168 || CPU_PXA910 || COMPILE_TEST select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -1752,7 +1757,7 @@ config FB_PXA This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called pxafb. If you want to compile it as a module, - say M here and read <file:Documentation/kbuild/modules.txt>. + say M here and read <file:Documentation/kbuild/modules.rst>. If unsure, say N. @@ -1778,7 +1783,7 @@ config FB_PXA_PARAMETERS single model of flatpanel then you can safely leave this option disabled. - <file:Documentation/fb/pxafb.txt> describes the available parameters. + <file:Documentation/fb/pxafb.rst> describes the available parameters. config PXA3XX_GCU tristate "PXA3xx 2D graphics accelerator driver" @@ -1833,7 +1838,7 @@ config FB_W100 This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called w100fb. If you want to compile it as a module, - say M here and read <file:Documentation/kbuild/modules.txt>. + say M here and read <file:Documentation/kbuild/modules.rst>. If unsure, say N. @@ -1862,7 +1867,7 @@ config FB_TMIO This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called tmiofb. If you want to compile it as a module, - say M here and read <file:Documentation/kbuild/modules.txt>. + say M here and read <file:Documentation/kbuild/modules.rst>. If unsure, say N. @@ -1873,7 +1878,8 @@ config FB_TMIO_ACCELL config FB_S3C tristate "Samsung S3C framebuffer support" - depends on FB && (CPU_S3C2416 || ARCH_S3C64XX) + depends on FB && HAVE_CLK && HAS_IOMEM + depends on (CPU_S3C2416 || ARCH_S3C64XX) || COMPILE_TEST select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -1908,7 +1914,7 @@ config FB_S3C2410 This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called s3c2410fb. If you want to compile it as a module, - say M here and read <file:Documentation/kbuild/modules.txt>. + say M here and read <file:Documentation/kbuild/modules.rst>. If unsure, say N. config FB_S3C2410_DEBUG @@ -1945,7 +1951,7 @@ config FB_SM501 This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called sm501fb. If you want to compile it as a module, - say M here and read <file:Documentation/kbuild/modules.txt>. + say M here and read <file:Documentation/kbuild/modules.rst>. If unsure, say N. @@ -2055,7 +2061,8 @@ config FB_SH7760 config FB_DA8XX tristate "DA8xx/OMAP-L1xx/AM335x Framebuffer support" - depends on FB && (ARCH_DAVINCI_DA8XX || SOC_AM33XX) + depends on FB && HAVE_CLK && HAS_IOMEM + depends on ARCH_DAVINCI_DA8XX || SOC_AM33XX || COMPILE_TEST select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -2172,7 +2179,7 @@ config FB_EP93XX config FB_PRE_INIT_FB bool "Don't reinitialize, use bootloader's GDC/Display configuration" - depends on FB && (FB_MB862XX_LIME || FB_MXS) + depends on FB && FB_MB862XX_LIME ---help--- Select this option if display contents should be inherited as set by the bootloader. @@ -2213,17 +2220,6 @@ config FB_JZ4740 help Framebuffer support for the JZ4740 SoC. -config FB_MXS - tristate "MXS LCD framebuffer support" - depends on FB && (ARCH_MXS || ARCH_MXC) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MODE_HELPERS - select VIDEOMODE_HELPERS - help - Framebuffer support for the MXS SoC. - config FB_PUV3_UNIGFX tristate "PKUnity v3 Unigfx framebuffer support" depends on FB && UNICORE32 && ARCH_PUV3 @@ -2288,7 +2284,7 @@ config FB_SM712 This driver is also available as a module. The module will be called sm712fb. If you want to compile it as a module, say M - here and read <file:Documentation/kbuild/modules.txt>. + here and read <file:Documentation/kbuild/modules.rst>. source "drivers/video/fbdev/omap/Kconfig" source "drivers/video/fbdev/omap2/Kconfig" diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile index 655f2537cac1..7dc4861a93e6 100644 --- a/drivers/video/fbdev/Makefile +++ b/drivers/video/fbdev/Makefile @@ -131,7 +131,6 @@ obj-$(CONFIG_FB_VGA16) += vga16fb.o obj-$(CONFIG_FB_OF) += offb.o obj-$(CONFIG_FB_MX3) += mx3fb.o obj-$(CONFIG_FB_DA8XX) += da8xx-fb.o -obj-$(CONFIG_FB_MXS) += mxsfb.o obj-$(CONFIG_FB_SSD1307) += ssd1307fb.o obj-$(CONFIG_FB_SIMPLE) += simplefb.o diff --git a/drivers/video/fbdev/acornfb.c b/drivers/video/fbdev/acornfb.c index 0c325b4da61d..92f23e3bc27a 100644 --- a/drivers/video/fbdev/acornfb.c +++ b/drivers/video/fbdev/acornfb.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/acornfb.c * * Copyright (C) 1998-2001 Russell King * - * 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. - * * Frame buffer code for Acorn platforms * * NOTE: Most of the modes with X!=640 will disappear shortly. diff --git a/drivers/video/fbdev/acornfb.h b/drivers/video/fbdev/acornfb.h index 175c8ff3367c..f8df4ecb4fd7 100644 --- a/drivers/video/fbdev/acornfb.h +++ b/drivers/video/fbdev/acornfb.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * linux/drivers/video/acornfb.h * * Copyright (C) 1998,1999 Russell King * - * 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. - * * Frame buffer code for Acorn platforms */ #if defined(HAS_VIDC20) diff --git a/drivers/video/fbdev/amifb.c b/drivers/video/fbdev/amifb.c index 758457026694..91ddc9602014 100644 --- a/drivers/video/fbdev/amifb.c +++ b/drivers/video/fbdev/amifb.c @@ -3554,10 +3554,8 @@ static int __init amifb_probe(struct platform_device *pdev) custom.dmacon = DMAF_ALL | DMAF_MASTER; info = framebuffer_alloc(sizeof(struct amifb_par), &pdev->dev); - if (!info) { - dev_err(&pdev->dev, "framebuffer_alloc failed\n"); + if (!info) return -ENOMEM; - } strcpy(info->fix.id, "Amiga "); info->fix.visual = FB_VISUAL_PSEUDOCOLOR; diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c index 13ba371e70aa..f940e8b66b85 100644 --- a/drivers/video/fbdev/arkfb.c +++ b/drivers/video/fbdev/arkfb.c @@ -954,10 +954,8 @@ static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) /* Allocate and fill driver data structure */ info = framebuffer_alloc(sizeof(struct arkfb_info), &(dev->dev)); - if (! info) { - dev_err(&(dev->dev), "cannot allocate memory\n"); + if (!info) return -ENOMEM; - } par = info->par; mutex_init(&par->open_lock); diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index b986af2a8042..fc9dfb0a95af 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -77,29 +77,8 @@ #define SWITCH_SND7 0x80 #define SWITCH_NONE 0x00 - #define up(x, r) (((x) + (r) - 1) & ~((r)-1)) - /* - * Interface to the world - */ - -static int atafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info); -static int atafb_set_par(struct fb_info *info); -static int atafb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, - unsigned int blue, unsigned int transp, - struct fb_info *info); -static int atafb_blank(int blank, struct fb_info *info); -static int atafb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info); -static void atafb_fillrect(struct fb_info *info, - const struct fb_fillrect *rect); -static void atafb_copyarea(struct fb_info *info, - const struct fb_copyarea *region); -static void atafb_imageblit(struct fb_info *info, const struct fb_image *image); -static int atafb_ioctl(struct fb_info *info, unsigned int cmd, - unsigned long arg); - static int default_par; /* default resolution (0=none) */ diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index e67dfd94bf1d..5ff8e0320d95 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -673,7 +673,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) lcdc_writel(sinfo, ATMEL_LCDC_MVAL, 0); /* Disable all interrupts */ - lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL); + lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0U); /* Enable FIFO & DMA errors */ lcdc_writel(sinfo, ATMEL_LCDC_IER, ATMEL_LCDC_UFLWI | ATMEL_LCDC_OWRI | ATMEL_LCDC_MERI); @@ -950,7 +950,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) struct fb_videomode fb_vm; struct gpio_desc *gpiod; struct videomode vm; - int ret = -ENOENT; + int ret; int i; sinfo->config = (struct atmel_lcdfb_config*) @@ -1053,10 +1053,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) ret = -ENOMEM; info = framebuffer_alloc(sizeof(struct atmel_lcdfb_info), dev); - if (!info) { - dev_err(dev, "cannot allocate memory\n"); + if (!info) goto out; - } sinfo = info->par; sinfo->pdev = pdev; @@ -1291,7 +1289,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg) * We don't want to handle interrupts while the clock is * stopped. It may take forever. */ - lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL); + lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0U); sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_CTR); lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0); diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index b02e67528a99..8504e19437ff 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -2103,10 +2103,9 @@ static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* We have the resources. Now virtualize them */ info = framebuffer_alloc(sizeof(struct aty128fb_par), &pdev->dev); - if (info == NULL) { - printk(KERN_ERR "aty128fb: can't alloc fb_info_aty128\n"); + if (!info) goto err_free_mmio; - } + par = info->par; info->pseudo_palette = par->pseudo_palette; diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index eebb62d82a23..72bcfbe42e49 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -3550,10 +3550,9 @@ static int atyfb_pci_probe(struct pci_dev *pdev, /* Allocate framebuffer */ info = framebuffer_alloc(sizeof(struct atyfb_par), &pdev->dev); - if (!info) { - PRINTKE("atyfb_pci_probe() can't alloc fb_info\n"); + if (!info) return -ENOMEM; - } + par = info->par; par->bus_type = PCI; info->fix = atyfb_fix; @@ -3643,10 +3642,9 @@ static int __init atyfb_atari_probe(void) } info = framebuffer_alloc(sizeof(struct atyfb_par), NULL); - if (!info) { - PRINTKE("atyfb_atari_probe() can't alloc fb_info\n"); + if (!info) return -ENOMEM; - } + par = info->par; info->fix = atyfb_fix; diff --git a/drivers/video/fbdev/aty/radeon_backlight.c b/drivers/video/fbdev/aty/radeon_backlight.c index 301d6d6aeead..d2c1263ad260 100644 --- a/drivers/video/fbdev/aty/radeon_backlight.c +++ b/drivers/video/fbdev/aty/radeon_backlight.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight code for ATI Radeon based graphic cards * * Copyright (c) 2000 Ani Joshi <ajoshi@kernel.crashing.org> * Copyright (c) 2003 Benjamin Herrenschmidt <benh@kernel.crashing.org> * Copyright (c) 2006 Michael Hanselmann <linux-kernel@hansmi.ch> - * - * 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 "radeonfb.h" diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index e8594bbaea60..6f891d82eebe 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -2294,8 +2294,6 @@ static int radeonfb_pci_register(struct pci_dev *pdev, info = framebuffer_alloc(sizeof(struct radeonfb_info), &pdev->dev); if (!info) { - printk (KERN_ERR "radeonfb (%s): could not allocate memory\n", - pci_name(pdev)); ret = -ENOMEM; goto err_disable; } diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c index 0adf0683cf08..99941ae1f3a1 100644 --- a/drivers/video/fbdev/au1100fb.c +++ b/drivers/video/fbdev/au1100fb.c @@ -340,14 +340,12 @@ int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi) */ int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) { - struct au1100fb_device *fbdev; - - fbdev = to_au1100fb_device(fbi); + struct au1100fb_device *fbdev = to_au1100fb_device(fbi); - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6 - return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len); + return dma_mmap_coherent(fbdev->dev, vma, fbdev->fb_mem, fbdev->fb_phys, + fbdev->fb_len); } static struct fb_ops au1100fb_ops = @@ -412,7 +410,6 @@ static int au1100fb_drv_probe(struct platform_device *dev) { struct au1100fb_device *fbdev; struct resource *regs_res; - unsigned long page; struct clk *c; /* Allocate new device private */ @@ -424,6 +421,7 @@ static int au1100fb_drv_probe(struct platform_device *dev) goto failed; platform_set_drvdata(dev, (void *)fbdev); + fbdev->dev = &dev->dev; /* Allocate region for our registers and map them */ regs_res = platform_get_resource(dev, IORESOURCE_MEM, 0); @@ -472,20 +470,6 @@ static int au1100fb_drv_probe(struct platform_device *dev) au1100fb_fix.smem_start = fbdev->fb_phys; au1100fb_fix.smem_len = fbdev->fb_len; - /* - * Set page reserved so that mmap will work. This is necessary - * since we'll be remapping normal memory. - */ - for (page = (unsigned long)fbdev->fb_mem; - page < PAGE_ALIGN((unsigned long)fbdev->fb_mem + fbdev->fb_len); - page += PAGE_SIZE) { -#ifdef CONFIG_DMA_NONCOHERENT - SetPageReserved(virt_to_page(CAC_ADDR((void *)page))); -#else - SetPageReserved(virt_to_page(page)); -#endif - } - print_dbg("Framebuffer memory map at %p", fbdev->fb_mem); print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024); diff --git a/drivers/video/fbdev/au1100fb.h b/drivers/video/fbdev/au1100fb.h index 9af19939a9c6..e7239bceefd3 100644 --- a/drivers/video/fbdev/au1100fb.h +++ b/drivers/video/fbdev/au1100fb.h @@ -110,6 +110,7 @@ struct au1100fb_device { dma_addr_t fb_phys; int panel_idx; struct clk *lcdclk; + struct device *dev; }; /********************************************************************/ diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c index 3872ccef4cb2..26caffb02b7e 100644 --- a/drivers/video/fbdev/au1200fb.c +++ b/drivers/video/fbdev/au1200fb.c @@ -147,6 +147,7 @@ struct au1200_lcd_iodata_t { struct au1200fb_device { struct fb_info *fb_info; /* FB driver info record */ struct au1200fb_platdata *pd; + struct device *dev; int plane; unsigned char* fb_mem; /* FrameBuffer memory map */ @@ -1232,10 +1233,8 @@ static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) { struct au1200fb_device *fbdev = info->par; - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); - pgprot_val(vma->vm_page_prot) |= _CACHE_MASK; /* CCA=7 */ - - return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len); + return dma_mmap_attrs(fbdev->dev, vma, fbdev->fb_mem, fbdev->fb_phys, + fbdev->fb_len, DMA_ATTR_NON_CONSISTENT); } static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata) @@ -1647,7 +1646,6 @@ static int au1200fb_drv_probe(struct platform_device *dev) struct au1200fb_device *fbdev; struct au1200fb_platdata *pd; struct fb_info *fbi = NULL; - unsigned long page; int bpp, plane, ret, irq; print_info("" DRIVER_DESC ""); @@ -1685,6 +1683,7 @@ static int au1200fb_drv_probe(struct platform_device *dev) fbdev = fbi->par; fbdev->fb_info = fbi; fbdev->pd = pd; + fbdev->dev = &dev->dev; fbdev->plane = plane; @@ -1702,16 +1701,6 @@ static int au1200fb_drv_probe(struct platform_device *dev) goto failed; } - /* - * Set page reserved so that mmap will work. This is necessary - * since we'll be remapping normal memory. - */ - for (page = (unsigned long)fbdev->fb_phys; - page < PAGE_ALIGN((unsigned long)fbdev->fb_phys + - fbdev->fb_len); - page += PAGE_SIZE) { - SetPageReserved(pfn_to_page(page >> PAGE_SHIFT)); /* LCD DMA is NOT coherent on Au1200 */ - } print_dbg("Framebuffer memory map at %p", fbdev->fb_mem); print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024); diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c index ca549e1532e6..f4dc320dcafe 100644 --- a/drivers/video/fbdev/chipsfb.c +++ b/drivers/video/fbdev/chipsfb.c @@ -366,7 +366,6 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent) p = framebuffer_alloc(0, &dp->dev); if (p == NULL) { - dev_err(&dp->dev, "Cannot allocate framebuffer structure\n"); rc = -ENOMEM; goto err_disable; } diff --git a/drivers/video/fbdev/cirrusfb.c b/drivers/video/fbdev/cirrusfb.c index b3be06dd2908..e4ce5667b125 100644 --- a/drivers/video/fbdev/cirrusfb.c +++ b/drivers/video/fbdev/cirrusfb.c @@ -2093,7 +2093,6 @@ static int cirrusfb_pci_register(struct pci_dev *pdev, info = framebuffer_alloc(sizeof(struct cirrusfb_info), &pdev->dev); if (!info) { - printk(KERN_ERR "cirrusfb: could not allocate memory\n"); ret = -ENOMEM; goto err_out; } @@ -2206,10 +2205,8 @@ static int cirrusfb_zorro_register(struct zorro_dev *z, struct cirrusfb_info *cinfo; info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev); - if (!info) { - printk(KERN_ERR "cirrusfb: could not allocate memory\n"); + if (!info) return -ENOMEM; - } zcl = (const struct zorrocl *)ent->driver_data; btype = zcl->type; diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index 7af8db28bb80..9a680ef3ffc3 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -182,7 +182,7 @@ int init_module(void) int ret = -ENXIO; dp = of_find_node_by_name(NULL, "control"); - if (dp != 0 && !control_of_init(dp)) + if (dp && !control_of_init(dp)) ret = 0; of_node_put(dp); @@ -580,7 +580,7 @@ static int __init control_init(void) control_setup(option); dp = of_find_node_by_name(NULL, "control"); - if (dp != 0 && !control_of_init(dp)) + if (dp && !control_of_init(dp)) ret = 0; of_node_put(dp); @@ -683,8 +683,8 @@ static int __init control_of_init(struct device_node *dp) return -ENXIO; } p = kzalloc(sizeof(*p), GFP_KERNEL); - if (p == 0) - return -ENXIO; + if (!p) + return -ENOMEM; control_fb = p; /* save it for cleanups */ /* Map in frame buffer and registers */ diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 452ef07b3a06..3a2d9ff0aa42 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/cyber2000fb.c * @@ -9,10 +10,6 @@ * 32 bit support, text color and panning fixes for modes != 8 bit * Copyright (C) 2002 Denis Oliver Kropp <dok@directfb.org> * - * 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. - * * Integraphics CyberPro 2000, 2010 and 5000 frame buffer device * * Based on cyberfb.c. @@ -1641,10 +1638,6 @@ static void cyberpro_common_resume(struct cfb_info *cfb) } /* - * PCI specific support. - */ -#ifdef CONFIG_PCI -/* * We need to wake up the CyberPro, and make sure its in linear memory * mode. Unfortunately, this is specific to the platform and card that * we are running on. @@ -1860,7 +1853,6 @@ static struct pci_driver cyberpro_driver = { .resume = cyberpro_pci_resume, .id_table = cyberpro_pci_table }; -#endif /* * I don't think we can use the "module_init" stuff here because diff --git a/drivers/video/fbdev/cyber2000fb.h b/drivers/video/fbdev/cyber2000fb.h index bad69102e774..04641aa13acc 100644 --- a/drivers/video/fbdev/cyber2000fb.h +++ b/drivers/video/fbdev/cyber2000fb.h @@ -1,12 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * linux/drivers/video/cyber2000fb.h * * Copyright (C) 1998-2000 Russell King * - * 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. - * * Integraphics Cyber2000 frame buffer device */ diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index 9ea817ac1d81..b1cf248f3291 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c @@ -1387,7 +1387,6 @@ static int fb_probe(struct platform_device *device) da8xx_fb_info = framebuffer_alloc(sizeof(struct da8xx_fb_par), &device->dev); if (!da8xx_fb_info) { - dev_dbg(&device->dev, "Memory allocation failed for fb_info\n"); ret = -ENOMEM; goto err_pm_runtime_disable; } diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 9f39f0c360e0..04a22663b4fb 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -169,6 +169,11 @@ static void efifb_show_boot_graphics(struct fb_info *info) return; } + if (bgrt_tab.status & 0x06) { + pr_info("efifb: BGRT rotation bits set, not showing boot graphics\n"); + return; + } + /* Avoid flashing the logo if we're going to print std probe messages */ if (console_loglevel > CONSOLE_LOGLEVEL_QUIET) return; @@ -448,7 +453,6 @@ static int efifb_probe(struct platform_device *dev) info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev); if (!info) { - pr_err("efifb: cannot allocate framebuffer\n"); err = -ENOMEM; goto err_release_mem; } diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c index 75f0db25d19f..d04a047094fc 100644 --- a/drivers/video/fbdev/ep93xx-fb.c +++ b/drivers/video/fbdev/ep93xx-fb.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/ep93xx-fb.c * @@ -10,11 +11,6 @@ * * Based on the Cirrus Logic ep93xxfb driver, and various other ep93xxfb * drivers. - * - * 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 <linux/platform_device.h> diff --git a/drivers/video/fbdev/fb-puv3.c b/drivers/video/fbdev/fb-puv3.c index 1bddcc20b2c0..fa62c4dff7d1 100644 --- a/drivers/video/fbdev/fb-puv3.c +++ b/drivers/video/fbdev/fb-puv3.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Frame Buffer Driver for PKUnity-v3 Unigfx * Code specific to PKUnity SoC and UniCore ISA * * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn> * Copyright (C) 2001-2010 Guan Xuetao - * - * 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 <linux/module.h> diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index 3fcb33232ba3..b9f6a82a0495 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/video/fbdev/gbefb.c @@ -39,9 +39,7 @@ struct gbefb_par { int valid; }; -#ifdef CONFIG_SGI_IP32 #define GBE_BASE 0x16000000 /* SGI O2 */ -#endif /* macro for fastest write-though access to the framebuffer */ #ifdef CONFIG_MIPS @@ -51,10 +49,6 @@ struct gbefb_par { #define pgprot_fb(_prot) (((_prot) & (~_CACHE_MASK)) | _CACHE_CACHABLE_NO_WA) #endif #endif -#ifdef CONFIG_X86 -#define pgprot_fb(_prot) (((_prot) & ~_PAGE_CACHE_MASK) | \ - cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS)) -#endif /* * RAM we reserve for the frame buffer. This defines the maximum screen @@ -279,7 +273,7 @@ static void gbe_turn_off(void) val = 0; SET_GBE_FIELD(VT_XY, FREEZE, val, 1); gbe->vt_xy = val; - udelay(10000); + mdelay(10); for (i = 0; i < 10000; i++) { val = gbe->vt_xy; if (GET_GBE_FIELD(VT_XY, FREEZE, val) != 1) @@ -294,7 +288,7 @@ static void gbe_turn_off(void) val = gbe->dotclock; SET_GBE_FIELD(DOTCLK, RUN, val, 0); gbe->dotclock = val; - udelay(10000); + mdelay(10); for (i = 0; i < 10000; i++) { val = gbe->dotclock; if (GET_GBE_FIELD(DOTCLK, RUN, val)) @@ -331,7 +325,7 @@ static void gbe_turn_on(void) val = gbe->dotclock; SET_GBE_FIELD(DOTCLK, RUN, val, 1); gbe->dotclock = val; - udelay(10000); + mdelay(10); for (i = 0; i < 10000; i++) { val = gbe->dotclock; if (GET_GBE_FIELD(DOTCLK, RUN, val) != 1) @@ -346,7 +340,7 @@ static void gbe_turn_on(void) val = 0; SET_GBE_FIELD(VT_XY, FREEZE, val, 0); gbe->vt_xy = val; - udelay(10000); + mdelay(10); for (i = 0; i < 10000; i++) { val = gbe->vt_xy; if (GET_GBE_FIELD(VT_XY, FREEZE, val)) @@ -547,7 +541,7 @@ static void gbe_set_timing_info(struct gbe_timing_info *timing) SET_GBE_FIELD(DOTCLK, P, val, timing->pll_p); SET_GBE_FIELD(DOTCLK, RUN, val, 0); /* do not start yet */ gbe->dotclock = val; - udelay(10000); + mdelay(10); /* setup pixel counter */ val = 0; @@ -1018,9 +1012,10 @@ static int gbefb_mmap(struct fb_info *info, /* remap using the fastest write-through mode on architecture */ /* try not polluting the cache when possible */ +#ifdef CONFIG_MIPS pgprot_val(vma->vm_page_prot) = pgprot_fb(pgprot_val(vma->vm_page_prot)); - +#endif /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ /* look for the starting tile */ diff --git a/drivers/video/fbdev/grvga.c b/drivers/video/fbdev/grvga.c index df5d546e57e9..d22e8b0c906d 100644 --- a/drivers/video/fbdev/grvga.c +++ b/drivers/video/fbdev/grvga.c @@ -336,10 +336,8 @@ static int grvga_probe(struct platform_device *dev) char *options = NULL, *mode_opt = NULL; info = framebuffer_alloc(sizeof(struct grvga_par), &dev->dev); - if (!info) { - dev_err(&dev->dev, "framebuffer_alloc failed\n"); + if (!info) return -ENOMEM; - } /* Expecting: "grvga: modestring, [addr:<framebuffer physical address>], [size:<framebuffer size>] * diff --git a/drivers/video/fbdev/gxt4500.c b/drivers/video/fbdev/gxt4500.c index 37527a10b954..c7502fd8f447 100644 --- a/drivers/video/fbdev/gxt4500.c +++ b/drivers/video/fbdev/gxt4500.c @@ -643,10 +643,9 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } info = framebuffer_alloc(sizeof(struct gxt4500_par), &pdev->dev); - if (!info) { - dev_err(&pdev->dev, "gxt4500: cannot alloc FB info record\n"); + if (!info) goto err_free_fb; - } + par = info->par; cardtype = ent->driver_data; par->refclk_ps = cardinfo[cardtype].refclk_ps; diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index 00f5bdcc6c6f..2dcb7c58b31e 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -762,10 +762,8 @@ static int hvfb_probe(struct hv_device *hdev, int ret; info = framebuffer_alloc(sizeof(struct hvfb_par), &hdev->device); - if (!info) { - pr_err("No memory for framebuffer info\n"); + if (!info) return -ENOMEM; - } par = info->par; par->info = info; diff --git a/drivers/video/fbdev/i740fb.c b/drivers/video/fbdev/i740fb.c index 24d3280a5b5f..347cf8babc3e 100644 --- a/drivers/video/fbdev/i740fb.c +++ b/drivers/video/fbdev/i740fb.c @@ -1006,10 +1006,8 @@ static int i740fb_probe(struct pci_dev *dev, const struct pci_device_id *ent) u8 *edid; info = framebuffer_alloc(sizeof(struct i740fb_par), &(dev->dev)); - if (!info) { - dev_err(&(dev->dev), "cannot allocate framebuffer\n"); + if (!info) return -ENOMEM; - } par = info->par; mutex_init(&par->open_lock); diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c index 35bba3c2036d..58b01c7d9056 100644 --- a/drivers/video/fbdev/imsttfb.c +++ b/drivers/video/fbdev/imsttfb.c @@ -1477,11 +1477,8 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) printk(KERN_ERR "imsttfb: no OF node for pci device\n"); info = framebuffer_alloc(sizeof(struct imstt_par), &pdev->dev); - - if (!info) { - printk(KERN_ERR "imsttfb: Can't allocate memory\n"); + if (!info) return -ENOMEM; - } par = info->par; diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index c4eb8661f751..b3286d1fa543 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -974,10 +974,9 @@ static int imxfb_probe(struct platform_device *pdev) } fbi->map_size = PAGE_ALIGN(info->fix.smem_len); - info->screen_base = dma_alloc_wc(&pdev->dev, fbi->map_size, - &fbi->map_dma, GFP_KERNEL); - - if (!info->screen_base) { + info->screen_buffer = dma_alloc_wc(&pdev->dev, fbi->map_size, + &fbi->map_dma, GFP_KERNEL); + if (!info->screen_buffer) { dev_err(&pdev->dev, "Failed to allocate video RAM: %d\n", ret); ret = -ENOMEM; goto failed_map; @@ -1046,7 +1045,7 @@ failed_cmap: if (pdata && pdata->exit) pdata->exit(fbi->pdev); failed_platform_init: - dma_free_wc(&pdev->dev, fbi->map_size, info->screen_base, + dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, fbi->map_dma); failed_map: iounmap(fbi->regs); @@ -1077,7 +1076,7 @@ static int imxfb_remove(struct platform_device *pdev) pdata = dev_get_platdata(&pdev->dev); if (pdata && pdata->exit) pdata->exit(fbi->pdev); - dma_free_wc(&pdev->dev, fbi->map_size, info->screen_base, + dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, fbi->map_dma); iounmap(fbi->regs); release_mem_region(res->start, resource_size(res)); diff --git a/drivers/video/fbdev/intelfb/intelfbdrv.c b/drivers/video/fbdev/intelfb/intelfbdrv.c index d7463a2a5d83..a76c61512c60 100644 --- a/drivers/video/fbdev/intelfb/intelfbdrv.c +++ b/drivers/video/fbdev/intelfb/intelfbdrv.c @@ -491,10 +491,9 @@ static int intelfb_pci_register(struct pci_dev *pdev, } info = framebuffer_alloc(sizeof(struct intelfb_info), &pdev->dev); - if (!info) { - ERR_MSG("Could not allocate memory for intelfb_info.\n"); - return -ENODEV; - } + if (!info) + return -ENOMEM; + if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) { ERR_MSG("Could not allocate cmap for intelfb_info.\n"); goto err_out_cmap; diff --git a/drivers/video/fbdev/jz4740_fb.c b/drivers/video/fbdev/jz4740_fb.c index 145095655cc2..0b6fa25f6924 100644 --- a/drivers/video/fbdev/jz4740_fb.c +++ b/drivers/video/fbdev/jz4740_fb.c @@ -457,7 +457,6 @@ static int jzfb_alloc_devmem(struct jzfb *jzfb) { int max_videosize = 0; struct fb_videomode *mode = jzfb->pdata->modes; - void *page; int i; for (i = 0; i < jzfb->pdata->num_modes; ++mode, ++i) { @@ -482,12 +481,6 @@ static int jzfb_alloc_devmem(struct jzfb *jzfb) if (!jzfb->vidmem) goto err_free_framedesc; - for (page = jzfb->vidmem; - page < jzfb->vidmem + PAGE_ALIGN(jzfb->vidmem_size); - page += PAGE_SIZE) { - SetPageReserved(virt_to_page(page)); - } - jzfb->framedesc->next = jzfb->framedesc_phys; jzfb->framedesc->addr = jzfb->vidmem_phys; jzfb->framedesc->id = 0xdeafbead; @@ -535,10 +528,8 @@ static int jzfb_probe(struct platform_device *pdev) } fb = framebuffer_alloc(sizeof(struct jzfb), &pdev->dev); - if (!fb) { - dev_err(&pdev->dev, "Failed to allocate framebuffer device\n"); + if (!fb) return -ENOMEM; - } fb->fbops = &jzfb_ops; fb->flags = FBINFO_DEFAULT; diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c index c76bef078c75..1a555f70923a 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.c +++ b/drivers/video/fbdev/matrox/matroxfb_base.c @@ -2502,7 +2502,7 @@ MODULE_PARM_DESC(nobios, "Disables ROM BIOS (0 or 1=disabled) (default=do not ch module_param(noinit, int, 0); MODULE_PARM_DESC(noinit, "Disables W/SG/SD-RAM and bus interface initialization (0 or 1=do not initialize) (default=0)"); module_param(memtype, int, 0); -MODULE_PARM_DESC(memtype, "Memory type for G200/G400 (see Documentation/fb/matroxfb.txt for explanation) (default=3 for G200, 0 for G400)"); +MODULE_PARM_DESC(memtype, "Memory type for G200/G400 (see Documentation/fb/matroxfb.rst for explanation) (default=3 for G200, 0 for G400)"); module_param(mtrr, int, 0); MODULE_PARM_DESC(mtrr, "This speeds up video memory accesses (0=disabled or 1) (default=1)"); module_param(sgram, int, 0); diff --git a/drivers/video/fbdev/mb862xx/mb862xx-i2c.c b/drivers/video/fbdev/mb862xx/mb862xx-i2c.c index ba96c44f2761..ffdb1597d303 100644 --- a/drivers/video/fbdev/mb862xx/mb862xx-i2c.c +++ b/drivers/video/fbdev/mb862xx/mb862xx-i2c.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Coral-P(A)/Lime I2C adapter driver * * (C) 2011 DENX Software Engineering, Anatolij Gustschin <agust@denx.de> - * - * 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 <linux/fb.h> diff --git a/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c b/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c index 8dd296d257dd..f58ff900e82a 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c +++ b/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * drivers/mb862xx/mb862xxfb_accel.c * @@ -6,11 +7,6 @@ * (C) 2007 Alexander Shishkin <virtuoso@slind.org> * (C) 2009 Valentin Sitdikov <v.sitdikov@gmail.com> * (C) 2009 Siemens AG - * - * 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 <linux/fb.h> #include <linux/delay.h> diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c index cd372527c9e4..962c0171d271 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * drivers/mb862xx/mb862xxfb.c * @@ -5,11 +6,6 @@ * * (C) 2008 Anatolij Gustschin <agust@denx.de> * DENX Software Engineering - * - * 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. - * */ #undef DEBUG @@ -684,10 +680,8 @@ static int of_platform_mb862xx_probe(struct platform_device *ofdev) } info = framebuffer_alloc(sizeof(struct mb862xxfb_par), dev); - if (info == NULL) { - dev_err(dev, "cannot allocate framebuffer\n"); + if (!info) return -ENOMEM; - } par = info->par; par->info = info; @@ -1009,7 +1003,6 @@ static int mb862xx_pci_probe(struct pci_dev *pdev, info = framebuffer_alloc(sizeof(struct mb862xxfb_par), dev); if (!info) { - dev_err(dev, "framebuffer alloc failed\n"); ret = -ENOMEM; goto dis_dev; } diff --git a/drivers/video/fbdev/mbx/mbxfb.c b/drivers/video/fbdev/mbx/mbxfb.c index 6ded480a69b4..50935252b50b 100644 --- a/drivers/video/fbdev/mbx/mbxfb.c +++ b/drivers/video/fbdev/mbx/mbxfb.c @@ -899,10 +899,8 @@ static int mbxfb_probe(struct platform_device *dev) } fbi = framebuffer_alloc(sizeof(struct mbxfb_info), &dev->dev); - if (fbi == NULL) { - dev_err(&dev->dev, "framebuffer_alloc failed\n"); + if (!fbi) return -ENOMEM; - } mfbi = fbi->par; fbi->pseudo_palette = mfbi->pseudo_palette; diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c index 87d943f15a12..17174cd7a5bb 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c @@ -433,7 +433,7 @@ static int mmphw_probe(struct platform_device *pdev) { struct mmp_mach_plat_info *mi; struct resource *res; - int ret, i, size, irq; + int ret, i, irq; struct mmphw_path_plat *path_plat; struct mmphw_ctrl *ctrl = NULL; @@ -461,9 +461,9 @@ static int mmphw_probe(struct platform_device *pdev) } /* allocate */ - size = sizeof(struct mmphw_ctrl) + sizeof(struct mmphw_path_plat) * - mi->path_num; - ctrl = devm_kzalloc(&pdev->dev, size, GFP_KERNEL); + ctrl = devm_kzalloc(&pdev->dev, + struct_size(ctrl, path_plats, mi->path_num), + GFP_KERNEL); if (!ctrl) { ret = -ENOMEM; goto failed; diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c index 1c3c7ab26a95..bafd5f5fac5a 100644 --- a/drivers/video/fbdev/mx3fb.c +++ b/drivers/video/fbdev/mx3fb.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2008 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de> * * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. - * - * 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 <linux/module.h> diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c deleted file mode 100644 index d8bebe35b410..000000000000 --- a/drivers/video/fbdev/mxsfb.c +++ /dev/null @@ -1,1028 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (C) 2010 Juergen Beisert, Pengutronix - * - * This code is based on: - * Author: Vitaly Wool <vital@embeddedalley.com> - * - * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved. - * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. - */ - -#define DRIVER_NAME "mxsfb" - -/** - * @file - * @brief LCDIF driver for i.MX23 and i.MX28 - * - * The LCDIF support four modes of operation - * - MPU interface (to drive smart displays) -> not supported yet - * - VSYNC interface (like MPU interface plus Vsync) -> not supported yet - * - Dotclock interface (to drive LC displays with RGB data and sync signals) - * - DVI (to drive ITU-R BT656) -> not supported yet - * - * This driver depends on a correct setup of the pins used for this purpose - * (platform specific). - * - * For the developer: Don't forget to set the data bus width to the display - * in the imx_fb_videomode structure. You will else end up with ugly colours. - * If you fight against jitter you can vary the clock delay. This is a feature - * of the i.MX28 and you can vary it between 2 ns ... 8 ns in 2 ns steps. Give - * the required value in the imx_fb_videomode structure. - */ - -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/of_device.h> -#include <linux/platform_device.h> -#include <linux/clk.h> -#include <linux/dma-mapping.h> -#include <linux/io.h> -#include <linux/fb.h> -#include <linux/regulator/consumer.h> -#include <video/of_display_timing.h> -#include <video/of_videomode.h> -#include <video/videomode.h> - -#define REG_SET 4 -#define REG_CLR 8 - -#define LCDC_CTRL 0x00 -#define LCDC_CTRL1 0x10 -#define LCDC_V4_CTRL2 0x20 -#define LCDC_V3_TRANSFER_COUNT 0x20 -#define LCDC_V4_TRANSFER_COUNT 0x30 -#define LCDC_V4_CUR_BUF 0x40 -#define LCDC_V4_NEXT_BUF 0x50 -#define LCDC_V3_CUR_BUF 0x30 -#define LCDC_V3_NEXT_BUF 0x40 -#define LCDC_TIMING 0x60 -#define LCDC_VDCTRL0 0x70 -#define LCDC_VDCTRL1 0x80 -#define LCDC_VDCTRL2 0x90 -#define LCDC_VDCTRL3 0xa0 -#define LCDC_VDCTRL4 0xb0 -#define LCDC_DVICTRL0 0xc0 -#define LCDC_DVICTRL1 0xd0 -#define LCDC_DVICTRL2 0xe0 -#define LCDC_DVICTRL3 0xf0 -#define LCDC_DVICTRL4 0x100 -#define LCDC_V4_DATA 0x180 -#define LCDC_V3_DATA 0x1b0 -#define LCDC_V4_DEBUG0 0x1d0 -#define LCDC_V3_DEBUG0 0x1f0 - -#define CTRL_SFTRST (1 << 31) -#define CTRL_CLKGATE (1 << 30) -#define CTRL_BYPASS_COUNT (1 << 19) -#define CTRL_VSYNC_MODE (1 << 18) -#define CTRL_DOTCLK_MODE (1 << 17) -#define CTRL_DATA_SELECT (1 << 16) -#define CTRL_SET_BUS_WIDTH(x) (((x) & 0x3) << 10) -#define CTRL_GET_BUS_WIDTH(x) (((x) >> 10) & 0x3) -#define CTRL_SET_WORD_LENGTH(x) (((x) & 0x3) << 8) -#define CTRL_GET_WORD_LENGTH(x) (((x) >> 8) & 0x3) -#define CTRL_MASTER (1 << 5) -#define CTRL_DF16 (1 << 3) -#define CTRL_DF18 (1 << 2) -#define CTRL_DF24 (1 << 1) -#define CTRL_RUN (1 << 0) - -#define CTRL1_FIFO_CLEAR (1 << 21) -#define CTRL1_SET_BYTE_PACKAGING(x) (((x) & 0xf) << 16) -#define CTRL1_GET_BYTE_PACKAGING(x) (((x) >> 16) & 0xf) - -#define TRANSFER_COUNT_SET_VCOUNT(x) (((x) & 0xffff) << 16) -#define TRANSFER_COUNT_GET_VCOUNT(x) (((x) >> 16) & 0xffff) -#define TRANSFER_COUNT_SET_HCOUNT(x) ((x) & 0xffff) -#define TRANSFER_COUNT_GET_HCOUNT(x) ((x) & 0xffff) - - -#define VDCTRL0_ENABLE_PRESENT (1 << 28) -#define VDCTRL0_VSYNC_ACT_HIGH (1 << 27) -#define VDCTRL0_HSYNC_ACT_HIGH (1 << 26) -#define VDCTRL0_DOTCLK_ACT_FALLING (1 << 25) -#define VDCTRL0_ENABLE_ACT_HIGH (1 << 24) -#define VDCTRL0_VSYNC_PERIOD_UNIT (1 << 21) -#define VDCTRL0_VSYNC_PULSE_WIDTH_UNIT (1 << 20) -#define VDCTRL0_HALF_LINE (1 << 19) -#define VDCTRL0_HALF_LINE_MODE (1 << 18) -#define VDCTRL0_SET_VSYNC_PULSE_WIDTH(x) ((x) & 0x3ffff) -#define VDCTRL0_GET_VSYNC_PULSE_WIDTH(x) ((x) & 0x3ffff) - -#define VDCTRL2_SET_HSYNC_PERIOD(x) ((x) & 0x3ffff) -#define VDCTRL2_GET_HSYNC_PERIOD(x) ((x) & 0x3ffff) - -#define VDCTRL3_MUX_SYNC_SIGNALS (1 << 29) -#define VDCTRL3_VSYNC_ONLY (1 << 28) -#define SET_HOR_WAIT_CNT(x) (((x) & 0xfff) << 16) -#define GET_HOR_WAIT_CNT(x) (((x) >> 16) & 0xfff) -#define SET_VERT_WAIT_CNT(x) ((x) & 0xffff) -#define GET_VERT_WAIT_CNT(x) ((x) & 0xffff) - -#define VDCTRL4_SET_DOTCLK_DLY(x) (((x) & 0x7) << 29) /* v4 only */ -#define VDCTRL4_GET_DOTCLK_DLY(x) (((x) >> 29) & 0x7) /* v4 only */ -#define VDCTRL4_SYNC_SIGNALS_ON (1 << 18) -#define SET_DOTCLK_H_VALID_DATA_CNT(x) ((x) & 0x3ffff) - -#define DEBUG0_HSYNC (1 < 26) -#define DEBUG0_VSYNC (1 < 25) - -#define MIN_XRES 120 -#define MIN_YRES 120 - -#define RED 0 -#define GREEN 1 -#define BLUE 2 -#define TRANSP 3 - -#define STMLCDIF_8BIT 1 /** pixel data bus to the display is of 8 bit width */ -#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */ -#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */ -#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */ - -#define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6) -#define MXSFB_SYNC_DOTCLK_FALLING_ACT (1 << 7) /* negative edge sampling */ - -enum mxsfb_devtype { - MXSFB_V3, - MXSFB_V4, -}; - -/* CPU dependent register offsets */ -struct mxsfb_devdata { - unsigned transfer_count; - unsigned cur_buf; - unsigned next_buf; - unsigned debug0; - unsigned hs_wdth_mask; - unsigned hs_wdth_shift; - unsigned ipversion; -}; - -struct mxsfb_info { - struct platform_device *pdev; - struct clk *clk; - struct clk *clk_axi; - struct clk *clk_disp_axi; - void __iomem *base; /* registers */ - unsigned allocated_size; - int enabled; - unsigned ld_intf_width; - unsigned dotclk_delay; - const struct mxsfb_devdata *devdata; - u32 sync; - struct regulator *reg_lcd; - int pre_init; -}; - -#define mxsfb_is_v3(host) (host->devdata->ipversion == 3) -#define mxsfb_is_v4(host) (host->devdata->ipversion == 4) - -static const struct mxsfb_devdata mxsfb_devdata[] = { - [MXSFB_V3] = { - .transfer_count = LCDC_V3_TRANSFER_COUNT, - .cur_buf = LCDC_V3_CUR_BUF, - .next_buf = LCDC_V3_NEXT_BUF, - .debug0 = LCDC_V3_DEBUG0, - .hs_wdth_mask = 0xff, - .hs_wdth_shift = 24, - .ipversion = 3, - }, - [MXSFB_V4] = { - .transfer_count = LCDC_V4_TRANSFER_COUNT, - .cur_buf = LCDC_V4_CUR_BUF, - .next_buf = LCDC_V4_NEXT_BUF, - .debug0 = LCDC_V4_DEBUG0, - .hs_wdth_mask = 0x3fff, - .hs_wdth_shift = 18, - .ipversion = 4, - }, -}; - -/* mask and shift depends on architecture */ -static inline u32 set_hsync_pulse_width(struct mxsfb_info *host, unsigned val) -{ - return (val & host->devdata->hs_wdth_mask) << - host->devdata->hs_wdth_shift; -} - -static inline u32 get_hsync_pulse_width(struct mxsfb_info *host, unsigned val) -{ - return (val >> host->devdata->hs_wdth_shift) & - host->devdata->hs_wdth_mask; -} - -static const struct fb_bitfield def_rgb565[] = { - [RED] = { - .offset = 11, - .length = 5, - }, - [GREEN] = { - .offset = 5, - .length = 6, - }, - [BLUE] = { - .offset = 0, - .length = 5, - }, - [TRANSP] = { /* no support for transparency */ - .length = 0, - } -}; - -static const struct fb_bitfield def_rgb888[] = { - [RED] = { - .offset = 16, - .length = 8, - }, - [GREEN] = { - .offset = 8, - .length = 8, - }, - [BLUE] = { - .offset = 0, - .length = 8, - }, - [TRANSP] = { /* no support for transparency */ - .length = 0, - } -}; - -static inline unsigned chan_to_field(unsigned chan, struct fb_bitfield *bf) -{ - chan &= 0xffff; - chan >>= 16 - bf->length; - return chan << bf->offset; -} - -static int mxsfb_check_var(struct fb_var_screeninfo *var, - struct fb_info *fb_info) -{ - struct mxsfb_info *host = fb_info->par; - const struct fb_bitfield *rgb = NULL; - - if (var->xres < MIN_XRES) - var->xres = MIN_XRES; - if (var->yres < MIN_YRES) - var->yres = MIN_YRES; - - var->xres_virtual = var->xres; - - var->yres_virtual = var->yres; - - switch (var->bits_per_pixel) { - case 16: - /* always expect RGB 565 */ - rgb = def_rgb565; - break; - case 32: - switch (host->ld_intf_width) { - case STMLCDIF_8BIT: - pr_debug("Unsupported LCD bus width mapping\n"); - break; - case STMLCDIF_16BIT: - case STMLCDIF_18BIT: - case STMLCDIF_24BIT: - /* real 24 bit */ - rgb = def_rgb888; - break; - } - break; - default: - pr_err("Unsupported colour depth: %u\n", var->bits_per_pixel); - return -EINVAL; - } - - /* - * Copy the RGB parameters for this display - * from the machine specific parameters. - */ - var->red = rgb[RED]; - var->green = rgb[GREEN]; - var->blue = rgb[BLUE]; - var->transp = rgb[TRANSP]; - - return 0; -} - -static inline void mxsfb_enable_axi_clk(struct mxsfb_info *host) -{ - if (host->clk_axi) - clk_prepare_enable(host->clk_axi); -} - -static inline void mxsfb_disable_axi_clk(struct mxsfb_info *host) -{ - if (host->clk_axi) - clk_disable_unprepare(host->clk_axi); -} - -static void mxsfb_enable_controller(struct fb_info *fb_info) -{ - struct mxsfb_info *host = fb_info->par; - u32 reg; - int ret; - - dev_dbg(&host->pdev->dev, "%s\n", __func__); - - if (host->reg_lcd) { - ret = regulator_enable(host->reg_lcd); - if (ret) { - dev_err(&host->pdev->dev, - "lcd regulator enable failed: %d\n", ret); - return; - } - } - - if (host->clk_disp_axi) - clk_prepare_enable(host->clk_disp_axi); - clk_prepare_enable(host->clk); - clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U); - - mxsfb_enable_axi_clk(host); - - /* if it was disabled, re-enable the mode again */ - writel(CTRL_DOTCLK_MODE, host->base + LCDC_CTRL + REG_SET); - - /* enable the SYNC signals first, then the DMA engine */ - reg = readl(host->base + LCDC_VDCTRL4); - reg |= VDCTRL4_SYNC_SIGNALS_ON; - writel(reg, host->base + LCDC_VDCTRL4); - - writel(CTRL_RUN, host->base + LCDC_CTRL + REG_SET); - - host->enabled = 1; -} - -static void mxsfb_disable_controller(struct fb_info *fb_info) -{ - struct mxsfb_info *host = fb_info->par; - unsigned loop; - u32 reg; - int ret; - - dev_dbg(&host->pdev->dev, "%s\n", __func__); - - /* - * Even if we disable the controller here, it will still continue - * until its FIFOs are running out of data - */ - writel(CTRL_DOTCLK_MODE, host->base + LCDC_CTRL + REG_CLR); - - loop = 1000; - while (loop) { - reg = readl(host->base + LCDC_CTRL); - if (!(reg & CTRL_RUN)) - break; - loop--; - } - - reg = readl(host->base + LCDC_VDCTRL4); - writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4); - - mxsfb_disable_axi_clk(host); - - clk_disable_unprepare(host->clk); - if (host->clk_disp_axi) - clk_disable_unprepare(host->clk_disp_axi); - - host->enabled = 0; - - if (host->reg_lcd) { - ret = regulator_disable(host->reg_lcd); - if (ret) - dev_err(&host->pdev->dev, - "lcd regulator disable failed: %d\n", ret); - } -} - -static int mxsfb_set_par(struct fb_info *fb_info) -{ - struct mxsfb_info *host = fb_info->par; - u32 ctrl, vdctrl0, vdctrl4; - int line_size, fb_size; - int reenable = 0; - - line_size = fb_info->var.xres * (fb_info->var.bits_per_pixel >> 3); - fb_size = fb_info->var.yres_virtual * line_size; - - if (fb_size > fb_info->fix.smem_len) - return -ENOMEM; - - fb_info->fix.line_length = line_size; - - if (host->pre_init) { - mxsfb_enable_controller(fb_info); - host->pre_init = 0; - return 0; - } - - /* - * It seems, you can't re-program the controller if it is still running. - * This may lead into shifted pictures (FIFO issue?). - * So, first stop the controller and drain its FIFOs - */ - if (host->enabled) { - reenable = 1; - mxsfb_disable_controller(fb_info); - } - - mxsfb_enable_axi_clk(host); - - /* clear the FIFOs */ - writel(CTRL1_FIFO_CLEAR, host->base + LCDC_CTRL1 + REG_SET); - - ctrl = CTRL_BYPASS_COUNT | CTRL_MASTER | - CTRL_SET_BUS_WIDTH(host->ld_intf_width); - - switch (fb_info->var.bits_per_pixel) { - case 16: - dev_dbg(&host->pdev->dev, "Setting up RGB565 mode\n"); - ctrl |= CTRL_SET_WORD_LENGTH(0); - writel(CTRL1_SET_BYTE_PACKAGING(0xf), host->base + LCDC_CTRL1); - break; - case 32: - dev_dbg(&host->pdev->dev, "Setting up RGB888/666 mode\n"); - ctrl |= CTRL_SET_WORD_LENGTH(3); - switch (host->ld_intf_width) { - case STMLCDIF_8BIT: - mxsfb_disable_axi_clk(host); - dev_err(&host->pdev->dev, - "Unsupported LCD bus width mapping\n"); - return -EINVAL; - case STMLCDIF_16BIT: - case STMLCDIF_18BIT: - case STMLCDIF_24BIT: - /* real 24 bit */ - break; - } - /* do not use packed pixels = one pixel per word instead */ - writel(CTRL1_SET_BYTE_PACKAGING(0x7), host->base + LCDC_CTRL1); - break; - default: - mxsfb_disable_axi_clk(host); - dev_err(&host->pdev->dev, "Unhandled color depth of %u\n", - fb_info->var.bits_per_pixel); - return -EINVAL; - } - - writel(ctrl, host->base + LCDC_CTRL); - - writel(TRANSFER_COUNT_SET_VCOUNT(fb_info->var.yres) | - TRANSFER_COUNT_SET_HCOUNT(fb_info->var.xres), - host->base + host->devdata->transfer_count); - - vdctrl0 = VDCTRL0_ENABLE_PRESENT | /* always in DOTCLOCK mode */ - VDCTRL0_VSYNC_PERIOD_UNIT | - VDCTRL0_VSYNC_PULSE_WIDTH_UNIT | - VDCTRL0_SET_VSYNC_PULSE_WIDTH(fb_info->var.vsync_len); - if (fb_info->var.sync & FB_SYNC_HOR_HIGH_ACT) - vdctrl0 |= VDCTRL0_HSYNC_ACT_HIGH; - if (fb_info->var.sync & FB_SYNC_VERT_HIGH_ACT) - vdctrl0 |= VDCTRL0_VSYNC_ACT_HIGH; - if (host->sync & MXSFB_SYNC_DATA_ENABLE_HIGH_ACT) - vdctrl0 |= VDCTRL0_ENABLE_ACT_HIGH; - if (host->sync & MXSFB_SYNC_DOTCLK_FALLING_ACT) - vdctrl0 |= VDCTRL0_DOTCLK_ACT_FALLING; - - writel(vdctrl0, host->base + LCDC_VDCTRL0); - - /* frame length in lines */ - writel(fb_info->var.upper_margin + fb_info->var.vsync_len + - fb_info->var.lower_margin + fb_info->var.yres, - host->base + LCDC_VDCTRL1); - - /* line length in units of clocks or pixels */ - writel(set_hsync_pulse_width(host, fb_info->var.hsync_len) | - VDCTRL2_SET_HSYNC_PERIOD(fb_info->var.left_margin + - fb_info->var.hsync_len + fb_info->var.right_margin + - fb_info->var.xres), - host->base + LCDC_VDCTRL2); - - writel(SET_HOR_WAIT_CNT(fb_info->var.left_margin + - fb_info->var.hsync_len) | - SET_VERT_WAIT_CNT(fb_info->var.upper_margin + - fb_info->var.vsync_len), - host->base + LCDC_VDCTRL3); - - vdctrl4 = SET_DOTCLK_H_VALID_DATA_CNT(fb_info->var.xres); - if (mxsfb_is_v4(host)) - vdctrl4 |= VDCTRL4_SET_DOTCLK_DLY(host->dotclk_delay); - writel(vdctrl4, host->base + LCDC_VDCTRL4); - - writel(fb_info->fix.smem_start + - fb_info->fix.line_length * fb_info->var.yoffset, - host->base + host->devdata->next_buf); - - mxsfb_disable_axi_clk(host); - - if (reenable) - mxsfb_enable_controller(fb_info); - - return 0; -} - -static int mxsfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *fb_info) -{ - unsigned int val; - int ret = -EINVAL; - - /* - * If greyscale is true, then we convert the RGB value - * to greyscale no matter what visual we are using. - */ - if (fb_info->var.grayscale) - red = green = blue = (19595 * red + 38470 * green + - 7471 * blue) >> 16; - - switch (fb_info->fix.visual) { - case FB_VISUAL_TRUECOLOR: - /* - * 12 or 16-bit True Colour. We encode the RGB value - * according to the RGB bitfield information. - */ - if (regno < 16) { - u32 *pal = fb_info->pseudo_palette; - - val = chan_to_field(red, &fb_info->var.red); - val |= chan_to_field(green, &fb_info->var.green); - val |= chan_to_field(blue, &fb_info->var.blue); - - pal[regno] = val; - ret = 0; - } - break; - - case FB_VISUAL_STATIC_PSEUDOCOLOR: - case FB_VISUAL_PSEUDOCOLOR: - break; - } - - return ret; -} - -static int mxsfb_blank(int blank, struct fb_info *fb_info) -{ - struct mxsfb_info *host = fb_info->par; - - switch (blank) { - case FB_BLANK_POWERDOWN: - case FB_BLANK_VSYNC_SUSPEND: - case FB_BLANK_HSYNC_SUSPEND: - case FB_BLANK_NORMAL: - if (host->enabled) - mxsfb_disable_controller(fb_info); - break; - - case FB_BLANK_UNBLANK: - if (!host->enabled) - mxsfb_enable_controller(fb_info); - break; - } - return 0; -} - -static int mxsfb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *fb_info) -{ - struct mxsfb_info *host = fb_info->par; - unsigned offset; - - if (var->xoffset != 0) - return -EINVAL; - - offset = fb_info->fix.line_length * var->yoffset; - - mxsfb_enable_axi_clk(host); - - /* update on next VSYNC */ - writel(fb_info->fix.smem_start + offset, - host->base + host->devdata->next_buf); - - mxsfb_disable_axi_clk(host); - - return 0; -} - -static struct fb_ops mxsfb_ops = { - .owner = THIS_MODULE, - .fb_check_var = mxsfb_check_var, - .fb_set_par = mxsfb_set_par, - .fb_setcolreg = mxsfb_setcolreg, - .fb_blank = mxsfb_blank, - .fb_pan_display = mxsfb_pan_display, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, -}; - -static int mxsfb_restore_mode(struct fb_info *fb_info, - struct fb_videomode *vmode) -{ - struct mxsfb_info *host = fb_info->par; - unsigned period; - unsigned long pa, fbsize; - int bits_per_pixel, ofs, ret = 0; - u32 transfer_count, vdctrl0, vdctrl2, vdctrl3, vdctrl4, ctrl; - - mxsfb_enable_axi_clk(host); - - /* Only restore the mode when the controller is running */ - ctrl = readl(host->base + LCDC_CTRL); - if (!(ctrl & CTRL_RUN)) { - ret = -EINVAL; - goto err; - } - - vdctrl0 = readl(host->base + LCDC_VDCTRL0); - vdctrl2 = readl(host->base + LCDC_VDCTRL2); - vdctrl3 = readl(host->base + LCDC_VDCTRL3); - vdctrl4 = readl(host->base + LCDC_VDCTRL4); - - transfer_count = readl(host->base + host->devdata->transfer_count); - - vmode->xres = TRANSFER_COUNT_GET_HCOUNT(transfer_count); - vmode->yres = TRANSFER_COUNT_GET_VCOUNT(transfer_count); - - switch (CTRL_GET_WORD_LENGTH(ctrl)) { - case 0: - bits_per_pixel = 16; - break; - case 3: - bits_per_pixel = 32; - break; - case 1: - default: - ret = -EINVAL; - goto err; - } - - fb_info->var.bits_per_pixel = bits_per_pixel; - - vmode->pixclock = KHZ2PICOS(clk_get_rate(host->clk) / 1000U); - vmode->hsync_len = get_hsync_pulse_width(host, vdctrl2); - vmode->left_margin = GET_HOR_WAIT_CNT(vdctrl3) - vmode->hsync_len; - vmode->right_margin = VDCTRL2_GET_HSYNC_PERIOD(vdctrl2) - - vmode->hsync_len - vmode->left_margin - vmode->xres; - vmode->vsync_len = VDCTRL0_GET_VSYNC_PULSE_WIDTH(vdctrl0); - period = readl(host->base + LCDC_VDCTRL1); - vmode->upper_margin = GET_VERT_WAIT_CNT(vdctrl3) - vmode->vsync_len; - vmode->lower_margin = period - vmode->vsync_len - - vmode->upper_margin - vmode->yres; - - vmode->vmode = FB_VMODE_NONINTERLACED; - - vmode->sync = 0; - if (vdctrl0 & VDCTRL0_HSYNC_ACT_HIGH) - vmode->sync |= FB_SYNC_HOR_HIGH_ACT; - if (vdctrl0 & VDCTRL0_VSYNC_ACT_HIGH) - vmode->sync |= FB_SYNC_VERT_HIGH_ACT; - - pr_debug("Reconstructed video mode:\n"); - pr_debug("%dx%d, hsync: %u left: %u, right: %u, vsync: %u, upper: %u, lower: %u\n", - vmode->xres, vmode->yres, vmode->hsync_len, vmode->left_margin, - vmode->right_margin, vmode->vsync_len, vmode->upper_margin, - vmode->lower_margin); - pr_debug("pixclk: %ldkHz\n", PICOS2KHZ(vmode->pixclock)); - - host->ld_intf_width = CTRL_GET_BUS_WIDTH(ctrl); - host->dotclk_delay = VDCTRL4_GET_DOTCLK_DLY(vdctrl4); - - fb_info->fix.line_length = vmode->xres * (bits_per_pixel >> 3); - - pa = readl(host->base + host->devdata->cur_buf); - fbsize = fb_info->fix.line_length * vmode->yres; - if (pa < fb_info->fix.smem_start) { - ret = -EINVAL; - goto err; - } - if (pa + fbsize > fb_info->fix.smem_start + fb_info->fix.smem_len) { - ret = -EINVAL; - goto err; - } - ofs = pa - fb_info->fix.smem_start; - if (ofs) { - memmove(fb_info->screen_base, fb_info->screen_base + ofs, fbsize); - writel(fb_info->fix.smem_start, host->base + host->devdata->next_buf); - } - - fb_info->fix.ypanstep = 1; - - clk_prepare_enable(host->clk); - host->enabled = 1; - -err: - if (ret) - mxsfb_disable_axi_clk(host); - - return ret; -} - -static int mxsfb_init_fbinfo_dt(struct fb_info *fb_info, - struct fb_videomode *vmode) -{ - struct mxsfb_info *host = fb_info->par; - struct fb_var_screeninfo *var = &fb_info->var; - struct device *dev = &host->pdev->dev; - struct device_node *np = host->pdev->dev.of_node; - struct device_node *display_np; - struct videomode vm; - u32 width; - int ret; - - display_np = of_parse_phandle(np, "display", 0); - if (!display_np) { - dev_err(dev, "failed to find display phandle\n"); - return -ENOENT; - } - - ret = of_property_read_u32(display_np, "bus-width", &width); - if (ret < 0) { - dev_err(dev, "failed to get property bus-width\n"); - goto put_display_node; - } - - switch (width) { - case 8: - host->ld_intf_width = STMLCDIF_8BIT; - break; - case 16: - host->ld_intf_width = STMLCDIF_16BIT; - break; - case 18: - host->ld_intf_width = STMLCDIF_18BIT; - break; - case 24: - host->ld_intf_width = STMLCDIF_24BIT; - break; - default: - dev_err(dev, "invalid bus-width value\n"); - ret = -EINVAL; - goto put_display_node; - } - - ret = of_property_read_u32(display_np, "bits-per-pixel", - &var->bits_per_pixel); - if (ret < 0) { - dev_err(dev, "failed to get property bits-per-pixel\n"); - goto put_display_node; - } - - ret = of_get_videomode(display_np, &vm, OF_USE_NATIVE_MODE); - if (ret) { - dev_err(dev, "failed to get videomode from DT\n"); - goto put_display_node; - } - - ret = fb_videomode_from_videomode(&vm, vmode); - if (ret < 0) - goto put_display_node; - - if (vm.flags & DISPLAY_FLAGS_DE_HIGH) - host->sync |= MXSFB_SYNC_DATA_ENABLE_HIGH_ACT; - - /* - * The PIXDATA flags of the display_flags enum are controller - * centric, e.g. NEGEDGE means drive data on negative edge. - * However, the drivers flag is display centric: Sample the - * data on negative (falling) edge. Therefore, check for the - * POSEDGE flag: - * drive on positive edge => sample on negative edge - */ - if (vm.flags & DISPLAY_FLAGS_PIXDATA_POSEDGE) - host->sync |= MXSFB_SYNC_DOTCLK_FALLING_ACT; - -put_display_node: - of_node_put(display_np); - return ret; -} - -static int mxsfb_init_fbinfo(struct fb_info *fb_info, - struct fb_videomode *vmode) -{ - int ret; - struct mxsfb_info *host = fb_info->par; - struct device *dev = &host->pdev->dev; - struct fb_var_screeninfo *var = &fb_info->var; - dma_addr_t fb_phys; - void *fb_virt; - unsigned fb_size; - - fb_info->fbops = &mxsfb_ops; - fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST; - strlcpy(fb_info->fix.id, "mxs", sizeof(fb_info->fix.id)); - fb_info->fix.type = FB_TYPE_PACKED_PIXELS; - fb_info->fix.ypanstep = 1; - fb_info->fix.visual = FB_VISUAL_TRUECOLOR, - fb_info->fix.accel = FB_ACCEL_NONE; - - ret = mxsfb_init_fbinfo_dt(fb_info, vmode); - if (ret) - return ret; - - var->nonstd = 0; - var->activate = FB_ACTIVATE_NOW; - var->accel_flags = 0; - var->vmode = FB_VMODE_NONINTERLACED; - - /* Memory allocation for framebuffer */ - fb_size = SZ_2M; - fb_virt = dma_alloc_wc(dev, PAGE_ALIGN(fb_size), &fb_phys, GFP_KERNEL); - if (!fb_virt) - return -ENOMEM; - - fb_info->fix.smem_start = fb_phys; - fb_info->screen_base = fb_virt; - fb_info->screen_size = fb_info->fix.smem_len = fb_size; - - if (mxsfb_restore_mode(fb_info, vmode)) - memset(fb_virt, 0, fb_size); - - return 0; -} - -static void mxsfb_free_videomem(struct fb_info *fb_info) -{ - struct mxsfb_info *host = fb_info->par; - struct device *dev = &host->pdev->dev; - - dma_free_wc(dev, fb_info->screen_size, fb_info->screen_base, - fb_info->fix.smem_start); -} - -static const struct platform_device_id mxsfb_devtype[] = { - { - .name = "imx23-fb", - .driver_data = MXSFB_V3, - }, { - .name = "imx28-fb", - .driver_data = MXSFB_V4, - }, { - /* sentinel */ - } -}; -MODULE_DEVICE_TABLE(platform, mxsfb_devtype); - -static const struct of_device_id mxsfb_dt_ids[] = { - { .compatible = "fsl,imx23-lcdif", .data = &mxsfb_devtype[0], }, - { .compatible = "fsl,imx28-lcdif", .data = &mxsfb_devtype[1], }, - { /* sentinel */ } -}; -MODULE_DEVICE_TABLE(of, mxsfb_dt_ids); - -static int mxsfb_probe(struct platform_device *pdev) -{ - const struct of_device_id *of_id = - of_match_device(mxsfb_dt_ids, &pdev->dev); - struct resource *res; - struct mxsfb_info *host; - struct fb_info *fb_info; - struct fb_videomode *mode; - int ret; - - if (of_id) - pdev->id_entry = of_id->data; - - fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev); - if (!fb_info) { - dev_err(&pdev->dev, "Failed to allocate fbdev\n"); - return -ENOMEM; - } - - mode = devm_kzalloc(&pdev->dev, sizeof(struct fb_videomode), - GFP_KERNEL); - if (mode == NULL) - return -ENOMEM; - - host = fb_info->par; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - host->base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(host->base)) { - ret = PTR_ERR(host->base); - goto fb_release; - } - - host->pdev = pdev; - platform_set_drvdata(pdev, host); - - host->devdata = &mxsfb_devdata[pdev->id_entry->driver_data]; - - host->clk = devm_clk_get(&host->pdev->dev, NULL); - if (IS_ERR(host->clk)) { - ret = PTR_ERR(host->clk); - goto fb_release; - } - - host->clk_axi = devm_clk_get(&host->pdev->dev, "axi"); - if (IS_ERR(host->clk_axi)) - host->clk_axi = NULL; - - host->clk_disp_axi = devm_clk_get(&host->pdev->dev, "disp_axi"); - if (IS_ERR(host->clk_disp_axi)) - host->clk_disp_axi = NULL; - - host->reg_lcd = devm_regulator_get(&pdev->dev, "lcd"); - if (IS_ERR(host->reg_lcd)) - host->reg_lcd = NULL; - -#if defined(CONFIG_FB_PRE_INIT_FB) - host->pre_init = 1; -#endif - - fb_info->pseudo_palette = devm_kcalloc(&pdev->dev, 16, sizeof(u32), - GFP_KERNEL); - if (!fb_info->pseudo_palette) { - ret = -ENOMEM; - goto fb_release; - } - - ret = mxsfb_init_fbinfo(fb_info, mode); - if (ret != 0) - goto fb_release; - - fb_videomode_to_var(&fb_info->var, mode); - - /* init the color fields */ - mxsfb_check_var(&fb_info->var, fb_info); - - platform_set_drvdata(pdev, fb_info); - - ret = register_framebuffer(fb_info); - if (ret != 0) { - dev_err(&pdev->dev,"Failed to register framebuffer\n"); - goto fb_destroy; - } - - if (!host->enabled) { - mxsfb_enable_axi_clk(host); - writel(0, host->base + LCDC_CTRL); - mxsfb_disable_axi_clk(host); - mxsfb_set_par(fb_info); - mxsfb_enable_controller(fb_info); - } - - host->pre_init = 0; - dev_info(&pdev->dev, "initialized\n"); - - return 0; - -fb_destroy: - if (host->enabled) - clk_disable_unprepare(host->clk); -fb_release: - framebuffer_release(fb_info); - - return ret; -} - -static int mxsfb_remove(struct platform_device *pdev) -{ - struct fb_info *fb_info = platform_get_drvdata(pdev); - struct mxsfb_info *host = fb_info->par; - - if (host->enabled) - mxsfb_disable_controller(fb_info); - - unregister_framebuffer(fb_info); - mxsfb_free_videomem(fb_info); - - framebuffer_release(fb_info); - - return 0; -} - -static void mxsfb_shutdown(struct platform_device *pdev) -{ - struct fb_info *fb_info = platform_get_drvdata(pdev); - struct mxsfb_info *host = fb_info->par; - - mxsfb_enable_axi_clk(host); - - /* - * Force stop the LCD controller as keeping it running during reboot - * might interfere with the BootROM's boot mode pads sampling. - */ - writel(CTRL_RUN, host->base + LCDC_CTRL + REG_CLR); - - mxsfb_disable_axi_clk(host); -} - -static struct platform_driver mxsfb_driver = { - .probe = mxsfb_probe, - .remove = mxsfb_remove, - .shutdown = mxsfb_shutdown, - .id_table = mxsfb_devtype, - .driver = { - .name = DRIVER_NAME, - .of_match_table = mxsfb_dt_ids, - }, -}; - -module_platform_driver(mxsfb_driver); - -MODULE_DESCRIPTION("Freescale mxs framebuffer driver"); -MODULE_AUTHOR("Sascha Hauer, Pengutronix"); -MODULE_LICENSE("GPL"); diff --git a/drivers/video/fbdev/nvidia/nv_backlight.c b/drivers/video/fbdev/nvidia/nv_backlight.c index 5c151b2ea683..e705a7872301 100644 --- a/drivers/video/fbdev/nvidia/nv_backlight.c +++ b/drivers/video/fbdev/nvidia/nv_backlight.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Backlight code for nVidia based graphic cards * * Copyright 2004 Antonino Daplas <adaplas@pol.net> * Copyright (c) 2006 Michael Hanselmann <linux-kernel@hansmi.ch> - * - * 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 <linux/backlight.h> diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 406f972d2e42..90eca64e3144 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1502,8 +1502,6 @@ static int planes_init(struct omapfb_device *fbdev) fbi = framebuffer_alloc(sizeof(struct omapfb_plane_struct), fbdev->dev); if (fbi == NULL) { - dev_err(fbdev->dev, - "unable to allocate memory for plane info\n"); planes_cleanup(fbdev); return -ENOMEM; } diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c index 9d78411a3bf7..63bd13ba429e 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Analog TV Connector driver * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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 <linux/slab.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c index 06e1db34541e..b4a1aefff766 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Generic DVI Connector driver * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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 <linux/i2c.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c index 58d5803ede67..49551afbdbe0 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * HDMI Connector driver * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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 <linux/slab.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c b/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c index a9a67167cc3d..ba7ed4039f8a 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * OPA362 analog video amplifier with output/power control * @@ -8,10 +9,6 @@ * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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 <linux/gpio.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c index 8c0953d069b7..09a59bd93d61 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * TFP410 DPI-to-DVI encoder driver * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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 <linux/gpio.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c index 47f0459e3551..67f0c9250e9e 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * TPD12S015 HDMI ESD protection & level shifter chip driver * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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 <linux/completion.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c index ace3d818afe5..37c9f5bfaefe 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Generic MIPI DPI Panel Driver * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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 <linux/gpio.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c index 87497a00241f..4b0793abdd84 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Generic DSI Command Mode panel driver * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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. */ /* #define DEBUG */ diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c index 6cd759c01037..0f93a260e432 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * LG.Philips LB035Q02 LCD Panel driver * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Based on a driver by: Steve Sakoman <steve@sakoman.com> - * - * 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 <linux/module.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c index a8be18a87fa0..a3912fc8031f 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * LCD panel driver for Sharp LS037V7DW01 * * Copyright (C) 2013 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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 <linux/delay.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c index f2c2fef3db74..1293515e4b16 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Sony ACX565AKM LCD Panel driver * @@ -6,18 +7,6 @@ * Original Driver Author: Imre Deak <imre.deak@nokia.com> * Based on panel-generic.c by Tomi Valkeinen <tomi.valkeinen@nokia.com> * Adapted to new DSS2 framework: Roger Quadros <roger.quadros@nokia.com> - * - * 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. - * - * 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/>. */ #include <linux/kernel.h> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c index f6da8755b859..595ebd8bd5dc 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Toppoly TD028TTEC1 panel support * @@ -10,18 +11,6 @@ * * Ported and adapted from Neo 1973 U-Boot by: * H. Nikolaus Schaller <hns@goldelico.com> - * - * 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. - * - * 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/>. */ #include <linux/module.h> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/Kconfig b/drivers/video/fbdev/omap2/omapfb/dss/Kconfig index a34820e8ab97..36b97fee2d57 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/Kconfig +++ b/drivers/video/fbdev/omap2/omapfb/dss/Kconfig @@ -39,18 +39,6 @@ config FB_OMAP2_DSS_DPI help DPI Interface. This is the Parallel Display Interface. -config FB_OMAP2_DSS_RFBI - bool "RFBI support" - depends on BROKEN - help - MIPI DBI support (RFBI, Remote Framebuffer Interface, in Texas - Instrument's terminology). - - DBI is a bus between the host processor and a peripheral, - such as a display or a framebuffer chip. - - See http://www.mipi.org/ for DBI specifications. - config FB_OMAP2_DSS_VENC bool "VENC support" default y diff --git a/drivers/video/fbdev/omap2/omapfb/dss/Makefile b/drivers/video/fbdev/omap2/omapfb/dss/Makefile index 7318d5260e8d..eb3689ae8d87 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/Makefile +++ b/drivers/video/fbdev/omap2/omapfb/dss/Makefile @@ -8,7 +8,6 @@ omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o display.o \ omapdss-y += manager.o manager-sysfs.o overlay.o overlay-sysfs.o apply.o \ dispc-compat.o display-sysfs.o omapdss-$(CONFIG_FB_OMAP2_DSS_DPI) += dpi.o -omapdss-$(CONFIG_FB_OMAP2_DSS_RFBI) += rfbi.o omapdss-$(CONFIG_FB_OMAP2_DSS_VENC) += venc.o omapdss-$(CONFIG_FB_OMAP2_DSS_SDI) += sdi.o omapdss-$(CONFIG_FB_OMAP2_DSS_DSI) += dsi.o diff --git a/drivers/video/fbdev/omap2/omapfb/dss/apply.c b/drivers/video/fbdev/omap2/omapfb/dss/apply.c index 2481f4871f66..c71021091828 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/apply.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/apply.c @@ -1,18 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2011 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "APPLY" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/core.c b/drivers/video/fbdev/omap2/omapfb/dss/core.c index b5956a1a30d4..37858be8be83 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/core.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/core.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "CORE" @@ -218,9 +207,6 @@ static int (*dss_output_drv_reg_funcs[])(void) __initdata = { #ifdef CONFIG_FB_OMAP2_DSS_SDI sdi_init_platform_driver, #endif -#ifdef CONFIG_FB_OMAP2_DSS_RFBI - rfbi_init_platform_driver, -#endif #ifdef CONFIG_FB_OMAP2_DSS_VENC venc_init_platform_driver, #endif @@ -242,9 +228,6 @@ static void (*dss_output_drv_unreg_funcs[])(void) = { #ifdef CONFIG_FB_OMAP2_DSS_VENC venc_uninit_platform_driver, #endif -#ifdef CONFIG_FB_OMAP2_DSS_RFBI - rfbi_uninit_platform_driver, -#endif #ifdef CONFIG_FB_OMAP2_DSS_SDI sdi_uninit_platform_driver, #endif diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c index a864608c5df1..3417618310ff 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c @@ -1,18 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "APPLY" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.h b/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.h index 14a69b3d4fb0..f51fe1a4a305 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.h +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.h @@ -1,18 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2012 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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. - * - * 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 __OMAP2_DSS_DISPC_COMPAT_H diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c index a06d9c25765c..376ee5bc3ddc 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/dispc.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "DISPC" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.h b/drivers/video/fbdev/omap2/omapfb/dss/dispc.h index e014d0419c58..65bba5420db7 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.h +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.h @@ -1,21 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * linux/drivers/video/omap2/dss/dispc.h * * Copyright (C) 2011 Texas Instruments * Author: Archit Taneja <archit@ti.com> - * - * - * 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. - * - * 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 __OMAP2_DISPC_REG_H diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc_coefs.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc_coefs.c index 59c9a5c47ca9..2c85ec9733b1 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc_coefs.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc_coefs.c @@ -1,20 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/dispc_coefs.c * * Copyright (C) 2011 Texas Instruments * Author: Chandrabhanu Mahapatra <cmahapatra@ti.com> - * - * 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. - * - * 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/>. */ #include <linux/kernel.h> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c b/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c index b3fdbfd0b82d..6dbe265b312d 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c @@ -1,21 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Nokia Corporation * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "DISPLAY" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/display.c b/drivers/video/fbdev/omap2/omapfb/dss/display.c index dd5468695c43..f91db94c9905 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/display.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/display.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/display.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "DISPLAY" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c index da09806b940c..e2e7fe6f89ee 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/dpi.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "DPI" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index 8e1d60d48dbb..d620376216e1 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -1,20 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/dsi.c * * Copyright (C) 2009 Nokia Corporation * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "DSI" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c index f0cac9e0eb94..7252d22dd117 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/dss.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "DSS" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.h b/drivers/video/fbdev/omap2/omapfb/dss/dss.h index b1a354494144..a2269008590f 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.h +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * linux/drivers/video/omap2/dss/dss.h * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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 __OMAP2_DSS_H @@ -472,10 +461,6 @@ void hdmi4_uninit_platform_driver(void); int hdmi5_init_platform_driver(void) __init; void hdmi5_uninit_platform_driver(void); -/* RFBI */ -int rfbi_init_platform_driver(void) __init; -void rfbi_uninit_platform_driver(void); - #ifdef CONFIG_FB_OMAP2_DSS_COLLECT_IRQ_STATS static inline void dss_collect_irq_stats(u32 irqstatus, unsigned *irq_arr) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss_features.c b/drivers/video/fbdev/omap2/omapfb/dss/dss_features.c index e8d428bc47e3..62c2d48d9e09 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss_features.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss_features.c @@ -1,20 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/dss_features.c * * Copyright (C) 2010 Texas Instruments * Author: Archit Taneja <archit@ti.com> - * - * 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. - * - * 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/>. */ #include <linux/kernel.h> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss_features.h b/drivers/video/fbdev/omap2/omapfb/dss/dss_features.h index 3d67d39f192f..6d66d6270c9d 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss_features.h +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss_features.h @@ -1,20 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * linux/drivers/video/omap2/dss/dss_features.h * * Copyright (C) 2010 Texas Instruments * Author: Archit Taneja <archit@ti.com> - * - * 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. - * - * 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 __OMAP2_DSS_FEATURES_H diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi.h b/drivers/video/fbdev/omap2/omapfb/dss/hdmi.h index f6de87e078b0..b9d4480ecfad 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi.h @@ -1,19 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * HDMI driver definition for TI OMAP4 Processor. * * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ - * - * 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. - * - * 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 _HDMI_H diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c index 28de56e21c74..7060ae56c062 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c @@ -1,20 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * HDMI interface DSS driver for TI's OMAP4 family of SoCs. * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ * Authors: Yong Zhi * Mythri pk <mythripk@ti.com> - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "HDMI" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c index d146793dd044..6b79b52d5fad 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * ti_hdmi_4xxx_ip.c * @@ -5,18 +6,6 @@ * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ * Authors: Yong Zhi * Mythri pk <mythripk@ti.com> - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "HDMICORE" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.h b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.h index a069f96ec6f6..f066d1f69132 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.h +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.h @@ -1,19 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * HDMI header definition for OMAP4 HDMI core IP * * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ - * - * 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. - * - * 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 _HDMI4_CORE_H_ diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c index 2e2fcc3d6d4f..ac49531e4732 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * HDMI driver for OMAP5 * @@ -8,18 +9,6 @@ * Mythri pk * Archit Taneja <archit@ti.com> * Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "HDMI" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c index bbfe7e2d4332..2f6ff14a48d9 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * OMAP5 HDMI CORE IP driver library * @@ -8,18 +9,6 @@ * Mythri pk * Archit Taneja <archit@ti.com> * Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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. - * - * 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/>. */ #include <linux/kernel.h> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.h b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.h index f2f1022c5516..f10b8a283011 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.h +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.h @@ -1,19 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * HDMI driver definition for TI OMAP5 processors. * * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * 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. - * - * 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 _HDMI5_CORE_H_ diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c index 11dbc05d5720..9c645adba9e2 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * HDMI PHY * * Copyright (C) 2013 Texas Instruments Incorporated - * - * 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 <linux/kernel.h> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_pll.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_pll.c index bc591fc12aef..4991be031b0b 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_pll.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_pll.c @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * HDMI PLL * * Copyright (C) 2013 Texas Instruments Incorporated - * - * 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. */ #define DSS_SUBSYS_NAME "HDMIPLL" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_wp.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_wp.c index 4af6ba220744..41ad52b9d013 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_wp.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_wp.c @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * HDMI wrapper * * Copyright (C) 2013 Texas Instruments Incorporated - * - * 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. */ #define DSS_SUBSYS_NAME "HDMIWP" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c b/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c index 44b96af4ef4e..b52cc1af0959 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c @@ -1,21 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Nokia Corporation * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "MANAGER" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/manager.c b/drivers/video/fbdev/omap2/omapfb/dss/manager.c index d21c641e1f3c..2c2da35345d0 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/manager.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/manager.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/manager.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "MANAGER" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c index 5da7ed6d653e..0ae0cab252d3 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c @@ -1,18 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2014 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> - * - * 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. - * - * 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/>. */ /* diff --git a/drivers/video/fbdev/omap2/omapfb/dss/output.c b/drivers/video/fbdev/omap2/omapfb/dss/output.c index bed9a978269d..4e2992a0ce50 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/output.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/output.c @@ -1,18 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Ltd * Author: Archit Taneja <archit@ti.com> - * - * 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. - * - * 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/>. */ #include <linux/kernel.h> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c b/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c index f1f6c0aea752..36acf366213a 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c @@ -1,21 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Nokia Corporation * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "OVERLAY" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/overlay.c b/drivers/video/fbdev/omap2/omapfb/dss/overlay.c index be17a4785a5e..8c8e627da13d 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/overlay.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/overlay.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/overlay.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "OVERLAY" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/pll.c b/drivers/video/fbdev/omap2/omapfb/dss/pll.c index 0564c5606cd0..725194d52445 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/pll.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/pll.c @@ -1,17 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2014 Texas Instruments Incorporated - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "PLL" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/rfbi.c b/drivers/video/fbdev/omap2/omapfb/dss/rfbi.c deleted file mode 100644 index 562b0c4ae0c6..000000000000 --- a/drivers/video/fbdev/omap2/omapfb/dss/rfbi.c +++ /dev/null @@ -1,1078 +0,0 @@ -/* - * linux/drivers/video/omap2/dss/rfbi.c - * - * Copyright (C) 2009 Nokia Corporation - * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> - * - * Some code and ideas taken from drivers/video/omap/ driver - * by Imre Deak. - * - * 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. - * - * 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/>. - */ - -#define DSS_SUBSYS_NAME "RFBI" - -#include <linux/kernel.h> -#include <linux/dma-mapping.h> -#include <linux/export.h> -#include <linux/vmalloc.h> -#include <linux/clk.h> -#include <linux/io.h> -#include <linux/delay.h> -#include <linux/kfifo.h> -#include <linux/ktime.h> -#include <linux/hrtimer.h> -#include <linux/seq_file.h> -#include <linux/semaphore.h> -#include <linux/platform_device.h> -#include <linux/pm_runtime.h> -#include <linux/component.h> - -#include <video/omapfb_dss.h> -#include "dss.h" - -struct rfbi_reg { u16 idx; }; - -#define RFBI_REG(idx) ((const struct rfbi_reg) { idx }) - -#define RFBI_REVISION RFBI_REG(0x0000) -#define RFBI_SYSCONFIG RFBI_REG(0x0010) -#define RFBI_SYSSTATUS RFBI_REG(0x0014) -#define RFBI_CONTROL RFBI_REG(0x0040) -#define RFBI_PIXEL_CNT RFBI_REG(0x0044) -#define RFBI_LINE_NUMBER RFBI_REG(0x0048) -#define RFBI_CMD RFBI_REG(0x004c) -#define RFBI_PARAM RFBI_REG(0x0050) -#define RFBI_DATA RFBI_REG(0x0054) -#define RFBI_READ RFBI_REG(0x0058) -#define RFBI_STATUS RFBI_REG(0x005c) - -#define RFBI_CONFIG(n) RFBI_REG(0x0060 + (n)*0x18) -#define RFBI_ONOFF_TIME(n) RFBI_REG(0x0064 + (n)*0x18) -#define RFBI_CYCLE_TIME(n) RFBI_REG(0x0068 + (n)*0x18) -#define RFBI_DATA_CYCLE1(n) RFBI_REG(0x006c + (n)*0x18) -#define RFBI_DATA_CYCLE2(n) RFBI_REG(0x0070 + (n)*0x18) -#define RFBI_DATA_CYCLE3(n) RFBI_REG(0x0074 + (n)*0x18) - -#define RFBI_VSYNC_WIDTH RFBI_REG(0x0090) -#define RFBI_HSYNC_WIDTH RFBI_REG(0x0094) - -#define REG_FLD_MOD(idx, val, start, end) \ - rfbi_write_reg(idx, FLD_MOD(rfbi_read_reg(idx), val, start, end)) - -enum omap_rfbi_cycleformat { - OMAP_DSS_RFBI_CYCLEFORMAT_1_1 = 0, - OMAP_DSS_RFBI_CYCLEFORMAT_2_1 = 1, - OMAP_DSS_RFBI_CYCLEFORMAT_3_1 = 2, - OMAP_DSS_RFBI_CYCLEFORMAT_3_2 = 3, -}; - -enum omap_rfbi_datatype { - OMAP_DSS_RFBI_DATATYPE_12 = 0, - OMAP_DSS_RFBI_DATATYPE_16 = 1, - OMAP_DSS_RFBI_DATATYPE_18 = 2, - OMAP_DSS_RFBI_DATATYPE_24 = 3, -}; - -enum omap_rfbi_parallelmode { - OMAP_DSS_RFBI_PARALLELMODE_8 = 0, - OMAP_DSS_RFBI_PARALLELMODE_9 = 1, - OMAP_DSS_RFBI_PARALLELMODE_12 = 2, - OMAP_DSS_RFBI_PARALLELMODE_16 = 3, -}; - -static int rfbi_convert_timings(struct rfbi_timings *t); -static void rfbi_get_clk_info(u32 *clk_period, u32 *max_clk_div); - -static struct { - struct platform_device *pdev; - void __iomem *base; - - unsigned long l4_khz; - - enum omap_rfbi_datatype datatype; - enum omap_rfbi_parallelmode parallelmode; - - enum omap_rfbi_te_mode te_mode; - int te_enabled; - - void (*framedone_callback)(void *data); - void *framedone_callback_data; - - struct omap_dss_device *dssdev[2]; - - struct semaphore bus_lock; - - struct omap_video_timings timings; - int pixel_size; - int data_lines; - struct rfbi_timings intf_timings; - - struct omap_dss_device output; -} rfbi; - -static inline void rfbi_write_reg(const struct rfbi_reg idx, u32 val) -{ - __raw_writel(val, rfbi.base + idx.idx); -} - -static inline u32 rfbi_read_reg(const struct rfbi_reg idx) -{ - return __raw_readl(rfbi.base + idx.idx); -} - -static int rfbi_runtime_get(void) -{ - int r; - - DSSDBG("rfbi_runtime_get\n"); - - r = pm_runtime_get_sync(&rfbi.pdev->dev); - WARN_ON(r < 0); - return r < 0 ? r : 0; -} - -static void rfbi_runtime_put(void) -{ - int r; - - DSSDBG("rfbi_runtime_put\n"); - - r = pm_runtime_put_sync(&rfbi.pdev->dev); - WARN_ON(r < 0 && r != -ENOSYS); -} - -static void rfbi_bus_lock(void) -{ - down(&rfbi.bus_lock); -} - -static void rfbi_bus_unlock(void) -{ - up(&rfbi.bus_lock); -} - -static void rfbi_write_command(const void *buf, u32 len) -{ - switch (rfbi.parallelmode) { - case OMAP_DSS_RFBI_PARALLELMODE_8: - { - const u8 *b = buf; - for (; len; len--) - rfbi_write_reg(RFBI_CMD, *b++); - break; - } - - case OMAP_DSS_RFBI_PARALLELMODE_16: - { - const u16 *w = buf; - BUG_ON(len & 1); - for (; len; len -= 2) - rfbi_write_reg(RFBI_CMD, *w++); - break; - } - - case OMAP_DSS_RFBI_PARALLELMODE_9: - case OMAP_DSS_RFBI_PARALLELMODE_12: - default: - BUG(); - } -} - -static void rfbi_read_data(void *buf, u32 len) -{ - switch (rfbi.parallelmode) { - case OMAP_DSS_RFBI_PARALLELMODE_8: - { - u8 *b = buf; - for (; len; len--) { - rfbi_write_reg(RFBI_READ, 0); - *b++ = rfbi_read_reg(RFBI_READ); - } - break; - } - - case OMAP_DSS_RFBI_PARALLELMODE_16: - { - u16 *w = buf; - BUG_ON(len & ~1); - for (; len; len -= 2) { - rfbi_write_reg(RFBI_READ, 0); - *w++ = rfbi_read_reg(RFBI_READ); - } - break; - } - - case OMAP_DSS_RFBI_PARALLELMODE_9: - case OMAP_DSS_RFBI_PARALLELMODE_12: - default: - BUG(); - } -} - -static void rfbi_write_data(const void *buf, u32 len) -{ - switch (rfbi.parallelmode) { - case OMAP_DSS_RFBI_PARALLELMODE_8: - { - const u8 *b = buf; - for (; len; len--) - rfbi_write_reg(RFBI_PARAM, *b++); - break; - } - - case OMAP_DSS_RFBI_PARALLELMODE_16: - { - const u16 *w = buf; - BUG_ON(len & 1); - for (; len; len -= 2) - rfbi_write_reg(RFBI_PARAM, *w++); - break; - } - - case OMAP_DSS_RFBI_PARALLELMODE_9: - case OMAP_DSS_RFBI_PARALLELMODE_12: - default: - BUG(); - - } -} - -static void rfbi_write_pixels(const void __iomem *buf, int scr_width, - u16 x, u16 y, - u16 w, u16 h) -{ - int start_offset = scr_width * y + x; - int horiz_offset = scr_width - w; - int i; - - if (rfbi.datatype == OMAP_DSS_RFBI_DATATYPE_16 && - rfbi.parallelmode == OMAP_DSS_RFBI_PARALLELMODE_8) { - const u16 __iomem *pd = buf; - pd += start_offset; - - for (; h; --h) { - for (i = 0; i < w; ++i) { - const u8 __iomem *b = (const u8 __iomem *)pd; - rfbi_write_reg(RFBI_PARAM, __raw_readb(b+1)); - rfbi_write_reg(RFBI_PARAM, __raw_readb(b+0)); - ++pd; - } - pd += horiz_offset; - } - } else if (rfbi.datatype == OMAP_DSS_RFBI_DATATYPE_24 && - rfbi.parallelmode == OMAP_DSS_RFBI_PARALLELMODE_8) { - const u32 __iomem *pd = buf; - pd += start_offset; - - for (; h; --h) { - for (i = 0; i < w; ++i) { - const u8 __iomem *b = (const u8 __iomem *)pd; - rfbi_write_reg(RFBI_PARAM, __raw_readb(b+2)); - rfbi_write_reg(RFBI_PARAM, __raw_readb(b+1)); - rfbi_write_reg(RFBI_PARAM, __raw_readb(b+0)); - ++pd; - } - pd += horiz_offset; - } - } else if (rfbi.datatype == OMAP_DSS_RFBI_DATATYPE_16 && - rfbi.parallelmode == OMAP_DSS_RFBI_PARALLELMODE_16) { - const u16 __iomem *pd = buf; - pd += start_offset; - - for (; h; --h) { - for (i = 0; i < w; ++i) { - rfbi_write_reg(RFBI_PARAM, __raw_readw(pd)); - ++pd; - } - pd += horiz_offset; - } - } else { - BUG(); - } -} - -static int rfbi_transfer_area(struct omap_dss_device *dssdev, - void (*callback)(void *data), void *data) -{ - u32 l; - int r; - struct omap_overlay_manager *mgr = rfbi.output.manager; - u16 width = rfbi.timings.x_res; - u16 height = rfbi.timings.y_res; - - /*BUG_ON(callback == 0);*/ - BUG_ON(rfbi.framedone_callback != NULL); - - DSSDBG("rfbi_transfer_area %dx%d\n", width, height); - - dss_mgr_set_timings(mgr, &rfbi.timings); - - r = dss_mgr_enable(mgr); - if (r) - return r; - - rfbi.framedone_callback = callback; - rfbi.framedone_callback_data = data; - - rfbi_write_reg(RFBI_PIXEL_CNT, width * height); - - l = rfbi_read_reg(RFBI_CONTROL); - l = FLD_MOD(l, 1, 0, 0); /* enable */ - if (!rfbi.te_enabled) - l = FLD_MOD(l, 1, 4, 4); /* ITE */ - - rfbi_write_reg(RFBI_CONTROL, l); - - return 0; -} - -static void framedone_callback(void *data) -{ - void (*callback)(void *data); - - DSSDBG("FRAMEDONE\n"); - - REG_FLD_MOD(RFBI_CONTROL, 0, 0, 0); - - callback = rfbi.framedone_callback; - rfbi.framedone_callback = NULL; - - if (callback != NULL) - callback(rfbi.framedone_callback_data); -} - -#if 1 /* VERBOSE */ -static void rfbi_print_timings(void) -{ - u32 l; - u32 time; - - l = rfbi_read_reg(RFBI_CONFIG(0)); - time = 1000000000 / rfbi.l4_khz; - if (l & (1 << 4)) - time *= 2; - - DSSDBG("Tick time %u ps\n", time); - l = rfbi_read_reg(RFBI_ONOFF_TIME(0)); - DSSDBG("CSONTIME %d, CSOFFTIME %d, WEONTIME %d, WEOFFTIME %d, " - "REONTIME %d, REOFFTIME %d\n", - l & 0x0f, (l >> 4) & 0x3f, (l >> 10) & 0x0f, (l >> 14) & 0x3f, - (l >> 20) & 0x0f, (l >> 24) & 0x3f); - - l = rfbi_read_reg(RFBI_CYCLE_TIME(0)); - DSSDBG("WECYCLETIME %d, RECYCLETIME %d, CSPULSEWIDTH %d, " - "ACCESSTIME %d\n", - (l & 0x3f), (l >> 6) & 0x3f, (l >> 12) & 0x3f, - (l >> 22) & 0x3f); -} -#else -static void rfbi_print_timings(void) {} -#endif - - - - -static u32 extif_clk_period; - -static inline unsigned long round_to_extif_ticks(unsigned long ps, int div) -{ - int bus_tick = extif_clk_period * div; - return (ps + bus_tick - 1) / bus_tick * bus_tick; -} - -static int calc_reg_timing(struct rfbi_timings *t, int div) -{ - t->clk_div = div; - - t->cs_on_time = round_to_extif_ticks(t->cs_on_time, div); - - t->we_on_time = round_to_extif_ticks(t->we_on_time, div); - t->we_off_time = round_to_extif_ticks(t->we_off_time, div); - t->we_cycle_time = round_to_extif_ticks(t->we_cycle_time, div); - - t->re_on_time = round_to_extif_ticks(t->re_on_time, div); - t->re_off_time = round_to_extif_ticks(t->re_off_time, div); - t->re_cycle_time = round_to_extif_ticks(t->re_cycle_time, div); - - t->access_time = round_to_extif_ticks(t->access_time, div); - t->cs_off_time = round_to_extif_ticks(t->cs_off_time, div); - t->cs_pulse_width = round_to_extif_ticks(t->cs_pulse_width, div); - - DSSDBG("[reg]cson %d csoff %d reon %d reoff %d\n", - t->cs_on_time, t->cs_off_time, t->re_on_time, t->re_off_time); - DSSDBG("[reg]weon %d weoff %d recyc %d wecyc %d\n", - t->we_on_time, t->we_off_time, t->re_cycle_time, - t->we_cycle_time); - DSSDBG("[reg]rdaccess %d cspulse %d\n", - t->access_time, t->cs_pulse_width); - - return rfbi_convert_timings(t); -} - -static int calc_extif_timings(struct rfbi_timings *t) -{ - u32 max_clk_div; - int div; - - rfbi_get_clk_info(&extif_clk_period, &max_clk_div); - for (div = 1; div <= max_clk_div; div++) { - if (calc_reg_timing(t, div) == 0) - break; - } - - if (div <= max_clk_div) - return 0; - - DSSERR("can't setup timings\n"); - return -1; -} - - -static void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t) -{ - int r; - - if (!t->converted) { - r = calc_extif_timings(t); - if (r < 0) - DSSERR("Failed to calc timings\n"); - } - - BUG_ON(!t->converted); - - rfbi_write_reg(RFBI_ONOFF_TIME(rfbi_module), t->tim[0]); - rfbi_write_reg(RFBI_CYCLE_TIME(rfbi_module), t->tim[1]); - - /* TIMEGRANULARITY */ - REG_FLD_MOD(RFBI_CONFIG(rfbi_module), - (t->tim[2] ? 1 : 0), 4, 4); - - rfbi_print_timings(); -} - -static int ps_to_rfbi_ticks(int time, int div) -{ - unsigned long tick_ps; - int ret; - - /* Calculate in picosecs to yield more exact results */ - tick_ps = 1000000000 / (rfbi.l4_khz) * div; - - ret = (time + tick_ps - 1) / tick_ps; - - return ret; -} - -static void rfbi_get_clk_info(u32 *clk_period, u32 *max_clk_div) -{ - *clk_period = 1000000000 / rfbi.l4_khz; - *max_clk_div = 2; -} - -static int rfbi_convert_timings(struct rfbi_timings *t) -{ - u32 l; - int reon, reoff, weon, weoff, cson, csoff, cs_pulse; - int actim, recyc, wecyc; - int div = t->clk_div; - - if (div <= 0 || div > 2) - return -1; - - /* Make sure that after conversion it still holds that: - * weoff > weon, reoff > reon, recyc >= reoff, wecyc >= weoff, - * csoff > cson, csoff >= max(weoff, reoff), actim > reon - */ - weon = ps_to_rfbi_ticks(t->we_on_time, div); - weoff = ps_to_rfbi_ticks(t->we_off_time, div); - if (weoff <= weon) - weoff = weon + 1; - if (weon > 0x0f) - return -1; - if (weoff > 0x3f) - return -1; - - reon = ps_to_rfbi_ticks(t->re_on_time, div); - reoff = ps_to_rfbi_ticks(t->re_off_time, div); - if (reoff <= reon) - reoff = reon + 1; - if (reon > 0x0f) - return -1; - if (reoff > 0x3f) - return -1; - - cson = ps_to_rfbi_ticks(t->cs_on_time, div); - csoff = ps_to_rfbi_ticks(t->cs_off_time, div); - if (csoff <= cson) - csoff = cson + 1; - if (csoff < max(weoff, reoff)) - csoff = max(weoff, reoff); - if (cson > 0x0f) - return -1; - if (csoff > 0x3f) - return -1; - - l = cson; - l |= csoff << 4; - l |= weon << 10; - l |= weoff << 14; - l |= reon << 20; - l |= reoff << 24; - - t->tim[0] = l; - - actim = ps_to_rfbi_ticks(t->access_time, div); - if (actim <= reon) - actim = reon + 1; - if (actim > 0x3f) - return -1; - - wecyc = ps_to_rfbi_ticks(t->we_cycle_time, div); - if (wecyc < weoff) - wecyc = weoff; - if (wecyc > 0x3f) - return -1; - - recyc = ps_to_rfbi_ticks(t->re_cycle_time, div); - if (recyc < reoff) - recyc = reoff; - if (recyc > 0x3f) - return -1; - - cs_pulse = ps_to_rfbi_ticks(t->cs_pulse_width, div); - if (cs_pulse > 0x3f) - return -1; - - l = wecyc; - l |= recyc << 6; - l |= cs_pulse << 12; - l |= actim << 22; - - t->tim[1] = l; - - t->tim[2] = div - 1; - - t->converted = 1; - - return 0; -} - -/* xxx FIX module selection missing */ -static int rfbi_setup_te(enum omap_rfbi_te_mode mode, - unsigned hs_pulse_time, unsigned vs_pulse_time, - int hs_pol_inv, int vs_pol_inv, int extif_div) -{ - int hs, vs; - int min; - u32 l; - - hs = ps_to_rfbi_ticks(hs_pulse_time, 1); - vs = ps_to_rfbi_ticks(vs_pulse_time, 1); - if (hs < 2) - return -EDOM; - if (mode == OMAP_DSS_RFBI_TE_MODE_2) - min = 2; - else /* OMAP_DSS_RFBI_TE_MODE_1 */ - min = 4; - if (vs < min) - return -EDOM; - if (vs == hs) - return -EINVAL; - rfbi.te_mode = mode; - DSSDBG("setup_te: mode %d hs %d vs %d hs_inv %d vs_inv %d\n", - mode, hs, vs, hs_pol_inv, vs_pol_inv); - - rfbi_write_reg(RFBI_HSYNC_WIDTH, hs); - rfbi_write_reg(RFBI_VSYNC_WIDTH, vs); - - l = rfbi_read_reg(RFBI_CONFIG(0)); - if (hs_pol_inv) - l &= ~(1 << 21); - else - l |= 1 << 21; - if (vs_pol_inv) - l &= ~(1 << 20); - else - l |= 1 << 20; - - return 0; -} - -/* xxx FIX module selection missing */ -static int rfbi_enable_te(bool enable, unsigned line) -{ - u32 l; - - DSSDBG("te %d line %d mode %d\n", enable, line, rfbi.te_mode); - if (line > (1 << 11) - 1) - return -EINVAL; - - l = rfbi_read_reg(RFBI_CONFIG(0)); - l &= ~(0x3 << 2); - if (enable) { - rfbi.te_enabled = 1; - l |= rfbi.te_mode << 2; - } else - rfbi.te_enabled = 0; - rfbi_write_reg(RFBI_CONFIG(0), l); - rfbi_write_reg(RFBI_LINE_NUMBER, line); - - return 0; -} - -static int rfbi_configure_bus(int rfbi_module, int bpp, int lines) -{ - u32 l; - int cycle1 = 0, cycle2 = 0, cycle3 = 0; - enum omap_rfbi_cycleformat cycleformat; - enum omap_rfbi_datatype datatype; - enum omap_rfbi_parallelmode parallelmode; - - switch (bpp) { - case 12: - datatype = OMAP_DSS_RFBI_DATATYPE_12; - break; - case 16: - datatype = OMAP_DSS_RFBI_DATATYPE_16; - break; - case 18: - datatype = OMAP_DSS_RFBI_DATATYPE_18; - break; - case 24: - datatype = OMAP_DSS_RFBI_DATATYPE_24; - break; - default: - BUG(); - return 1; - } - rfbi.datatype = datatype; - - switch (lines) { - case 8: - parallelmode = OMAP_DSS_RFBI_PARALLELMODE_8; - break; - case 9: - parallelmode = OMAP_DSS_RFBI_PARALLELMODE_9; - break; - case 12: - parallelmode = OMAP_DSS_RFBI_PARALLELMODE_12; - break; - case 16: - parallelmode = OMAP_DSS_RFBI_PARALLELMODE_16; - break; - default: - BUG(); - return 1; - } - rfbi.parallelmode = parallelmode; - - if ((bpp % lines) == 0) { - switch (bpp / lines) { - case 1: - cycleformat = OMAP_DSS_RFBI_CYCLEFORMAT_1_1; - break; - case 2: - cycleformat = OMAP_DSS_RFBI_CYCLEFORMAT_2_1; - break; - case 3: - cycleformat = OMAP_DSS_RFBI_CYCLEFORMAT_3_1; - break; - default: - BUG(); - return 1; - } - } else if ((2 * bpp % lines) == 0) { - if ((2 * bpp / lines) == 3) - cycleformat = OMAP_DSS_RFBI_CYCLEFORMAT_3_2; - else { - BUG(); - return 1; - } - } else { - BUG(); - return 1; - } - - switch (cycleformat) { - case OMAP_DSS_RFBI_CYCLEFORMAT_1_1: - cycle1 = lines; - break; - - case OMAP_DSS_RFBI_CYCLEFORMAT_2_1: - cycle1 = lines; - cycle2 = lines; - break; - - case OMAP_DSS_RFBI_CYCLEFORMAT_3_1: - cycle1 = lines; - cycle2 = lines; - cycle3 = lines; - break; - - case OMAP_DSS_RFBI_CYCLEFORMAT_3_2: - cycle1 = lines; - cycle2 = (lines / 2) | ((lines / 2) << 16); - cycle3 = (lines << 16); - break; - } - - REG_FLD_MOD(RFBI_CONTROL, 0, 3, 2); /* clear CS */ - - l = 0; - l |= FLD_VAL(parallelmode, 1, 0); - l |= FLD_VAL(0, 3, 2); /* TRIGGERMODE: ITE */ - l |= FLD_VAL(0, 4, 4); /* TIMEGRANULARITY */ - l |= FLD_VAL(datatype, 6, 5); - /* l |= FLD_VAL(2, 8, 7); */ /* L4FORMAT, 2pix/L4 */ - l |= FLD_VAL(0, 8, 7); /* L4FORMAT, 1pix/L4 */ - l |= FLD_VAL(cycleformat, 10, 9); - l |= FLD_VAL(0, 12, 11); /* UNUSEDBITS */ - l |= FLD_VAL(0, 16, 16); /* A0POLARITY */ - l |= FLD_VAL(0, 17, 17); /* REPOLARITY */ - l |= FLD_VAL(0, 18, 18); /* WEPOLARITY */ - l |= FLD_VAL(0, 19, 19); /* CSPOLARITY */ - l |= FLD_VAL(1, 20, 20); /* TE_VSYNC_POLARITY */ - l |= FLD_VAL(1, 21, 21); /* HSYNCPOLARITY */ - rfbi_write_reg(RFBI_CONFIG(rfbi_module), l); - - rfbi_write_reg(RFBI_DATA_CYCLE1(rfbi_module), cycle1); - rfbi_write_reg(RFBI_DATA_CYCLE2(rfbi_module), cycle2); - rfbi_write_reg(RFBI_DATA_CYCLE3(rfbi_module), cycle3); - - - l = rfbi_read_reg(RFBI_CONTROL); - l = FLD_MOD(l, rfbi_module+1, 3, 2); /* Select CSx */ - l = FLD_MOD(l, 0, 1, 1); /* clear bypass */ - rfbi_write_reg(RFBI_CONTROL, l); - - - DSSDBG("RFBI config: bpp %d, lines %d, cycles: 0x%x 0x%x 0x%x\n", - bpp, lines, cycle1, cycle2, cycle3); - - return 0; -} - -static int rfbi_configure(struct omap_dss_device *dssdev) -{ - return rfbi_configure_bus(dssdev->phy.rfbi.channel, rfbi.pixel_size, - rfbi.data_lines); -} - -static int rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *), - void *data) -{ - return rfbi_transfer_area(dssdev, callback, data); -} - -static void rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h) -{ - rfbi.timings.x_res = w; - rfbi.timings.y_res = h; -} - -static void rfbi_set_pixel_size(struct omap_dss_device *dssdev, int pixel_size) -{ - rfbi.pixel_size = pixel_size; -} - -static void rfbi_set_data_lines(struct omap_dss_device *dssdev, int data_lines) -{ - rfbi.data_lines = data_lines; -} - -static void rfbi_set_interface_timings(struct omap_dss_device *dssdev, - struct rfbi_timings *timings) -{ - rfbi.intf_timings = *timings; -} - -static void rfbi_dump_regs(struct seq_file *s) -{ -#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, rfbi_read_reg(r)) - - if (rfbi_runtime_get()) - return; - - DUMPREG(RFBI_REVISION); - DUMPREG(RFBI_SYSCONFIG); - DUMPREG(RFBI_SYSSTATUS); - DUMPREG(RFBI_CONTROL); - DUMPREG(RFBI_PIXEL_CNT); - DUMPREG(RFBI_LINE_NUMBER); - DUMPREG(RFBI_CMD); - DUMPREG(RFBI_PARAM); - DUMPREG(RFBI_DATA); - DUMPREG(RFBI_READ); - DUMPREG(RFBI_STATUS); - - DUMPREG(RFBI_CONFIG(0)); - DUMPREG(RFBI_ONOFF_TIME(0)); - DUMPREG(RFBI_CYCLE_TIME(0)); - DUMPREG(RFBI_DATA_CYCLE1(0)); - DUMPREG(RFBI_DATA_CYCLE2(0)); - DUMPREG(RFBI_DATA_CYCLE3(0)); - - DUMPREG(RFBI_CONFIG(1)); - DUMPREG(RFBI_ONOFF_TIME(1)); - DUMPREG(RFBI_CYCLE_TIME(1)); - DUMPREG(RFBI_DATA_CYCLE1(1)); - DUMPREG(RFBI_DATA_CYCLE2(1)); - DUMPREG(RFBI_DATA_CYCLE3(1)); - - DUMPREG(RFBI_VSYNC_WIDTH); - DUMPREG(RFBI_HSYNC_WIDTH); - - rfbi_runtime_put(); -#undef DUMPREG -} - -static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev) -{ - struct omap_overlay_manager *mgr = rfbi.output.manager; - struct dss_lcd_mgr_config mgr_config; - - mgr_config.io_pad_mode = DSS_IO_PAD_MODE_RFBI; - - mgr_config.stallmode = true; - /* Do we need fifohandcheck for RFBI? */ - mgr_config.fifohandcheck = false; - - mgr_config.video_port_width = rfbi.pixel_size; - mgr_config.lcden_sig_polarity = 0; - - dss_mgr_set_lcd_config(mgr, &mgr_config); - - /* - * Set rfbi.timings with default values, the x_res and y_res fields - * are expected to be already configured by the panel driver via - * omapdss_rfbi_set_size() - */ - rfbi.timings.hsw = 1; - rfbi.timings.hfp = 1; - rfbi.timings.hbp = 1; - rfbi.timings.vsw = 1; - rfbi.timings.vfp = 0; - rfbi.timings.vbp = 0; - - rfbi.timings.interlace = false; - rfbi.timings.hsync_level = OMAPDSS_SIG_ACTIVE_HIGH; - rfbi.timings.vsync_level = OMAPDSS_SIG_ACTIVE_HIGH; - rfbi.timings.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; - rfbi.timings.de_level = OMAPDSS_SIG_ACTIVE_HIGH; - rfbi.timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE; - - dss_mgr_set_timings(mgr, &rfbi.timings); -} - -static int rfbi_display_enable(struct omap_dss_device *dssdev) -{ - struct omap_dss_device *out = &rfbi.output; - int r; - - if (out->manager == NULL) { - DSSERR("failed to enable display: no output/manager\n"); - return -ENODEV; - } - - r = rfbi_runtime_get(); - if (r) - return r; - - r = dss_mgr_register_framedone_handler(out->manager, - framedone_callback, NULL); - if (r) { - DSSERR("can't get FRAMEDONE irq\n"); - goto err1; - } - - rfbi_config_lcd_manager(dssdev); - - rfbi_configure_bus(dssdev->phy.rfbi.channel, rfbi.pixel_size, - rfbi.data_lines); - - rfbi_set_timings(dssdev->phy.rfbi.channel, &rfbi.intf_timings); - - return 0; -err1: - rfbi_runtime_put(); - return r; -} - -static void rfbi_display_disable(struct omap_dss_device *dssdev) -{ - struct omap_dss_device *out = &rfbi.output; - - dss_mgr_unregister_framedone_handler(out->manager, - framedone_callback, NULL); - - rfbi_runtime_put(); -} - -static int rfbi_init_display(struct omap_dss_device *dssdev) -{ - rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev; - return 0; -} - -static void rfbi_init_output(struct platform_device *pdev) -{ - struct omap_dss_device *out = &rfbi.output; - - out->dev = &pdev->dev; - out->id = OMAP_DSS_OUTPUT_DBI; - out->output_type = OMAP_DISPLAY_TYPE_DBI; - out->name = "rfbi.0"; - out->dispc_channel = OMAP_DSS_CHANNEL_LCD; - out->owner = THIS_MODULE; - - omapdss_register_output(out); -} - -static void rfbi_uninit_output(struct platform_device *pdev) -{ - struct omap_dss_device *out = &rfbi.output; - - omapdss_unregister_output(out); -} - -/* RFBI HW IP initialisation */ -static int rfbi_bind(struct device *dev, struct device *master, void *data) -{ - struct platform_device *pdev = to_platform_device(dev); - u32 rev; - struct resource *rfbi_mem; - struct clk *clk; - int r; - - rfbi.pdev = pdev; - - sema_init(&rfbi.bus_lock, 1); - - rfbi_mem = platform_get_resource(rfbi.pdev, IORESOURCE_MEM, 0); - if (!rfbi_mem) { - DSSERR("can't get IORESOURCE_MEM RFBI\n"); - return -EINVAL; - } - - rfbi.base = devm_ioremap(&pdev->dev, rfbi_mem->start, - resource_size(rfbi_mem)); - if (!rfbi.base) { - DSSERR("can't ioremap RFBI\n"); - return -ENOMEM; - } - - clk = clk_get(&pdev->dev, "ick"); - if (IS_ERR(clk)) { - DSSERR("can't get ick\n"); - return PTR_ERR(clk); - } - - rfbi.l4_khz = clk_get_rate(clk) / 1000; - - clk_put(clk); - - pm_runtime_enable(&pdev->dev); - - r = rfbi_runtime_get(); - if (r) - goto err_runtime_get; - - msleep(10); - - rev = rfbi_read_reg(RFBI_REVISION); - dev_dbg(&pdev->dev, "OMAP RFBI rev %d.%d\n", - FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0)); - - rfbi_runtime_put(); - - dss_debugfs_create_file("rfbi", rfbi_dump_regs); - - rfbi_init_output(pdev); - - return 0; - -err_runtime_get: - pm_runtime_disable(&pdev->dev); - return r; -} - -static void rfbi_unbind(struct device *dev, struct device *master, void *data) -{ - struct platform_device *pdev = to_platform_device(dev); - - rfbi_uninit_output(pdev); - - pm_runtime_disable(&pdev->dev); - - return 0; -} - -static const struct component_ops rfbi_component_ops = { - .bind = rfbi_bind, - .unbind = rfbi_unbind, -}; - -static int rfbi_probe(struct platform_device *pdev) -{ - return component_add(&pdev->dev, &rfbi_component_ops); -} - -static int rfbi_remove(struct platform_device *pdev) -{ - component_del(&pdev->dev, &rfbi_component_ops); - return 0; -} - -static int rfbi_runtime_suspend(struct device *dev) -{ - dispc_runtime_put(); - - return 0; -} - -static int rfbi_runtime_resume(struct device *dev) -{ - int r; - - r = dispc_runtime_get(); - if (r < 0) - return r; - - return 0; -} - -static const struct dev_pm_ops rfbi_pm_ops = { - .runtime_suspend = rfbi_runtime_suspend, - .runtime_resume = rfbi_runtime_resume, -}; - -static struct platform_driver omap_rfbihw_driver = { - .probe = rfbi_probe, - .remove = rfbi_remove, - .driver = { - .name = "omapdss_rfbi", - .pm = &rfbi_pm_ops, - .suppress_bind_attrs = true, - }, -}; - -int __init rfbi_init_platform_driver(void) -{ - return platform_driver_register(&omap_rfbihw_driver); -} - -void rfbi_uninit_platform_driver(void) -{ - platform_driver_unregister(&omap_rfbihw_driver); -} diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c index c4be732a4714..002f07f5480f 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c @@ -1,20 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/sdi.c * * Copyright (C) 2009 Nokia Corporation * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "SDI" diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c index 392464da12e4..f81e2a46366d 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/dss/venc.c * @@ -5,18 +6,6 @@ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * * VENC settings from TI's DSS driver - * - * 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. - * - * 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/>. */ #define DSS_SUBSYS_NAME "VENC" diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c index 8e23160ec59f..56995f44e76d 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/omapfb-ioctl.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #include <linux/fb.h> diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c index b8b5b4ac0e09..858c2c011d19 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/omapfb-main.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #include <linux/module.h> @@ -1892,12 +1881,8 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev) fbi = framebuffer_alloc(sizeof(struct omapfb_info), fbdev->dev); - - if (fbi == NULL) { - dev_err(fbdev->dev, - "unable to allocate memory for plane info\n"); + if (!fbi) return -ENOMEM; - } clear_fb_info(fbi); diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c index bd0d20283372..4a5db170ef59 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/omap2/omapfb-sysfs.c * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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/>. */ #include <linux/fb.h> diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb.h b/drivers/video/fbdev/omap2/omapfb/omapfb.h index 555487d6dbea..d27abccb37bc 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb.h +++ b/drivers/video/fbdev/omap2/omapfb/omapfb.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * linux/drivers/video/omap2/omapfb.h * @@ -6,18 +7,6 @@ * * Some code and ideas taken from drivers/video/omap/ driver * by Imre Deak. - * - * 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. - * - * 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 __DRIVERS_VIDEO_OMAP2_OMAPFB_H__ diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinumfb.c index 76f299375a00..632b246ca35f 100644 --- a/drivers/video/fbdev/platinumfb.c +++ b/drivers/video/fbdev/platinumfb.c @@ -538,10 +538,9 @@ static int platinumfb_probe(struct platform_device* odev) dev_info(&odev->dev, "Found Apple Platinum video hardware\n"); info = framebuffer_alloc(sizeof(*pinfo), &odev->dev); - if (info == NULL) { - dev_err(&odev->dev, "Failed to allocate fbdev !\n"); + if (!info) return -ENOMEM; - } + pinfo = info->par; if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) || diff --git a/drivers/video/fbdev/pmag-aa-fb.c b/drivers/video/fbdev/pmag-aa-fb.c index ca7e9390d1e7..d1e78ce3a9c2 100644 --- a/drivers/video/fbdev/pmag-aa-fb.c +++ b/drivers/video/fbdev/pmag-aa-fb.c @@ -165,10 +165,8 @@ static int pmagaafb_probe(struct device *dev) int err; info = framebuffer_alloc(sizeof(struct aafb_par), dev); - if (!info) { - printk(KERN_ERR "%s: Cannot allocate memory\n", dev_name(dev)); + if (!info) return -ENOMEM; - } par = info->par; dev_set_drvdata(dev, info); diff --git a/drivers/video/fbdev/pmag-ba-fb.c b/drivers/video/fbdev/pmag-ba-fb.c index 3b9249449ea6..56b912bb28de 100644 --- a/drivers/video/fbdev/pmag-ba-fb.c +++ b/drivers/video/fbdev/pmag-ba-fb.c @@ -150,10 +150,8 @@ static int pmagbafb_probe(struct device *dev) int err; info = framebuffer_alloc(sizeof(struct pmagbafb_par), dev); - if (!info) { - printk(KERN_ERR "%s: Cannot allocate memory\n", dev_name(dev)); + if (!info) return -ENOMEM; - } par = info->par; dev_set_drvdata(dev, info); diff --git a/drivers/video/fbdev/pmagb-b-fb.c b/drivers/video/fbdev/pmagb-b-fb.c index e58df36233c4..2822b2225924 100644 --- a/drivers/video/fbdev/pmagb-b-fb.c +++ b/drivers/video/fbdev/pmagb-b-fb.c @@ -257,10 +257,8 @@ static int pmagbbfb_probe(struct device *dev) int err; info = framebuffer_alloc(sizeof(struct pmagbbfb_par), dev); - if (!info) { - printk(KERN_ERR "%s: Cannot allocate memory\n", dev_name(dev)); + if (!info) return -ENOMEM; - } par = info->par; dev_set_drvdata(dev, info); diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c index 73d92d8a85cc..7ff4b6b84282 100644 --- a/drivers/video/fbdev/pvr2fb.c +++ b/drivers/video/fbdev/pvr2fb.c @@ -140,7 +140,7 @@ static struct pvr2fb_par { unsigned char is_doublescan; /* Are scanlines output twice? (doublescan) */ unsigned char is_lowres; /* Is horizontal pixel-doubling enabled? */ - unsigned long mmio_base; /* MMIO base */ + void __iomem *mmio_base; /* MMIO base */ u32 palette[16]; } *currentpar; @@ -194,39 +194,6 @@ static unsigned int shdma = PVR2_CASCADE_CHAN; static unsigned int pvr2dma = ONCHIP_NR_DMA_CHANNELS; #endif -static int pvr2fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, unsigned int blue, - unsigned int transp, struct fb_info *info); -static int pvr2fb_blank(int blank, struct fb_info *info); -static unsigned long get_line_length(int xres_virtual, int bpp); -static void set_color_bitfields(struct fb_var_screeninfo *var); -static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info); -static int pvr2fb_set_par(struct fb_info *info); -static void pvr2_update_display(struct fb_info *info); -static void pvr2_init_display(struct fb_info *info); -static void pvr2_do_blank(void); -static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id); -static int pvr2_init_cable(void); -static int pvr2_get_param(const struct pvr2_params *p, const char *s, - int val, int size); -#ifdef CONFIG_PVR2_DMA -static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, - size_t count, loff_t *ppos); -#endif - -static struct fb_ops pvr2fb_ops = { - .owner = THIS_MODULE, - .fb_setcolreg = pvr2fb_setcolreg, - .fb_blank = pvr2fb_blank, - .fb_check_var = pvr2fb_check_var, - .fb_set_par = pvr2fb_set_par, -#ifdef CONFIG_PVR2_DMA - .fb_write = pvr2fb_write, -#endif - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, -}; - static struct fb_videomode pvr2_modedb[] = { /* * Broadcast video modes (PAL and NTSC). I'm unfamiliar with @@ -354,6 +321,36 @@ static int pvr2fb_setcolreg(unsigned int regno, unsigned int red, return 0; } +/* + * Determine the cable type and initialize the cable output format. Don't do + * anything if the cable type has been overidden (via "cable:XX"). + */ + +#define PCTRA ((void __iomem *)0xff80002c) +#define PDTRA ((void __iomem *)0xff800030) +#define VOUTC ((void __iomem *)0xa0702c00) + +static int pvr2_init_cable(void) +{ + if (cable_type < 0) { + fb_writel((fb_readl(PCTRA) & 0xfff0ffff) | 0x000a0000, + PCTRA); + cable_type = (fb_readw(PDTRA) >> 8) & 3; + } + + /* Now select the output format (either composite or other) */ + /* XXX: Save the previous val first, as this reg is also AICA + related */ + if (cable_type == CT_COMPOSITE) + fb_writel(3 << 8, VOUTC); + else if (cable_type == CT_RGB) + fb_writel(1 << 9, VOUTC); + else + fb_writel(0, VOUTC); + + return cable_type; +} + static int pvr2fb_set_par(struct fb_info *info) { struct pvr2fb_par *par = (struct pvr2fb_par *)info->par; @@ -623,7 +620,7 @@ static void pvr2_do_blank(void) is_blanked = do_blank > 0 ? do_blank : 0; } -static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id) +static irqreturn_t __maybe_unused pvr2fb_interrupt(int irq, void *dev_id) { struct fb_info *info = dev_id; @@ -642,36 +639,6 @@ static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -/* - * Determine the cable type and initialize the cable output format. Don't do - * anything if the cable type has been overidden (via "cable:XX"). - */ - -#define PCTRA 0xff80002c -#define PDTRA 0xff800030 -#define VOUTC 0xa0702c00 - -static int pvr2_init_cable(void) -{ - if (cable_type < 0) { - fb_writel((fb_readl(PCTRA) & 0xfff0ffff) | 0x000a0000, - PCTRA); - cable_type = (fb_readw(PDTRA) >> 8) & 3; - } - - /* Now select the output format (either composite or other) */ - /* XXX: Save the previous val first, as this reg is also AICA - related */ - if (cable_type == CT_COMPOSITE) - fb_writel(3 << 8, VOUTC); - else if (cable_type == CT_RGB) - fb_writel(1 << 9, VOUTC); - else - fb_writel(0, VOUTC); - - return cable_type; -} - #ifdef CONFIG_PVR2_DMA static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, size_t count, loff_t *ppos) @@ -742,6 +709,46 @@ out_unmap: } #endif /* CONFIG_PVR2_DMA */ +static struct fb_ops pvr2fb_ops = { + .owner = THIS_MODULE, + .fb_setcolreg = pvr2fb_setcolreg, + .fb_blank = pvr2fb_blank, + .fb_check_var = pvr2fb_check_var, + .fb_set_par = pvr2fb_set_par, +#ifdef CONFIG_PVR2_DMA + .fb_write = pvr2fb_write, +#endif + .fb_fillrect = cfb_fillrect, + .fb_copyarea = cfb_copyarea, + .fb_imageblit = cfb_imageblit, +}; + +#ifndef MODULE +static int pvr2_get_param_val(const struct pvr2_params *p, const char *s, + int size) +{ + int i; + + for (i = 0; i < size; i++) { + if (!strncasecmp(p[i].name, s, strlen(s))) + return p[i].val; + } + return -1; +} +#endif + +static char *pvr2_get_param_name(const struct pvr2_params *p, int val, + int size) +{ + int i; + + for (i = 0; i < size; i++) { + if (p[i].val == val) + return p[i].name; + } + return NULL; +} + /** * pvr2fb_common_init * @@ -760,7 +767,7 @@ out_unmap: * in for flexibility anyways. Who knows, maybe someone has tv-out on a * PCI-based version of these things ;-) */ -static int pvr2fb_common_init(void) +static int __maybe_unused pvr2fb_common_init(void) { struct pvr2fb_par *par = currentpar; unsigned long modememused, rev; @@ -773,8 +780,8 @@ static int pvr2fb_common_init(void) goto out_err; } - par->mmio_base = (unsigned long)ioremap_nocache(pvr2_fix.mmio_start, - pvr2_fix.mmio_len); + par->mmio_base = ioremap_nocache(pvr2_fix.mmio_start, + pvr2_fix.mmio_len); if (!par->mmio_base) { printk(KERN_ERR "pvr2fb: Failed to remap mmio space\n"); goto out_err; @@ -822,8 +829,8 @@ static int pvr2fb_common_init(void) fb_info->var.xres, fb_info->var.yres, fb_info->var.bits_per_pixel, get_line_length(fb_info->var.xres, fb_info->var.bits_per_pixel), - (char *)pvr2_get_param(cables, NULL, cable_type, 3), - (char *)pvr2_get_param(outputs, NULL, video_output, 3)); + pvr2_get_param_name(cables, cable_type, 3), + pvr2_get_param_name(outputs, video_output, 3)); #ifdef CONFIG_SH_STORE_QUEUES fb_notice(fb_info, "registering with SQ API\n"); @@ -841,7 +848,7 @@ out_err: if (fb_info->screen_base) iounmap(fb_info->screen_base); if (par->mmio_base) - iounmap((void *)par->mmio_base); + iounmap(par->mmio_base); return -ENXIO; } @@ -901,15 +908,15 @@ static int __init pvr2fb_dc_init(void) return pvr2fb_common_init(); } -static void __exit pvr2fb_dc_exit(void) +static void pvr2fb_dc_exit(void) { if (fb_info->screen_base) { iounmap(fb_info->screen_base); fb_info->screen_base = NULL; } if (currentpar->mmio_base) { - iounmap((void *)currentpar->mmio_base); - currentpar->mmio_base = 0; + iounmap(currentpar->mmio_base); + currentpar->mmio_base = NULL; } free_irq(HW_EVENT_VSYNC, fb_info); @@ -958,8 +965,8 @@ static void pvr2fb_pci_remove(struct pci_dev *pdev) fb_info->screen_base = NULL; } if (currentpar->mmio_base) { - iounmap((void *)currentpar->mmio_base); - currentpar->mmio_base = 0; + iounmap(currentpar->mmio_base); + currentpar->mmio_base = NULL; } pci_release_regions(pdev); @@ -985,29 +992,12 @@ static int __init pvr2fb_pci_init(void) return pci_register_driver(&pvr2fb_pci_driver); } -static void __exit pvr2fb_pci_exit(void) +static void pvr2fb_pci_exit(void) { pci_unregister_driver(&pvr2fb_pci_driver); } #endif /* CONFIG_PCI */ -static int pvr2_get_param(const struct pvr2_params *p, const char *s, int val, - int size) -{ - int i; - - for (i = 0 ; i < size ; i++ ) { - if (s != NULL) { - if (!strncasecmp(p[i].name, s, strlen(s))) - return p[i].val; - } else { - if (p[i].val == val) - return (int)p[i].name; - } - } - return -1; -} - /* * Parse command arguments. Supported arguments are: * inverse Use inverse color maps @@ -1047,9 +1037,9 @@ static int __init pvr2fb_setup(char *options) } if (*cable_arg) - cable_type = pvr2_get_param(cables, cable_arg, 0, 3); + cable_type = pvr2_get_param_val(cables, cable_arg, 3); if (*output_arg) - video_output = pvr2_get_param(outputs, output_arg, 0, 3); + video_output = pvr2_get_param_val(outputs, output_arg, 3); return 0; } @@ -1082,12 +1072,8 @@ static int __init pvr2fb_init(void) #endif fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par), NULL); - - if (!fb_info) { - printk(KERN_ERR "Failed to allocate memory for fb_info\n"); + if (!fb_info) return -ENOMEM; - } - currentpar = fb_info->par; diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index d59c8a59f582..4282cb117b92 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -2068,7 +2068,7 @@ static int __init pxafb_setup_options(void) #define pxafb_setup_options() (0) module_param_string(options, g_options, sizeof(g_options), 0); -MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)"); +MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.rst)"); #endif #else diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c index cc242ba057d3..ca593a3e41d7 100644 --- a/drivers/video/fbdev/riva/fbdev.c +++ b/drivers/video/fbdev/riva/fbdev.c @@ -1902,7 +1902,6 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) info = framebuffer_alloc(sizeof(struct riva_par), &pd->dev); if (!info) { - printk (KERN_ERR PFX "could not allocate memory\n"); ret = -ENOMEM; goto err_ret; } diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c index 9ec85ccd0ce9..ba04d7a67829 100644 --- a/drivers/video/fbdev/s3c-fb.c +++ b/drivers/video/fbdev/s3c-fb.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* linux/drivers/video/s3c-fb.c * * Copyright 2008 Openmoko Inc. @@ -6,10 +7,6 @@ * http://armlinux.simtec.co.uk/ * * Samsung SoC Framebuffer driver - * - * 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 <linux/kernel.h> @@ -287,7 +284,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var, /* 666 with one bit alpha/transparency */ var->transp.offset = 18; var->transp.length = 1; - /* drop through */ + /* fall through */ case 18: var->bits_per_pixel = 32; @@ -315,7 +312,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var, case 25: var->transp.length = var->bits_per_pixel - 24; var->transp.offset = 24; - /* drop through */ + /* fall through */ case 24: /* our 24bpp is unpacked, so 32bpp */ var->bits_per_pixel = 32; @@ -812,7 +809,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info) case FB_BLANK_POWERDOWN: wincon &= ~WINCONx_ENWIN; sfb->enabled &= ~(1 << index); - /* fall through to FB_BLANK_NORMAL */ + /* fall through - to FB_BLANK_NORMAL */ case FB_BLANK_NORMAL: /* disable the DMA and display 0x0 (black) */ @@ -1105,14 +1102,14 @@ static int s3c_fb_alloc_memory(struct s3c_fb *sfb, struct s3c_fb_win *win) dev_dbg(sfb->dev, "want %u bytes for window\n", size); - fbi->screen_base = dma_alloc_wc(sfb->dev, size, &map_dma, GFP_KERNEL); - if (!fbi->screen_base) + fbi->screen_buffer = dma_alloc_wc(sfb->dev, size, &map_dma, GFP_KERNEL); + if (!fbi->screen_buffer) return -ENOMEM; dev_dbg(sfb->dev, "mapped %x to %p\n", - (unsigned int)map_dma, fbi->screen_base); + (unsigned int)map_dma, fbi->screen_buffer); - memset(fbi->screen_base, 0x0, size); + memset(fbi->screen_buffer, 0x0, size); fbi->fix.smem_start = map_dma; return 0; @@ -1129,9 +1126,9 @@ static void s3c_fb_free_memory(struct s3c_fb *sfb, struct s3c_fb_win *win) { struct fb_info *fbi = win->fbinfo; - if (fbi->screen_base) + if (fbi->screen_buffer) dma_free_wc(sfb->dev, PAGE_ALIGN(fbi->fix.smem_len), - fbi->screen_base, fbi->fix.smem_start); + fbi->screen_buffer, fbi->fix.smem_start); } /** @@ -1189,10 +1186,8 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no, fbinfo = framebuffer_alloc(sizeof(struct s3c_fb_win) + palette_size * sizeof(u32), sfb->dev); - if (!fbinfo) { - dev_err(sfb->dev, "failed to allocate framebuffer\n"); - return -ENOENT; - } + if (!fbinfo) + return -ENOMEM; windata = sfb->pdata->win[win_no]; initmode = *sfb->pdata->vtiming; diff --git a/drivers/video/fbdev/s3fb.c b/drivers/video/fbdev/s3fb.c index d63f23e26f7d..be16c349c10f 100644 --- a/drivers/video/fbdev/s3fb.c +++ b/drivers/video/fbdev/s3fb.c @@ -1128,10 +1128,8 @@ static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) /* Allocate and fill driver data structure */ info = framebuffer_alloc(sizeof(struct s3fb_info), &(dev->dev)); - if (!info) { - dev_err(&(dev->dev), "cannot allocate memory\n"); + if (!info) return -ENOMEM; - } par = info->par; mutex_init(&par->open_lock); diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c index 405715b60ec7..ab8fe838c776 100644 --- a/drivers/video/fbdev/sh7760fb.c +++ b/drivers/video/fbdev/sh7760fb.c @@ -6,7 +6,7 @@ * Manuel Lauss <mano@roarinelk.homelinux.net> * (c) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> * - * PLEASE HAVE A LOOK AT Documentation/fb/sh7760fb.txt! + * PLEASE HAVE A LOOK AT Documentation/fb/sh7760fb.rst! * * Thanks to Siegfried Schaefer <s.schaefer at schaefer-edv.de> * for his original source and testing! diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index b8454424910d..ac0bcac9a865 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -1564,10 +1564,8 @@ sh_mobile_lcdc_overlay_fb_init(struct sh_mobile_lcdc_overlay *ovl) /* Allocate and initialize the frame buffer device. */ info = framebuffer_alloc(0, priv->dev); - if (info == NULL) { - dev_err(priv->dev, "unable to allocate fb_info\n"); + if (!info) return -ENOMEM; - } ovl->info = info; @@ -2049,10 +2047,8 @@ sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch, * list and allocate the color map. */ info = framebuffer_alloc(0, priv->dev); - if (info == NULL) { - dev_err(priv->dev, "unable to allocate fb_info\n"); + if (!info) return -ENOMEM; - } ch->info = info; diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index dde52d027416..6edb4492e675 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* linux/drivers/video/sm501fb.c * * Copyright (c) 2006 Simtec Electronics * Vincent Sanders <vince@simtec.co.uk> * Ben Dooks <ben@simtec.co.uk> * - * 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. - * * Framebuffer driver for the Silicon Motion SM501 */ @@ -1868,10 +1865,8 @@ static int sm501fb_probe_one(struct sm501fb_info *info, } fbi = framebuffer_alloc(sizeof(struct sm501fb_par), info->dev); - if (fbi == NULL) { - dev_err(info->dev, "cannot allocate %s framebuffer\n", name); + if (!fbi) return -ENOMEM; - } par = fbi->par; par->info = info; diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c index f1dcc6766d1e..7b1b0d8d27a7 100644 --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -1538,7 +1538,6 @@ static int smtcfb_pci_probe(struct pci_dev *pdev, info = framebuffer_alloc(sizeof(*sfb), &pdev->dev); if (!info) { - dev_err(&pdev->dev, "framebuffer_alloc failed\n"); err = -ENOMEM; goto failed_free; } diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c index 8cd7892a0b0d..0e0f5bbfc5ef 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c @@ -1650,10 +1650,8 @@ static int ufx_usb_probe(struct usb_interface *interface, /* allocates framebuffer driver structure, not framebuffer memory */ info = framebuffer_alloc(0, &usbdev->dev); - if (!info) { - dev_err(dev->gdev, "framebuffer_alloc failed\n"); + if (!info) goto e_nomem; - } dev->info = info; info->par = dev; diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 021b727e8b5c..b674948e3bb8 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -555,10 +555,8 @@ static int ssd1307fb_probe(struct i2c_client *client, } info = framebuffer_alloc(sizeof(struct ssd1307fb_par), &client->dev); - if (!info) { - dev_err(&client->dev, "Couldn't allocate framebuffer.\n"); + if (!info) return -ENOMEM; - } par = info->par; par->info = info; diff --git a/drivers/video/fbdev/sunxvr1000.c b/drivers/video/fbdev/sunxvr1000.c index 8fe37c0ef2f5..784c9bd5d502 100644 --- a/drivers/video/fbdev/sunxvr1000.c +++ b/drivers/video/fbdev/sunxvr1000.c @@ -121,7 +121,6 @@ static int gfb_probe(struct platform_device *op) info = framebuffer_alloc(sizeof(struct gfb_info), &op->dev); if (!info) { - printk(KERN_ERR "gfb: Cannot allocate fb_info\n"); err = -ENOMEM; goto err_out; } diff --git a/drivers/video/fbdev/sunxvr2500.c b/drivers/video/fbdev/sunxvr2500.c index 544465ba1dc0..31683e5a8b79 100644 --- a/drivers/video/fbdev/sunxvr2500.c +++ b/drivers/video/fbdev/sunxvr2500.c @@ -132,7 +132,6 @@ static int s3d_pci_register(struct pci_dev *pdev, info = framebuffer_alloc(sizeof(struct s3d_info), &pdev->dev); if (!info) { - printk(KERN_ERR "s3d: Cannot allocate fb_info\n"); err = -ENOMEM; goto err_disable; } diff --git a/drivers/video/fbdev/sunxvr500.c b/drivers/video/fbdev/sunxvr500.c index bc595937df08..d392976126a6 100644 --- a/drivers/video/fbdev/sunxvr500.c +++ b/drivers/video/fbdev/sunxvr500.c @@ -272,7 +272,6 @@ static int e3d_pci_register(struct pci_dev *pdev, info = framebuffer_alloc(sizeof(struct e3d_info), &pdev->dev); if (!info) { - printk(KERN_ERR "e3d: Cannot allocate fb_info\n"); err = -ENOMEM; goto err_disable; } diff --git a/drivers/video/fbdev/tgafb.c b/drivers/video/fbdev/tgafb.c index 65ba9921506e..286b2371c7dd 100644 --- a/drivers/video/fbdev/tgafb.c +++ b/drivers/video/fbdev/tgafb.c @@ -1416,10 +1416,8 @@ static int tgafb_register(struct device *dev) /* Allocate the fb and par structures. */ info = framebuffer_alloc(sizeof(struct tga_par), dev); - if (!info) { - printk(KERN_ERR "tgafb: Cannot allocate memory\n"); + if (!info) return -ENOMEM; - } par = info->par; dev_set_drvdata(dev, info); diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index 00b99363e528..c328e8265cb1 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1686,10 +1686,8 @@ static int dlfb_usb_probe(struct usb_interface *intf, /* allocates framebuffer driver structure, not framebuffer memory */ info = framebuffer_alloc(0, &dlfb->udev->dev); - if (!info) { - dev_err(&dlfb->udev->dev, "framebuffer_alloc failed\n"); + if (!info) goto error; - } dlfb->info = info; info->par = dlfb; diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c index 8db5de13e2b7..f815f98190bc 100644 --- a/drivers/video/fbdev/via/viafbdev.c +++ b/drivers/video/fbdev/via/viafbdev.c @@ -1742,10 +1742,8 @@ int via_fb_pci_probe(struct viafb_dev *vdev) viafbinfo = framebuffer_alloc(viafb_par_length + ALIGN(sizeof(struct viafb_shared), BITS_PER_LONG/8), &vdev->pdev->dev); - if (!viafbinfo) { - printk(KERN_ERR"Could not allocate memory for viafb_info.\n"); + if (!viafbinfo) return -ENOMEM; - } viaparinfo = (struct viafb_par *)viafbinfo->par; viaparinfo->shared = viafbinfo->par + viafb_par_length; @@ -1820,8 +1818,6 @@ int via_fb_pci_probe(struct viafb_dev *vdev) viafbinfo1 = framebuffer_alloc(viafb_par_length, &vdev->pdev->dev); if (!viafbinfo1) { - printk(KERN_ERR - "allocate the second framebuffer struct error\n"); rc = -ENOMEM; goto out_fb_release; } diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c index 5cac871db3ee..c339a8fbad81 100644 --- a/drivers/video/fbdev/vt8623fb.c +++ b/drivers/video/fbdev/vt8623fb.c @@ -669,10 +669,8 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) /* Allocate and fill driver data structure */ info = framebuffer_alloc(sizeof(struct vt8623fb_info), &(dev->dev)); - if (! info) { - dev_err(&(dev->dev), "cannot allocate memory\n"); + if (!info) return -ENOMEM; - } par = info->par; mutex_init(&par->open_lock); diff --git a/drivers/video/fbdev/w100fb.c b/drivers/video/fbdev/w100fb.c index 696106ecdff0..597ffaa13cd2 100644 --- a/drivers/video/fbdev/w100fb.c +++ b/drivers/video/fbdev/w100fb.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/video/w100fb.c * @@ -17,11 +18,6 @@ * * Hardware acceleration support by Alberto Mardegan * <mardy@users.sourceforge.net> - * - * 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 <linux/delay.h> diff --git a/drivers/video/fbdev/w100fb.h b/drivers/video/fbdev/w100fb.h index fffae7b4f6e9..52c96d155b4c 100644 --- a/drivers/video/fbdev/w100fb.h +++ b/drivers/video/fbdev/w100fb.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * linux/drivers/video/w100fb.h * @@ -10,11 +11,6 @@ * Modified to work with 2.6 by Richard Purdie <rpurdie@rpsys.net> * * w32xx support by Ian Molton - * - * 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. - * */ #if !defined (_W100FB_H) |