From 689c25b9d6bbd62875f1fb31dca5cc694b8e262f Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Wed, 27 Jan 2021 23:29:38 -0800 Subject: drivers/i2c: sx9310: Replace register map with descriptive names The current driver is using chip registers map to configure the SAR sensor, which is opaque, especially when the datasheet is not published widely. Use more descriptive names, as defined in Linux kernel documentation at https://www.kernel.org/doc/Documentation/devicetree/bindings/iio/proximity/semtech%2Csx9310.yaml BUG=b:173341604 BRANCH=volteer TEST=Dump all tables, check semtech property: for i in $(find /sys/firmware/acpi/tables/ -type f) ; do f=$(basename $i); cat $i > /tmp/$f.dat ; iasl -d /tmp/$f.dat done In SSDT.dsl, we have: Package (0x06) { Package (0x02) { "semtech,cs0-ground", Zero }, Package (0x02) { "semtech,startup-sensor", Zero }, Package (0x02) { "semtech,proxraw-strength", Zero }, Package (0x02) { "semtech,avg-pos-strength", 0x0200 }, Package (0x02) { "semtech,combined-sensors", Package (0x03) { Zero, One, 0x02 } }, Package (0x02) { "semtech,resolution", "finest" } } Change-Id: I8d1c81b56eaeef1dbb0f73c1d74c3a20e8b2fd7b Signed-off-by: Gwendal Grignou Reviewed-on: https://review.coreboot.org/c/coreboot/+/50210 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/drivers/i2c/sx9310/registers.h | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/drivers/i2c/sx9310/registers.h (limited to 'src/drivers/i2c/sx9310/registers.h') diff --git a/src/drivers/i2c/sx9310/registers.h b/src/drivers/i2c/sx9310/registers.h deleted file mode 100644 index 4744ae4c67..0000000000 --- a/src/drivers/i2c/sx9310/registers.h +++ /dev/null @@ -1,29 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef REGISTER -#error "define REGISTER(NAME) before including this file" -#endif - -REGISTER(reg_prox_ctrl0); -REGISTER(reg_prox_ctrl1); -REGISTER(reg_prox_ctrl2); -REGISTER(reg_prox_ctrl3); -REGISTER(reg_prox_ctrl4); -REGISTER(reg_prox_ctrl5); -REGISTER(reg_prox_ctrl6); -REGISTER(reg_prox_ctrl7); -REGISTER(reg_prox_ctrl8); -REGISTER(reg_prox_ctrl9); -REGISTER(reg_prox_ctrl10); -REGISTER(reg_prox_ctrl11); -REGISTER(reg_prox_ctrl12); -REGISTER(reg_prox_ctrl13); -REGISTER(reg_prox_ctrl14); -REGISTER(reg_prox_ctrl15); -REGISTER(reg_prox_ctrl16); -REGISTER(reg_prox_ctrl17); -REGISTER(reg_prox_ctrl18); -REGISTER(reg_prox_ctrl19); -REGISTER(reg_sar_ctrl0); -REGISTER(reg_sar_ctrl1); -REGISTER(reg_sar_ctrl2); -- cgit v1.2.3