Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2297030pxp; Mon, 21 Mar 2022 16:11:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypjcAcmAJ8cUocql9MB6mqQvBvWS22tEsxhxmPly7wS3NgY59TAP70dPXbWmN5IHs/DbaR X-Received: by 2002:a05:6a00:134c:b0:4f7:65a6:88b with SMTP id k12-20020a056a00134c00b004f765a6088bmr26808585pfu.79.1647904316387; Mon, 21 Mar 2022 16:11:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647904316; cv=none; d=google.com; s=arc-20160816; b=j86eTwECzFJenCBnukyo/ssw/rMiZQLnk5fKnhGBjsC++m38OEgYS1nRxHwAjINaQN zOrTHBNhefp1QCo5L4kq0MazHUA9gSabvQ1IMVDHilQq/1hMCQU8+zfHH+93up2ZZqoM 7/bXnWWKdKQhQYUvwq3yDTm/6RPA8NBM6owPLsO7/qzSziy/did6Hkt064iq0JySOSN2 T4WDKnwEmOfmSCji4SyT5Cat2VppYnJiDX/0tmOAbF0AklmmfEJi/BOIaaQacOAsEWFm fBRK5uBkGWkZnJiiSrRmq3ljYGLalIQyMxyx4Z1qpmZF7+RNLVb1gVXQ1QGDftFK4uy8 z9UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MIXaXRe6fXniSeUMQJNT+Y5fVee3c9bLU6mP2FbFMEI=; b=0XTDXn5RzfPppxRp/++tFbOELwTRnpzwhvK6Ek7/papxKf7IMMlGdcYRb+h+tl5+3S bLP6t6CbOeEyQOxY3rg36+kipY0fVFtwZRbi+e8EeIHT8a9rc6XsDV8bu7hVhywD5SeF bx8byQedXl5756SCYAZQQgb5MHglCsgasA4w8Q4sXPm/pCQitx3jv7PFOL8e6rJ/MWJJ jfIv7L0T7kckTGIeqLopfD8lsmAeOAVTbec1zx5sjpaNt+S5BcPI8roUjgkNZ15GPSCR 48pdB0JHDsWfq9qwJgKNDz647KCQcQNGw3UiVmh57TS13yaQOz+wcd7KbhwKCQQOm2DT Jojw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HPEi+s6W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v8-20020a17090a458800b001c72b71a7e4si562382pjg.27.2022.03.21.16.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:11:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HPEi+s6W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 82F704357C5; Mon, 21 Mar 2022 15:10:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345392AbiCUIsM (ORCPT + 99 others); Mon, 21 Mar 2022 04:48:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345420AbiCUIr7 (ORCPT ); Mon, 21 Mar 2022 04:47:59 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FC37A5E98; Mon, 21 Mar 2022 01:46:35 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id b24so16904183edu.10; Mon, 21 Mar 2022 01:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MIXaXRe6fXniSeUMQJNT+Y5fVee3c9bLU6mP2FbFMEI=; b=HPEi+s6WHuEIucuNESN+56exbAgTPW/IyPFiMDR2Nw8O9wqz9unVp50uQEeTWtZuhw s0C8zfIUrdD+qRqYGEB/VT/kINCHD4Gsxnq70tFlohTshaid8zE3/0JI28LcE+FhwJai Tjt+7PP7Rk1OBL5T/4J4Wk9WJN5X5mNJmMAROYxbm6Ryl5uog5EaiHgWi2CU/clspExU NPeLJZ3lrPI7mpdmyDxTDW3vl2NBu6AgKbDDRM1f2GUOQsHt2hwd7CKmyx1M6ysI1Vhd 4AVhxqAEnlIDKMP8A+RSO7iNDm95sM9AIpdBSTAeolrhsl6uH0fUQyv+DvMBhJEqBefY CzPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MIXaXRe6fXniSeUMQJNT+Y5fVee3c9bLU6mP2FbFMEI=; b=5D29EnHZS+K/SRcxR+o0Znlaj/aDhsRHDH3TYV9wQioB/rlkjNMHC5gUCnODmLvLiE 0OIIUwHJPMjoG1CJdgUAyYCYF03W8GJ91q/2gEgUxTPf/HJuctGT9SBUKEIMLafyUYZo x2cLS5icD1Swt42FM92exAkrUeAeMY202YTLNIyvS4FjZBhhzftKQHbDST97OoU1SodI PUW4h5twjltFiQz8BWcD45nb4/iz7pnUKh+Q+xXro+jG6IdTeM4URlBGJ1iyRFlLCKyY d3BrvuR4xtAT2M3j5S7jhYk+oXzCHRUoKzIw7lMYRzGEWWE7PdKLJQgfwklkNmns26wA Wrkw== X-Gm-Message-State: AOAM531Dh6WcVGxvQCwWDpB7Is2peR8kIGseE9mpXBUR8khbbPX8/VD4 hlEjY/FaNY7XCjfyeWzpL8EyCaGOSRQbTWyg8Yc= X-Received: by 2002:aa7:d1ce:0:b0:419:19ed:725a with SMTP id g14-20020aa7d1ce000000b0041919ed725amr12734450edp.270.1647852393881; Mon, 21 Mar 2022 01:46:33 -0700 (PDT) MIME-Version: 1.0 References: <20220319181023.8090-1-jagathjog1996@gmail.com> <20220319181023.8090-6-jagathjog1996@gmail.com> In-Reply-To: <20220319181023.8090-6-jagathjog1996@gmail.com> From: Andy Shevchenko Date: Mon, 21 Mar 2022 10:45:23 +0200 Message-ID: Subject: Re: [PATCH v1 5/5] iio: accel: bma400: Add step change event To: Jagath Jog J Cc: Dan Robertson , Jonathan Cameron , linux-iio , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Sat, Mar 19, 2022 at 8:10 PM Jagath Jog J wrote: > > Added support for event when there is a detection of single step > or double step change. INT1 pin is used to interrupt and event > is pushed to userspace. ... > #include > #include > #include > +#include Keep this block ordered, ... > + switch (chan->type) { > + case IIO_STEPS: > + switch (type) { > + case IIO_EV_TYPE_CHANGE: > + return data->steps_enabled; > + default: > + return -EINVAL; > + } > + default: > + return -EINVAL; > + } > + return 0; Dead code. ... > + case IIO_STEPS: > + switch (type) { > + case IIO_EV_TYPE_CHANGE: > + mutex_lock(&data->mutex); > + ret = regmap_update_bits(data->regmap, > + BMA400_INT12_MAP_REG, > + BMA400_STEP_INT_MSK, > + FIELD_PREP(BMA400_STEP_INT_MSK, > + state)); > + mutex_unlock(&data->mutex); > + if (ret) > + return ret; > + data->steps_enabled = state; > + return 0; > + default: > + return -EINVAL; > + } > + default: > + return -EINVAL; > + } > + return 0; Ditto. -- With Best Regards, Andy Shevchenko