[bootlin/training-materials] dea44e: kernel: i2c: Try giving a better definition of SMBus

Miquèl Raynal noreply at github.com
Mon Nov 15 10:47:27 CET 2021


  Branch: refs/heads/master
  Home:   https://github.com/bootlin/training-materials
  Commit: dea44e6d2eb5be1a0f666edfa8eddf5e12cf905c
      https://github.com/bootlin/training-materials/commit/dea44e6d2eb5be1a0f666edfa8eddf5e12cf905c
  Author: Miquel Raynal <miquel.raynal at bootlin.com>
  Date:   2021-11-15 (Mon, 15 Nov 2021)

  Changed paths:
    M slides/kernel-i2c/kernel-i2c.tex

  Log Message:
  -----------
  kernel: i2c: Try giving a better definition of SMBus

SMBus does not simply target byte reads/writes. It's actually a full
specification targetting devices power management on an "I2C bus". It is
true that for us, it offers a register-like interface but it is only a
biased view from our side, it's not the original purpose.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>


  Commit: a0981a5afbe4b8bf2cdfb0651945c7c90df86316
      https://github.com/bootlin/training-materials/commit/a0981a5afbe4b8bf2cdfb0651945c7c90df86316
  Author: Miquel Raynal <miquel.raynal at bootlin.com>
  Date:   2021-11-15 (Mon, 15 Nov 2021)

  Changed paths:
    M slides/kernel-i2c/kernel-i2c.tex

  Log Message:
  -----------
  kernel: i2c: Clarify why we should use the SMBus protocol

Using SMBus commands is not mandatory but preferred (see the kdoc) and
only when talking to an SMBus device, so make this clear. While at it,
clarify the reason for that choice: SMBus commands will be translated
into I2C commands by the core if needed, but the opposite is not
possible.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>


  Commit: cf2bf93fac52f87f2efc39110b741f03b2b72df6
      https://github.com/bootlin/training-materials/commit/cf2bf93fac52f87f2efc39110b741f03b2b72df6
  Author: Miquel Raynal <miquel.raynal at bootlin.com>
  Date:   2021-11-15 (Mon, 15 Nov 2021)

  Changed paths:
    M slides/kernel-i2c/kernel-i2c.tex

  Log Message:
  -----------
  kernel: i2c: Clarify SMBus concept

SMBus does not feature any kind of registers, this is our way to
interpret the specification, so use " " around the word register because
it's actually just a command that will be interpreted by the device.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>


  Commit: 328c113700661e4a220e2f0efb4d4a3d8b519c48
      https://github.com/bootlin/training-materials/commit/328c113700661e4a220e2f0efb4d4a3d8b519c48
  Author: Miquel Raynal <miquel.raynal at bootlin.com>
  Date:   2021-11-15 (Mon, 15 Nov 2021)

  Changed paths:
    M slides/kernel-i2c/kernel-i2c.tex

  Log Message:
  -----------
  kernel: i2c: Fix the SMBus example

I2C/SMBus do not support two Start bits in the same sequence. It is
actually a repeated start (abbreviated Sr) which must be performed after
the command byte to signify that we change the direction of the flow:
the host wrote the command, now it's the peripheral responsibility to
talk on the bus.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>


Compare: https://github.com/bootlin/training-materials/compare/b56c33f72de6...328c11370066


More information about the training-materials-updates mailing list