forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/video/fbdev/mx3fb.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2008
34 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
45 *
56 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #include <linux/module.h>
....@@ -512,7 +509,7 @@
512509 uint16_t h_start_width, uint16_t h_sync_width,
513510 uint16_t h_end_width, uint16_t v_start_width,
514511 uint16_t v_sync_width, uint16_t v_end_width,
515
- struct ipu_di_signal_cfg sig)
512
+ const struct ipu_di_signal_cfg *sig)
516513 {
517514 unsigned long lock_flags;
518515 uint32_t reg;
....@@ -594,17 +591,17 @@
594591
595592 /* DI settings */
596593 old_conf = mx3fb_read_reg(mx3fb, DI_DISP_IF_CONF) & 0x78FFFFFF;
597
- old_conf |= sig.datamask_en << DI_D3_DATAMSK_SHIFT |
598
- sig.clksel_en << DI_D3_CLK_SEL_SHIFT |
599
- sig.clkidle_en << DI_D3_CLK_IDLE_SHIFT;
594
+ old_conf |= sig->datamask_en << DI_D3_DATAMSK_SHIFT |
595
+ sig->clksel_en << DI_D3_CLK_SEL_SHIFT |
596
+ sig->clkidle_en << DI_D3_CLK_IDLE_SHIFT;
600597 mx3fb_write_reg(mx3fb, old_conf, DI_DISP_IF_CONF);
601598
602599 old_conf = mx3fb_read_reg(mx3fb, DI_DISP_SIG_POL) & 0xE0FFFFFF;
603
- old_conf |= sig.data_pol << DI_D3_DATA_POL_SHIFT |
604
- sig.clk_pol << DI_D3_CLK_POL_SHIFT |
605
- sig.enable_pol << DI_D3_DRDY_SHARP_POL_SHIFT |
606
- sig.Hsync_pol << DI_D3_HSYNC_POL_SHIFT |
607
- sig.Vsync_pol << DI_D3_VSYNC_POL_SHIFT;
600
+ old_conf |= sig->data_pol << DI_D3_DATA_POL_SHIFT |
601
+ sig->clk_pol << DI_D3_CLK_POL_SHIFT |
602
+ sig->enable_pol << DI_D3_DRDY_SHARP_POL_SHIFT |
603
+ sig->Hsync_pol << DI_D3_HSYNC_POL_SHIFT |
604
+ sig->Vsync_pol << DI_D3_VSYNC_POL_SHIFT;
608605 mx3fb_write_reg(mx3fb, old_conf, DI_DISP_SIG_POL);
609606
610607 map = &di_mappings[mx3fb->disp_data_fmt];
....@@ -858,7 +855,7 @@
858855 fbi->var.upper_margin,
859856 fbi->var.vsync_len,
860857 fbi->var.lower_margin +
861
- fbi->var.vsync_len, sig_cfg) != 0) {
858
+ fbi->var.vsync_len, &sig_cfg) != 0) {
862859 dev_err(fbi->device,
863860 "mx3fb: Error initializing panel.\n");
864861 return -EINVAL;
....@@ -1252,7 +1249,7 @@
12521249 * invoked by the core framebuffer driver to perform operations like
12531250 * blitting, rectangle filling, copy regions and cursor definition.
12541251 */
1255
-static struct fb_ops mx3fb_ops = {
1252
+static const struct fb_ops mx3fb_ops = {
12561253 .owner = THIS_MODULE,
12571254 .fb_set_par = mx3fb_set_par,
12581255 .fb_check_var = mx3fb_check_var,
....@@ -1392,7 +1389,8 @@
13921389 * mx3fb_init_fbinfo() - initialize framebuffer information object.
13931390 * @return: initialized framebuffer structure.
13941391 */
1395
-static struct fb_info *mx3fb_init_fbinfo(struct device *dev, struct fb_ops *ops)
1392
+static struct fb_info *mx3fb_init_fbinfo(struct device *dev,
1393
+ const struct fb_ops *ops)
13961394 {
13971395 struct fb_info *fbi;
13981396 struct mx3fb_info *mx3fbi;