Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp685170ybz; Wed, 22 Apr 2020 06:11:28 -0700 (PDT) X-Google-Smtp-Source: APiQypIU/jseRfV46n21gVbWmwT5gDYu6la6ChzjX5cpTsF0o62pIu0UrIVr8uV6Xbd9/oVkTw5B X-Received: by 2002:a50:eb8e:: with SMTP id y14mr23195465edr.270.1587561088732; Wed, 22 Apr 2020 06:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587561088; cv=none; d=google.com; s=arc-20160816; b=XGPgOnUMB+RidpRALJ7o57ZfyO21h5C7uUyRz3P0to++NggtOw8aGvuhuheOrTL7Mk b+8wG/KQdLtHlqjlfjS/MzH5JwMZGtQ7M9AxJzlfofKswzEGNzwDzS177rVaqUXEVlHZ L6Js60K9i8e95RU4pTDVtIQFsky5Xe1IEHGs0YbsfUIf2+2Ys8ClDO2Lz4yfwJEAOIG4 Gg5BTLWKDUkDwF2LVVt56ll85MFxE1SuznJfEfiOSyHlq/QW2pAwgAgg/okUt/+f+7Ov uQtanhaAQ8PD3R3KrJg6Qxa/bXmxJs/qzxsZtLztsUqZGlCdgsfCr5wODrDQ6L9C/TMN S0LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RKZeIF5oa3PJGYfL412u0zBLwHBoYTt9cbGj5XIHl7w=; b=bjwzXk8mS1CDDc7Mf+6g2HhmXJa9m4ruoqkc5yE678V+gzeaIST3DF3ha12Eajf0sD hQmRlKt8CDjcS3JgAN43m9A22SGFwWfWcngFbfosSHNuqEV0o+TFksMmQCqZhJ8xndHt 9mNXmW1/tS+ooXim4D67hXoi2XtsUw5VVflfAWzyTre81aIX3SUJplCpqMXgi+T7E0LZ b823sN0oHg5BmEQSzNc/95tRkX+VWILE8ft5gHpxgaOAuCaKxKf80SKHUY+JAv2v415A lNRQeO4MtYhF5ype6S8pCTRaEk+Yl7T5OFQ4ILwzZOoq9XDQUE9HFgza5ECWyhIqolGL WWXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NZ8PkCeH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn15si3351035edb.555.2020.04.22.06.11.05; Wed, 22 Apr 2020 06:11:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NZ8PkCeH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbgDVNJI (ORCPT + 99 others); Wed, 22 Apr 2020 09:09:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725810AbgDVNJH (ORCPT ); Wed, 22 Apr 2020 09:09:07 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83374C03C1A9; Wed, 22 Apr 2020 06:09:07 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id v4so4915108wme.1; Wed, 22 Apr 2020 06:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RKZeIF5oa3PJGYfL412u0zBLwHBoYTt9cbGj5XIHl7w=; b=NZ8PkCeHEJb93tczaENRAIVlVsv5YvvQfIvNgzZqUu90AJ2bRIxEhOHszY209N/LLN uFndkxXGY1EJGgQlzVnWX+F6wk8mfNgrdTtMmC6SJ+9hV/6wIntc7oU4j7ku1ASfNjGT AkiyNOQO2FD7kfl8UmcKrH0Qkfo3SooN5iYYvkGUn5MWryhIxaYYTmQ/+uVByK5+5Lan pcKv3RjWbLoplpSPoK0MI7f4LXUuqqMhmz3CgIWyv/iM42JqvG0/daXbMxt5mHkVlbce D60rNLSNGzc4YX5P896pH05DNWDOFxOLZs8DfEa7Rfjszbb9arilSw4GmHpVK9FO1tr5 LUnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RKZeIF5oa3PJGYfL412u0zBLwHBoYTt9cbGj5XIHl7w=; b=oTDNaJsLO/bkIvR/wt5z0P0Hc1MxT7/IKf9RK1EO19Fxz9VZ4ln2rAojlMysYhDkCu MXDffzpxMAmp4gSV3ZQmpGMPEergB2Rk0QbOLOkH8Qhoe+2Ck+x/AgoE8MiN/NIDpM40 t+yXSkBCjoZfDWgWgLlTzGTFLVMBgcacSkBPdnaYzan1+yxr4LN7EhdI1spNSqNvA0jU khYfkcfh5OpzNpqVt+PXp31HkRQYIKeVfZYF8whCVUw1kjwD+5aZM3V7rsc3r2oToUKI FHxAQrs4FwbOjyfFf7w6/BaFVR+Fzzx3NWGBSjTxAaqk5H6ZvJBE9InK2D4vNEJqVXoD UsQQ== X-Gm-Message-State: AGi0PubiDOpP1bEUj23FQhS/sYBNMxktFWipPQ3361jtC/5yBnaa1Pkk o/kXFtjFC4kfpzbRlpa34QQ= X-Received: by 2002:a05:600c:2218:: with SMTP id z24mr10372240wml.82.1587560946273; Wed, 22 Apr 2020 06:09:06 -0700 (PDT) Received: from meru.fronius.com ([2a01:cb18:832e:5f00:8872:7e71:5cf6:8a5b]) by smtp.gmail.com with ESMTPSA id o3sm2064820wru.68.2020.04.22.06.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 06:09:05 -0700 (PDT) From: Mathieu Othacehe To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu Othacehe Subject: [PATCH v5 0/4] iio: vcnl: Add interrupts support for VCNL4010/20. Date: Wed, 22 Apr 2020 15:08:52 +0200 Message-Id: <20200422130856.1722-1-m.othacehe@gmail.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Here's a v5 taking Andy remarks into account. Thanks, Mathieu Changes from v4: * Rename vcnl4010_in_periodic_mode into vcnl4010_is_in_periodic_mode and vcnl4010_thr_enabled into vcnl4010_is_thr_enabled. Also fix bitmask checking in those functions. * Refactor vcnl4010_write_proxy_samp_freq to loop in the other direction. Changes from v3: * Use i2c_smbus_read_byte_data and i2c_smbus_write_word_data for read and write functions. * Rename vcnl4010_prox_threshold to vcnl4010_config_threshold. * Do not lock i2c accesses as they are already protected. * Fix a typo in irq name. * Do not provide ALS sampling frequency operation, as ALS data are not buffered anymore. * Return bool in vcnl4010_in_periodic_mode and vcnl4010_thr_enabled functions. Changes from v2: * Rebase on iio testing branch. * Remove useless test in vcnl4010_probe_trigger. Changes from v1: * Split into four different patches. * Use iio_device_claim_direct_mode to protect raw access from buffer capture. * Requesting a sampling frequency above the limit is no longer possible. * Inline read_isr and write_isr functions. * Remove IIO_LIGHT data from buffer capture. * Make sure postenable and predisable functions respect the common form. * Do not set the trigger by default. * Remove the devm_iio_triggered_buffer_setup top half. Mathieu Othacehe (4): iio: vcnl4000: Factorize data reading and writing. iio: vcnl4000: Add event support for VCNL4010/20. iio: vcnl4000: Add sampling frequency support for VCNL4010/20. iio: vcnl4000: Add buffer support for VCNL4010/20. drivers/iio/light/Kconfig | 2 + drivers/iio/light/vcnl4000.c | 750 ++++++++++++++++++++++++++++++++--- 2 files changed, 686 insertions(+), 66 deletions(-) -- 2.26.0