| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/drivers/video/cyber2000fb.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 8 | 9 | * |
|---|
| 9 | 10 | * 32 bit support, text color and panning fixes for modes != 8 bit |
|---|
| 10 | 11 | * 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. |
|---|
| 15 | 12 | * |
|---|
| 16 | 13 | * Integraphics CyberPro 2000, 2010 and 5000 frame buffer device |
|---|
| 17 | 14 | * |
|---|
| .. | .. |
|---|
| 50 | 47 | #include <linux/i2c.h> |
|---|
| 51 | 48 | #include <linux/i2c-algo-bit.h> |
|---|
| 52 | 49 | |
|---|
| 53 | | -#include <asm/pgtable.h> |
|---|
| 54 | 50 | |
|---|
| 55 | 51 | #ifdef __arm__ |
|---|
| 56 | 52 | #include <asm/mach-types.h> |
|---|
| .. | .. |
|---|
| 61 | 57 | struct cfb_info { |
|---|
| 62 | 58 | struct fb_info fb; |
|---|
| 63 | 59 | struct display_switch *dispsw; |
|---|
| 64 | | - struct display *display; |
|---|
| 65 | 60 | unsigned char __iomem *region; |
|---|
| 66 | 61 | unsigned char __iomem *regs; |
|---|
| 67 | 62 | u_int id; |
|---|
| .. | .. |
|---|
| 1064 | 1059 | return 0; |
|---|
| 1065 | 1060 | } |
|---|
| 1066 | 1061 | |
|---|
| 1067 | | -static struct fb_ops cyber2000fb_ops = { |
|---|
| 1062 | +static const struct fb_ops cyber2000fb_ops = { |
|---|
| 1068 | 1063 | .owner = THIS_MODULE, |
|---|
| 1069 | 1064 | .fb_check_var = cyber2000fb_check_var, |
|---|
| 1070 | 1065 | .fb_set_par = cyber2000fb_set_par, |
|---|
| .. | .. |
|---|
| 1164 | 1159 | #define DDC_SDA_IN (1 << 6) |
|---|
| 1165 | 1160 | |
|---|
| 1166 | 1161 | static void cyber2000fb_enable_ddc(struct cfb_info *cfb) |
|---|
| 1162 | + __acquires(&cfb->reg_b0_lock) |
|---|
| 1167 | 1163 | { |
|---|
| 1168 | 1164 | spin_lock(&cfb->reg_b0_lock); |
|---|
| 1169 | 1165 | cyber2000fb_writew(0x1bf, 0x3ce, cfb); |
|---|
| 1170 | 1166 | } |
|---|
| 1171 | 1167 | |
|---|
| 1172 | 1168 | static void cyber2000fb_disable_ddc(struct cfb_info *cfb) |
|---|
| 1169 | + __releases(&cfb->reg_b0_lock) |
|---|
| 1173 | 1170 | { |
|---|
| 1174 | 1171 | cyber2000fb_writew(0x0bf, 0x3ce, cfb); |
|---|
| 1175 | 1172 | spin_unlock(&cfb->reg_b0_lock); |
|---|
| .. | .. |
|---|
| 1642 | 1639 | } |
|---|
| 1643 | 1640 | |
|---|
| 1644 | 1641 | /* |
|---|
| 1645 | | - * PCI specific support. |
|---|
| 1646 | | - */ |
|---|
| 1647 | | -#ifdef CONFIG_PCI |
|---|
| 1648 | | -/* |
|---|
| 1649 | 1642 | * We need to wake up the CyberPro, and make sure its in linear memory |
|---|
| 1650 | 1643 | * mode. Unfortunately, this is specific to the platform and card that |
|---|
| 1651 | 1644 | * we are running on. |
|---|
| .. | .. |
|---|
| 1817 | 1810 | } |
|---|
| 1818 | 1811 | } |
|---|
| 1819 | 1812 | |
|---|
| 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) |
|---|
| 1821 | 1814 | { |
|---|
| 1822 | 1815 | return 0; |
|---|
| 1823 | 1816 | } |
|---|
| .. | .. |
|---|
| 1825 | 1818 | /* |
|---|
| 1826 | 1819 | * Re-initialise the CyberPro hardware |
|---|
| 1827 | 1820 | */ |
|---|
| 1828 | | -static int cyberpro_pci_resume(struct pci_dev *dev) |
|---|
| 1821 | +static int __maybe_unused cyberpro_pci_resume(struct device *dev) |
|---|
| 1829 | 1822 | { |
|---|
| 1830 | | - struct cfb_info *cfb = pci_get_drvdata(dev); |
|---|
| 1823 | + struct cfb_info *cfb = dev_get_drvdata(dev); |
|---|
| 1831 | 1824 | |
|---|
| 1832 | 1825 | if (cfb) { |
|---|
| 1833 | 1826 | cyberpro_pci_enable_mmio(cfb); |
|---|
| .. | .. |
|---|
| 1853 | 1846 | |
|---|
| 1854 | 1847 | MODULE_DEVICE_TABLE(pci, cyberpro_pci_table); |
|---|
| 1855 | 1848 | |
|---|
| 1849 | +static SIMPLE_DEV_PM_OPS(cyberpro_pci_pm_ops, |
|---|
| 1850 | + cyberpro_pci_suspend, |
|---|
| 1851 | + cyberpro_pci_resume); |
|---|
| 1852 | + |
|---|
| 1856 | 1853 | static struct pci_driver cyberpro_driver = { |
|---|
| 1857 | 1854 | .name = "CyberPro", |
|---|
| 1858 | 1855 | .probe = cyberpro_pci_probe, |
|---|
| 1859 | 1856 | .remove = cyberpro_pci_remove, |
|---|
| 1860 | | - .suspend = cyberpro_pci_suspend, |
|---|
| 1861 | | - .resume = cyberpro_pci_resume, |
|---|
| 1857 | + .driver.pm = &cyberpro_pci_pm_ops, |
|---|
| 1862 | 1858 | .id_table = cyberpro_pci_table |
|---|
| 1863 | 1859 | }; |
|---|
| 1864 | | -#endif |
|---|
| 1865 | 1860 | |
|---|
| 1866 | 1861 | /* |
|---|
| 1867 | 1862 | * I don't think we can use the "module_init" stuff here because |
|---|