Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp534322iog; Wed, 15 Jun 2022 07:17:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t7hzCxLbhLnJF2Sv7udgPGIUp8qSrnW0Chepg77YyALE1j4Aa3dFdiughNfQ68GS4tV/8j X-Received: by 2002:a17:902:ce87:b0:163:fc5e:398b with SMTP id f7-20020a170902ce8700b00163fc5e398bmr9339824plg.125.1655302659509; Wed, 15 Jun 2022 07:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655302659; cv=none; d=google.com; s=arc-20160816; b=saWPkx3FwhyHdmntqPlGlMPPBJsQX3Pf2Jp1usGVg9GKYeF5xudoPmSsIuIL90jxpA LtJHGjnBI4SZfKQQPLFzoM/MwVku4fi03KU/MJJuP/UM3dsOAkAGh5scoW9+Rf0Roqqp J9l1zwbnv42A0eA+J6/H1QNyqwH1dSjrT7XqjQo/jq+aMSBTTvf4Rb9vydHVMLPU8MQ+ yGwZIGtAsWb6G1FT7BdFjK9TlGtJGWu4CZzV/tNtS+3axmDijmp+cCccbfe7+Rm8/0Bd vsV0Szdckg1Cv2xRwqFW7r9IKSbCIzKmNW+efa2Ob3VmtYl1c79EtQBpDTo2KTithtcD fibA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=odlpwrwpgrrsrH7GRNNy1Rf210OnxeUfXpoCAfOR9BM=; b=p9LqDIF4HWPr1pSlAsty2Qu/ZSwpZ51t6I4OIRiX7YKPOZ7HMaoiszf3l2eZSftVcO zY1Xx2Pn77ffJ/ospFdoaJuwYu9zo4L3mGS5i7Yu/uCS9bUFoqNYcWiB8b5yrhlBaKkG 4Fg/z/m78hc2zxhZFivz9oDw7yTJwMC2eFf/A9N8u/MhYIX8unI6Aqymr0PqeNHNrl7a fuhOf3LDyqMIVjnTYmgsEHjk3LVK33KlzVMFFtbMG+2nZUPeiaEIiRxG8W+3X9fPFLpz ZQpdwrbkJFfnC0vjYpS5AISR2ZznFyuW7y6YQsd6667s+VvVYk80ZveMNzlRPnD1h37q Fjmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LpYtRhqr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f11-20020a170902ce8b00b001637d6a52e8si19617278plg.19.2022.06.15.07.17.23; Wed, 15 Jun 2022 07:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LpYtRhqr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343956AbiFONwD (ORCPT + 99 others); Wed, 15 Jun 2022 09:52:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239803AbiFONv5 (ORCPT ); Wed, 15 Jun 2022 09:51:57 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 521E53C717; Wed, 15 Jun 2022 06:51:56 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2405:201:10:3153:7fbd:8a7b:29b6:89fb]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: shreeya) by madras.collabora.co.uk (Postfix) with ESMTPSA id 7B37D6601701; Wed, 15 Jun 2022 14:51:51 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655301114; bh=izgURzLTy40gnm0phiG12h3sKNra6Vhk2TKfrtJGjtw=; h=From:To:Cc:Subject:Date:From; b=LpYtRhqr1HskmYyVVVlRdDuc84lU1+qwAyYlPHRFYCxj8tWaIyaP2tcUf23f+oVxS Tg4hSCDBbkprsaxujxhuzRI2KfWr7zBlI1ZMPq2A2fWS/jNsof8IQbqOynB9OQTk+d BU9TALaDqNYcGWnGR+Uhq47gqcrbC7iAfW0LIJbpgpq5QfSR3M4XTPmiZllTW0xy48 jA+WHNNfh55w3dlykVcHjNl3vk9oJjBjETetDjaaXvlIiA26BII0NbhlKl05Nb1sEy FM+NTZiTr3Wm+ghzhs+v47LBQzPcfx37HVrZMChNrsQ0UjqRiv7BPNcM98TOqC/M7U ecaeM7632wRYg== From: Shreeya Patel To: jic23@kernel.org, lars@metafoo.de, robh+dt@kernel.org, Zhigang.Shi@liteon.com, krisman@collabora.com Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, alvaro.soliverez@collabora.com, andy.shevchenko@gmail.com, digetx@gmail.com, Shreeya Patel Subject: [PATCH v6 0/2] Add LTRF216A Driver Date: Wed, 15 Jun 2022 19:21:28 +0530 Message-Id: <20220615135130.227236-1-shreeya.patel@collabora.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds support for ltrf216a Ambient Light Sensor and documents the DT bindings for the same. Changes in v6 - Fix some errors reported by kernel test robot. - Add protocol details for the datasheet link. - Remove useless assignments. - Add unit details for read data delay macro. - Use pm_sleep_ptr(). Changes in v5 - Add power management support. - Add reset functionality. - Use readx_poll_timeout() to get data. - Cleanup some of the redundant code. - Update int_time_fac after I2C write is successful. - Rename mutex to lock. - Use Reverse Xmas tree pattern for all variable definitions. - Improve error handling messages and add error codes. - Add one more MODULE_AUTHOR. - Remove cleardata which was reading data for infrared light. - Remove patch for deprecated vendor prefix [PATCH v4 3/3]. - Remove deprecated string from DT binding document. Changes in v4 - Add more descriptive comment for mutex lock - Fix mutex locking in read_raw() - Use i2c_smbus_read_i2c_block_data() Changes in v3 - Use u16 instead of u8 for int_time_fac - Reorder headers in ltrf216a.c file - Remove int_time_mapping table and use int_time_available - Fix indentation in the bindings file. Changes in v2 - Add support for 25ms and 50ms integration time. - Rename some of the macros as per names given in datasheet - Add a comment for the mutex lock - Use read_avail callback instead of attributes and set the appropriate _available bit. - Use FIELD_PREP() at appropriate places. - Add a constant lookup table for integration time and reg val - Use BIT() macro for magic numbers. - Improve error handling at few places. - Use get_unaligned_le24() and div_u64() - Use probe_new() callback and devm functions - Return errors in probe using dev_err_probe() - Use DEFINE_SIMPLE_DEV_PM_OPS() - Correct the formula for lux to use 0.45 instead of 0.8 - Add interrupt and power supply property in DT bindings - Add vendor prefix name as per the alphabetical order. Shreeya Patel (2): dt-bindings: Document ltrf216a light sensor bindings iio: light: Add support for ltrf216a sensor .../bindings/iio/light/liteon,ltrf216a.yaml | 50 ++ drivers/iio/light/Kconfig | 10 + drivers/iio/light/Makefile | 1 + drivers/iio/light/ltrf216a.c | 429 ++++++++++++++++++ 4 files changed, 490 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/light/liteon,ltrf216a.yaml create mode 100644 drivers/iio/light/ltrf216a.c -- 2.30.2