Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp962105rwi; Mon, 10 Oct 2022 09:20:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5JGTl4LMr/lIMYWQv4dc+SbWntdH7RTloHCSQMzuhMbBjPOOTnzdc+MIxnnwy6wA4eQsfF X-Received: by 2002:a17:902:7290:b0:17f:d04b:bf57 with SMTP id d16-20020a170902729000b0017fd04bbf57mr18542923pll.147.1665418857713; Mon, 10 Oct 2022 09:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418857; cv=none; d=google.com; s=arc-20160816; b=poRoSWf8HdJw1iqqNqraGlfPIka/eeWYt2CgR1Oi1HZ+daKN6l9upUMS8B7GhkXP4n RI0cWNMzhenbMEhYj0TwFXMov8s51i7AfUUUFClvTRIGCv8S+egMseJGPCH8yTK9yz5V WqcSCkGQ4CUgxU5UNnq/y108bVd4aU4bMWIK5+S/EewrCXP1Km6gd8nVm6rhKSjaw3aJ eqDkapnlTdrJkssg111oBCBlCLHMZkQ2r4Fw3nrcf+t2KhnkKyVWN1ag9yJJ8Fw9hITa kamScmEEQ2t+sztkTVLMg4d87nKAYEz2tN6VZelO7hIpX5vFGtRphoJiWwh2RRXdlLJk yM7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:message-id:subject:cc:from:to:dkim-signature:date; bh=v8t2lgopjGAlj4wqpLkRQ1AnOzaZKPh8TfSRmc4oklE=; b=c6oIZ8BkHThhhfuJJwLG2T8buLS6mba2HZBlDsLyD0Y7DBSJUDQyIohNh3VTuvaFUH 8Ly4ZyTmwbpEi4zhWG8jyjqvQlIjveF0YDL9aReOjVhowU1Ir4lA3a7DekhAFbjrrVki f9aosSlRXnMhuRIBCIlCQLx5leBot5aMphcZtpf9EZnCfylSAP1eHzKdyiu80wAir3aE eiML4q7e17OEJRwCvpPJSYS7asWKpYX75waF40UoexX4dEgPfcZWLUo2g0zsoLkCXdUO feK1y7w2q+arkU23cNstTiVlOyr3yNpddtTP5NEgkq0R5LlPnX+TosUlr2LzZSi44L9W QWtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=lOxRxmLy; 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=connolly.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e4-20020a17090301c400b0017822387267si14476353plh.399.2022.10.10.09.20.46; Mon, 10 Oct 2022 09:20:57 -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=@connolly.tech header.s=protonmail header.b=lOxRxmLy; 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=connolly.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbiJJQSL (ORCPT + 99 others); Mon, 10 Oct 2022 12:18:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbiJJQSI (ORCPT ); Mon, 10 Oct 2022 12:18:08 -0400 Received: from mail-4018.proton.ch (mail-4018.proton.ch [185.70.40.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97FF76DAE4 for ; Mon, 10 Oct 2022 09:18:05 -0700 (PDT) Date: Mon, 10 Oct 2022 16:17:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1665418683; x=1665677883; bh=v8t2lgopjGAlj4wqpLkRQ1AnOzaZKPh8TfSRmc4oklE=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID; b=lOxRxmLyaILR+j+bXkejDUmHL1SmEfzt6EeJ4BvN9pTighkdY+YF9dwmwUo/It/jP xt7OYk41es+gckbAfe7lfCvtcidi1vVuYuDlCRSNLzbDFZ/+lZfF2cco2KhZeA8bBh astZAlu0V3026VrhzkQ61BVp+L+cZH+2Oc44keMU= To: caleb@connolly.tech From: Caleb Connolly Cc: Andy Gross , Bjorn Andersson , devicetree@vger.kernel.org, Dmitry Torokhov , Jeff LaBundy , Konrad Dybcio , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , Nick Desaulniers , Rob Herring , Tom Rix Subject: [PATCH v5 0/2] input: introduce support for Qualcomm SPMI haptics Message-ID: <20221010161727.1298112-1-caleb@connolly.tech> Feedback-ID: 10753939:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, TO_EQ_FM_DIRECT_MX 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 This series introduces a driver for the SPMI haptics hardware block found in Qualcomm PMICs. SPMI haptics support LRA (Linear Resonant Actuator) style haptics, as well as ERM (Eccentric Rotating Mass). It also supports several modes of driving the haptics, e.g. by loading the pattern to play into an internal buffer, or using PWM. More information about the hardware can be found here: https://gitlab.com/sdm845-mainline/linux/-/wikis/PMI8998-QPNP-Hapti= cs This driver has been written based on downstream sources as no public documentation is available. It includes initial support for LRA haptics in buffer mode, this combination seems to be the most common and will enable haptics on the OnePlus 6 and 6T, PocoPhone F1, OnePlus 5 and several other Qualcomm devices with mainline kernel support. The driver is implemented using the ff-memless (forcefeedback) input framework and makes an attempt to control the strength of vibration relativ= e to the magnitude set from userspace. Changes since v4: - Significant rewrite and cleanup - switch to dev_err_probe() - Run through clang-format Changes since v3: - Adjust example DTS to avoid creating new warnings in dt_binding_check - Address warnings from kernel test robot. Changes since v2: - Addressed Rob's comments on dt-bindings (I'm not sure what to do about the pmic compatible?) - Fixed some typos Changes since v1: - Replace old QPNP naming with SPMI - Address Bjorn's comments on the driver, various style and code cleanups - Address Bjorn's comments on the DT bindings and DTS - Pickup patches from Joel and Jami to enable haptics on the OnePlus 5 and Poco F1. Caleb Connolly (2): dt-bindings: input: add Qualcomm SPMI haptics driver input: add Qualcomm SPMI haptics driver .../bindings/input/qcom,spmi-haptics.yaml | 123 ++++ drivers/input/misc/Kconfig | 15 + drivers/input/misc/Makefile | 1 + drivers/input/misc/qcom-spmi-haptics.c | 674 ++++++++++++++++++ include/dt-bindings/input/qcom,spmi-haptics.h | 32 + 5 files changed, 845 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/qcom,spmi-hapti= cs.yaml create mode 100644 drivers/input/misc/qcom-spmi-haptics.c create mode 100644 include/dt-bindings/input/qcom,spmi-haptics.h -- 2.38.0