diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2023-02-10 16:24:21 -0800 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-03-11 12:18:28 +0000 |
commit | e522a6f7cbeb0cdb672f3f3ed88dd1ed930a76d2 (patch) | |
tree | a88e8f2e0e87b1f313f123e1b3b35d59473c78e2 /drivers/iio/proximity/sx_common.h | |
parent | 6d5f85de2d610d652ab7e90fea19a85c58b8df04 (diff) | |
download | linux-stable-e522a6f7cbeb0cdb672f3f3ed88dd1ed930a76d2.tar.gz linux-stable-e522a6f7cbeb0cdb672f3f3ed88dd1ed930a76d2.tar.bz2 linux-stable-e522a6f7cbeb0cdb672f3f3ed88dd1ed930a76d2.zip |
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>
Diffstat (limited to 'drivers/iio/proximity/sx_common.h')
-rw-r--r-- | drivers/iio/proximity/sx_common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/proximity/sx_common.h b/drivers/iio/proximity/sx_common.h index a2bbdef200d1..101b90e52ff2 100644 --- a/drivers/iio/proximity/sx_common.h +++ b/drivers/iio/proximity/sx_common.h @@ -8,6 +8,7 @@ #ifndef IIO_SX_COMMON_H #define IIO_SX_COMMON_H +#include <linux/acpi.h> #include <linux/iio/iio.h> #include <linux/iio/types.h> #include <linux/regulator/consumer.h> @@ -26,6 +27,7 @@ static_assert(SX_COMMON_MAX_NUM_CHANNELS < BITS_PER_LONG); struct sx_common_reg_default { u8 reg; u8 def; + const char *property; }; /** @@ -148,6 +150,9 @@ int sx_common_probe(struct i2c_client *client, const struct sx_common_chip_info *chip_info, const struct regmap_config *regmap_config); +void sx_common_get_raw_register_config(struct device *dev, + struct sx_common_reg_default *reg_def); + /* 3 is the number of events defined by a single phase. */ extern const struct iio_event_spec sx_common_events[3]; |