em3288 linux_4.19 lvds+tp调试

c 复制代码
一、显示配置
c 复制代码
\rk3288_linux4.19\kernel\arch\arm\boot\dts\rk3288-evb-act8846.dts

panel {
	compatible ="simple-panel";
	backlight = <&backlight>;
	bus-format = <MEDIA_BUS_FMT_RGB666_1X18>;
	enable-gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
	enable-delay-ms = <1>;
	power-supply = <&vcc_lcd>;
	rockchip,data-mapping = "vesa"; //rgb  close
	rockchip,data-width = <24>;
 	rockchip,output = "lvds";

  	display-timings {
		native-mode = <&timing0>;
     timing0: timing0 {
				clock-frequency = <78000000>;
				hactive = <1280>;
				vactive = <800>;
				hback-porch = <100>;
				hfront-porch = <18>;
				vback-porch = <8>;
				vfront-porch = <6>;
				hsync-len = <10>;
				vsync-len = <2>;
				hsync-active = <0>;
				vsync-active = <0>;
				de-active = <0>;
				pixelclk-active = <0>;
		    };
    };
		port {
			panel_in_lvds: endpoint {
				remote-endpoint = <&lvds_out_panel>;
			};
		};
	};	
.............................
&route_lvds {
	status = "okay";
};

&lvds {
	status = "okay";

	ports {
		port@1 {
			reg = <1>;

			lvds_out_panel: endpoint {
				remote-endpoint = <&panel_in_lvds>;
			};
		};
	};
};

&lvds_in_vopl {
	status = "okay";
};

&lvds_in_vopb {
	status = "disabled";
};

&backlight {
//	enable-gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
	pinctrl-names = "default";
//	pinctrl-0 = <&bl_en>;
	pwms = <&pwm1 0 1000000 PWM_POLARITY_INVERTED>;
};

&pwm1 {
	status = "okay";
};
c 复制代码
二、gt928 配置
c 复制代码
\rk3288_linux4.19\kernel\arch\arm\boot\dts\rk3288-evb-act8846.dts

&i2c4 {
	status = "okay";
	ts@02 {
		compatible = "goodix,gt9xx";
		reg = <0x5d>;
		touch-gpio = <&gpio8 RK_PB1 IRQ_TYPE_LEVEL_LOW>;
		reset-gpio = <&gpio7 RK_PA6 GPIO_ACTIVE_LOW>;
		max-x = <1280>;
		max-y = <800>;
	};
};
c 复制代码
\rk3288_linux4.19\kernel\drivers\input\touchscreen\gt9xx\gt9xx.c

static void gtp_touch_down(struct goodix_ts_data* ts,s32 id,s32 x,s32 y,s32 w)
{
	if (gtp_change_x2y)
		GTP_SWAP(x, y);
+        x = ts->abs_x_max - x; 
	if (!bgt911 && !bgt970) {
		if (gtp_x_reverse)
			x = ts->abs_x_max - x;

		if (gtp_y_reverse)
			y = ts->abs_y_max - y;
	}
	
..........................
static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
    s32 ret = -1;
    struct goodix_ts_data *ts;
    u16 version_info;
    
    struct device_node *np = client->dev.of_node;
+ //   enum of_gpio_flags rst_flags, pwr_flags;
+ 	enum of_gpio_flags rst_flags;
    u32 val;
	printk("%s() start\n", __func__);

    
    GTP_DEBUG_FUNC();
    
    //do NOT remove these logs
    GTP_INFO("GTP Driver Version: %s", GTP_DRIVER_VERSION);
    GTP_INFO("GTP I2C Address: 0x%02x", client->addr);

    i2c_connect_client = client;
    
    if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) 
    {
        GTP_ERROR("I2C check functionality failed.");
        return -ENODEV;
    }
    ts = kzalloc(sizeof(*ts), GFP_KERNEL);
    if (ts == NULL)
    {
        GTP_ERROR("Alloc GFP_KERNEL memory failed.");
        return -ENOMEM;
    }
    
    memset(ts, 0, sizeof(*ts));
    
    if (!np) {
    	dev_err(&client->dev, "no device tree\n");
    	return -EINVAL;
    }
