[Letux-kernel] [PATCH] Letux-root: use the force in si4721

H. Nikolaus Schaller hns at goldelico.com
Mon Aug 6 10:04:28 CEST 2018


Hi,

> Am 06.08.2018 um 07:46 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> the chip seems to be occupied now by a kernel driver, so
> forcefully access the device from userspace, so the tool can still
> be used

I think the sound card registers as an i2c client which marks the i2c
address as being used. i2cdetect reports UU and blocks access as well
in that case.

>  until there is a fully-working driver in kernel (if there
> ever will be)

Well, for that we would need to add widgets to the sound card driver
so that we can tune and send commands. Maybe read status values.

Should not be very difficult but may be against the ideas how kernel
maintainers would solve it (IMHO there is already some si47xx driver
but without digital sound handling).

> 
> Signed-off-by: Andreas Kemnade <andreas at kemnade.info>
> ---
> Letux/root/si4721.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Letux/root/si4721.c b/Letux/root/si4721.c
> index 80ac30498997..acb863e417a1 100644
> --- a/Letux/root/si4721.c
> +++ b/Letux/root/si4721.c
> @@ -37,7 +37,7 @@ static int send_cmd(unsigned char *cmd_data,int cmd_len,unsigned char *resp_data
> 			exit(1);
> 		}
> 	}
> -	if (ioctl(fd, I2C_SLAVE, chipaddr) < 0) {
> +	if (ioctl(fd, I2C_SLAVE_FORCE, chipaddr) < 0) {

Yes, kernels are a little more strict about this for a while.

> 		printf("Failed to acquire bus access and/or talk to slave: %s\n", strerror(errno));
> 		return -1;
> 	}
> -- 
> 2.11.0

Didn't make it into letux-4.18-rc8 but is queued.

BR and thanks,
Nikolaus



More information about the Letux-kernel mailing list