Commit Graph

324 Commits

Author SHA1 Message Date
Xiang Xiao eddd90de78 poll: pollsetup should notify only one fd passd by caller
since it's redundant to iterate the whole fds array in setup

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-11-21 09:07:17 +01:00
raiden00pl b565e28da3 Kconfigs: rename {Rpmsg|rpmsg} to RPMGS 2023-10-28 13:58:56 +08:00
hujun5 66fa229fcc Fix some typos in comments
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-10-11 08:14:49 +02:00
liushuai25 10fce11e19 After turning on the system by power button, the first press of the power button is ineffective.
Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 08:31:44 +03:00
chenrun1 dd4055be78 button_upper.c:Modify the unknown command message level in ioctl to iinfo
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-09-08 15:55:28 +03:00
chao an 664927c86e mm/alloc: remove all unnecessary cast for alloc
Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 14:34:20 +08:00
chao an b60f01a55b inode/i_private: remove all unnecessary cast for i_private
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 08:58:07 +02:00
chao an 7aa45305b7 fs/inode: remove all unnecessary check for filep/inode
Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 09:47:11 +08:00
xuxin19 f2f0d7fbad cmake:fix drivers build block during cmake reforming
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-16 22:38:52 +08:00
liuhongchao f9dbeaef86 drivers/input:fix circbuf leak
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-14 20:40:11 +08:00
hujun5 c712a00620 drivers/input: rm sched_[un]lock
We use enter_critical_section to protect the read and write of priv structures,
sched_lock is mainly used to prevent active context switching caused by nxsem_post.
We do not actively switch contexts when reading and writing priv structures,
so sched_lock can be removed.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-12 23:32:38 +08:00
liuhongchao 69b655f4b2 drivers/input:support mouse driver
Implement mouse driver lower upper

Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-11 20:37:11 +08:00
liuhongchao 7dde402982 drivers/input:Fix setting the number of keyboard driver buffers fails
Buffer nums is not multiplied by the structure size

Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-11 13:17:54 +08:00
zhanghu5 5890fde1ed drivers/input: Implement the debounce in button_upper.c
use delay configurable watchdog to implement debounce

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2023-08-10 23:14:26 +08:00
yintao 26f996b927 nuttx/input: fix uinput_rpmsg_device_destroy crash
Signed-off-by: yintao <yintao@xiaomi.com>
2023-08-10 23:13:40 +08:00
chao an 6ee9ec7656 build: add initial cmake build system
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)

------------------

How to test

From within nuttx/. Configure:

cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja

