diff mbox series

[i2c-next,v6,1/5] dt-bindings: i2c: Add 'timeout-ms' and '#retries' properties as common optional

Message ID 20181004204322.20665-2-jae.hyun.yoo@linux.intel.com (mailing list archive)
State Superseded, archived
Headers show
Series i2c: aspeed: Add bus idle waiting logic for multi-master use cases | expand

Commit Message

Jae Hyun Yoo Oct. 4, 2018, 8:43 p.m. UTC
This commit adds 'timeout-ms' and '#retries' properties as common
optional properties that can be used for setting 'timeout' and
'retries' values of 'struct i2c_adapter'. With this patch, the bus
timeout value and the master transfer retries count can be set
through these properties at the registration time of an adapter.
Still the values can be set by I2C_TIMEOUT and I2C_RETRIES ioctls
on cdev at runtime too.

These properties may not be supported by all drivers. However, if
a driver wants to support one of them, it should adapt the
bindings in this document.

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
---
 Documentation/devicetree/bindings/i2c/i2c.txt | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Rob Herring Oct. 5, 2018, 8:39 p.m. UTC | #1
On Thu, Oct 04, 2018 at 01:43:18PM -0700, Jae Hyun Yoo wrote:
> This commit adds 'timeout-ms' and '#retries' properties as common
> optional properties that can be used for setting 'timeout' and
> 'retries' values of 'struct i2c_adapter'. With this patch, the bus
> timeout value and the master transfer retries count can be set
> through these properties at the registration time of an adapter.
> Still the values can be set by I2C_TIMEOUT and I2C_RETRIES ioctls
> on cdev at runtime too.
> 
> These properties may not be supported by all drivers. However, if
> a driver wants to support one of them, it should adapt the
> bindings in this document.
> 
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
> ---
>  Documentation/devicetree/bindings/i2c/i2c.txt | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c.txt b/Documentation/devicetree/bindings/i2c/i2c.txt
> index 11263982470e..6d7a6e919cf8 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c.txt
> @@ -80,6 +80,12 @@ wants to support one of the below features, it should adapt the bindings below.
>  	Names of map programmable addresses.
>  	It can contain any map needing another address than default one.
>  
> +- timeout-ms

bus-timeout-ms in case we have some other timeout needed.

> +	Bus timeout in milliseconds.
> +
> +- #retries
> +	Number of retries for master transfer.
> +
>  Binding may contain optional "interrupts" property, describing interrupts
>  used by the device. I2C core will assign "irq" interrupt (or the very first
>  interrupt if not using interrupt names) as primary interrupt for the slave.
> -- 
> 2.19.0
>
Jae Hyun Yoo Oct. 5, 2018, 8:43 p.m. UTC | #2
Hi Rob,

On 10/5/2018 1:39 PM, Rob Herring wrote:
> On Thu, Oct 04, 2018 at 01:43:18PM -0700, Jae Hyun Yoo wrote:
>> +++ b/Documentation/devicetree/bindings/i2c/i2c.txt
>> @@ -80,6 +80,12 @@ wants to support one of the below features, it should adapt the bindings below.
>>   	Names of map programmable addresses.
>>   	It can contain any map needing another address than default one.
>>   
>> +- timeout-ms
> 
> bus-timeout-ms in case we have some other timeout needed.
> 

Agreed. I'll change it like you suggested.

Thanks,
Jae
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/i2c.txt b/Documentation/devicetree/bindings/i2c/i2c.txt
index 11263982470e..6d7a6e919cf8 100644
--- a/Documentation/devicetree/bindings/i2c/i2c.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c.txt
@@ -80,6 +80,12 @@  wants to support one of the below features, it should adapt the bindings below.
 	Names of map programmable addresses.
 	It can contain any map needing another address than default one.
 
+- timeout-ms
+	Bus timeout in milliseconds.
+
+- #retries
+	Number of retries for master transfer.
+
 Binding may contain optional "interrupts" property, describing interrupts
 used by the device. I2C core will assign "irq" interrupt (or the very first
 interrupt if not using interrupt names) as primary interrupt for the slave.