media: rc: gpio-ir-recv: add recorder timeout property
Subsystems (3)
PATCH 1/1 media: rc: gpio-ir-recv: add recorder timeout property
This optional property allows to set the recorder timeout via the devicetree:
- linux,timeout-us: set the length of a space at which the recorder goes idle, specified in microseconds.
Signed-off-by Michael Klein <[email protected]>
--- .../devicetree/bindings/media/gpio-ir-receiver.txt | 3 +++ Documentation/devicetree/bindings/media/rc.yaml | 6 ++++++ drivers/media/rc/gpio-ir-recv.c | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/media/gpio-ir-receiver.txt +3 -0
@@ -9,6 +9,8 @@ Optional properties: directory. - linux,autosuspend-period: autosuspend delay time, the unit is milisecond. + - linux,timeout-us: set the length of a space at which + the recorder goes idle, specified in microseconds. Example node:
@@ -17,4 +19,5 @@ Example node: gpios = <&gpio0 19 1>; linux,rc-map-name = "rc-rc6-mce"; linux,autosuspend-period = <125>; + linux,timeout-us = <125000>; };
Documentation/devicetree/bindings/media/rc.yaml +6 -0
@@ -151,4 +151,10 @@ properties: - rc-xbox-dvd - rc-zx-irdec + linux,timeout-us: + description: + Set the length of a space at which the recorder goes idle, specified in + microseconds. + $ref: '/schemas/types.yaml#/definitions/uint32' + additionalProperties: true
drivers/media/rc/gpio-ir-recv.c +3 -1
@@ -99,7 +99,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) rcdev->dev.parent = dev; rcdev->driver_name =KBUILD_MODNAME ; rcdev->min_timeout =1 ; - rcdev->timeout =IR_DEFAULT_TIMEOUT ; +if (of_property_read_u32 (np,"linux,timeout-us" , &rcdev->timeout)) { + rcdev->timeout =IR_DEFAULT_TIMEOUT ; + } rcdev->max_timeout =10 *IR_DEFAULT_TIMEOUT ; rcdev->allowed_protocols =RC_PROTO_BIT_ALL_IR_DECODER ; rcdev->map_name =of_get_property (np,"linux,rc-map-name" ,NULL );
Signature · 1 line
2.28.0