hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/video/fbdev/cyber2000fb.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/drivers/video/cyber2000fb.c
34 *
....@@ -8,10 +9,6 @@
89 *
910 * 32 bit support, text color and panning fixes for modes != 8 bit
1011 * Copyright (C) 2002 Denis Oliver Kropp <dok@directfb.org>
11
- *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License version 2 as
14
- * published by the Free Software Foundation.
1512 *
1613 * Integraphics CyberPro 2000, 2010 and 5000 frame buffer device
1714 *
....@@ -50,7 +47,6 @@
5047 #include <linux/i2c.h>
5148 #include <linux/i2c-algo-bit.h>
5249
53
-#include <asm/pgtable.h>
5450
5551 #ifdef __arm__
5652 #include <asm/mach-types.h>
....@@ -61,7 +57,6 @@
6157 struct cfb_info {
6258 struct fb_info fb;
6359 struct display_switch *dispsw;
64
- struct display *display;
6560 unsigned char __iomem *region;
6661 unsigned char __iomem *regs;
6762 u_int id;
....@@ -1064,7 +1059,7 @@
10641059 return 0;
10651060 }
10661061
1067
-static struct fb_ops cyber2000fb_ops = {
1062
+static const struct fb_ops cyber2000fb_ops = {
10681063 .owner = THIS_MODULE,
10691064 .fb_check_var = cyber2000fb_check_var,
10701065 .fb_set_par = cyber2000fb_set_par,
....@@ -1164,12 +1159,14 @@
11641159 #define DDC_SDA_IN (1 << 6)
11651160
11661161 static void cyber2000fb_enable_ddc(struct cfb_info *cfb)
1162
+ __acquires(&cfb->reg_b0_lock)
11671163 {
11681164 spin_lock(&cfb->reg_b0_lock);
11691165 cyber2000fb_writew(0x1bf, 0x3ce, cfb);
11701166 }
11711167
11721168 static void cyber2000fb_disable_ddc(struct cfb_info *cfb)
1169
+ __releases(&cfb->reg_b0_lock)
11731170 {
11741171 cyber2000fb_writew(0x0bf, 0x3ce, cfb);
11751172 spin_unlock(&cfb->reg_b0_lock);
....@@ -1642,10 +1639,6 @@
16421639 }
16431640
16441641 /*
1645
- * PCI specific support.
1646
- */
1647
-#ifdef CONFIG_PCI
1648
-/*
16491642 * We need to wake up the CyberPro, and make sure its in linear memory
16501643 * mode. Unfortunately, this is specific to the platform and card that
16511644 * we are running on.
....@@ -1817,7 +1810,7 @@
18171810 }
18181811 }
18191812
1820
-static int cyberpro_pci_suspend(struct pci_dev *dev, pm_message_t state)
1813
+static int __maybe_unused cyberpro_pci_suspend(struct device *dev)
18211814 {
18221815 return 0;
18231816 }
....@@ -1825,9 +1818,9 @@
18251818 /*
18261819 * Re-initialise the CyberPro hardware
18271820 */
1828
-static int cyberpro_pci_resume(struct pci_dev *dev)
1821
+static int __maybe_unused cyberpro_pci_resume(struct device *dev)
18291822 {
1830
- struct cfb_info *cfb = pci_get_drvdata(dev);
1823
+ struct cfb_info *cfb = dev_get_drvdata(dev);
18311824
18321825 if (cfb) {
18331826 cyberpro_pci_enable_mmio(cfb);
....@@ -1853,15 +1846,17 @@
18531846
18541847 MODULE_DEVICE_TABLE(pci, cyberpro_pci_table);
18551848
1849
+static SIMPLE_DEV_PM_OPS(cyberpro_pci_pm_ops,
1850
+ cyberpro_pci_suspend,
1851
+ cyberpro_pci_resume);
1852
+
18561853 static struct pci_driver cyberpro_driver = {
18571854 .name = "CyberPro",
18581855 .probe = cyberpro_pci_probe,
18591856 .remove = cyberpro_pci_remove,
1860
- .suspend = cyberpro_pci_suspend,
1861
- .resume = cyberpro_pci_resume,
1857
+ .driver.pm = &cyberpro_pci_pm_ops,
18621858 .id_table = cyberpro_pci_table
18631859 };
1864
-#endif
18651860
18661861 /*
18671862 * I don't think we can use the "module_init" stuff here because