Re: [PATCH v6 4/5] i2c: aspeed: added driver for Aspeed I2C

From: Benjamin Herrenschmidt
Date: Tue Mar 28 2017 - 04:59:10 EST


On Mon, 2017-03-27 at 22:12 -0700, Brendan Higgins wrote:
> +/* 0x04 : I2CD Clock and AC Timing Control Register #1 */
> +#define ASPEED_I2CD_TIME_SCL_HIGH_SHIFTÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ16
> +#define ASPEED_I2CD_TIME_SCL_HIGH_MASKÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂGENMASK(19, 16)
> +#define ASPEED_I2CD_TIME_SCL_LOW_SHIFTÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ12
> +#define ASPEED_I2CD_TIME_SCL_LOW_MASKÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂGENMASK(15, 12)
> +#define ASPEED_I2CD_TIME_BASE_DIVISOR_MASKÂÂÂÂÂÂÂÂÂÂÂÂÂGENMASK(3, 0)
> +#define ASPEED_I2CD_TIME_SCL_REG_MAXÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂGENMASK(3, 0)
> +/* 0x08 : I2CD Clock and AC Timing Control Register #2 */
> +#define ASPEED_NO_TIMEOUT_CTRLÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ0

Those are slightly different between the 2400 and 2500, allowing
slightly more fine grained settings (faster base clock and thus higher
numbers in high/low counts).

I *think* that using the 2400 values as-is might work ok, at least
it does for 100kHz but I would double check.

I'll review the rest tomorrow.

Cheers,
Ben.