[PATCH v2 16/57] i2c: Add a generic driver to generate ACPI info

Heiko Schocher hs at denx.de
Mon Aug 31 12:41:01 CEST 2020


Hello Simon,

Am 30.08.2020 um 01:31 schrieb Simon Glass:
> Many I2C devices produce roughly the same ACPI data with just things like
> the GPIO/interrupt information being different.
> 
> This can be handled by a generic driver along with some information in the
> device tree.
> 
> Add a generic i2c driver for this purpose.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
> (no changes since v1)
> 
> Changes in v1:
> - Adjust implementation to match new ACPI GPIO generation
> - Capitalise ACPI_OPS_PTR
> - Rename acpi-probed to linux,probed
> - Support hid-over-i2c separately as well
> - Use acpi,ddn instead of acpi,desc
> - Use updated acpi_device_write_dsm_i2c_hid() function
> 
>   doc/device-tree-bindings/i2c/generic-acpi.txt |  42 ++++
>   drivers/i2c/Makefile                          |   3 +
>   drivers/i2c/acpi_i2c.c                        | 226 ++++++++++++++++++
>   drivers/i2c/acpi_i2c.h                        |  15 ++
>   drivers/i2c/i2c-uclass.c                      |  17 ++
>   include/acpi/acpi_device.h                    |  55 +++++
>   include/i2c.h                                 |  23 ++
>   7 files changed, 381 insertions(+)
>   create mode 100644 doc/device-tree-bindings/i2c/generic-acpi.txt
>   create mode 100644 drivers/i2c/acpi_i2c.c
>   create mode 100644 drivers/i2c/acpi_i2c.h
> 
> diff --git a/doc/device-tree-bindings/i2c/generic-acpi.txt b/doc/device-tree-bindings/i2c/generic-acpi.txt
> new file mode 100644
> index 00000000000..f6fc1614ecf
> --- /dev/null
> +++ b/doc/device-tree-bindings/i2c/generic-acpi.txt
> @@ -0,0 +1,42 @@
> +I2C generic device
> +==================
> +
> +This is used only to generate ACPI tables for an I2C device.
> +
> +Required properties :
> +
> + - compatible : "i2c-chip";
> + - reg : I2C chip address
> + - acpi,hid : HID name for the device
> +
> +Optional properies in addition to device.txt:
> +
> + - reset-gpios : GPIO used to assert reset to the device
> + - irq-gpios : GPIO used for interrupt (if Interrupt is not used)
> + - stop-gpios : GPIO used to stop the device
> + - interrupts-extended : Interrupt to use for the device
> + - reset-delay-ms : Delay after de-asserting reset, in ms
> + - reset-off-delay-ms : Delay after asserting reset (during power off)
> + - enable-delay-ms : Delay after asserting enable
> + - enable-off-delay-m s: Delay after de-asserting enable (during power off)

typo s/m s/ms

> + - stop-delay-ms : Delay after de-aserting stop
> + - stop-off-delay-ms : Delay after asserting stop (during power off)
> + - hid-descr-addr : HID register offset (for Human Interface Devices)
[...]

Beside of the typo, you can add my

Reviewed-by: Heiko Schocher <hs at denx.de>

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de


More information about the U-Boot mailing list