From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 195D23A2E28 for ; Thu, 25 Jun 2026 02:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782352850; cv=none; b=Z6ICpAwCGOv7ARwagWjrcZbqVF84h40wF1qvCuT9ZxkP3O2tYJPQL0Wt/95dVoytY1BgPOnwWWVyx/37ZyOFm7EdOigM4e2npsKo54gyvjhViikffj8BvojerRwQkh+TSl93ufuBUqHCAKNgSd+egnUAtTheEn7Ah1KpACVYau4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782352850; c=relaxed/simple; bh=1XRKW0vDR45JGT3UWYWuagvWFRDF/O/QLqhohEncfdo=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=hrUlLr75S3TVDgFUJD+t9OuzSO+6uR90FRGJfKtOtZO7MSbMAfImqDpTrvIvyYGE+30pD5rM/Jb2Ot6RSBVakexTyNDBbBve4sbjsMo810YP4of29UNhirHArDlWPeT7ol0NK2ad/wAJwdiMYBRuv+6w1R56r34VoltyluP0wO8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=knKgH9hh; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FiFwnQyy; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="knKgH9hh"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FiFwnQyy" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65OLqVZ84110517 for ; Thu, 25 Jun 2026 02:00:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=iF6ibc0xqZo4e3ksGi+x6u qeIxacuV5DBZJu2XgrUGw=; b=knKgH9hhSkC/XfvHWKtUpM0bQmuim1l5JYQyWL ewXX0wPZwoZz9LJUcAE0OzKaRch2tC8rP6hUII7CsHmv/tIeY5RY31qFLFzQxm0Z xpjOtI/fnQHgoCKj/awLAJ6WHUcgvwAZOPc/2m4g3b8wARYl0Ow9myEIoJRcLmf7 +EnO6HWkfid8301E2WudrSoIV/zvZSe4f+Ny/tuLTNeTaSNLWhkrC+YYStE6TdjS udldk8YPquDJkstbYTA0r2hfZSV/+uVl+xmayU8tKrGOASm8Ba0TxlQoit+BY1IB w6RYnX6V8s7hlhVk97ufHBP0M+24gHLfjVHLSC8AZNxh1CQg== Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f0nv7h10v-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 25 Jun 2026 02:00:48 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-30c62861b3bso852273eec.0 for ; Wed, 24 Jun 2026 19:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782352847; x=1782957647; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=iF6ibc0xqZo4e3ksGi+x6uqeIxacuV5DBZJu2XgrUGw=; b=FiFwnQyy38R09eckgnDPpnbCSO3h/CRuummTHNoCVKbEP/bareVef4MtMl0y8P5rsd raAzMXQtgel7lOmwygD74uEq+kTFF+yIHvlmybNhqXCzQ4qb+D25e/YFWerNkX0RjDba y9ELcC/n4KJjs/jiSog0tMTJt/PdypJvHA9hDvzp9k7G44OFHfR+Q/r8JY9LF8ldSs0e Y1PBtYi6AJue0rrrk+u5dyL8itij839romv+2PR7xOEWgBhLIF0Y1C5scQeLIb/QEZl7 rYHafYzjzHBo3Y5fDivUZ8XGdQ+zW90QjjYTgXa6mxG8aeNhCgQYtFzHdBa6fe9rpS86 U1kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782352847; x=1782957647; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iF6ibc0xqZo4e3ksGi+x6uqeIxacuV5DBZJu2XgrUGw=; b=m816CVcoRn0nim/iAZ1NCCjAZAIiIufi9PmclNtXxSjQ4guXJPdORU2e2BbMcLJw0T 2NEXyKv6hvdry0o8fHA6pALfJzTKo38GTxlwzbI6SW8q/XKZOkV1NddwGE7sMeYh6p9l t7xFPBRfCijOp+aq45Zg+7abdRFOMDE4bl66AUUhtvFGr5zdWyu7GuO5gGWxtWQ90Lal n1WV6pnmU8/0Q2uvOJ6tkNR+ELhvtzfNBRL4FifUmGRr6DYTuuGKbLyrZHyNe2hONYfN JILphxkyJRCj3c+/PU2wX32GKa8RUGLPmg1XpdPTHYwCtjsaGEDGHpZNexsx1Q3evKVG 7abg== X-Forwarded-Encrypted: i=1; AHgh+RrdFY2P3c9TqbEDAK3A6FAzT4dcoAMhBeDuqNhLVvKIMp0KsGb8Fyi7bIloXTYGQ9ZsOhfk0LuZFl5lGC8=@vger.kernel.org X-Gm-Message-State: AOJu0YxuPDea9zVxF7spBiVazw0ErzglTmeHnZNOoCits1f/RNpviJDG 9vJxeDGqjA1DKe/Sf6NPkoB56GtjeCXAV6ItHwPpX8evey6s89I20o0GuzbJueHLCEiyPb3qgm5 GEEUGD2vuior5NB8lkzQ5U8d5qC4bWGLhdDIcwnhkOFY+biLtzC9lY0FFbx29iBgDe5I= X-Gm-Gg: AfdE7ckEE/Oakjn+PnFusl+wtWZ046uL3mc1Ka8Yg9ssvr6Y9sExW9+yghcVFlr8joD EPzI6IKQiq3gRJNS6TzD+vShREXkZxSI+XAADU7BJH9olpsUmJSfiRt0SL6UXlQj6mXYoym1WoS M1lHR+07YSqbFmBirErunc8qhkBoADcIm2n564L8sde4s3Jbutsume+BCte75gMJuvwnvU34yHd tXxf4tzT57RmJ6Sl+ROJt6UK9Rac2dd0D9aob0Q+z9wzxKmEtnHNN2yShE1kubqUbzXS1HF7uaS V7ILSETcK29ykOWqcWxMFNYbKnsSoURMXIWqZq7d8jVXJ/+t0bsBUSj4ZVoNQUh5oVu0XUvCfmK NM7R9u7sLSifq6Lyza1w47sUGSXBDY6nQRH7uF4WtUsy8whkkfZpiYte2++Uq92s= X-Received: by 2002:a05:7300:1485:b0:30c:7ab6:7ff7 with SMTP id 5a478bee46e88-30c84bc4e7amr742502eec.15.1782352845901; Wed, 24 Jun 2026 19:00:45 -0700 (PDT) X-Received: by 2002:a05:7300:1485:b0:30c:7ab6:7ff7 with SMTP id 5a478bee46e88-30c84bc4e7amr742373eec.15.1782352844019; Wed, 24 Jun 2026 19:00:44 -0700 (PDT) Received: from hu-fenglinw-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30c7c8afca8sm2933939eec.17.2026.06.24.19.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2026 19:00:43 -0700 (PDT) From: Fenglin Wu Subject: [PATCH v2 0/3] input: misc: Add an initial driver for haptics inside Qcom PMIH010x PMIC Date: Wed, 24 Jun 2026 19:00:35 -0700 Message-Id: <20260624-qcom-spmi-haptics-v2-0-b9118e60f3e3@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAMOLPGoC/32NTQ6CMBCFr0Jm7RAYSImuvIdhAWWUSYRCBxsN6 d2tHMDNS76X97ODshdWuGQ7eA6i4uYEdMrAjt38YJQhMVBBpjClwdW6CXWZBMdu2cQqVtaeG25 6qogh9RbPd3kfm7c28Si6Of85LkL5c/+thRILHKjmmmhg09dXp5qvr+6ZolOeBNoY4xdngIbvu QAAAA== X-Change-ID: 20260616-qcom-spmi-haptics-3cc97e7b232e To: linux-arm-msm@vger.kernel.org, Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Stephen Boyd , Bjorn Andersson , Konrad Dybcio Cc: David Collins , Subbaraman Narayanamurthy , Kamal Wadhwa , kernel@oss.qualcomm.com, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Fenglin Wu X-Mailer: b4 0.16-dev-17187 X-Developer-Signature: v=1; a=ed25519-sha256; t=1782352843; l=3511; i=fenglin.wu@oss.qualcomm.com; s=20260324; h=from:subject:message-id; bh=1XRKW0vDR45JGT3UWYWuagvWFRDF/O/QLqhohEncfdo=; b=9gdxI7Dk+7XkZfPAg2VWu5NzwswK/jSdi94TNuaGcS8WIDVmf9HfUO0SIHgi5bTYRbJ6oPZAA djcbQYiyh5nCtU4WGrxhy05ja/7z9k9svfrqTvl07+XhBdHVOyejm+J X-Developer-Key: i=fenglin.wu@oss.qualcomm.com; a=ed25519; pk=hJdt3E7o54lql+miD2GaxwF74cDyhgNwMbmFOZ46bRU= X-Proofpoint-Spam-Info: AW1haW4tMjYwNjI1MDAxNSBTYWx0ZWRfXxbQq4KEi3I8u gFLfJzAc5sT3ikDQAnK9GijrH8RPuT+YWeakeROKW/I6BJk8pGjIj6tObK1zHvlawixit52Ow5x awpyUivE+RiBxDRStgl7SEhrUfeYWGs= X-Authority-Analysis: v=2.4 cv=RJiD2Yi+ c=1 sm=1 tr=0 ts=6a3c8bd0 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=bC-a23v3AAAA:8 a=EUspDBNiAAAA:8 a=F7vqA0BNXnWFEAHbpNcA:9 a=QEXdDO2ut3YA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 a=FO4_E8m0qiDe52t0p3_H:22 X-Proofpoint-ORIG-GUID: 0IdjvcuSgmRKKdOLE0C9gIblNQKpm5bC X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjI1MDAxNSBTYWx0ZWRfXwr94OkIyS61v 03g+I06ja2JfrCr0G1ouDXYsKMAFTXmNmfbAj4yTop/Aisftcgt0qX3Bu8MzY1F8/YvkVC3lgnw FG0estC2IDQ3n253MDqicFePQ8Hg0829n59/zk1nW0f0juiLnktTA/I+eDVhZj4gwdk7Ykv1vQ5 CFtVh2/4vDYWWfD+J3m5AHiZObdRHgMsei58jFSrH9UPWxxUMff6aihsPu9A3NYz9Y7yuA7fcT9 CEb8JnrSJ8DfviBfBRjgFJA7o1ZpmNHlDycaTphIKmS+FRhoIbP6fS5KelGzduucCUV1d6z6N1Q uPf+0XBUkWPWr1f04JDKtheXDj39qMClpzdd7UG5B+ubFyEv21xBOLh4uQPxDL1/ysCF2hvzZ2r hvaBht4NmLmSEkUUigsWqzwyH4I9VhzvzpmKD/VljZ7rMzFc8fDJInPlCVTlhcU9avVjlAJukXh NgAG77RYnKt2nSWrTwA== X-Proofpoint-GUID: 0IdjvcuSgmRKKdOLE0C9gIblNQKpm5bC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-24_04,2026-06-24_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 clxscore=1015 impostorscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606250015 Qualcomm PMIH0108 PMIC has a haptics module inside and it could drive a LRA actuator with several play modes, including: DIRECT_PLAY, FIFO, PAT_MEM, SWR, etc. Add an initial driver to support two of the play modes using the input force-feedback framework: -- FF_CONSTANT effect for DIRECT_PLAY mode which drives sinusoidual waveforms with fixed period and amplitude, which would generate a constant vibration effect on the LRA actuator. -- FF_PERIODIC effect with FF_CUSTOM for FIFO streaming mode, which can play an arbitrary waveform composed of a sequence of 8-bit samples at a configurable play rate. Also, add the device node in the existing pmih0108 dtsi files, and enble the haptics device for several boards by updating the vmax and lra-period sttings according to the LRA components that mounted on each of them. Signed-off-by: Fenglin Wu --- Changes in v2: Dropped dtsi change and I will resend them after the driver and binding changes get accepted. Updated haptics binding and addressed review comments from Krzysztof and Konrad: - Extended the description to clarify the 'PAT_MEM' mode (not yet supported in the driver) by comparing it with the 'FIFO' mode. - Updated the compatible string to 'qcom,spmi-haptics' to match the file name and removed the PMIC wildcard. - Simplified register names to 'cfg' and 'ptn'. - Corrected the unit naming for the 'qcom,vmax-microvolt' property. - Added an additional clarification for the 'qcom,lra-period-us' property. Updated the driver to address review comments from Konrad and Julian: - In haptics_write_fifo_chunk(), separated variable declaration and assignment, and added comments explaining the 4-byte and 1-byte FIFO writes. - Replaced manual 'x * n / d' calculations with mult_frac(). - Switched to disable_irq() to prevent late IRQs after device removal. - Replaced property reads with device_property_read_u32(). - Remove the 'INPUT' dependency in Kconfig Updated the driver to address feedback from Sashiko AI: - Guarded pm_runtime_resume()/suspend() with 'pm_ref_held' to prevent runtime PM reference leaks. - Replaced spinlock with a mutex to protect FIFO data during playback and avoid calling sleepable regmap APIs under spinlock. - Adjusted suspend/remove() sequence to stop playback before canceling work, and freed FIFO buffers to prevent potential memory leaks. - In FF_PERIODIC handling, allocated 'fifo_data' before assigning data to ensure its consistency with 'data_len'. - Registered the input device after enabling runtime PM. - Unify to use 'h->dev' pointer in probe() - Link to v1: https://patch.msgid.link/20260616-qcom-spmi-haptics-v1-0-d24e422de6b4@oss.qualcomm.com --- Fenglin Wu (3): dt-bindings: input: Add Qualcomm SPMI PMIC haptics dt-bindings: mfd: qcom,spmi-pmic: Document haptics device input: misc: Add Qualcomm SPMI PMIC haptics driver .../bindings/input/qcom,spmi-haptics.yaml | 132 ++++ .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 4 + drivers/input/misc/Kconfig | 11 + drivers/input/misc/Makefile | 1 + drivers/input/misc/qcom-spmi-haptics.c | 838 +++++++++++++++++++++ 5 files changed, 986 insertions(+) --- base-commit: 66725039f7090afe14c31bd259e2059a68f04023 change-id: 20260616-qcom-spmi-haptics-3cc97e7b232e Best regards, -- Fenglin Wu