-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Sim/gpiochip: sim gpiochip support nuttx access host gpiochip #17719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
acassis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yezhonghui2024 Please include Documentation explaining how to test it. Please include the host commands as well
The relevant commands for the host side, and test procedures test results have been supplemented. @acassis |
|
@yezhonghui2024 thank you, but I mean in the Documentation/
New features require Documentation, otherwise users will not know how to use it and it will become another hidden features (NuttX has a lot of it) |
ba62374
c044148 to
ba62374
Compare
okay,I got. nuttx/Documentation/components/drivers/special/sim_gpiochip.rst add @acassis |
|
@yezhonghui2024 your Documentation is excellent! Really detailed, this is the kind of Documentation we need on NuttX. Please also add later the host prepare steps you added here in the summary. It could be inside a new sim:gpiochip board profile example Documentation/, so please submit the gpiochip board profile that you used for testing. This way someone willing to test it will just run: and follow the testing steps from Documentation. |
ba62374 to
5038556
Compare
In test section, I add the host prepare steps already,it need a CH341A USB to SPI I2C Serial Adapter Module - Programmer/Converter and I support host drivers source. I don't see any meaningful advantages in introducing a sim:gpiochip board |
bbc45bf to
30b1be9
Compare
Remember: after the PR is merged and closed it will be difficult to end user find this PR with the test, this is why we need it in the Documentation. |
add sim gpiochip driver Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
fix gpio pinval issue Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
sim gpiochip ioexpander export to user Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
30b1be9 to
5a7ab1c
Compare
Documentation update: Add host setup prerequisites and external references to sim_gpiochip.rst @acassis |
@yezhonghui2024 I failed to find these steps in the Documentation: Testing prepare: 4.CONFIG_SIM_GPIOCHIP=y Maybe you forgot to push the Documentation modification, I noticed your last commit didn't modify any file inside Documentation/ |
Documentation/platforms/sim/sim_gpiochip.rst has follow information
|


Note: Please adhere to Contributing Guidelines.
Summary
add gpiochip in sim platform
Impact
sim can access host gpiochip hardware via sim gpiochip driver
Testing
prepare:
need a ch341A usb module(CH341A USB to SPI I2C Serial Adapter Module - Programmer/Converter)
host driver reference open source driver
https://github.com/frank-zago/ch341-i2c-spi-gpio;make and install ko
sudo insmod ch341-core.ko
sudo insmod gpio-ch341.ko
sudo insmod i2c-ch341.ko
sudo insmod spi-ch341.ko
ls /dev check /dev/gpiochipX exist
4.CONFIG_SIM_GPIOCHIP=y
CONFIG_SIM_GPIOCHIP_NAME="/dev/gpiochipX"
[ 73.170835] [61] [ INFO] [ap] [==========] tests: Running 4 test(s).
[ 73.170856] [61] [ INFO] [ap] [ RUN ] drivertest_gpio_bool
[ 73.171065] [61] [ INFO] [ap] [ OK ] drivertest_gpio_bool
[ 73.171076] [61] [ INFO] [ap] [ RUN ] drivertest_gpio_loop
[ 73.171114] [61] [ INFO] [ap] [ OK ] drivertest_gpio_loop
[ 73.171118] [61] [ INFO] [ap] [ RUN ] drivertest_gpio_rw
[ 73.171243] [61] [ INFO] [ap] [ OK ] drivertest_gpio_rw
[ 73.171247] [61] [ INFO] [ap] [ RUN ] drivertest_gpio_interrupt
[ 75.542250] [61] [ INFO] [ap] [ OK ] drivertest_gpio_interrupt
[ 75.542270] [61] [ INFO] [ap] [==========] tests: 4 test(s) run.
[ 75.542275] [61] [ INFO] [ap] [ PASSED ] 4 test(s).