Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1800914rwd; Tue, 13 Jun 2023 14:34:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HJ+vfxOYAprD2pWsco47jYvDxRT5czA/t24sjuHC/yvg7CZ/wQOniTXIdwijN+GOP7BZA X-Received: by 2002:a17:907:a49:b0:961:272d:bdb9 with SMTP id be9-20020a1709070a4900b00961272dbdb9mr12697005ejc.43.1686692099096; Tue, 13 Jun 2023 14:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686692099; cv=none; d=google.com; s=arc-20160816; b=BSPQdCYhcu1LlVh5hIvjs2G++O98Fwe8ZgsmmIZgzCBgco0keDNEEckH4vNEaCMMPH tuGCERg+RB52Mf7QHLtcoE42wcdjlz+37v+NSJTdhsO3oWjI5Uz5r8mcG3BE9Gyk+TRH OQX55PRh620aWd3y8txVK9t5tL4s3iFmpq8cX/9+mP9/ZXa/wj2B7+EIt/Yuw5RnGfHR 3MuFw7W8smKa2v7g7kcxHVdZhMRgjBG4Oc3+3cXOcMj061kxRQgTn3KohGpbNdWLoCHl Iervjg0QgfLkJpwJWKjCKgt5BfIYH7Gf2BT1wxhDVJ+sJ8d22T2eDH4X6+WZ2QApP8Dm xy2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oJHDlNUkyVnd278ObwLBEUkrQV1z1aBeDldY+tsmkrA=; b=ZuOoS8BzplI4ddzbYlwUoJD5EyF23Mca2tF8J3KKQdfAGKbik/Vc8Y96LWcbTyq/hF MvLI7TI4LwHOcGTIZv+Fqu/Sve0pF8VuH/m7MI4ZDrfps835lHnd4K1Co5i6enUhhCIx wXUuMfNilgYTZGLSjN3RsAEoUXQGGyYVO9XDNhHwxbV//snbfCImBTwDe9lMUSia9xaP a9+25StbsHF6SER7uqZM1LyO81NHQAkHGuBevywJ7XAmv2JkBSlufyv/2yHjAp3s1zhF TzIFcqNvdBUBHYzJaVNmKZSvpQr2C2wjebBJEUBcFmE2gxYPgEhtxbKajDT99y9Ogp+D wnLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=egSlXNlx; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020aa7c1c6000000b005187ad1cce9si845974edp.421.2023.06.13.14.34.34; Tue, 13 Jun 2023 14:34:59 -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=@kernel.org header.s=k20201202 header.b=egSlXNlx; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234214AbjFMUtD (ORCPT + 99 others); Tue, 13 Jun 2023 16:49:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbjFMUtC (ORCPT ); Tue, 13 Jun 2023 16:49:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D90810CB; Tue, 13 Jun 2023 13:49:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0B84F61766; Tue, 13 Jun 2023 20:49:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9549C433C0; Tue, 13 Jun 2023 20:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686689339; bh=LZ97z1+GXSKxEYwgCKzZ2M26Iq4Z4fYmY+AtBbPX4jU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=egSlXNlxxAKAQanOSQh+hPBzHCaBVRvixNxVcK2PJLzPdac6XjuvJiFqmo1PbHKZJ Ep97EhFKsafUAwSTb8qqUCtG9te6TFq9SWAHJowvncUZsHKulS4eASY3NMq0/PWXZB 7UMWhPcj+ugQbMihh7minnDiwKgznugCS5mPCwN8PqtwXFOXC4NvaM+6rmlvpurxL9 jVgPZJwHl/CiQgsMqft2H2PA0ZCia8a6C8Ebi+na/1ui3DfqJlclh32at2veSCA+o0 nK7ZJczVXDZ6SuAUsMNq9rHKMbNYb4llkARuZQKa0mjnaunkw1W4ecGEtKKMBkWpQK Qf+m3EQ9dn6Bg== Date: Tue, 13 Jun 2023 22:48:55 +0200 From: Andi Shyti To: Marge Yang Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, david.chiu@tw.synaptics.com, derek.cheng@tw.synaptics.com, sam.tsai@synaptics.com, vincent.huang@tw.synaptics.com Subject: Re: [PATCH V2] Input: synaptics-rmi4- Add a new feature for Forepad. Message-ID: <20230613204855.bm4wxneamkd76heq@intel.intel> References: <20230612022607.315149-1-marge.yang@tw.synaptics.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230612022607.315149-1-marge.yang@tw.synaptics.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Hi Marge, [...] > +static irqreturn_t rmi_f21_attention(int irq, void *ctx) > +{ > + struct rmi_function *fn = ctx; > + struct f21_data *f21 = dev_get_drvdata(&fn->dev); > + int error; > + > + error = rmi_read_block(fn->rmi_dev, > + fn->fd.data_base_addr+RMI_F21_FORCE_CLICK_OFFSET, > + f21->data_regs, 1); > + if (error) { > + dev_err(&fn->dev, > + "%s: Failed to read f21 data registers: %d\n", > + __func__, error); > + return IRQ_RETVAL(error); > + } > + > + if (!!(f21->data_regs[0] & RMI_f21_FORCE_CLICK)) no need for double negation here. Andi > + input_report_key(f21->input, f21->key_code, true); > + else > + input_report_key(f21->input, f21->key_code, false); > + return IRQ_HANDLED; > +}