1*f39db26cSSui Jingfeng // SPDX-License-Identifier: GPL-2.0+ 2*f39db26cSSui Jingfeng /* 3*f39db26cSSui Jingfeng * Copyright (C) 2023 Loongson Technology Corporation Limited 4*f39db26cSSui Jingfeng */ 5*f39db26cSSui Jingfeng 6*f39db26cSSui Jingfeng #include <linux/pci.h> 7*f39db26cSSui Jingfeng 8*f39db26cSSui Jingfeng #include <video/nomodeset.h> 9*f39db26cSSui Jingfeng 10*f39db26cSSui Jingfeng #include "loongson_module.h" 11*f39db26cSSui Jingfeng 12*f39db26cSSui Jingfeng static int loongson_modeset = -1; 13*f39db26cSSui Jingfeng MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); 14*f39db26cSSui Jingfeng module_param_named(modeset, loongson_modeset, int, 0400); 15*f39db26cSSui Jingfeng 16*f39db26cSSui Jingfeng int loongson_vblank = 1; 17*f39db26cSSui Jingfeng MODULE_PARM_DESC(vblank, "Disable/Enable hw vblank support"); 18*f39db26cSSui Jingfeng module_param_named(vblank, loongson_vblank, int, 0400); 19*f39db26cSSui Jingfeng loongson_module_init(void)20*f39db26cSSui Jingfengstatic int __init loongson_module_init(void) 21*f39db26cSSui Jingfeng { 22*f39db26cSSui Jingfeng if (!loongson_modeset || video_firmware_drivers_only()) 23*f39db26cSSui Jingfeng return -ENODEV; 24*f39db26cSSui Jingfeng 25*f39db26cSSui Jingfeng return pci_register_driver(&lsdc_pci_driver); 26*f39db26cSSui Jingfeng } 27*f39db26cSSui Jingfeng module_init(loongson_module_init); 28*f39db26cSSui Jingfeng loongson_module_exit(void)29*f39db26cSSui Jingfengstatic void __exit loongson_module_exit(void) 30*f39db26cSSui Jingfeng { 31*f39db26cSSui Jingfeng pci_unregister_driver(&lsdc_pci_driver); 32*f39db26cSSui Jingfeng } 33*f39db26cSSui Jingfeng module_exit(loongson_module_exit); 34