Re: [PATCH] RFC : mikroBUS driver for add-on boards

From: Christopher Friedt
Date: Fri Jul 24 2020 - 16:02:37 EST


Hi Vaishnav!

On Fri, Jul 24, 2020 at 8:06 AM Vaishnav M A <vaishnav@xxxxxxxxxxxxxxx> wrote:
> +enum mikrobus_protocol {
> + MIKROBUS_PROTOCOL_SPI = 0x01,
> + MIKROBUS_PROTOCOL_I2C = 0x02,
> + MIKROBUS_PROTOCOL_UART = 0x03,
> + MIKROBUS_PROTOCOL_SPI_GPIOCS = 0x04,
> + MIKROBUS_PROTOCOL_I2C_MUX = 0x05
> +};

We've already chatted about this off-list, but I just wanted to post
here as well so other readers are aware.

Given that MikroBus will be layered on top of Greybus and will use
Greybus Manifests, and that there is a related change [1] for the
Greybus Manifest tool (manifesto), and given that other, non-mikroBUS,
form factors may want to re-use the "[device-descriptor N]" tag, I
think it would make sense to use

[device-descriptor];
protocol = [cport protocol]

instead of

[device-descriptor];
protocol = [mikrobus protocol].

As you mentioned, there is no specific mikrobus i2c protocol, and the
protocol field is really just an enumeration.

If there are no other technical issues aside from that, I think it
would make sense to use the Greybus CPort protocol enumerations
instead of introducing a new one that is less generic.

That's the only significant critique I have.

Otherwise, great work and thank you for your contribution!

[1] https://github.com/projectara/manifesto/pull/2