aboutsummaryrefslogtreecommitdiffstats
path: root/src/linux/i2c.c
Commit message (Collapse)AuthorAgeFilesLines
* linux: forward i2c errors to i2ccmdTimofey Titovets2024-10-261-7/+15
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c: handle errors at i2ccmdsTimofey Titovets2024-10-261-2/+7
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* linux: Allow for more i2c busesCarl Richard Theodor Schneider2024-03-211-1/+1
| | | | | | | | | | | | | | | Similar to commit df79893, this allows klipper to use up to /dev/i2c-14. Similar to before, this limit is arbitrary. This is required for some other SoCs, which have even more i2c buses available, e.g. the rk3399: $ ls -1 /dev/i2c-* /dev/i2c-0 /dev/i2c-3 /dev/i2c-7 Signed-off-by: Carl Richard Theodor Schneider <dev.github@crtified.me>
* linux: Fast Linux MCU i2c_read() with I2C_RDRW (#6101)Dr. Matthew Swabey2023-03-141-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | Reading an I2C device from the Linux MCU used a separate write(2) to select the target register & read(2) to get the value(s). This implementation uses ioctl(file, I2C_RDWR, ...) to skip a large bus idle period and extra process sleep by combining them like the stm32. I2C_RDRW requires I2C_FUNC_I2C flag in the I2C driver. I2C_FUNC_I2C is defined in: BCM2835: Pi 1 Models A, A+, B, B+, the Raspberry Pi Zero, the Raspberry Pi Zero W, and the Raspberry Pi Compute Module 1 BCM2836: Pi 2 Model B Identical to BCM2835 except Cortex BCM2837: Pi 3 Model B, later models of the Raspberry Pi 2 Model B, and the Raspberry Pi Compute Module 3 BCM2837B0: Pi 3 Models A+, B+, and the Raspberry Pi Compute Module 3+ BCM2711: Pi 4 Model B, the Raspberry Pi 400, and the Raspberry Pi Compute Module 4 RK3xxx: Rockchips SoCs NanoPi, RockPi, Tinker, etc. SUNXI: H2, H3, etc. Orange Pi AMLOGIC: S905x, Banana Pi, Odroid, etc. TEGRA: NVidia Jetson etc. MediaTek: Several SBCs in other ranges Signed-off-by: Matthew Swabey <matthew@swabey.org>
* linux: Update i2c.c (#5295)Blinker732022-03-141-1/+1
| | | | | | | | | | | | | | | Similarly to commit 8cf1b512 for SPI, the Rpi4 has more i2c busses to offer This change allows klipper to use up to I2c bus 6 /boot/configtxt dtparam=i2c_arm=on dtoverlay=i2c6 and pi@fluiddpi:~ $ ls -1 /dev/i2c* /dev/i2c-1 /dev/i2c-6 Signed-off-by: Sylvain Dansereau <brutus_dansereau@hotmail.com>
* htu21d: Support for HTI21D family sensor on I2C bus (#2803)Lucio Tarantino2020-05-031-1/+2
| | | Signed-off-by: Lucio Tarantino <lucio.tarantino@gmail.com>
* linux: implement i2cArksine2020-01-131-0/+101
Signed-off-by: Eric Callahan <arksine.code@gmail.com>