Commit Graph

649636 Commits

Author SHA1 Message Date
Cao Jian
c003ef6bea osd: add member copying in CONFIG_COMPAT [1/1]
PD#SWPL-32539

Problem:
on a64_32 platform
green screen if GE2D_STRIDE_CUSTOM is set

Solution:
add member copying in CONFIG_COMPAT

Verify:
c1

Change-Id: I47b3d2bba6eb1825c96416fd593668bb397fde87
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:35 +09:00
fushan.zeng
13e82edf2e linux: reboot power down cpu timeout [1/3]
PD#SH-5853

Problem:
reboot power down cpu timeout

Solution:
power down cpus throug bl31
set PWRN_EN bits

Verify:
S905D3

Signed-off-by: fushan.zeng <fushan.zeng@amlogic.com>
Change-Id: Ib0a9bcf5ef4d0115ba0e83864f6497761050d6f5
2023-04-21 13:52:35 +09:00
renjiang.han
2a0849472a ppmgr: The picture is incorrect due to alignment issues. [1/1]
PD#SWPL-36752

Problem:
The picture is incorrect due to alignment issues using GDC rotation.

Solution:
When using GDC rotation, the width of the buffer and the width
of the effective area are transmitted to the GDC drive.

Verify:
on A311D-W400

Change-Id: I6fabb794750dbb971fc270a174b48dd24965bc9b
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
2023-04-21 13:52:35 +09:00
renjiang.han
0e4bc14772 ppmgr: add support gdc rotate. [1/1]
PD#SWPL-28849

Problem:
ppmgr uses ge2d for lower rotation efficiency.

Solution:
ppmgr uses gdc to do 1080p rotation.

Verify:
on w400

Change-Id: I81c7f3c3ababa2518e733608c89ac50074bbdbe9
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:35 +09:00
renjiang.han
0587c27531 ppmgr: configure buffer and canvas according to rotation requirements. [1/1]
PD#SWPL-27018

Problem:
The mismatch between the width and height of the buffer
and canvas results in garbage.

Solution:
Configure buffer and canvas according to rotation requirements.

Verify:
on U212

Change-Id: Ied08838ad4d4fc7628be55cd2de58f91562030c0
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
2023-04-21 13:52:35 +09:00
renjiang.han
f4bb60c4ff ppmgr: support 4k & 1080 rotation for vdin. [1/1]
PD#SWPL-26142

Problem:
vdin is compressed in 1080 & 4k output, but ppmgr does
not support compressed format.

Solution:
If rotation is required, ppmgr informs vdin to output yuv.

Verify:
ab301

Change-Id: Ifebda530dad1c1a57a0415389543d48a8d4fbef2
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
2023-04-21 13:52:35 +09:00
renjiang.han
24b9f69d9d ppmgr: The picture format is not rotated. [1/1]
PD#SWPL-18297

Problem:
The picture shows abnormality after ppmgr.

Solution:
The picture format is not rotated.

Verify:
on U212

Change-Id: I259554c2f7cb3a5eeb4e90c1c3e135d5005a6f01
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
2023-04-21 13:52:34 +09:00
Cao Jian
9587417431 gdc: add the stride support in gdc_process_phys [1/1]
PD#SWPL-36752

Problem:
Support the stride in physical address configuration

Solution:
add this support

Verify:
verified on g12b

Change-Id: Ic85384af6b67687e9f437319f6bc397c6e39a0cc
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:34 +09:00
Tao Zeng
9219f9ded0 rodata: fix compile error of rodata optimize [1/1]
PD#SWPL-31258

Problem:
Compile failed after merge https://scgit.amlogic.com/#/c/120275/

