1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2023 Loongson Technology Corporation Limited
10 static const struct lsdc_kms_funcs ls7a1000_kms_funcs = {
11 .create_i2c = lsdc_create_i2c_chan,
12 .irq_handler = ls7a1000_dc_irq_handler,
13 .output_init = ls7a1000_output_init,
14 .cursor_plane_init = ls7a1000_cursor_plane_init,
15 .primary_plane_init = lsdc_primary_plane_init,
16 .crtc_init = ls7a1000_crtc_init,
19 static const struct lsdc_kms_funcs ls7a2000_kms_funcs = {
20 .create_i2c = lsdc_create_i2c_chan,
21 .irq_handler = ls7a2000_dc_irq_handler,
22 .output_init = ls7a2000_output_init,
23 .cursor_plane_init = ls7a2000_cursor_plane_init,
24 .primary_plane_init = lsdc_primary_plane_init,
25 .crtc_init = ls7a2000_crtc_init,
28 static const struct loongson_gfx_desc ls7a1000_gfx = {
31 .max_pixel_clk = 200000,
34 .num_of_hw_cursor = 1,
38 .has_vblank_counter = false,
39 .funcs = &ls7a1000_kms_funcs,
41 .conf_reg_base = LS7A1000_CONF_REG_BASE,
43 .reg_offset = LS7A1000_PLL_GFX_REG,
48 .reg_offset = LS7A1000_PIXPLL0_REG,
52 .reg_offset = LS7A1000_PIXPLL1_REG,
56 .chip_id = CHIP_LS7A1000,
57 .model = "LS7A1000 bridge chipset",
60 static const struct loongson_gfx_desc ls7a2000_gfx = {
63 .max_pixel_clk = 350000,
66 .num_of_hw_cursor = 2,
70 .has_vblank_counter = true,
71 .funcs = &ls7a2000_kms_funcs,
73 .conf_reg_base = LS7A2000_CONF_REG_BASE,
75 .reg_offset = LS7A2000_PLL_GFX_REG,
80 .reg_offset = LS7A2000_PIXPLL0_REG,
84 .reg_offset = LS7A2000_PIXPLL1_REG,
88 .chip_id = CHIP_LS7A2000,
89 .model = "LS7A2000 bridge chipset",
92 static const struct lsdc_desc *__chip_id_desc_table[] = {
93 [CHIP_LS7A1000] = &ls7a1000_gfx.dc,
94 [CHIP_LS7A2000] = &ls7a2000_gfx.dc,
95 [CHIP_LS_LAST] = NULL,
98 const struct lsdc_desc *
99 lsdc_device_probe(struct pci_dev *pdev, enum loongson_chip_id chip_id)
101 return __chip_id_desc_table[chip_id];