Re: [PATCH -next v3 1/2] i2c: add SCCB helpers

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

 



Hi,

yes! From a first look this nails it for me. Thanks for doing it.

Minor comments follow...

> +#if 0
> +	/*
> +	 * sccb_xfer not needed yet, since there is no driver support currently.
> +	 * Just showing how it should be done if we ever need it.
> +	 */
> +	if (adap->algo->sccb_xfer)
> +		return true;
> +#endif

I think this should be a more generic comment in the header, like

/*
 * If we ever want support for hardware doing SCCB natively, we will
 * introduce a sccb_xfer() callback to struct i2c_algorithm and check
 * for it here.
 */

> +/**
> + * sccb_read_byte - Read data from SCCB slave device
> + * @client: Handle to slave device
> + * @addr: Register to be read from

I think 'addr' is too easy to confuse with client->addr. SMBus uses
'command' but I am also fine with 'reg' because we will deal with
registers.

> + * This executes the 2-phase write transmission cycle that is followed by a
> + * 2-phase read transmission cycle, returning negative errno else a data byte
> + * received from the device.
> + */

Nice docs!

> +/**
> + * sccb_write_byte - Write data to SCCB slave device
> + * @client: Handle to slave device
> + * @addr: Register to write to

'reg'?

Kind regards,

   Wolfram

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux