forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/gpu/drm/sti/sti_hda.c
....@@ -6,13 +6,18 @@
66
77 #include <linux/clk.h>
88 #include <linux/component.h>
9
+#include <linux/io.h>
910 #include <linux/module.h>
1011 #include <linux/platform_device.h>
1112 #include <linux/seq_file.h>
1213
13
-#include <drm/drmP.h>
1414 #include <drm/drm_atomic_helper.h>
15
-#include <drm/drm_crtc_helper.h>
15
+#include <drm/drm_bridge.h>
16
+#include <drm/drm_debugfs.h>
17
+#include <drm/drm_device.h>
18
+#include <drm/drm_file.h>
19
+#include <drm/drm_print.h>
20
+#include <drm/drm_probe_helper.h>
1621
1722 /* HDformatter registers */
1823 #define HDA_ANA_CFG 0x0000
....@@ -226,7 +231,7 @@
226231 AWGi_720x480p_60, NN_720x480p_60, VID_ED}
227232 };
228233
229
-/**
234
+/*
230235 * STI hd analog structure
231236 *
232237 * @dev: driver device
....@@ -362,16 +367,16 @@
362367 { "hda", hda_dbg_show, 0, NULL },
363368 };
364369
365
-static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
370
+static void hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
366371 {
367372 unsigned int i;
368373
369374 for (i = 0; i < ARRAY_SIZE(hda_debugfs_files); i++)
370375 hda_debugfs_files[i].data = hda;
371376
372
- return drm_debugfs_create_files(hda_debugfs_files,
373
- ARRAY_SIZE(hda_debugfs_files),
374
- minor->debugfs_root, minor);
377
+ drm_debugfs_create_files(hda_debugfs_files,
378
+ ARRAY_SIZE(hda_debugfs_files),
379
+ minor->debugfs_root, minor);
375380 }
376381
377382 /**
....@@ -508,8 +513,8 @@
508513 }
509514
510515 static void sti_hda_set_mode(struct drm_bridge *bridge,
511
- struct drm_display_mode *mode,
512
- struct drm_display_mode *adjusted_mode)
516
+ const struct drm_display_mode *mode,
517
+ const struct drm_display_mode *adjusted_mode)
513518 {
514519 struct sti_hda *hda = bridge->driver_private;
515520 u32 mode_idx;
....@@ -581,7 +586,6 @@
581586 &hda_supported_modes[i].mode);
582587 if (!mode)
583588 continue;
584
- mode->vrefresh = drm_mode_vrefresh(mode);
585589
586590 /* the first mode is the preferred mode */
587591 if (i == 0)
....@@ -638,10 +642,7 @@
638642 = to_sti_hda_connector(connector);
639643 struct sti_hda *hda = hda_connector->hda;
640644
641
- if (hda_debugfs_init(hda, hda->drm_dev->primary)) {
642
- DRM_ERROR("HDA debugfs setup failed\n");
643
- return -EINVAL;
644
- }
645
+ hda_debugfs_init(hda, hda->drm_dev->primary);
645646
646647 return 0;
647648 }
....@@ -696,7 +697,7 @@
696697
697698 bridge->driver_private = hda;
698699 bridge->funcs = &sti_hda_bridge_funcs;
699
- drm_bridge_attach(encoder, bridge, NULL);
700
+ drm_bridge_attach(encoder, bridge, NULL, 0);
700701
701702 connector->encoder = encoder;
702703
....@@ -754,14 +755,14 @@
754755 DRM_ERROR("Invalid hda resource\n");
755756 return -ENOMEM;
756757 }
757
- hda->regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
758
+ hda->regs = devm_ioremap(dev, res->start, resource_size(res));
758759 if (!hda->regs)
759760 return -ENOMEM;
760761
761762 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
762763 "video-dacs-ctrl");
763764 if (res) {
764
- hda->video_dacs_ctrl = devm_ioremap_nocache(dev, res->start,
765
+ hda->video_dacs_ctrl = devm_ioremap(dev, res->start,
765766 resource_size(res));
766767 if (!hda->video_dacs_ctrl)
767768 return -ENOMEM;