Re: [PATCH v10 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018-09-10 23:38, Ajay Gupta wrote:
>> My guess is that with the above, you can actually program the I2C_MST_ADDR
>> register inside the "if (Read)" branch and then remove the I2C_AQ_COMB |
>> I2C_AQ_COMB_WRITE_FIRST | I2C_AQ_COMB_SAME_ADDR quirks.
> 
> We need I2C_MST_ADDR to be programmed even in a single write message.
> If we move it inside "if (Read)" branch then a single write message will not get it.
> 
> How does the below look?
> 
> for (i = 0; i < num; i++) {
> 	write msg[i].addr to I2C_MST_ADDR;
>  	if (Read) {
>  		read (without stop);
>  	} else  {
>  		start;
>  		addr;
>  		write;
>  	}
>  }
>  stop;

Sure, that's perfectly fine. I just don't see why the chip needs that for
writes when the address has to be written manually anyway, but if it does
need it, then so it is (and if it doesn't need it, the penalty for the
extra register write is probably not all that significant...)

Cheers,
Peter



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux