From patchwork Tue May 21 15:34:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= X-Patchwork-Id: 13669528 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 29D69144D02; Tue, 21 May 2024 15:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305699; cv=none; b=AzEAqhArBKOKRqr2VCsC6IelK+HC6oa+t2AoGhqxS/p1SVl4yJRyvNd0BCMrNoqn6ALu2KxWIpfxhnl9KnP513fg9YFgIQOLxeWWcaKL1lhwwy0GgCpxGbIREcnVfBsdDcsU6mGvHXGMbMwcM4Rdd6n0Mo9Et916/S9Rhvuh5fU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305699; c=relaxed/simple; bh=FGJ+hAkNElRAqStcbX6IavZod/JCIGJCaxgAaACqtag=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E1eJuzivXOgbeP7feXMxIG3nic3QR7//vsXZnhcq3bLva5DuZvnd/OMs/RvkwgV4otVkuCqfJqH3rSMPqLD4+zJT3WBUOX0N43bHVES4OAznd5IcyZHNOpF7RHgwY/OLrVakc+GilRpRT0gAsTWmStzNkAL4cqgbMgMnePmo00E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Xk/pAqIg; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xk/pAqIg" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-420180b5838so24327965e9.2; Tue, 21 May 2024 08:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716305696; x=1716910496; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=0rTfPVP4sEXoI/c4pdAS3vKkM5M7v+nTWcjaWAo5UlI=; b=Xk/pAqIgXGsIYhmz3hOCFvV6XPvmZDw1AFSTSaSUZmRmI9FI9VFb/PSO+3uE1Dk/lq 6YpAfU74Yxb+XYN2YcAiKHFqxCYg3beTPr46oyX/5IUMSnwo83xR/R6I1Ew1m1TJpWPC +OycDjFimUb2hdBNDJvJRocz5lLxcJE+i5J5Qk95+iKP83ofIdK9hYm4w19ADBksoGxH B3HGV36bSu19Z9dL+zXA89stO34t++xV/LiUYfJj/lUcwzEkAkyIAbKboeyz3Q+YiUWt VPTdLEIVpfAYrLhFBOO0xuOgvw2I6JNBhfNmW6K4oB7VAsnSpyuD1QUMKUp2N29SBOPc 11oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716305696; x=1716910496; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0rTfPVP4sEXoI/c4pdAS3vKkM5M7v+nTWcjaWAo5UlI=; b=o2S3EoT7/BKP+1B89QAN8PJ7F+EC57/SJEHba2pSMF+j64Fpak5AbcZzWMIl2oGlFj IeSwB7pRVx4lf0L/s30dO6ZBwJtkIbMbnOeGd/oGtH5FnFUQ0Knkp+vPQOhFtCP2XfJN LiVfpg968QAJQ+0olyDSxz1gi8a19b5iKKlUInjS+xbyb2JKuFW3sBnRglqoB9SATyks Mb8ZDIICTgYcB/tcfBx4dVNL1YXVPUjTjwRanNXq3i6c7yk6994W4YhX5BptmLGncBVW zMcujBYzPeJJQRNsWGTYWtdigvbIiTwPrJKOeBYtkJdLWY6EmDeYGcKFjQd4HacsNIoE y1yw== X-Forwarded-Encrypted: i=1; AJvYcCX8N2MqrVL4TQRsb01vSXUyIU9r5HoX9C+KUgBJa5iDKf49tMgE/DmaXRMoGruLf2oo7YJm12B5aEwIGg2qNR1bg+wHvYHuhTGeeKxq X-Gm-Message-State: AOJu0YzqakbcOS3iKP3NnJeGaL8Nv+nuORdGoqrolTqxulcO8D/TAuDq 57NkSRwoYb/iNaEC8STBvclqTCkI1hUp+hOfITWrufLsEOoeVWgilZEHGJwQ X-Google-Smtp-Source: AGHT+IFxGFUbE5hlOlh1iw4kvmrRHnhBczIBwekTMTQXrOwej/fpIT3SCKOMq5BnRUO5R7kmAhG0hA== X-Received: by 2002:a05:600c:35cd:b0:420:1508:f0b2 with SMTP id 5b1f17b1804b1-4201508f247mr247197415e9.40.1716305696434; Tue, 21 May 2024 08:34:56 -0700 (PDT) Received: from [192.168.1.130] (51B6D146.unconfigured.pool.telekom.hu. [81.182.209.70]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42013c5fa61sm368737285e9.40.2024.05.21.08.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 08:34:56 -0700 (PDT) From: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= Date: Tue, 21 May 2024 17:34:51 +0200 Subject: [PATCH 1/3] iio: light: stk3310: relax failure to match id Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240521-stk3311-v1-1-07a4966b355a@gmail.com> References: <20240521-stk3311-v1-0-07a4966b355a@gmail.com> In-Reply-To: <20240521-stk3311-v1-0-07a4966b355a@gmail.com> To: Jonathan Cameron , Lars-Peter Clausen Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?QmFy?= =?utf-8?b?bmFiw6FzIEN6w6ltw6Fu?= X-Mailer: b4 0.13.0 Relax failure to match ID to a warning rather than probe fail. This add abilty to use other compatible variants when chip id is not defined in the driver. Signed-off-by: Barnabás Czémán --- drivers/iio/light/stk3310.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index 08d471438175..7cae261541c6 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -477,8 +477,7 @@ static int stk3310_init(struct iio_dev *indio_dev) chipid != STK3311_CHIP_ID_VAL && chipid != STK3311X_CHIP_ID_VAL && chipid != STK3335_CHIP_ID_VAL) { - dev_err(&client->dev, "invalid chip id: 0x%x\n", chipid); - return -ENODEV; + dev_warn(&client->dev, "unknown chip id: 0x%x\n", chipid); } state = STK3310_STATE_EN_ALS | STK3310_STATE_EN_PS; From patchwork Tue May 21 15:34:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= X-Patchwork-Id: 13669529 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 6CFBD144D24; Tue, 21 May 2024 15:34:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305701; cv=none; b=YsTDCC5MVRIPMveNumQHAi9uBEXXWTaUD/8LZkk0UwJIVDfLMaMBWJ/O+lOyOMmhDMi9a896Ru1bpxQFfNAddc01hL44iUT5b/2kcSmUb7yraft8NZbyvMXd3yHubpfJDhzyQWXW5JiCTgNGj0VOYPIelHh9Jk+yvkqV8fWAjYc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305701; c=relaxed/simple; bh=yVca4Azo07IIKs/CnJ5EUgKmSD62PNWM3PW3gtNBLNQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h6M7DyCn873I1/1CcxXtTQ0SHXPFkIaa0WzB4AOvAGBvgUNyt/bz4wFzOZhB7SkiWUp5zji6aGbvibuD4YrSdur32LF0EL9GPSvPg9tj0339jhBRXPBXBe8gVPHX/Qgr6++7idc6oVYdaGTDGT8dGHDhjDejrNtT2CG7rt+4R4Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HswmumZI; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HswmumZI" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2e716e302bdso34218211fa.1; Tue, 21 May 2024 08:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716305697; x=1716910497; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Lvgbq91/6HEHU1LdvaNMtkZEi5kvFS6+7y61hOHHWTM=; b=HswmumZIjqP8t9CrOwHZxyQ5NAQoTTDDYV1QF4XJIJhMwd/OhtFAaTAdHSxs0m8QVa T/7qC5+JYa/0IJUBArZnl5K2eFLM82HpOD9+y/rz5ROamyormeldOb9STmJkDrrNEWgI +m9bIvKiwg+h2Ww9hgxdO5IT7aGg59P3fU85yJ9b+GrmrfWQF73RIwn76q6VulUHQfcz 9NUeLRT9JGwvDG1I7PzBJf5vJJnU1sohcUrt6/QReE2PBTlOgQR8ap3vxFzN3QhIXA1I JF0jfivLOkompPjIX6A3Tiizs46rBP5WY7AUDJl6lZ0ZzrS+UrSfxCgiB11En9Yu828u mtTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716305697; x=1716910497; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lvgbq91/6HEHU1LdvaNMtkZEi5kvFS6+7y61hOHHWTM=; b=biRK8IRWPp66NoZatkzJMwOzRf36z5MRbkVk3giL0nmW+Wo2/tOPgzC6bRnrD2CBKU D55jugXj4FRnOEiTDErDyvwmOBRXb+f0H4tfnMvYOn2DkiOOEvYkO3oILo0MzQqVJ750 XQthFSUYRqqgWrY4YrFJRSj4TUUTSpCbFfDMyX6Q68RWEjXFoMbHF6ftkNkQ3qn5Ee/q ZYtKXyhWZ0tclhdHPJbNZLCn7DwigfqKHuErlB38FTUgm6LH05cg+ebhSb+V4lIWUeTM cQI37I5TLfKF6SVFOQOMxQxHBo2vgilIVd9ZIgHRupA8bu4DSNX1izPmcfLsqE2zUv5+ Ci6Q== X-Forwarded-Encrypted: i=1; AJvYcCXx10E8WiuZ6I1AF2ghANpriQJ49V3QHfd5Nf84U3f06TP/cgM+KqO/IKvGjd+CO4bMyhy/l+kdS6T3vs9p8edomBC8RVNHBrA9XR8J X-Gm-Message-State: AOJu0Yy6NI3q0zI5Tli5dY1wFkfL1ef3jR2cqlrYLboMbYe2MXe0+78K g0bMpwCRXppzciBndeVkyUY0vg8fdn5DJhHX5OkOOX0eyh3Lu6bTEe103NO5 X-Google-Smtp-Source: AGHT+IEHfUlVmZ0akfqu2R79FCpHCIRSlYLhug7s9ZU2T7tLnmzRnUUrHpFQ36wnEy+KiN5beUdzfg== X-Received: by 2002:a2e:be13:0:b0:2de:25e2:6187 with SMTP id 38308e7fff4ca-2e51fe57b06mr231624511fa.23.1716305697265; Tue, 21 May 2024 08:34:57 -0700 (PDT) Received: from [192.168.1.130] (51B6D146.unconfigured.pool.telekom.hu. [81.182.209.70]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42013c5fa61sm368737285e9.40.2024.05.21.08.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 08:34:56 -0700 (PDT) From: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= Date: Tue, 21 May 2024 17:34:52 +0200 Subject: [PATCH 2/3] iio: light: stk3310: make chip id check expandable Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240521-stk3311-v1-2-07a4966b355a@gmail.com> References: <20240521-stk3311-v1-0-07a4966b355a@gmail.com> In-Reply-To: <20240521-stk3311-v1-0-07a4966b355a@gmail.com> To: Jonathan Cameron , Lars-Peter Clausen Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?QmFy?= =?utf-8?b?bmFiw6FzIEN6w6ltw6Fu?= X-Mailer: b4 0.13.0 Modify chip id check for support easier additions for compatible variants. Signed-off-by: Barnabás Czémán --- drivers/iio/light/stk3310.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index 7cae261541c6..5b3fe98af9c9 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -81,6 +81,13 @@ static const struct reg_field stk3310_reg_field_flag_psint = static const struct reg_field stk3310_reg_field_flag_nf = REG_FIELD(STK3310_REG_FLAG, 0, 0); +static const u8 stk3310_chip_ids[] = { + STK3310_CHIP_ID_VAL, + STK3311X_CHIP_ID_VAL, + STK3311_CHIP_ID_VAL, + STK3335_CHIP_ID_VAL, +}; + /* Estimate maximum proximity values with regard to measurement scale. */ static const int stk3310_ps_max[4] = { STK3310_PS_MAX_VAL / 640, @@ -197,6 +204,16 @@ static const struct attribute_group stk3310_attribute_group = { .attrs = stk3310_attributes }; +static int stk3310_check_chip_id(const u8 chip_id) +{ + for (int i = 0; i < ARRAY_SIZE(stk3310_chip_ids); i++) { + if (chip_id == stk3310_chip_ids[i]) + return 0; + } + + return -ENODEV; +} + static int stk3310_get_index(const int table[][2], int table_size, int val, int val2) { @@ -473,12 +490,9 @@ static int stk3310_init(struct iio_dev *indio_dev) if (ret < 0) return ret; - if (chipid != STK3310_CHIP_ID_VAL && - chipid != STK3311_CHIP_ID_VAL && - chipid != STK3311X_CHIP_ID_VAL && - chipid != STK3335_CHIP_ID_VAL) { + ret = stk3310_check_chip_id(chipid); + if (ret < 0) dev_warn(&client->dev, "unknown chip id: 0x%x\n", chipid); - } state = STK3310_STATE_EN_ALS | STK3310_STATE_EN_PS; ret = stk3310_set_state(data, state); From patchwork Tue May 21 15:34:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= X-Patchwork-Id: 13669530 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 1F4C8143890; Tue, 21 May 2024 15:34:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305701; cv=none; b=awmaQcyS1UjTfRPYjKNivYwm8f6uCE5Btb3U0tu4p3325hqSAJl4Ef5I7IC4cQmfu9dnMJKHI7C8I7rZD8yM2bM4HFPe63zUm7INikycEiM3ee7Bvnyx1kIa2M7H5EqdgWXvnPhaQrrcKxNxVhX2dOh885xP2C6VbU6CG8+STik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305701; c=relaxed/simple; bh=IhbufTRNj1fsqNMJmPo1i6lTZleZnqfHZ5ZVklTF00M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BI/Wa6vNBBYv/ahmkwlg7EQlHpOAZg4WzZOFwBuOmakpWfmNC+jbYVVFUBmc+9tspmSj5vLt6IfsOqZYqH9mYrgENbh87y14o72qiUO2jm4hsAaKIqD8s5x7rWl25pVUOJHkyHR85UGdKjj4l9smQWJrDZTxGFgztinmliIVsvA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=h6CG0M1Q; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h6CG0M1Q" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4200ee78e56so31251185e9.3; Tue, 21 May 2024 08:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716305698; x=1716910498; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Z3RuTPxmjmQFVuJzzTgJATCtyYrNLyLjxNXWjIoUyj4=; b=h6CG0M1Q1BPfxAuH+hKUPgNFnShaX/GzyWoWleENe2wVw53sbqYaTNptBuGL4EhSVF V6mS6O84XiQOEveKT6TXhv+U4o6NiD2TfcYj6mpIhVIHse1AJqdtG1wWEsSXMC3+3VBq ywMyieq8VX8MtW38mLHXrYc1C+AVcMIMLwHfjPlj9nzexT7XOZJEPZuXESPHWUBQlojv JClRvCdX74yZL7loVku6U43v617cd89aNRDrElqtuzgiillpCnnouE8YNJID/UdFHuCb OkJ+1WUX83r//Dt5rbPSMaxniPKtc9qjPTtz9xQtH1kWhEeiXdnjCmbNGrNzqjtc5Vev f5DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716305698; x=1716910498; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z3RuTPxmjmQFVuJzzTgJATCtyYrNLyLjxNXWjIoUyj4=; b=VYCT2X7icj0NJkftvEkIjkrhqRe+jxwLHYhAtIr0w1Pe/oQDfEPH5eHa2qeO21aaVx /IK8JN6kp4Jgu3HaQfjuLqJ2OJHLKqXtLT3iLDcAAzNvk2DQcFj5cXHO2flujokFSF4k P1I0fmwMoPHBFJhOVd1eR352dADWoeBKErogIoxl+xWNnSwwrpPffp7l3N4Q9ZIWJ2py oBoK/AxD7QgryFqh4p85lCDb+kqEOx/I2KR8vs5T9KSFabcLKQnHtVnxDsin/Gheft/G 8zjdiz++UXzxK9Guxyu9AJ8gx707bRCne93iTW++Ngtx1HEKGcKHaEu2s6wYrwsmO3/I sH5g== X-Forwarded-Encrypted: i=1; AJvYcCXEUUyWQsV5w1kJmLiNDYpP4GeGOeraveiQ6NM0jD1ZHk8hLLBg2CFW1dI76xRpYVdRmcRneNKREq+G48r5eSuMTE22UWP7tpBnS36t X-Gm-Message-State: AOJu0YxTbpbdCZwrf6nfFJ5/kRMKSjo8Vvj2Gx+g7jEZyVAChYPZnlrg 26poKge0+21rBse29UV62Im4/D86vos2AajBleDBcFYheMpTcZTq6DPpP7UP X-Google-Smtp-Source: AGHT+IH5QKibLyDcTpAV+T6KJg6LGOZDcU+2pdVCXEiga1AgYpwzKY/iH/ItyXSKh1v2m6J1Ro+vOg== X-Received: by 2002:a05:600c:450e:b0:41b:d8ef:8dcd with SMTP id 5b1f17b1804b1-41feac59ea0mr240309145e9.28.1716305698403; Tue, 21 May 2024 08:34:58 -0700 (PDT) Received: from [192.168.1.130] (51B6D146.unconfigured.pool.telekom.hu. [81.182.209.70]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42013c5fa61sm368737285e9.40.2024.05.21.08.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 08:34:57 -0700 (PDT) From: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= Date: Tue, 21 May 2024 17:34:53 +0200 Subject: [PATCH 3/3] iio: light: stk3310: support more stk3311 variants Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240521-stk3311-v1-3-07a4966b355a@gmail.com> References: <20240521-stk3311-v1-0-07a4966b355a@gmail.com> In-Reply-To: <20240521-stk3311-v1-0-07a4966b355a@gmail.com> To: Jonathan Cameron , Lars-Peter Clausen Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?QmFy?= =?utf-8?b?bmFiw6FzIEN6w6ltw6Fu?= X-Mailer: b4 0.13.0 Add support for more stk3311 variants like stk3311-a and stk3311-s34, they are register compatible but they have different chip ids. Signed-off-by: Barnabás Czémán --- drivers/iio/light/stk3310.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index 5b3fe98af9c9..2905c9feff1a 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -37,6 +37,8 @@ #define STK3310_CHIP_ID_VAL 0x13 #define STK3311_CHIP_ID_VAL 0x1D +#define STK3311A_CHIP_ID_VAL 0x15 +#define STK3311S34_CHIP_ID_VAL 0x1E #define STK3311X_CHIP_ID_VAL 0x12 #define STK3335_CHIP_ID_VAL 0x51 #define STK3310_PSINT_EN 0x01 @@ -83,6 +85,8 @@ static const struct reg_field stk3310_reg_field_flag_nf = static const u8 stk3310_chip_ids[] = { STK3310_CHIP_ID_VAL, + STK3311A_CHIP_ID_VAL, + STK3311S34_CHIP_ID_VAL, STK3311X_CHIP_ID_VAL, STK3311_CHIP_ID_VAL, STK3335_CHIP_ID_VAL,