[v3,1/2] dt-bindings: i2c: stm32f7: add st,smbus-alert binding for SMBus Alert

Message ID 1616998145-28278-2-git-send-email-alain.volmat@foss.st.com
State New
Headers show
Series
  • i2c: stm32f7: add SMBus-Alert support
Related show

Commit Message

Alain Volmat March 29, 2021, 6:09 a.m.
Based on the SMBus specification, SMBus Alert active state is low.
As often on SoC, the SMBus Alert pin is not only dedicated to this
feature and can also be used for another purpose (by configuring it
as alternate function for other functions via pinctrl).

"smbus" dt-binding has been introduced recently [1], however it is also
used to indicate usage of host-notify feature.
Relying on 'smbus' binding for SMBus-Alert as well as it was discussed
previously [2] would lead to requiring the SMBALERT# pin to be configured
as alternate function for i2c/smbus controller even if only host-notify is
needed.
Indeed, not doing so would lead to spurious SMBus Alert interrupts since
the i2c/smbus controller would see the (not configured) SMBA pin as low
level.

For that reason, SMBus-Alert needs to have its own binding in order
to only be enabled whenever SMBALERT# pin is configured as alternate
function for i2c/smbus controller.

[1] https://lore.kernel.org/linux-i2c/20200721062217.GA1044@kunai/
[2] https://lore.kernel.org/linux-i2c/20200701143738.GF3457@gnbcxd0016.gnb.st.com/

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Reviewed-by: Rob Herring <robh@kernel.org>

---
v3: use lore.kernel.org links
v2: introduce st,smbus-alert property
---
 Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Wolfram Sang May 4, 2021, 7:53 p.m. | #1
> +        st,smbus-alert:

After reading the specs again, I think we can make this a generic
binding. SMBusAlert is optional. So, we can say it is not covered by the
"smbus" binding and needs a seperate one. Makes sense?
Alain Volmat May 5, 2021, 9:49 a.m. | #2
Hi Wolfram,

On Tue, May 04, 2021 at 09:53:48PM +0200, Wolfram Sang wrote:
> 

> > +        st,smbus-alert:

> 

> After reading the specs again, I think we can make this a generic

> binding. SMBusAlert is optional. So, we can say it is not covered by the

> "smbus" binding and needs a seperate one. Makes sense?


Indeed, SMBus Spec [1] mentions about SMBALERT#:
An optional signal that a slave device can use to notify the system
master that it has information for the master

Hence it does make sense to separate it from the smbus binding. I will
post a v4 of this serie with the addition of a generic binding 'smbus-alert'.

Alain

[1] http://www.smbus.org/specs/SMBus_3_1_20180319.pdf

Patch

diff --git a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml
index d747f4990ad8..0d45ead7d835 100644
--- a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml
@@ -36,6 +36,11 @@  allOf:
             minItems: 3
             maxItems: 3
 
+        st,smbus-alert:
+          description: Enable the SMBus-Alert via SMBA pin, note SMBA pin
+                       must also be configured via pinctrl.
+          type: boolean
+
   - if:
       properties:
         compatible: