From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 023EC4418CC for ; Wed, 6 May 2026 12:19:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778069970; cv=none; b=KWFJm5gnNni7mPckL/sbKJXW4Jme3S/FhVtBiWNMWmORy/tx0Us1ye3CiEjfl8j2l5ks87cZ/0kNCHlZWAPssHlMyQPeFlj/7WgCDbh7w4tRhclvWccHLsEizFcUyeUivBpUu0Qa4cmUrhfTNL5MQOIpOTycfiGCmd2yAlJeAmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778069970; c=relaxed/simple; bh=WEYp9Pc0nIkcN+xiiA1sakOUxmN97k9d9UtFeOmdugw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BY786Q6sHz1/NbTdLYdSpe3V3kl+hdDJ+zS0VzObENzjfs9kvhA5/QS8vtPlgRCkGAOap+b8S/8+C+Oe07KE2H+IIYhqcOEHDaoH1XP4gN5d6Mh7Q0ZG3cLAXAkCCorZMcAK/uOpLNnRhObRuUs42vXLVe7vYtCjOvA52VoX0mg= 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=o0LYvXeq; arc=none smtp.client-ip=209.85.221.45 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="o0LYvXeq" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-43d64313c39so4545282f8f.3 for ; Wed, 06 May 2026 05:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778069967; x=1778674767; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ky0aM7E+PpEfVJyxjQiWZoXt7cbpeu7WIfgg1hOUvWE=; b=o0LYvXeqnxoCGEX67GwRVKjo3GblJyccEPOt+tAslGVlejoFPhL+u4tgXdoUNHmE2H /qV9IJXutBJwrJqrXR8qSRKNqId8sXftB6HDjVhRp1eMnDAd/epQejCWMoNtLm2sbVOR +AwqPCQHJPCIdF6UC/nI4SdTGA2KT6f6FMleA7ycEOpv0OUE8FihTMP2MtSQGeLx3FfY LtB1DZ82qsAeaUZAZHERyX5GUAlNp15DL90vP0CYVUox9TwA7xhIF2vv36eUlMJgyCni aPwN1m4UNyoeU69eWN8jwDhWCblmykCUbSqthf1vyy+fh8aIq3TCwM63k7xoQjpiHOvT F7tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778069967; x=1778674767; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ky0aM7E+PpEfVJyxjQiWZoXt7cbpeu7WIfgg1hOUvWE=; b=os3xe/tGPuNmzAodUSoSZyd6YKMGnO642W8iOHNY+BCY7r+Fh9GL+VyBcU/pX+Vch+ 7Rv3hlBkku3vKCo9ScHYeM4rsj7FooYSmGssJ5TM3tWaASPKb+7c4hcKgk/oH/WgooeU dP7Hn2wwrPMvq4/8s80HgSJN5ok49O5K+zVEIJuDMZ+9nuUBDffztdCKDLFfhhoGRdzJ Qozne8W0+qy2MoKVj/etgTpuQXA2a2HfVko7h4vidsH29FKrVRttF5XLvFB4F2CKKHT/ xWUXj6++OIMelM8/byMV6WPxgI2Fo9KTsbyc1UJGeuFpQGDg1ZYbl6T4zM5hY8G6m860 k8+g== X-Forwarded-Encrypted: i=1; AFNElJ8zgQSX7nNOtLthcd6694OAuHPY1qN3RfiPIEUFH96zb5XTRf8HMeyZed17n8eWSDiNx7C8lFa/5XPjkf4=@vger.kernel.org X-Gm-Message-State: AOJu0YwPnRf0lvTw2wTwqpmXzErIY3wIIEJn1AXy/x8aPwRrgaCWWNW7 cv0NUW28Qq5y6OAgJPK7q6G6jcgHODy7toPMg7o4mN7SLcblVKq3jtyr X-Gm-Gg: AeBDieskDBjvmU0AmTwGcWKzpMDJUPBHZHK/omUhy3e05d/mBd0moxSMnbxPjnbCcIq rI8YKnheNaXUv2wJ/yVk/4xmRk6cfviycx+x22jCvlGrfsuHOLJabT+t67NHjPpVtMvFZjzP+MA caxPCRbTI5udE3hSPCJimyCKTHJdG/ZLdTgSKsVk5XSMK/0+of9Sd9YHsJJLoQziENsHggSJs4I tKsITkpwar2PsgrNYQY4zsQ0jFm2DaUxnh2jxsNde4nGJ+vCjKwFWQfzlWHYuGt38Rt/PCcWd5X ojSgY9sja/LMzuGZg3D6JVkB5izlk1HkoMnmluAqt8zo3aACfmEJ5wHo4QyCD9EPsAGQPDJjLIr 6HM+FqdbFOfZuol3CwUfzeTdWUT4sPCwXKbImVQ4+HLEQB00YEDvvhkB0aGmk5wMCpjwD2ZcQ4f fKPMDWiXzMWI4romKMzLcbk5/s9++5Xo9CrPhriKJ9 X-Received: by 2002:a5d:5f90:0:b0:44a:8c10:40dc with SMTP id ffacd0b85a97d-4515b9f3c74mr5875556f8f.18.1778069966515; Wed, 06 May 2026 05:19:26 -0700 (PDT) Received: from [192.168.37.44] ([217.61.173.50]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45052483166sm12046902f8f.7.2026.05.06.05.19.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 May 2026 05:19:26 -0700 (PDT) Message-ID: <1c02501f-c9f5-4b94-bc9e-a6f1f07209f7@gmail.com> Date: Wed, 6 May 2026 14:19:24 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/3] iio: light: tcs3472: devm conversion, wait time, locking cleanup To: Andy Shevchenko Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, shuah@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linux.dev References: <20260506094311.222500-1-aldocontelk@gmail.com> Content-Language: en-US From: Aldo Conte In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/6/26 12:21, Andy Shevchenko wrote: > On Wed, May 06, 2026 at 11:43:08AM +0200, Aldo Conte wrote: >> This series of changes modernizes the tcs3472 driver by completing the >> devm conversion and updating the locking style to use an automatic >> guard (mutex). Furthermore, it implement control of the WAIT state, >> resolving a TODO. >> >> Patch1: Converts the driver to use device-managed resource allocation. >> This removes the need for an explicit remove() callback, since cleanup >> is now handled automatically. It also adds a new function called >> tcs3472_powerdown_action() that powers down the chip when the driver is >> unloaded, removed or when probe fails after the chip has been enabled. >> >> Patch2: adds support for the wait time resolving the old TODO comment. >> The user can control the WTIME indirectly by writing to the >> sampling_frequency attribute. Changing the sampling >> frequency attribute results in a change to the wtime while preserving >> the current integration time. >> Similarly, if the user has previously set a sampling frequency and >> then changes the integration time, the driver re-computes WTIME so the >> previous frequency is preserved. The patch also handles the deactivation >> of wtime when the requested frequency is very high, as well as the >> extension of wtime to its maximum values (by enabling the use of WLONG) >> when the requested frequency is very low. >> >> Patch3: converts the remaining mutex_lock()/mutex_unlock() pairs to >> guard(mutex). >> >> All patches have been tested on a Raspberry Pi 3B with a TCS3472 >> connected to I2C-1 at address 0x29. Sampling frequency and integration >> time changes have been exercised checking the value of WTIME and >> consequently WEN and WLONG. Raw RGBC reads, calibscale, integration_time >> and threshold events continue to work as before. > > Thanks for contribution, unfortunately this series needs much more work > and more preparatory patches as well. I have reviewed the current series. > Please, follow and address (or comment why it can't be done as suggested). > Thank you for your review. These mistakes are undoubtedly due to my still limited experience. I will start working on them right away. Best regards, Aldo Conte