Commit Graph

71 Commits

Author SHA1 Message Date
CTCaer
9b2026ac6e bdk: touch: homogenize return values 2026-02-22 02:50:45 +02:00
CTCaer
cb81aaecdb bdk: i2c: homogenize return values 2026-02-22 02:42:53 +02:00
CTCaer
2824dff8f0 bdk: touch: check event count for wait event
And increase checks during autotune execution.
2026-02-21 09:15:15 +02:00
CTCaer
3e141fba20 bdk: touch: simplify input reporting
Additionally, touch polling now returns 1 for no event result.
2026-02-20 02:50:18 +02:00
CTCaer
c067c113e6 bdk: touch: switch to custom chip info cmd
And also check if chip id is correct on init.
2026-02-20 02:39:54 +02:00
CTCaer
98c14fd3c1 bdk: touch: use packet i2c for all transfers
The repeating byte doesn't exist in i2c packet mode.
Additionally, adjust split transfers to one.
2026-02-20 02:36:38 +02:00
CTCaer
f6bf40b903 bdk: touch: refactor
And also use packet mode for big tx/rx combo i2c trasnfers.
2026-02-20 00:43:58 +02:00
CTCaer
0a55598ab6 bdk: touch: refactor/improve
- Remove useless poll wait
- Use more defines
- Deduplicate code
- Add more checks
- Add switch sense mode
2026-02-15 02:32:38 +02:00
CTCaer
0da69efd07 bdk: pinmux: always detach I2C4 pins from I2C3 pm
Generally I2C3 communication can work via I2C3 or I2C4 pins.
Defaults are fine as long as one of the pin groups are floating or grounded or
both share I2C traces.

In NX boards I2C4 SDA is used for GC and connected to 1V8.
So if a GC is slotted, I2C3 works, if not, no communication is possible.

This config was done previously inside I2C3 consumer driver (touchscreen).
Now it's moved inside pinmux_config_i2c.
2026-01-21 23:49:59 +02:00
CTCaer
74972a68df bdk: joycon: make init stricter but relax timings
Additionally, if both Joy-Con are found, try to send rumble simultaneously.
2026-01-20 20:03:38 +02:00
CTCaer
bf5a7b1a12 bdk: joycon: more refactoring 2026-01-12 03:08:20 +02:00
CTCaer
d94f356bf5 bdk: joycon: generalize _jc_packet_add_uart_hdr
Correct its header construction in case it's used in the future.
Plus some unhardcoding of lengths.
2026-01-11 17:24:18 +02:00
CTCaer
876d6adbe7 bdk: joycon: increase connection timeout to 1.8s 2026-01-11 17:06:48 +02:00
CTCaer
b4fcc72b6b bdk: joycon: refactor some fields
And add better comments.
2026-01-11 17:05:37 +02:00
CTCaer
928985ced1 bdk: joycon: use packed structs and bitfields 2026-01-10 13:39:06 +02:00
CTCaer
8123de714a bdk: joycon: correct crc8 offsets
By luck the current offset and length of the calculation always worked.
Correct it though because the function might be used fully in the future.
2026-01-10 13:36:34 +02:00
CTCaer
f05759e0f2 bdk: joycon: maintain consistent naming styles 2026-01-10 13:32:46 +02:00
CTCaer
76cb5422e3 bdk: joycon: optimize rumble enable 2026-01-06 23:14:11 +02:00
CTCaer
c03757e73d bdk: joycon: improve charger config
Utilize charger config set command which allows for supplement mode.
Additionally, remove ping config when SIO and parse buttons/sticks on subcmd reports.
2025-12-27 06:06:17 +02:00
CTCaer
05cc9b6985 bdk: refactor several comments and defines 2025-06-22 13:32:32 +03:00
CTCaer
811971dfa0 bdk: als: no need to check above 255 with u8 2025-04-30 09:13:19 +03:00
CTCaer
b1bc6ebdd8 bdk: joycon: utilize packet id per joycon
Also fix a possible infinite loop
2024-10-04 21:39:35 +03:00
CTCaer
9d79af231e bdk: use static where it should 2024-06-02 07:09:34 +03:00
CTCaer
7a74761da9 bdk: bpmp: add and use bpmp_clk_rate_relaxed 2024-06-02 06:51:06 +03:00
CTCaer
93296c2c38 bdk: joycon: add packet size checks
Pass the real received data size and do the proper checks for minimum info.
2024-05-19 17:42:10 +03:00
CTCaer
7af343dd6c bdk: input: make joycon detection more robust
There's a hw bug on the gpio controller that can latch the last value on reads.
Mitigate that by reading once to unlatch the input value.

Also actually allow sio to be polled every 8ms.
2024-05-19 10:19:25 +03:00
CTCaer
28960728f9 bdk: joycon: add bit numbers on the button struct 2024-04-25 04:46:27 +03:00
CTCaer
902ccede9a bdk: joycon: use proper bits for batt levels 2024-04-25 04:45:50 +03:00
CTCaer
eff55ff378 bdk: touch: rename samsung touch panel
BH2109 is the board model and not the touch panel.
2023-12-25 02:41:42 +02:00
CTCaer
ce137852b7 bdk: change some defines and comments 2023-10-12 06:59:15 +03:00
CTCaer
fdf0dcc636 bdk: joycon: add info about sio imu report 2023-08-22 14:36:23 +03:00
CTCaer
d7ad9b874b bdk: use the typedefs on jc calib 2023-06-11 13:27:48 +03:00
CTCaer
bc0eea11f3 bdk: joycon: add calibration struct 2023-06-08 02:44:35 +03:00
CTCaer
50811aacfa bdk: touch: reorder power on
So touch IC reset can be properly done on a fast power cycle.
2023-03-31 09:08:20 +03:00
CTCaer
9a98c1afb9 bdk: stylistic corrections
And update copyrights
2023-02-11 23:46:38 +02:00
CTCaer
5bb9a244ea bdk: utilize new gpio functions 2023-02-11 23:08:32 +02:00
CTCaer
ff5ee9758d bdk: joycon: refactor some structs and comments 2022-10-11 03:49:18 +03:00
CTCaer
70523e404f bdk: whitespace refactor 2022-07-11 22:10:11 +03:00
CTCaer
b787053c2d bdk: joycon: fixup hori pads
For Hori game pads:
- Restore the no power down fix
- Revert RTS signal back to active high
2022-07-01 13:47:41 +03:00
CTCaer
b0c0a86108 bdk: migrate timers/sleeps to timer driver 2022-06-27 10:22:19 +03:00
CTCaer
9e613a7600 bdk: hwinit: simplify uart debug port paths 2022-05-13 03:56:59 +03:00
CTCaer
f31170bb51 bdk: joycon: add Sio support (for Hoag) 2022-05-09 06:09:06 +03:00
CTCaer
47d06d0e8a bdk: joycon: use flow control to improve packet integrity 2022-05-09 05:55:06 +03:00
CTCaer
2aed1b3b83 bdk: joycon: add 3 mbaud support and full init
Additionally use states for proper init
2022-05-09 05:48:10 +03:00
CTCaer
833a115eb2 bdk: joycon: improve and streamline jc detect 2022-05-09 05:39:45 +03:00
CTCaer
9f30c51bd1 bdk: joycon: refactor driver 2022-05-09 05:32:32 +03:00
CTCaer
f7bf4af3ec bdk: uart: refactor and add new functionality
- Allow to set CTS/RTS mode (only specific combos supported for now)
- Support the above modes in receiving
- Set 2 stop bits to decreases errors on high baudrates
2022-05-08 05:45:16 +03:00
CTCaer
70504c295e bdk: various functionality independent changes 2022-01-16 01:03:24 +02:00
CTCaer
09b3e47ac8 bdk: touch: rename samsung touch panel 2021-10-19 09:11:58 +03:00
CTCaer
6992ece762 bdk: touch: add samsung touch model name 2021-10-15 16:09:25 +03:00