From patchwork Wed Jul 12 15:12:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waqar Hameed X-Patchwork-Id: 11938 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1243136vqm; Wed, 12 Jul 2023 08:50:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlEabfEQxxnaeCwp5HfJVMZsPpfT/ANtC41VefGq6zKJfnBBcfy2AYvaD7GxnrkwZOo56s9p X-Received: by 2002:a17:902:ef92:b0:1b7:d23f:8a66 with SMTP id iz18-20020a170902ef9200b001b7d23f8a66mr18182438plb.59.1689177017151; Wed, 12 Jul 2023 08:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689177017; cv=none; d=google.com; s=arc-20160816; b=EJfuh9R7rUtzT8PPRRJbTK3z8VFLQclzoQbX3sNcssG9wVQP6Ww1AcNUoRq/W+PIPp wp95dMncnDhSaD6lR5baYNvEHy4fOPIq1XfEFw9l7hCWbXHe6s5rtNHlY70SZ2TtSthB o65fq1X/1Hp+3/XvhqC7pW+5EG3MAj4mOgRUmX3UvlMy5dtGBqUg5w6IgkOKeY5UVnHj hcrtWdzoTuTAoRJISiQ3mGUAi8FQEFX2mHjZGn1fhDe/DjAPtadGiWWrxcPmUgBeos2a FqVaotLyVW5okBy8wC0a2PTv8QOBJwpTTw+troRe7FJCBn3W87fn04f5LYHUbiho/duK DflQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :user-agent:dkim-signature; bh=AtZaat57K0cFWC3O715ofKEr2hCcMnCQF0lwfCNSfiA=; fh=JGYM2Q85S698F/UkubHNfXVmHXdrulhcDNpUt8Ct1Po=; b=cZJ5YZN0Aaoc/4b7Ipv+g6GvG8PikVGNTPmZjOch2DVhzJe4IfyU78OSEWiuZl+G1U h9igPTuhrIj/hzrVx9e5/dqI5XsSVEqpHxKzf/l69h3mrDlqATi5MrnZbBV4+Jlk/xYO tctzDcFDgbl1MG5bcJhH+4iFzt9iWWnPhINhMXwRIEm558a0b7uZw/RUqFDz/146QwMO pKAK7zxQe9T7uX0Nln4b0DwIvTEK30S6I5gZBFu/SPVUWXzH/Z9ZftoD2hse6tStHeBi Rwb6e8WZLXE3s9ZrVQqQgiUfYoQ2xXND1nkVlNPL4ExmOG1LrBP0/dYy71uoQx2xcp44 WXxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=V8Yw72vv; 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=axis.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b2-20020a170902d50200b001b80dbd3913si3558379plg.625.2023.07.12.08.50.01; Wed, 12 Jul 2023 08:50:17 -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 (test mode) header.i=@axis.com header.s=axis-central1 header.b=V8Yw72vv; 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=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233627AbjGLP2L (ORCPT + 99 others); Wed, 12 Jul 2023 11:28:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233374AbjGLP2H (ORCPT ); Wed, 12 Jul 2023 11:28:07 -0400 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B581C2; Wed, 12 Jul 2023 08:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1689175686; x=1720711686; h=from:to:cc:subject:date:message-id:mime-version; bh=AtZaat57K0cFWC3O715ofKEr2hCcMnCQF0lwfCNSfiA=; b=V8Yw72vvjlRzCFOpaaWRXR0H3o6xePL6ylfroF5IavqGwbBOF/ZrDhrV BoOZKiFCjD3gy6A1UgPSFwLIR4SO9ZruDhaThypNhVEXFdjiG+eqT/uZH r8DlnApvabi4PFuBFhhgldZutKB2bSaAefGvMPLO+cL9xyq6bweWL/c5H 7fy7RnrpuW024zafC5ciLLQ4CK+utKbyN+vvkaT/pF48DDqL5z87n++zc 6a8ZAT6a9p8YRyJ/DmjNh8+LU2UOqhc00iOkyJCfIFFbtplAkq8mFdBkU mmLWrZsXZXvqtQH+IZ2gIVZ8gc+DN86Q06oqS8iViZUq+9tmrvryxsWHd w==; User-agent: a.out From: Waqar Hameed To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , Subject: [PATCH v2 0/3] Add driver for Murata IRS-D200 Date: Wed, 12 Jul 2023 17:12:16 +0200 Message-ID: MIME-Version: 1.0 X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: se-mail01w.axis.com (10.20.40.7) To se-mail01w.axis.com (10.20.40.7) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771230480066460813 X-GMAIL-MSGID: 1771230480066460813 Murata IRS-D200 is a PIR sensor for human detection. In this series we add devicetree bindings and an IIO driver with support for triggered buffer and events. Link to the datasheet should be added to the devicetree bindings, when that is available. Changes in v2: [dt-bindings] * Remove "bindings for" in commit subject. * Remove superfluous yaml block style indicator ('|') for `description:`. * Change node name in example from `pir` to `proximity`. * Add required `vdd-supply` property. [iio] * Add event enums for running period and count. * Use `set_trigger_state` callback instead of `iio_buffer_setup_ops`'s `predisable` and `postenable`. * Use `regmap_bulk_read()` in `irsd200_read_data()` and `irsd200_read_timer()`. * Use `regmap_bulk_write()` in `irsd200_write_timer()`. * Remove comment for macro `IRS_UPPER_COUNT()`. * Move `IIO_EV_INFO_LOW/HIGH_PASS_FILTER_3DB` from `iio_event_spec` to `iio_chan_spec`. * Ignore timer (`IRS_INTR_TIMER`) interrupts. * Clarify comment on `ssleep(3)` in `irsd200_write_data_rate()`. * Only check for non-zero return values from `regmap` functions (as opposed to `ret < 0`). * Add macro defines for operation states. * Remove fix size in static const array declarations. * Remove unnecessary `ret` variable in `irsd200_write_raw()`. * Remove comments in `irsd200_event_spec[]`. * Remove unnecessary call to `i2c_set_clientdata()` in probe. * Use `dev_err_probe()` everywhere in probe. * Remove unnecessary braces around if statement in probe. * Get and enable regulator in probe. Link to v1: https://lore.kernel.org/lkml/cover.1686926857.git.waqarh@axis.com/ Waqar Hameed (3): dt-bindings: iio: proximity: Add Murata IRS-D200 iio: Add event enums for running period and count iio: Add driver for Murata IRS-D200 Documentation/ABI/testing/sysfs-bus-iio | 16 + .../iio/proximity/murata,irsd200.yaml | 60 ++ drivers/iio/industrialio-event.c | 2 + drivers/iio/proximity/Kconfig | 12 + drivers/iio/proximity/Makefile | 1 + drivers/iio/proximity/irsd200.c | 982 ++++++++++++++++++ include/linux/iio/types.h | 2 + 7 files changed, 1075 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/proximity/murata,irsd200.yaml create mode 100644 drivers/iio/proximity/irsd200.c base-commit: 3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c