Solution:
Fix it

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: Ida94b0853baca9126b145e378d69b657b9cd4419
2023-04-21 13:52:34 +09:00
Tao Zeng
1c6529b998 rodata: optimize memory usage of rodata section [5/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, replace __FILE__ definition, using relative path instead of
absolute path. This can help to save about 50KB memory. For example:
[   36.820945@0] WARNING: CPU: 0 PID: 4817 at /mnt/fileroot/tao.zeng/p-android/
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 common/drivers/amlogic/memory_ext/page_trace.c:973
				 ~~~~~~ absolute path
		 pagetrace_write+0x10/0x18
[   42.792868@1] WARNING: CPU: 1 PID: 4864 at drivers/amlogic/
                 memory_ext/page_trace.c:973 pagetrace_write+0x10/0x18

2, replace __FUNC__ definition. using kallsyms interface to print function
instead of build in const string. This change can save about 100KB rodata.

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I65e4e9eb61a2226002557759833e4e16ed37b92e
2023-04-21 13:52:34 +09:00
Tao Zeng
2a7548129f rodata: optimize memory usage of rodata section [4/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, optimize kallsyms compress code. This can help to increase
about 18% of compress ratio and save about 200 ~ 500KB under
different config.

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I4c058fbb22d89bc50c81fa3266ee0f7613f076f2
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2023-04-21 13:52:34 +09:00
Tao Zeng
5b574c9eda mm: add more functions to check cma alloc/free user [1/1]
PD#SWPL-5301

Problem:
Sometimes we need to catch who allcated/free cma pools

Solution:
Add more functions in pagetrace

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I06c114441fc20c8fbde853be9ecb0fc96fd00111
2023-04-21 13:52:34 +09:00
Tao Zeng
ea094c64aa mm: fix Lost RAM too large problem when playing 4k [1/2]
PD#SWPL-16990

Problem:
Lost RAM will be over 200MB when playing 4K.

Solution:
Add cma pages in /proc/meminfo and give a information
for android layer to count them.

Verify:
x301

Change-Id: I99d1ded53ed351a5cb0d24f0e03850a55ef0d272
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2023-04-21 13:52:34 +09:00
Tao Zeng
9a149fa4b0 rodata: optimize memory usage of rodata section [3/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, remove CONFIG_KALLSYMS_ALL in module.c, which can help to save
about 200KB module memory during runtime compared from /proc/pagetrce:
           3068,         c020edd8, module_alloc   -- before
           2776,         c020edd8, module_alloc   -- after

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I15acee0df76f74a04c10d8f290d10fc35d51a283
2023-04-21 13:52:34 +09:00
Tao Zeng
fca514c91e rodata: optimize memory usage of rodata section [2/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, remove CONFIG_KALLSYMS_ALL in scripts, which can help to save
about 1MB ro data in code size.

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: Ie0387da46c6b789cb4f8c5d7e2128238e3986da0
2023-04-21 13:52:34 +09:00
Tao Zeng
313fd8232d rodata: optimize memory usage of rodata section [1/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, remove all # lines in .config when generate /proc/config.gz, which can
save about 20KB ro-memory.

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I80b85b006ddec3bbcfb9c8921eb59577af49ad0d
2023-04-21 13:52:34 +09:00
Arnd Bergmann
e6a1386f32 module: fix DEBUG_SET_MODULE_RONX typo
PD#SWPL-31258

[ Upstream commit 4d217a5adc ]

The newly added 'rodata_enabled' global variable is protected by
the wrong #ifdef, leading to a link error when CONFIG_DEBUG_SET_MODULE_RONX
is turned on:

kernel/module.o: In function `disable_ro_nx':
module.c:(.text.unlikely.disable_ro_nx+0x88): undefined reference to `rodata_enabled'
kernel/module.o: In function `module_disable_ro':
module.c:(.text.module_disable_ro+0x8c): undefined reference to `rodata_enabled'
kernel/module.o: In function `module_enable_ro':
module.c:(.text.module_enable_ro+0xb0): undefined reference to `rodata_enabled'

CONFIG_SET_MODULE_RONX does not exist, so use the correct one instead.

Fixes: 39290b389e ("module: extend 'rodata=off' boot cmdline parameter to module mappings")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jessica Yu <jeyu@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Change-Id: I3ed114cc957edca46684dc14bc47e133cd1725de
2023-04-21 13:52:34 +09:00
Cao Jian
479ffdf842 gdc: add a probed flag to avoid crash [1/1]
PD#SWPL-29848

Problem:
on platforms which GDC are not supported
if create_gdc_work_queue is invoked
a crash occurs

Solution:
add a probed flag to avoid crash
add a interface is_gdc_supported to query

Verify:
g12b/tm2

Change-Id: I65b88294822d8a2c7429d375039fee962b9612aa
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:33 +09:00
Cao Jian
dfd7a2da8e gdc: support phy addr configuration [1/1]
PD#SWPL-15157

Problem:
GDC Driver Support physical address configuration

Solution:
add this support

Verify:
verified on g12b

Change-Id: I8aee517a13bb2a65c021279cc3b54bd9861fc20c
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:33 +09:00
hang cheng
3cdb821e1b hdmitx: double confirm the ACR packet is enabled [1/1]
PD#SWPL-34731

Problem:
the ACR packet is not enabled with very low probability

Solution:
double confirm the ACR packet is enabled
simultaneously with audio sample packet

Verify:
AC214

Signed-off-by: hang cheng <hang.cheng@amlogic.com>
Change-Id: Ie7a142a739f8928b34dd1904176786f8664d6f18
2023-04-21 13:52:33 +09:00
renjiang.han
49eba5bef4 ppmgr: rotate to exit with garbage. [1/1]
PD#SWPL-35488

Problem:
rotate to exit with garbage.

Solution:
after unreg is over, the buffer of ppmgr is released.

Verify:
on X301

Change-Id: I40cd59db0dee442fde034ccfb1c3f1afe86eb3ff
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:33 +09:00
Cao Jian
af20988661 osd: use viu2 logo output size for viu1 mode switch [1/1]
PD#SWPL-34685

Problem:
for dual logo, if viu1 interface(such as hdmi) is unplugged when booting
the viu2 display device will be used for viu1 after booting

Solution:
use viu2 logo output size for viu1 mode switch

Verify:
on sm1

Change-Id: I90819039fe46edc33d93d0114bdadb4c0de97b1e
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:33 +09:00
“maolin.zhou”
1c4c10f09e tsync: apts lookup failed because interpolate calc method invalid [1/1]
PD#SWPL-31520

Problem:
Because interpolate threshold setting is too small, this will lead to
failure of using the interpolate calculation method to look up right
audio pts.

Solution:
Increase the threshold of the apts interpolate value

Verify:
U212

Change-Id: I30d4ad7085f4774d932acf557784ffbb85169afb
Signed-off-by: maolin.zhou <maolin.zhou@amlogic.com>
2023-04-21 13:52:33 +09:00
jintao xu
f86181dd9d ionvideo: use alloc canvas [1/1]
PD#SWPL-28070

Problem:
ionvideo use ppmgr canvas

Solution:
ionvideo use alloc canvas

Verify:
T962X2-X301

Change-Id: Ic0f0f39eaeb129c4a5449b795dcb367964073275
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
2023-04-21 13:52:33 +09:00
Zongdong Jiao
2c8a794002 hdmitx: fix wrong color under 480i/576i, Y422 [1/1]
PD#SWPL-31602

Problem:
Lack y422 setting for 480i/576i

Solution:
Add y422 setting for 480i/576i

Verify:
SM1/Newton

Change-Id: I3a1b766fc3e87dc70592cb3c3c4db8527ce9037d
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
2023-04-21 13:52:33 +09:00
Pengcheng Chen
f7c31b27d8 osd: osd not divide when format RGBX [1/1]
PD#SWPL-32340

Problem:
osd display abnormal when layer is premult_en and rgbx

Solution:
osd not divide when format RGBX

Verify:
u215

Change-Id: Icac55eddd3b5ca47350a585a377d2a54e3e5b0b1
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2023-04-21 13:52:33 +09:00
Zhengrong.Zhu
5bd85810ae hdmitx: In HDMI2.0 certification test, cannot be switched to 420 [1/1]
PD#SWPL-25446

Problem:
In the empty capmap processing, create the bitmap errorly.

Solution:
In the empty capmap processing, modify the code about the bitmap.

Verify:
Verify on the board of U212

Change-Id: I26d4d07692557c8d6b0df0c984282f81e13ab6c4
Signed-off-by: Zhengrong Zhu <zhengrong.zhu@amlogic.com>
2023-04-21 13:52:33 +09:00
Zongdong Jiao
df12ca3fee hdmitx: need to support 1080i mode for DVI case [1/1]
PD#SWPL-23446

Problem:
The HDMI ATC Lab requires to support 1080i mode for DVI case

Solution:
Add 1080i mode for DVI case

Verify:
G12

Change-Id: I9285a9669176793e55a6f0fe8007702b4c2f239f
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
2023-04-21 13:52:33 +09:00
Zongdong Jiao
8696ec962f hdmitx: remove DDC glitch filter in plugout [1/1]
PD#SWPL-22926

Problem:
hdcp_tx22 may still work at the beginning of plugout, and reset
DDC glitch filter may hold SDA as low

Solution:
Remove DDC glitch filter in plugout

Verify:
sm1

Change-Id: Ifdc760f8246ee38ab2525835be5d29fd37cdfc7c
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:33 +09:00
Zongdong Jiao
8b50f64bd3 hdmitx: resend scdc/div40 in probe stage [1/1]
PD#SWPL-25274

Problem:
The TV and mbox may power up simutanously. If the uboot output
4k 4.5G or 6G signal, it also send the SCDC/DIV40, but TV may
discard DIV40 during itself bootup. And next TV will generate
the HPD, but mbox may discard this HPD during the probe stage.
So TV may display nothing, while mbox still output normally.

Solution:
Resend scdc/div40 in probe stage

Verify:
G12

Change-Id: I3276889541596b42acc6d0e05a48953a4e9a63b1
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
2023-04-21 13:52:33 +09:00
Zongdong Jiao
d8544983eb hdmitx: add hdcp limitation [1/1]
PD#SWPL-24787

Problem:
For some type's chip, there is no 4k output, and there
will no need the hdcp22

Solution:
Add hdcp limitation

Verify:
805x/y

Change-Id: I36bf7b89d614a738bfca2d5c50a14d2355063792
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
2023-04-21 13:52:33 +09:00
changqing.gao
10339a40a3 config: remove unused configs on ref-board [1/1]
PD#SWPL-27983

Problem:
code size of kernel is too large

Solution:
remove unused but default enabled configs for refernce-board
merge from:a3242b3096d5b9423105e2695723244e7edee433

Verify:
ac214

Change-Id: I9b66178acf67971c0144c4b7141d676866d7b65a
Signed-off-by: changqing.gao <changqing.gao@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:32 +09:00
Tao Zeng
c97cac5c71 config: remove unused configs on ref-board [1/1]
PD#SWPL-27983

Problem:
code size of kernel is too large

Solution:
remove unused but default enabled configs for refernce-board
code size comparison(base on ARMv7):
------------------------------------------
             |   before(KB)  |   after(KB)
------------------------------------------
kernel code: |    14336      |   11456
rwdata:      |     1352      |    1195
rodata:      |     5144      |    4560
init:        |     1024      |    1024
bss:         |     1379      |    1327
------------------------------------------
summary:     |    22211      |   18538
------------------------------------------

This change can save about 3.6MB kernel code size

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: Iafc4b2a2b8dc55a42fbee197cc7272fd2c476cec
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:32 +09:00
long.yu
351c78def9 emmc: save clock reg after cali failure [1/1]
PD#SWPL-30974

Problem:
don't need to save the value of
the Clock register after a calibration failure

Solution:
save clock register

Verify:
txl

Change-Id: I79799967ee3417600df960492a94f868427effb2
Signed-off-by: long.yu <long.yu@amlogic.com>
2023-04-21 13:52:32 +09:00
Nanxin Qin
4be10acc4e media: fixed issue of fastplay mode. [1/2]
PD#SWPL-30672

Problem:
1. echo 1 > /sys/class/codec_mm/fastplay_enable
fail with single mode playback on arch 32bit.

2. add codec_mm_memset to avoid vmap fail.

Solution:
fixed issue of reserve memory alloc from CMA.

Verify:
u212

Change-Id: I8823427dfde16d1811132d11c8bab0fe71f1d641
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
2023-04-21 13:52:32 +09:00
Chris
8cf2c7456b ODROID-G12: Add picdec for imageserver.
Change-Id: Ic42dfe19241596079a8a5927ba9a38655589d7e7
2023-04-17 12:32:19 +09:00
Luke Go
e820bc3314 ODROID-COMMON: arm64/dts: g12: Add new uart a pinctrl.
- mesong12b have a_uart_pins pinctrl set that separate mux with cts. So
  if you want to remove cts and rts from pinctrl, have to redefined or
  make new one. this patch add new pinctrl to use only rx and tx pin of
  uart a.

Signed-off-by: Luke Go <sangch.go@gmail.com>
Change-Id: Id18893a943b9937855317cbe1adac3a78261d4f6
2023-04-17 12:32:19 +09:00
Luke Go
600936d78d ODROID-G12: arm64/overlays: Moved uart pinmux to overlay.
Signed-off-by: Luke Go <sangch.go@gmail.com>
Change-Id: I865665108503c45e6ba5f9721fec6add5932dcc9
2023-04-17 12:32:19 +09:00
Hyeonki Hong
f92e4a25e7 ODROID-COMMON: arm64/dts: g12: set uart_a cts/rts to disable
Change-Id: Ia2a22e6d294605bddf612cb763f700594fb2176b
(cherry picked from commit 5a7fddf46c5709e7c05e77c189a902dec2364d1e)
2023-04-17 12:32:19 +09:00
Chris
6ce28606e6 ODROID-G12: Fix passthrough not working
Android does not need hdmitx_ext_set_i2s_mask with vu7c.

Change-Id: Id31292e36cde63618c4a2b402451d503f3923be5
2023-04-11 15:27:01 +09:00
Chris
5ce5a126a8 ODROID-N2: Add RTL8152/3 Driver.
Change-Id: I4b330123335e27430f94c1c822192b4c01ed3d69
2023-03-16 12:14:00 +09:00
Chris
7153b96d49 ODROID-N2L: Fix dts for USB devices.
Change-Id: I50db6bf0393e201fd4011a6ee9c63023bcfef00f
2022-12-16 11:07:01 +09:00
Chris
57d82246a9 ODROID-N2L: Delete pcf8563 rtc from dts.
Change-Id: Id86065b8098a0c1ddadf920ca4b0077b3d8da71d
2022-11-02 13:50:18 +09:00
Chris
ceed7aa5bc ODROID-N2L: Add pcf8563 dtbo for RTC Shield.
Change-Id: Id786921d1c34895cfb9f1291fdc7c49f3d821c9f
2022-11-02 09:08:49 +09:00
Chris
38775d03e8 ODROID-G12: Fix to enable multi-touch for goodix.
Change-Id: I487efc66ee2e0a48daa384e88eed800e1eae9948
2022-10-27 15:10:23 +09:00
Chris
b5c616e80e ODROID-G12: Enable to change orientation for goodix.
referenced:
https://gitlab.com/AdyaAdya/goodix-touchscreen-linux-driver

Change-Id: I117e7d2a7fd701ef1a3cf6a1198809c4d4a09603
2022-10-27 15:10:03 +09:00
Simon Beginn
dd09367e7a Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
[ Upstream commit cffdd6d904 ]

The touchscreen on the Teclast x98 Pro is also mounted upside-down in
relation to the display orientation.

Signed-off-by: Simon Beginn <linux@simonmicro.de>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Link: https://lore.kernel.org/r/20201117004253.27A5A27EFD@localhost
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Change-Id: Id643f6a3314b4808d3ec98e92107ab719a17dd7c
2022-10-27 15:09:42 +09:00
Hans de Goede
c5557f488f Input: goodix - add upside-down quirk for Teclast X89 tablet
commit df5b5e555b upstream.

The touchscreen on the Teclast X89 is mounted upside down in relation to
the display orientation (the touchscreen itself is mounted upright, but the
display is mounted upside-down). Add a quirk for this so that we send
coordinates which match the display orientation.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
Link: https://lore.kernel.org/r/20191202085636.6650-1-hdegoede@redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Idab48cdbdf6791021543aa4b33d87d341c9ab0e8
2022-10-27 15:09:18 +09:00
Marcin Niestroj
f467f6e1a0 Input: goodix - use generic touchscreen_properties
Use touchscreen_properties structure instead of implementing all
properties by our own. It allows us to reuse generic code for parsing
device-tree properties (which was implemented manually in the driver for
now). Additionally, it allows us to report events using generic
touchscreen_report_pos(), which automatically handles inverted and
swapped axes.

This fixes the issue with the custom code incorrectly handling case where
ts->inverted_x and ts->swapped_x_y were true, but ts->inverted_y was
false. Assuming we have 720x1280 touch panel, ts->abs_x_max == 1279 and
ts->abs_y_max == 719 (because we inverted that in goodix_read_config()).
Now let's assume that we received event from (0:0) position (in touch
panel original coordinates). In function goodix_ts_report_touch() we
calculate input_x as 1279, but after swapping input_y takes that value
(which is more that maximum 719 value reported during initialization).

Note that since touchscreen coordinates are 0-indexed, we now report
touchscreen range as (0:size-1).

Developed and tested on custom DT-based device with gt1151 touch
panel.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
[dtor: fix endianness annotation reported by sparse, handle errors when
 initializing MT slots]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Change-Id: I3fdd49b7357ca94111fde041c295a4a548ba109b
2022-10-27 15:08:57 +09:00
Marcin Niestroj
9875ffd457 Input: goodix - support gt1151 touchpanel
Support was added based on Goodix GitHub repo [1]. There are two major
differences between gt1151 and currently supported devices (gt9x):
 * CONFIG_DATA register has 0x8050 address instead of 0x8047,
 * config data checksum has 16-bit width instead of 8-bit.

Also update goodix_i2c_test() function, so it reads ID register (which
has the same address for all devices) instead of CONFIG_DATA (because
its address is known only after reading ID of the device).

[1] https://github.com/goodix/gt1x_driver_generic

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Change-Id: I12f2f9e745c2f14ff45b3f967fbf91e629230989
2022-10-27 15:08:32 +09:00