元太电磁膜SUDE-10S19MI-01X驱动适配

屏规格书:
在这里插入图片描述

dts配置:
首先要确保CONFIG_I2C_HID宏打开,i2c-hid-core.c 文件才能编译进去代码。规格书vendor product 分别为0x2d1f 和0x0165 来区别,不至于影响到整体的hid其他设备。

   +  i2c-hid-dev@10 {
	 +  compatible = "hid-over-i2c";
	 +	reg = <0x10>;
	 +	hid-descr-addr = <0x0001>;
	 +	interrupt-parent = <&gpio0>;
	 +	interrupts = <6 0x0>;
	 +	post-power-on-delay-ms = <70>;
	 +	vdd = "vdd-supply";
	 +	status ="okay";
	 + };


hid-input.c 文件里面根据实际情况,是否实际需要x,y坐标是否需要反,或x , 或y 反,或x,y都反。
hidinput_configure_usage函数。这里面x,y需要对调,而且x,还需要最大变最小,最小变最大逻辑 20320-value

static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,
				     struct hid_usage *usage)
{


 +if((device->vendor==0x2d1f)&&(device->product==0x0123))
 +{
 +       if(b==20320)
 +       {
 +       	b=15240;
 +       }
 +      else if(b==15240){
 +          b= 20320;
 +       }
 +}



		if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK)
			input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4);
		else	input_set_abs_params(input, usage->code, a, b, 0, 0);











	  (!test_bit(usage->code, input->key)) == value)
		input_event(input, EV_MSC, MSC_SCAN, usage->hid);

	input_event(input, usage->type, usage->code, value);

	//input_event(input, usage->type, usage->code, value);
 + if((hid->vendor==0x2d1f)&&(hid->product==0x0123))
 + {
 +	    if(usage->code == ABS_X)
 +	     input_event(input, usage->type, ABS_Y, value);
 +      else if(usage->code == ABS_Y)
 +	     input_event(input, usage->type, ABS_X, 20320-value);
 +	    else
 +	       input_event(input, usage->type, usage->code, value);
 +  }
 +  else
 + {
 +     input_event(input, usage->type, usage->code, value);
 + }





	if ((field->flags & HID_MAIN_ITEM_RELATIVE) &&
	    usage->type == EV_KEY && value) {










}


frameworks/base/data/keyboards/Vendor_2d1f_Product_0165.idc 添加此文件

# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Emulator keyboard configuration file #1.
#
#touch.orientationAware touch x y


touch.deviceType = touchScreen
touch.orientationAware = 1

keyboard.layout = qwerty
keyboard.characterMap = qwerty
keyboard.orientationAware = 1
keyboard.builtIn = 1

cursor.mode = navigation
cursor.orientationAware = 1

屏规格书

  • 30
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

baidu_37552881

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值