Skip to content
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

open i2c device using ioctl is not supported #40

Open
axet opened this issue May 20, 2024 · 1 comment
Open

open i2c device using ioctl is not supported #40

axet opened this issue May 20, 2024 · 1 comment

Comments

@axet
Copy link

axet commented May 20, 2024

Hello!

I'm trying to setup mlx90640 i2c device using CH341T-V3 usb stick. When device opened via ioctl command I get following:

I2C device tree: '/dev/i2c-7'
Starting...
Configured...0
refresh = 0
Ioctl read i2c error:: Operation not supported

Checking the source code it seems like ioctl call failed:

        ioctl_msg[0].len	= 	len;
        ioctl_msg[0].addr	= 	device->addr;
        ioctl_msg[0].buf	=	buf;
        ioctl_msg[0].flags	=	flags | I2C_M_RD;

        /* Package to i2c message to operation i2c device */
        ioctl_data.nmsgs	=	1;
        ioctl_data.msgs		=	ioctl_msg;

        ioctl(device->bus, I2C_RDWR, (unsigned long)&ioctl_data) == -1

I'm not sure if drive fully support linux i2c bus commands or not.

Full source:

@frank-zago
Copy link
Owner

i2c bus drivers do not support ioctl directly; this is done through the i2c core. There could be a parameter that the driver doesn't like though, or a missing option. ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants