Re: [PATCH 2/3] Documentation: i2c: describe the new slave mode

From: Geert Uytterhoeven
Date: Thu Mar 12 2015 - 09:27:20 EST


On Thu, Mar 12, 2015 at 1:42 PM, Wolfram Sang <wsa@xxxxxxxxxxxxx> wrote:
> --- /dev/null
> +++ b/Documentation/i2c/slave-interface
> @@ -0,0 +1,178 @@
> +Linux I2C slave interface description
> +=====================================
> +
> +by Wolfram Sang <wsa@xxxxxxxxxxxxxxxxxxxx> in 2014-15
> +
> +Finally, Linux can also be an I2C slave in case I2C controllers have slave
> +support. Besides this HW requirement, one also needs a software backend
> +providing the actual functionality. An example for this is the slave-eeprom
> +driver, which acts as a dual memory driver. While another I2C master on the bus
> +can access it like a regular eeprom, the Linux I2C slave can access the content

EEPROM (to match [PATCH 3/3])
contents

> +via sysfs and retrieve/provide information as needed. The software backend

> +About ACK/NACK
> +--------------
> +
> +It is good behaviour to always ACK the address phase, so the master knows if a
> +device is basically present or if it mysteriously disappeared. Using NACK to
> +state being busy is troublesome. SMBus demands to always ACK the address phase,
> +while I2C specification is more loose on that. Most I2C controllers also

the I2C specification

> +automatically ACK when detecting its slave address, so there is no option to

their slave addresses

> +NACK it. For those reasons, this API does not support NACK in the address

NACK them.

> +phase.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/