iio: proximity: sx_common: Add old register mapping
authorGwendal Grignou <gwendal@chromium.org>
Sat, 11 Feb 2023 00:24:21 +0000 (16:24 -0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 11 Mar 2023 12:18:28 +0000 (12:18 +0000)
commite522a6f7cbeb0cdb672f3f3ed88dd1ed930a76d2
treea88e8f2e0e87b1f313f123e1b3b35d59473c78e2
parent6d5f85de2d610d652ab7e90fea19a85c58b8df04
iio: proximity: sx_common: Add old register mapping

Older firmwares still send sensor configuration using a list of
registers with opaque values defined during sensor tuning.
sx9234 and sx9360 sensor on ACPI based devices are concerned.
More schema to configure the sensors will be needed to support devices
designed for windows, like Samsung Galaxy Book2.

Support schema is: "<_HID>.<register_name>". For instance
"STH9324,reg_adv_ctrl2" in:

    Scope (\_SB.PCI0.I2C2)
    {
        Device (SX28)
        {
            Name (_HID, "STH9324")  // _HID: Hardware ID
...
            Name (_DSD, Package (0x02)  // _DSD: Device-Specific Data
            {
                ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /*
Device Properties for _DSD */,
                Package (0x3F)
                {
...
                    Package (0x02)
                    {
                        "STH9324,reg_adv_ctrl2",
                        Zero
                    },`

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20230211002421.3447060-1-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/sx9324.c
drivers/iio/proximity/sx9360.c
drivers/iio/proximity/sx_common.c
drivers/iio/proximity/sx_common.h