From patchwork Tue Jun 25 16:51:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaustabh Chakraborty X-Patchwork-Id: 13711664 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B71E41494D9; Tue, 25 Jun 2024 17:00:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719334825; cv=none; b=k7FLxLp4Y/RGoK9hRxJiIQHauoaZwm00xbjSBJWwW6lgwK39S0Fp8dTC+oJLlfsFAw4OmQvzoPbG3it6IJsfttGI4OKFon9m55+lyfJlVXyyw7ifM44GrXvmCtcSt3uLE41oDPVoYBAAA1Qyw3Ixd6H7U9r635dQfuLzdr3pq8Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719334825; c=relaxed/simple; bh=7zGkmCGwedhVhDlUUqPb+kRA9524NAzODRiWSHPQgVc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qKqUEyEnj//j/qfi0U+RTj1fjcjDo+KXA/yazqR5HfEgtmdz7wZEvtRXR+ZJEInUDcySL7ff8fLc2/z1OXh3D9qLHfX2HPjZGPIc20ooayuBeKqhqMXLBQ7SRF+paZh60C1fKmM6yJh5t6NRPbw3PL8xiPVat9W7r8V9UTeWgRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=lKZFGi00; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="lKZFGi00" X-Virus-Scanned: SPAM Filter at disroot.org From: Kaustabh Chakraborty DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1719334357; bh=7zGkmCGwedhVhDlUUqPb+kRA9524NAzODRiWSHPQgVc=; h=From:To:Cc:Subject:Date; b=lKZFGi00vOR3gge+h8j+BPt5adPxE55XO0ejK31HCF8KVMgYyHPN3gq6cqXGgS9s1 kK+yMrqDXc+S73KKLziI6P/nmIY/GtFsNPIABdpPTwdQeRogl0+nzuq2DRJuWe8Ckb sR03DlR/ylMIf+0vB7iGNTTYj00zPAP4ZZnvNcVlVs3fb5McfBHxZ08ayJDZ7mFDhR YVHeOK9ttegmAVKnGAIDMQAzS93YfyK9FdTX8w2P9QLdt5PKk3Ix9UyM5v96YN8/v6 o5pOCgS2vzAhtl3/AVsjc9oR1axLaNFtOvDBiXBcFpZgSgz/+YBX1I1VwgYWEB7Om3 WwSKfSOnbRW7w== To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, Kaustabh Chakraborty Subject: [PATCH 1/2] iio: light: stk3310: add support for stk3013 Date: Tue, 25 Jun 2024 22:21:05 +0530 Message-ID: <20240625165122.231182-1-kauschluss@disroot.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for Sensortek's STK3013 in the driver. The part bears the product ID 0x31. As seen in [1], Sensortek lists STK3013 as a proximity sensor. But it has been experimentally observed that they do have ambient light sensing capabilities. Furthermore, [2] implements a proximity and ambient light sensor driver for STK3x1x devices, which is also indicative of the fact that these parts are also ambient light sensors. [1] https://www.sensortek.com.tw/index.php/en/products/optical-sensor/ [2] https://android.googlesource.com/kernel/msm.git/+/e6dfa4641d88201e8019be19ff557e5d2cf4572f Signed-off-by: Kaustabh Chakraborty --- drivers/iio/light/stk3310.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index e3470d6743ef..003e7c1473d7 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -35,6 +35,7 @@ #define STK3310_STATE_EN_ALS BIT(1) #define STK3310_STATE_STANDBY 0x00 +#define STK3013_CHIP_ID_VAL 0x31 #define STK3310_CHIP_ID_VAL 0x13 #define STK3311_CHIP_ID_VAL 0x1D #define STK3311A_CHIP_ID_VAL 0x15 @@ -84,6 +85,7 @@ static const struct reg_field stk3310_reg_field_flag_nf = REG_FIELD(STK3310_REG_FLAG, 0, 0); static const u8 stk3310_chip_ids[] = { + STK3013_CHIP_ID_VAL, STK3310_CHIP_ID_VAL, STK3311A_CHIP_ID_VAL, STK3311S34_CHIP_ID_VAL, @@ -700,6 +702,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(stk3310_pm_ops, stk3310_suspend, stk3310_resume); static const struct i2c_device_id stk3310_i2c_id[] = { + { "STK3013" }, { "STK3310" }, { "STK3311" }, { "STK3335" }, @@ -708,6 +711,7 @@ static const struct i2c_device_id stk3310_i2c_id[] = { MODULE_DEVICE_TABLE(i2c, stk3310_i2c_id); static const struct acpi_device_id stk3310_acpi_id[] = { + {"STK3013", 0}, {"STK3310", 0}, {"STK3311", 0}, {} @@ -716,6 +720,7 @@ static const struct acpi_device_id stk3310_acpi_id[] = { MODULE_DEVICE_TABLE(acpi, stk3310_acpi_id); static const struct of_device_id stk3310_of_match[] = { + { .compatible = "sensortek,stk3013", }, { .compatible = "sensortek,stk3310", }, { .compatible = "sensortek,stk3311", }, { .compatible = "sensortek,stk3335", }, From patchwork Tue Jun 25 16:51:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaustabh Chakraborty X-Patchwork-Id: 13711633 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A1176174ED2; Tue, 25 Jun 2024 16:52:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719334368; cv=none; b=A/RH6wCMY1gmu27OT59G8/x2BnOp9GNZ9EAXqq+Lr6Du4fwrFL6Lv7WySRp+R4/O0YDSd1uJO1tCwRxwa34nbNZ6bwgcDt174tbP/m/dqgMOvs8M4p34tUi2GJ9xcz+/j8PMTR8Pw17L1NLZJpHMXQ1j0gEgyKxSoBGOEMBOpGo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719334368; c=relaxed/simple; bh=39UsyjL9EP1PAdrBgELTOcXGolrV68DGXQAkjwpdElU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qLpsSDZPp532S+DXKzOpDYw7jDZA8Un55AjGO8F4mlb/UXKKCieSWB0dBjFoki4NM1/b1GGum86RQIxEMR8ml+QWbMfEKjdDsaFLxijrpp5xZTWWolS1piQRsVLehFCIMGEYIkVsqe+PjeEzfn8yIKxzogPFg/B9AC91Rn13Cz0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=hhlitPq3; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="hhlitPq3" X-Virus-Scanned: SPAM Filter at disroot.org From: Kaustabh Chakraborty DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1719334361; bh=39UsyjL9EP1PAdrBgELTOcXGolrV68DGXQAkjwpdElU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hhlitPq3Nvo4ZCypF+4Z3yToisK89YnVwB1+zYdefJQxIED3GIeS59QsSEsBjt4GI kMqABX5ffDb10NjYo5TeL9e9m6FC0m+9xolBsG8rV2oQTayVg/Hqxm396XgYAEaqqi 2HuI31HnwytqTJoF0oz0/P9SK5WQnPR1nIVKiRt+GB7kORdnn1AoM2Wlm/uQhwwt5B 3gxd39wY6Ce/R3/5ZAHO8kGPKCob8OZBeCHMWQt+Yc1YZEVQcNdVYoHWW/NOp3IEI3 qHZ2GWWli7kEIGUMAKdpsPw60PqIPdFIhxQnMYaETRLTLpI7C2KCfKjLigPglIzQuo op325CmX/4qNw== To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, Kaustabh Chakraborty Subject: [PATCH 2/2] dt-bindings: iio: light: stk33xx: add compatible for stk3013 Date: Tue, 25 Jun 2024 22:21:06 +0530 Message-ID: <20240625165122.231182-2-kauschluss@disroot.org> In-Reply-To: <20240625165122.231182-1-kauschluss@disroot.org> References: <20240625165122.231182-1-kauschluss@disroot.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the compatible string of stk3013 to the existing list. Signed-off-by: Kaustabh Chakraborty --- Documentation/devicetree/bindings/iio/light/stk33xx.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml index f6e22dc9814a..6003da66a7e6 100644 --- a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml +++ b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml @@ -19,6 +19,7 @@ allOf: properties: compatible: enum: + - sensortek,stk3013 - sensortek,stk3310 - sensortek,stk3311 - sensortek,stk3335