+    
+/*    if (of_property_read_u32(np, "tp-size", &val)) {
    	dev_err(&client->dev, "no max-x defined\n");
    	return -EINVAL;
+    } */
+
	if (val == 89) {
		m89or101 = TRUE;
		gtp_change_x2y = TRUE;
		gtp_x_reverse = FALSE;
		gtp_y_reverse = TRUE;
	} else if (val == 101) {
		m89or101 = FALSE;
		gtp_change_x2y = TRUE;
		gtp_x_reverse = TRUE;
		gtp_y_reverse = FALSE;
	} else if (val == 911) {
		m89or101 = FALSE;
		bgt911 = TRUE;
		gtp_change_x2y = TRUE;
		gtp_x_reverse = FALSE;
		gtp_y_reverse = TRUE;
	} else if (val == 9110) {
		m89or101 = FALSE;
		bgt9110 = TRUE;
		gtp_change_x2y = TRUE;
		gtp_x_reverse = TRUE;
		gtp_y_reverse = FALSE;
	} else if (val == 9111) {
		m89or101 = FALSE;
		bgt9111 = TRUE;
		gtp_change_x2y = TRUE;
		gtp_x_reverse = FALSE;
		gtp_y_reverse = FALSE;
	} else if (val == 970) {
		m89or101 = FALSE;
		bgt911 = FALSE;
		bgt970 = TRUE;
		gtp_change_x2y = FALSE;
		gtp_x_reverse = FALSE;
		gtp_y_reverse = TRUE;
	} else if (val == 910) {
		m89or101 = FALSE;
		bgt911 = FALSE;
		bgt970 = FALSE;
		bgt910 = TRUE;
		gtp_change_x2y = TRUE;
		gtp_x_reverse = FALSE;
		gtp_y_reverse = TRUE;
	}

	ts->tp_regulator = devm_regulator_get(&client->dev, "tp");
	if (IS_ERR(ts->tp_regulator)) {
		dev_err(&client->dev, "failed to get regulator, %ld\n",
			PTR_ERR(ts->tp_regulator));
		return PTR_ERR(ts->tp_regulator);
	}

	ret = regulator_enable(ts->tp_regulator);
	if (ret < 0)
		GTP_ERROR("failed to enable tp regulator\n");
	msleep(20);

    ts->irq_pin = of_get_named_gpio_flags(np, "touch-gpio", 0, (enum of_gpio_flags *)(&ts->irq_flags));
    ts->rst_pin = of_get_named_gpio_flags(np, "reset-gpio", 0, &rst_flags);
 +   //ts->pwr_pin = of_get_named_gpio_flags(np, "power-gpio", 0, &pwr_flags);
    //ts->tp_select_pin = of_get_named_gpio_flags(np, "tp-select-gpio", 0, &tp_select_flags);
    if (of_property_read_u32(np, "max-x", &val)) {
    	dev_err(&client->dev, "no max-x defined\n");
    	return -EINVAL;
    }
    //ts->abs_x_max = val;
    if (of_property_read_u32(np, "max-y", &val)) {
    	dev_err(&client->dev, "no max-y defined\n");
    	return -EINVAL;
    }
    //ts->abs_y_max = val;
    if (of_property_read_u32(np, "configfile-num", &val)) {
	    ts->cfg_file_num = 0;
    } else {
	    ts->cfg_file_num = val;
    }
    ts->pendown =PEN_RELEASE;
    ts->client = client;
    
    
    INIT_WORK(&ts->work, goodix_ts_work_func);
    ts->client = client;
    spin_lock_init(&ts->irq_lock);          // 2.6.39 later
    // ts->irq_lock = SPIN_LOCK_UNLOCKED;   // 2.6.39 & before
#if GTP_ESD_PROTECT
    ts->clk_tick_cnt = 2 * HZ;      // HZ: clock ticks in 1 second generated by system
    GTP_DEBUG("Clock ticks for an esd cycle: %d", ts->clk_tick_cnt);  
    spin_lock_init(&ts->esd_lock);
    // ts->esd_lock = SPIN_LOCK_UNLOCKED;
#endif


相关推荐
腾渊信息科技公司7 小时前
工业数据运维痛点根治方案:基于AI Agent的产线自动化台账系统落地
运维·人工智能·自动化·个人开发·ai编程
Dxy12393102167 小时前
Proxy Protocol v2 详解
运维
踏月的造梦星球8 小时前
DMDPC 学习:架构、部署、运维与调优
运维·数据库·学习·架构
潘正翔8 小时前
docker核心概念
linux·运维·服务器·docker·容器·centos·运维开发
weigangwin9 小时前
agent-workspace-linux 不是远程桌面:Linux AI 工作区的隔离边界验收
linux·xvfb·mcp·桌面隔离·权限边界·bubblewrap·agent-workspace
renhongxia19 小时前
世界模型,是“空中楼阁”还是AGI的“最后一块拼图”?
运维·服务器·数据库·人工智能·算法·agi
Dovis(誓平步青云)10 小时前
远程办公软件文件传输实测:6 款工具的速度、稳定性和办公体验对比
linux·运维·服务器·后端·生成对抗网络
专注_每天进步一点点10 小时前
SLB(绑定弹性公网ip)-gateway-业务pod,gateway上出现reset by peer,业务pod上没有reset by peer
服务器·tcp/ip·gateway
Java小白笔记11 小时前
Docker 安装配置完全指南:MacOS 、Windows、Linux环境下的安装、配置与验证
linux·macos·docker
csdn_aspnet11 小时前
GitHub Actions自动化运维实战,用CI/CD流水线实现测试、部署、安全扫描一体化
运维·安全·ci/cd·自动化·github