From patchwork Wed Jul 25 15:18:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Novotny X-Patchwork-Id: 10544149 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE6DC1805 for ; Wed, 25 Jul 2018 15:25:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE0FD2A463 for ; Wed, 25 Jul 2018 15:25:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC5522A4B8; Wed, 25 Jul 2018 15:25:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA6212A4B3 for ; Wed, 25 Jul 2018 15:25:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728436AbeGYQhl (ORCPT ); Wed, 25 Jul 2018 12:37:41 -0400 Received: from hosting.pavoucek.net ([46.28.107.168]:33612 "EHLO hosting.pavoucek.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728579AbeGYQhl (ORCPT ); Wed, 25 Jul 2018 12:37:41 -0400 Received: from tomas.local.tbs-biometrics.cz (unknown [176.74.132.138]) (Authenticated sender: tomas@novotny.cz) by hosting.pavoucek.net (Postfix) with ESMTPSA id B83A9102B94; Wed, 25 Jul 2018 17:18:32 +0200 (CEST) From: Tomas Novotny To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Tomas Novotny Subject: [PATCH v3 0/4] iio: vcnl4000: add support for vcnl4200 Date: Wed, 25 Jul 2018 17:18:17 +0200 Message-Id: <20180725151821.17566-1-tomas.novotny@tbs-biometrics.com> X-Mailer: git-send-email 2.12.3 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tomas Novotny VCNL4200 is another proximity and ambient light sensor from Vishay. I'm adding support for that sensor to vcnl4000 driver, which currently supports VCNL4000/10/20. The VCNL4200 is a bit different from VCNL4000/10/20. Common things are: - integrated proximity and ambient light sensor - SMBus compatible I2C interface - Vishay VCNL4xxx series... Different things are: - totally different register map - 8-bit vs. 16-bit registers. The 16-bit values are in two 8-bit registers on VCNL4000. 16-bit value is in one register on VCNL4200. - VCNL4000 has flags when the measurement is finished - blocking read is implemented for vcnl4200 (there is no 'ready' flag, just interrupts) It is tested on VCNL4020 and VCNL4200. Changes in v3: - improve commit message of 2/4 (clearly state that it is groundwork for another change) - add vcnl4020 device id to the list of supported ids Changes in v2: - reading light and proximity values for vcnl4200 is blocking (if you request new value too early) - patches 2 and 3 were added; original patch 2 is now patch 4 - vcnl4010 id is handled (patch 2) - warn user on incorrect usage of vcnl40{0,1}0 id (patch 3) - minor stuff (add parenthesis, switch instead of if, rename sensors to channels, fix return) Tomas Novotny (4): iio: vcnl4000: make the driver extendable iio: vcnl4000: add VCNL4010 and VCNL4020 device id iio: vcnl4000: warn on incorrectly specified device id iio: vcnl4000: add support for VCNL4200 drivers/iio/light/Kconfig | 5 +- drivers/iio/light/vcnl4000.c | 220 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 197 insertions(+), 28 deletions(-)