(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja

This uses ninja generator (install with sudo apt install ninja-build). To build:

$ cmake --build build

menuconfig:

$ cmake --build build -t menuconfig

--------------------------

2. cmake/build: reformat the cmake style by cmake-format

https://github.com/cheshirekow/cmake_format

$ pip install cmakelang

$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done

Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:50:48 +08:00
Nicolas Caramelli e82b762fb7 input/touchscreen: Translate raw X/Y data into pixel coordinates 2023-07-03 10:17:04 -03:00
TimJTi c904b16cd9 Rename touchscreen ioctls for clarity 2023-05-26 22:42:57 +08:00
Xiang Xiao 51dc67ad5f fs: Add g_ prefix for all global file_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-24 16:13:29 +02:00
chao an 4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
ligd 354abd4e8e uinput: fix uinput compile failed, if no define CONFIG_UINPUT_TOUCH
input/uinput.c:81:28: error: field 'lower' has incomplete type
   81 |   struct touch_lowerhalf_s lower;
      |                            ^~~~~
CC:  pipes/pipe.c

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 10:55:52 +08:00
Lee Lup Yuen 6de5a862cd drivers/input: Add driver for Goodix GT9XX Touch Panel
This PR adds the driver for Goodix GT9XX I2C Touch Panel, which will be called by PINE64 PinePhone.

Our driver follows the design of the NuttX Driver for [Cypress MBR3108](https://github.com/apache/nuttx/blob/master/drivers/input/cypress_mbr3108.c).

We have documented our driver here: ["NuttX Touch Panel Driver for PinePhone"](https://lupyuen.github.io/articles/touch2#appendix-nuttx-touch-panel-driver-for-pinephone)

`drivers/input/Kconfig`: Added option `INPUT_GT9XX` to select GT9XX Driver

`drivers/input/Make.defs`: Added GT9XX Driver to Makefile

`drivers/input/gt9xx.c`, `gt9xx.h`: I2C Driver for GT9XX Touch Panel
2023-01-13 12:19:53 +08:00
Xiang Xiao b0a0ba3ad7 fs: Move mmap callback before truncate in [file|mountpt]_operations
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao 779a610ca3 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
Jukka Laitinen f33dc4df3f Change FIOC_MMAP into file operation call
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen 41e9df2f3e Add ftruncate into file operation calls
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
pengyiqiang c4535ee66a drivers/input/touchscreen_upper: add missing function code comments
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-12-01 10:26:11 +08:00
Xiang Xiao a446b5816f mm/circbuf: Remove MM_CIRCBUF option from Kconfig
since the linker can remove the unused object file from the final image

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 10:18:27 -03:00
yinshengkai 85f727f232 tools: replace INCDIR to Makefile variable
In the past, header file paths were generated by the incdir command
Now they are generated by concatenating environment variables

In this way, when executing makefile, no shell command will be executed,
it will improve the speed of executing makfile
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-03 19:59:55 +08:00
anjiahao d7b4e91dda Call nxsem_destroy or nxmutex_destry in the error path
1.Don't check the return value of nxsem_init or nxmutex_init
2.Fix some style issue

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 13:56:52 +01:00
anjiahao 5724c6b2e4 sem:remove sem default protocl
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
Xiang Xiao dca5a3483f drivers: Destroy mutex and sem in the error path
also correct the order to ensure the memory free is last step

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
anjiahao dee38ce3e8 arch: Replace critical section with nxmutex in i2c/spi/1wire initialization
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
anjiahao d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Fotis Panagiotopoulos bbf3f2866d Fixed non-UTF8 characters. 2022-09-28 09:38:55 +08:00
wangbowen6 344c8be049 poll: add poll_notify() api and call it in all drivers
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-26 12:06:32 +08:00
Nathan Hartman 1913163c64 drivers: Fix some Kconfig help texts 2022-09-13 23:25:47 +08:00
ligd 8a3683fb9f rptun: add ns_match callback to resolve rptun deadlock
thread A: accept -> net_lock -> socket_rpmsg_accept
          -> rpmsg_register_callabck -> rptun_lock
thread B: ns_bind -> rpmsg_socket_ns_bind -> get_tx_payload_buffer
          -> rptun_wait_tx -> usrsock_rpmsg_ept_cb -> usrsockdev_write
          -> net_lock -> deadlock

fix:
add ns_match callback

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-27 20:36:51 +08:00
Petro Karashchenko 09b3fb25ab drivers: remove unimplemented open/close/ioctl interfaces
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-15 16:56:25 +08:00
Jiuzhu Dong d87cf8d4ca fs/poll: change format for type pollevent_t
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-07 12:14:06 +08:00
yinshengkai dfbf06e250 fix uinput rpmsg logic error 2022-04-06 14:36:11 +03:00
Xiang Xiao 7b97b3ad70 input/touchscreen: Fix the typo error
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-28 12:33:48 +03:00
Petro Karashchenko 98ba65c422 c89: get rid of designated initializers in common code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-28 13:39:27 +08:00
Xiang Xiao 7ea14aa8f8 input/keyboard: Make each instance could have a different buffer size
just like what is done for touch screen driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-21 09:03:05 +02:00
Xiang Xiao 7de9b879a1 input/touchscreen: Change the type of touch_upperhalf_s::nums from uint32_t to uint8_t
to align with the type of touch_register

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-21 09:03:05 +02:00
Xiang Xiao 9b2c89fc0e input/uinput: Remove the argument from initialization function
since each type of uinput just need Instantiate one instance

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-21 09:03:05 +02:00
Xiang Xiao fd5fb26f51 input/uinput: Rename UINPUT_TOUCHSCREEN to UINPUT_TOUCH
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-21 09:03:05 +02:00
yinshengkai bfe29c8d1f driver/uinput: add uinput keyboard support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-03-17 19:44:17 +02:00
yinshengkai a0fa07c275 driver/keyboard: add keyboard upperhalf driver
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-03-17 19:44:17 +02:00
yinshengkai c3c6b64cc3 driver/uinput: Add cross core control function
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-03-17 19:44:17 +02:00