From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D0862054F2; Tue, 18 Mar 2025 13:28:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742304539; cv=none; b=PPlbauvf9hJ+bedk7YhzF3n1wCZAklDsTPnV2KFL2F+5CcwIXNG4WTn68OrpavITt1n49p1FTvB/EoLKlwiu4lJV7GfEP8+D+LrGhH8noRhGLIN/P9HwELqWvUuY+QL4bndZQVJbeGkse6dniL+7Fz0t553B9vZetCqWke91t1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742304539; c=relaxed/simple; bh=zkloTWqSwQluyT+su4wyVRo8WPOd3qdFyiz4CAykb8I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VVE95XoQ60jKIcPS7jn3JS075s724NX+ASGFEEINU/zrT0k6t3vGPLMWZcsB//ch9UdaOq02P8VmbUO8mn7jirAS8NqA7EBBMHA3sxSjT7UCf/pZbb2t/kf73cIgBwlg4J/Rs/C7skBJ5CKfEcS4Nf993kKVxzL5X6mVgdIF2A0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pkZ/327W; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pkZ/327W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06BDAC4CEDD; Tue, 18 Mar 2025 13:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742304538; bh=zkloTWqSwQluyT+su4wyVRo8WPOd3qdFyiz4CAykb8I=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=pkZ/327WMlXWLGPqy1g2zn1K1X3FoeakUThWo0l65uMdmoESAdlvD1xTki+NDOFrZ gDXBj0fo5WavcaLqPBibqfJ2nKqFDfzq7Jx0kKO2Cc+NRJTzVK5qZbIir+Cw1hH2M2 QYOaGiHbyZVSZ9SiXavK4cncCI8FW1IrHKNVjx97keT2Xu8w+TEVSBsAoaFA1DO6A2 lNxjbbzTj1nCDCs4IK6x7LZAbL6yiKJ9UyBMDe2htktJO9EOz6+E5MJRlj3D1hOhyM ttHBxBii5PYOh9I9Z6lUMeLLBR1JpiaxZEaIWiPPUh4jNGFIwZEudeu6vgtNu2rlvf WlzUEbFu8Rp1Q== Message-ID: Date: Tue, 18 Mar 2025 14:28:50 +0100 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] iio: light: bh1750: Add hardware reset support via GPIO To: Sergio Perez Alegre Cc: tduszyns@gmail.com, jic23@kernel.org, lars@metafoo.de, robh@kernel.org, conor+dt@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20250316145514.627-1-sergio@pereznus.es> <01f48f6d-55a4-4dbe-b1ae-ef8c54dcc1ff@kernel.org> <64182937-29e9-45dc-aa2f-5f2b739056a1@me.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEM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DfTtB YpsFAmA872oFCRRflLYACgkQG5NDfTtBYpvScw/9GrqBrVLuJoJ52qBBKUBDo4E+5fU1bjt0 Gv0nh/hNJuecuRY6aemU6HOPNc2t8QHMSvwbSF+Vp9ZkOvrM36yUOufctoqON+wXrliEY0J4 ksR89ZILRRAold9Mh0YDqEJc1HmuxYLJ7lnbLYH1oui8bLbMBM8S2Uo9RKqV2GROLi44enVt vdrDvo+CxKj2K+d4cleCNiz5qbTxPUW/cgkwG0lJc4I4sso7l4XMDKn95c7JtNsuzqKvhEVS oic5by3fbUnuI0cemeizF4QdtX2uQxrP7RwHFBd+YUia7zCcz0//rv6FZmAxWZGy5arNl6Vm lQqNo7/Poh8WWfRS+xegBxc6hBXahpyUKphAKYkah+m+I0QToCfnGKnPqyYIMDEHCS/RfqA5 t8F+O56+oyLBAeWX7XcmyM6TGeVfb+OZVMJnZzK0s2VYAuI0Rl87FBFYgULdgqKV7R7WHzwD uZwJCLykjad45hsWcOGk3OcaAGQS6NDlfhM6O9aYNwGL6tGt/6BkRikNOs7VDEa4/HlbaSJo 7FgndGw1kWmkeL6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <64182937-29e9-45dc-aa2f-5f2b739056a1@me.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 18/03/2025 14:16, Sergio Perez Alegre wrote: > El 17 mar. 2025, a las 8:24, Krzysztof Kozlowski escr= ibieron: On 16/03/2025 15:55, Sergio Perez wrote: Some BH1750 sensors req= uire a hardware reset before they can be detected on the I2C bus. This pa= tch adds support for an optional reset GPIO that can be specified in the = device tree. The reset sequence pulls the GPIO low and then high before i= nitializing the sensor, which enables proper detection with tools like i2= cdetect. Update the devicetree binding documentation to include the new r= eset-gpios property with examples. Signed-off-by: Sergio Perez Please run scripts/checkpatch.pl and fix reported warnings. Af= ter that, run also `scripts/checkpatch.pl --strict` and (probably) fix mo= re warnings. Some warnings can be ignored, especially from --strict run, = but the code here looks like it needs a fix. Feel free to get in touch if= the warning is not clear.
Please use scripts/get_maintaine= rs.pl to get a list of necessary people and lists to CC. It might happen,= that command when run on an older kernel, gives you outdated entries. Th= erefore please be sure you base your patches on recent Linux kernel. Tool= s like b4 or scripts/get_maintainer.pl provide you proper list of people,= so fix your workflow. Tools might also fail if you work on some ancient = tree (don't, instead use mainline) or work on fork of kernel (don't, inst= ead use mainline). Just use b4 and everything should be fine, although re= member about `b4 prep --auto-to-cc` if you added new patches to the patch= set. You missed at least devicetree list (maybe more), so this won't be t= ested by automated tooling. Performing review on untested code might be a= waste of time. Please kindly resend and include all necessary To/Cc entr= ies.
Sorry, I had run the scripts/get_maintainer.pl tool a= nd got fewer recipients than necessary. I have redone everything in a cle= an installation and now I have obtained more recipients. Any fixes I make= in the patch I send to this same thread or should I send it with git sen= d-mail? I say this because perhaps I have done it incorrectly and possibl= y created 3 versions, I apologize. My latest version (v3) includes all th= e suggestions mentioned but due to my ignorance of the procedure I though= t they should be sent to the list again as before. --- .../devicetree/bin= dings/iio/light/bh1750.yaml | 20 +++- drivers/iio/light/bh1750.c | 113 ++= ++++++++++------ ... and please go through your patch and see what happen= ed there. 2 files changed, 95 insertions(+), 38 deletions(-) diff --git a= /Documentation/devicetree/bindings/iio/light/bh1750.yaml b/Documentation/= devicetree/bindings/iio/light/bh1750.yaml index 1a88b3c253d5..d53b221eb84= b 100644 --- a/Documentation/devicetree/bindings/iio/light/bh1750.yaml ++= + b/Documentation/devicetree/bindings/iio/light/bh1750.yaml @@ -11,6 +11,= 9 @@ maintainers: description: | Ambient light sensor with an i2c interfa= ce. + + Some BH1750 sensors require a hardware reset before being properl= y detected + on the I2C bus. This can be done using the optional reset-gp= ios property. properties: compatible: @@ -23,6 +26,10 @@ properties: reg:= maxItems: 1 + + reset-gpios: + description: GPIO connected to the sensor= 's reset line (active low) + maxItems: 1 required: - compatible @@ -41,5 = +48,16 @@ examples: reg =3D <0x23>; }; }; + - | + i2c { + #address-cells = =3D <1>; + #size-cells =3D <0>; + + light-sensor@23 { + compatible =3D "r= ohm,bh1750"; + reg =3D <0x23>; + reset-gpios =3D <&gpio2 17 GPIO_ACTIVE_H= IGH>; + }; + }; -... +... \ No newline at end of file You have unrelated = changed all over the place. Best regards, Krzysztof Hm? No clue what this means, sorry, unreadable. Best regards, Krzysztof