From patchwork Fri Jul 12 15:24:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaustabh Chakraborty X-Patchwork-Id: 13731888 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 A4580171075; Fri, 12 Jul 2024 15:25:13 +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=1720797918; cv=none; b=AxZQX40cNf9iM0Vql4vwj4axPUbEFGDBRwhpvHfF6DtQSGxagDxusOyH1tl9XZtQq8UmGEbWr9ArTCkdTX51XUKNOttxCsGM5Sq4TbNNR2WZeMskf3iD6y4XzoN/GEEKT9/sQkvNtY6xsseJyUNh+gg9bWrlrRlT/InVl9XuO0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720797918; c=relaxed/simple; bh=Nf3c5cFPQqH6NjdQ5t3abQSsHaZokZU2IJwpFQAzxTs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lyPXCDiaVgVAtC4AopwkfZ0NkY8UyWey/VEsZvKWv8RbQoV/9SNCMJAByZZ+XQwV88heFe67v49AqAq6GrphgjZo0ypXazNy95IBddit34KmAnsp5lVcU3QozoJrwBn5deHdN3KUIGGueV8YM7j8yszexoOgYYFVZdQ5UkV8HsA= 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=Ue0QRp+W; 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="Ue0QRp+W" Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id E3D1441A24; Fri, 12 Jul 2024 17:25:05 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WHmxWArao7F8; Fri, 12 Jul 2024 17:25:05 +0200 (CEST) From: Kaustabh Chakraborty DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1720797905; bh=Nf3c5cFPQqH6NjdQ5t3abQSsHaZokZU2IJwpFQAzxTs=; h=From:To:Cc:Subject:Date; b=Ue0QRp+WNS90FLcaHVnbZMvBVre3++HUBVGu2tCdVppyhZdzfohN1ffXUnIbBwpcb Fn52/3gZwYJSA9Wt//tdwhoheXW/wDl4s5WZvLucFwkWLrdRMD8DNe4/fv4pDyCo0p Y5K/oOvL3CH78vV0+SN0ocXzAOaV87TAJ8IppVNDeFpHPlHn1Fn1T+iyn7BoU8AYzf RquPp4Q0pcWS7+W3DAHyeM2VnZ4QLM6mHLym88IjeylLyoNcWQ768hrhVK8ybwOkWZ icpqg6FTSaJrzAivTO5VfzG5yJKviAzkAoqwF+0C0S0VbMMVQiOt5LZD+4e0gE+lWo MWRUxgtD9/v4g== To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, Kaustabh Chakraborty , Conor Dooley Subject: [PATCH 1/3] iio: light: stk3310: relax chipid check warning Date: Fri, 12 Jul 2024 20:54:00 +0530 Message-ID: <20240712152417.97726-1-kauschluss@disroot.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In order to allow newer devices which are compatible with existing sensors, issuing a warning for an unknown chipid indicates that something has gone wrong with the init process, which isn't ideal. Swap it with a friendlier info message to get things right. Suggested-by: Conor Dooley Signed-off-by: Kaustabh Chakraborty --- drivers/iio/light/stk3310.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index e3470d6743ef..48a971de6a04 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -496,7 +496,7 @@ static int stk3310_init(struct iio_dev *indio_dev) ret = stk3310_check_chip_id(chipid); if (ret < 0) - dev_warn(&client->dev, "unknown chip id: 0x%x\n", chipid); + dev_info(&client->dev, "new unknown chip id: 0x%x\n", chipid); state = STK3310_STATE_EN_ALS | STK3310_STATE_EN_PS; ret = stk3310_set_state(data, state); From patchwork Fri Jul 12 15:24:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaustabh Chakraborty X-Patchwork-Id: 13731890 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 8224238DC7; Fri, 12 Jul 2024 15:25:17 +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=1720797919; cv=none; b=iPFZ0wvfP43+V4Pb5ixKoQLYycbhhfKRK0/o95TkVkz8LSLOHLvtGZGc3YZBDNnHi3smAnjDXpBxRA/kO0qWHH4PCc1f6sZaR7cDC04E4laAjeqFz3yDsdgk/FYfU8mgrYl7qZYLlm/ojM9E3V3IvuqrUzC1VPU546Zw03lS+Tc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720797919; c=relaxed/simple; bh=HuKnqTxFRMZlKP0bBlf9blLr9jAV7BBvT/4TiHr3PDA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IoSnuj5M1EY0RX5gfgDEF+U2yLktBuz9xJ2O8k7HAEvZ8wVjusXcH8bypXsdc4kqYY2LhAff6Oj/CW2RzwIZAoY1/FjLVNQvHo81v+/Ro24gvE/5OaO6um0S+ilJIsfxQdHlBlJJVoaet6bO4L22ZGsbolof+E1Y6nan80C10iQ= 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=X2cjFFn8; 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="X2cjFFn8" Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 5DC01410A8; Fri, 12 Jul 2024 17:25:10 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xy20ZnCFpo_O; Fri, 12 Jul 2024 17:25:09 +0200 (CEST) From: Kaustabh Chakraborty DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1720797909; bh=HuKnqTxFRMZlKP0bBlf9blLr9jAV7BBvT/4TiHr3PDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=X2cjFFn8AjzWzfRRLuO3xSGZ3FKjfchHQp++AdUtXPxNLQrqrdZ/AO65RALuHzTdZ qIpvCsy4L58IhbBX3HxyW4v9fiAkt+wG102DXtXbbB9xwDqZG8pyvFP7OY9iD71Pb+ 0nQuHOGZDy4lrq51o4lZuYEwGOqp6eGTPsJWoMzvVcUgiRl/cKZ6uSD4iEn4rMhahg Z95POhWI5wDGYEA65OfcBLdI7fLBewra5tdWCmfB4ohROZHsvmvQu11y1ununPOOft C6V34/dFdjkQ9VN9f9udftFGlVYUVCBN8YvCrCRtYzOZeDYnl0LWAbrRQAzBYEeiaM WjD9Nmqwl5C8w== To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, Kaustabh Chakraborty Subject: [PATCH 2/3] iio: light: stk3310: add support for stk3013 Date: Fri, 12 Jul 2024 20:54:01 +0530 Message-ID: <20240712152417.97726-2-kauschluss@disroot.org> In-Reply-To: <20240712152417.97726-1-kauschluss@disroot.org> References: <20240712152417.97726-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 48a971de6a04..ed20b6714546 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 Fri Jul 12 15:24:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaustabh Chakraborty X-Patchwork-Id: 13731889 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 B0097173336; Fri, 12 Jul 2024 15:25:15 +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=1720797918; cv=none; b=oK7P81f9PYaw/EIG1SuRTn9DkwJ1OUb6dLvuRmetspLfwjdK2kAT1JNLphsxwA5j/ynmXeD3LR5KzA9GB2Zqw0F+PMMrKoEbA26SOhSp4QEjBm4TqLlewFVzmJVjwxWzkvQlV084FSZMNdyQ0oCH7Q8FFZslQP5UsWW3aymgtmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720797918; c=relaxed/simple; bh=39UsyjL9EP1PAdrBgELTOcXGolrV68DGXQAkjwpdElU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fPfxdFmb9rCgCHTXt8Y19sSFUrvoerdc+Ook/uZ+xaEe/h+eUA0rhS3MbzUwDFViThjcAtIAa0f2fmgOOqWoP1k1Y24VXO1VcJQybsyQNzlo3yX1mc8cJCQaADXnXE+A1F/CDNIEO9M4SudhYTwsBTcOmgAWK6cBYAO8gV2sVp8= 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=KH8s7PT6; 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="KH8s7PT6" Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B996641A14; Fri, 12 Jul 2024 17:25:13 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H9SaWp3caJ0W; Fri, 12 Jul 2024 17:25:13 +0200 (CEST) From: Kaustabh Chakraborty DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1720797913; bh=39UsyjL9EP1PAdrBgELTOcXGolrV68DGXQAkjwpdElU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KH8s7PT6MEGFVqT4+lo78frWDiDCVz0X3tehopeBT84CjPi8o/7HCgaT0YrzKsgsp f9rhspMP9fdffAaLMg8hnljrLmy+oS4/PWXKZvSM/90wR0E8Fvq16d1sn10jz+UJev lAhhLO9cyDN/l/Mx8pK2cswZRxjsmWyX4XCEEPzlkv54svcBL+m8vxD42aXb/lRq0v eFU4OF6vnwm7YX2LMfx0L8MDeo92iwIc57sZrqf/xzmcV48XWwGa9CXTRMWMxnyAPM N1OeXpaJEu9RvKQ2tW303HG0WlNxQLNwiIiXUJYrZZpkKDOH1+gsY4W5t4CkhlZFC+ 3Zfq2uL81y1cA== To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, Kaustabh Chakraborty Subject: [PATCH 3/3] dt-bindings: iio: light: stk33xx: add compatible for stk3013 Date: Fri, 12 Jul 2024 20:54:02 +0530 Message-ID: <20240712152417.97726-3-kauschluss@disroot.org> In-Reply-To: <20240712152417.97726-1-kauschluss@disroot.org> References: <20240712152417.97726-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