Message ID | 20230731053712.2220898-1-quic_fenglinw@quicinc.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1835321vqg; Sun, 30 Jul 2023 23:46:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlF8Y+KrOFHeusbMuohi4DUBU6aFw1th56bRrBY6lZBLZt3y9lDbSKWNcWCPN95f3AUfhrje X-Received: by 2002:a17:902:efc7:b0:1b8:73a4:706a with SMTP id ja7-20020a170902efc700b001b873a4706amr7765239plb.69.1690785986490; Sun, 30 Jul 2023 23:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690785986; cv=none; d=google.com; s=arc-20160816; b=JOH+iyEypg+0FGIi6rJHpwZA+mdTgHJH0xxk2NkL5USfaMDbF3rta/XkZAhIDomGpl RidXNQsoM+GZ4NMXjHvQSp/AhbLeR0Dv9qnl8HNUncosJSQEnElqweFX0YqRlZ3McXNC iMw9KQc7DB5ptbGEA7ag1FwZ1rei0/9C7IMPFl6LvA43GeomjJIoIs+Zr+hBZfOcFz51 +aP7Xvb9wdHC+SVnkQkIPnJ6hmj/ZZxQWEKKWIFUYDGoLYuIOqxP36zl4AlYHeaeXeqg 9Kx68IoeP43wDwMkrhKWMI1fn4vvmnBWjkuvIi1tasYMMTbME44+c+X1425uLmi+gkzy 8hKQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=O6cIJZiiWjY1egzZiMxl9oj6vlsStz0Iwku/cov0Gec=; fh=CUfDX9ivjh0h/tOB2i2xx4oL9gh+BmqTvmgSWHAs+9Q=; b=JQYwKfG7YISSIg7F1x+7fQwZbYYzwNadJypGNKmyB/VrVr8MBDJXJdDuzBVStNXW6N Xct8iqHLjnMASnACyehkJrSabZ0PCT8CGVdBoIM6ohUT/JbbDsu0+W1RSIIbLglyL/SO Gnb77Eezt3sBlH1V9fHg6B94q2LSHe1qNTSM5n2wMc1/3dbXEUFfWXlq520uLSMwTQbH MQu3+x62C0JL+MUlh8+qR9vt4uf4BDuEnScHoGO09WV6tDurGnIwZiClid3m2nNL923M VTJftbxW/RJN7ccJARefb9GKZDSISpXEKe6MDj590ua4CJ3lGcNnH4MkG5kpX566HHPX lAVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MCcPXzC8; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id la12-20020a170902fa0c00b001b8698149fbsi6594793plb.477.2023.07.30.23.46.13; Sun, 30 Jul 2023 23:46:26 -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=@quicinc.com header.s=qcppdkim1 header.b=MCcPXzC8; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbjGaFht (ORCPT <rfc822;dengxinlin2429@gmail.com> + 99 others); Mon, 31 Jul 2023 01:37:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbjGaFhq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 31 Jul 2023 01:37:46 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3D9EE7B; Sun, 30 Jul 2023 22:37:45 -0700 (PDT) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36V41KRQ005889; Mon, 31 Jul 2023 05:37:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=O6cIJZiiWjY1egzZiMxl9oj6vlsStz0Iwku/cov0Gec=; b=MCcPXzC8wyMisFJ9FQCSPunSZrIo7+qU79UJ0PFgo/vavHHVraFGcmBv/FmAWXmXe6OE qFKwpPc/GxojernpeFT5x6P+Sg7JaeM6bxY8z9u7AK3E0nXGFXNG/AHcWKRPplEkCxyH yZEP6CYkDURGfNxKW9jWhXNN+pJ21+2U7cf/z44G7PpugXpMSfpApHl6jRN9rdExApMq j4nRwbV2Gz5q1iqjwHbgmN2pFqjA5fwkbbf3TF/hVkyKXljhDT4wCfoRzauIUPV57b6A Q1TAx7EpIxtNAAIdoCu0tInE8X6FsXIKV/qPxjOtYjrLD9IHuKDQfqDjMQcOV0RjDumV iw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s4uhmjpdn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jul 2023 05:37:42 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36V5bgQp013983 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jul 2023 05:37:42 GMT Received: from fenglinw2-gv.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Sun, 30 Jul 2023 22:37:39 -0700 From: Fenglin Wu <quic_fenglinw@quicinc.com> To: <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <robh+dt@kernel.org>, <agross@kernel.org>, <andersson@kernel.org>, <dmitry.baryshkov@linaro.org> CC: <quic_collinsd@quicinc.com>, <quic_subbaram@quicinc.com>, <quic_fenglinw@quicinc.com>, <quic_kamalw@quicinc.com>, <jestar@qti.qualcomm.com> Subject: [PATCH v4 0/3] Add support for vibrator in multiple PMICs Date: Mon, 31 Jul 2023 13:37:05 +0800 Message-ID: <20230731053712.2220898-1-quic_fenglinw@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: tID8iWP6bGOCXRwmdkypSq_JmtC9a2c1 X-Proofpoint-GUID: tID8iWP6bGOCXRwmdkypSq_JmtC9a2c1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-27_10,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 bulkscore=0 malwarescore=0 mlxlogscore=983 mlxscore=0 impostorscore=0 adultscore=0 priorityscore=1501 spamscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307310050 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_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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772917606334942639 X-GMAIL-MSGID: 1772917606334942639 |
Series |
Add support for vibrator in multiple PMICs
|
|
Message
Fenglin Wu
July 31, 2023, 5:37 a.m. UTC
Add SW support for the vibrator module inside PMI632, PM7250B, PM7325B, PM7550BA. It is very similar to the vibrator module inside PM8916 which is supported in pm8xxx-vib driver but just the drive amplitude is controlled with 2 registers, and the register base offset in each PMIC is different. Changes in v4: 1. Update to use the combination of the HW type and register offset as the constant match data, the register base address defined in 'reg' property will be added when accessing SPMI registers using regmap APIs. 2. Remove 'qcom,spmi-vib-gen1' generic compatible string. Changes in v3: 1. Refactor the driver to support different type of the vibrators with better flexibility by introducing the HW type with corresponding register fields definitions. 2. Add 'qcom,spmi-vib-gen1' and 'qcom,spmi-vib-gen2' compatible strings, and add PMI632, PM7250B, PM7325B, PM7550BA as compatbile as spmi-vib-gen2. Changes in v2: Remove the "pm7550ba-vib" compatible string as it's compatible with pm7325b. Fenglin Wu (3): input: pm8xxx-vib: refactor to easily support new SPMI vibrator dt-bindings: input: qcom,pm8xxx-vib: add new SPMI vibrator module input: pm8xxx-vibrator: add new SPMI vibrator support .../bindings/input/qcom,pm8xxx-vib.yaml | 16 +- drivers/input/misc/pm8xxx-vibrator.c | 171 ++++++++++++------ 2 files changed, 132 insertions(+), 55 deletions(-)
Comments
Hi Fenglin, On Mon Jul 31, 2023 at 7:37 AM CEST, Fenglin Wu wrote: > Add SW support for the vibrator module inside PMI632, PM7250B, PM7325B, PM7550BA. > It is very similar to the vibrator module inside PM8916 which is supported in > pm8xxx-vib driver but just the drive amplitude is controlled with 2 registers, > and the register base offset in each PMIC is different. Briefly tested on a SDM632+PMI632-based Fairphone 3. I didn't really check for vibration strength or anything more detailed but with the fftest tool the vibrator seems to work fine! Diff is attached below. I can send the pmi632.dtsi change once this series is merged (unless you send something first). Many thanks for sending these patches! Tested-by: Luca Weiss <luca.weiss@fairphone.com> # sdm632-fairphone-fp3 (pmi632) Regards Luca diff --git a/arch/arm64/boot/dts/qcom/pmi632.dtsi b/arch/arm64/boot/dts/qcom/pmi632.dtsi index 4eb79e0ce40a..41ef7dad508e 100644 --- a/arch/arm64/boot/dts/qcom/pmi632.dtsi +++ b/arch/arm64/boot/dts/qcom/pmi632.dtsi @@ -161,5 +161,11 @@ pmi632_lpg: pwm { status = "disabled"; }; + + pmi632_vib: vibrator@5700 { + compatible = "qcom,pmi632-vib", "qcom,spmi-vib-gen2"; + reg = <0x5700>; + status = "disabled"; + }; }; }; diff --git a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts index 301eca9a4f31..0d89bc39f613 100644 --- a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts +++ b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts @@ -112,6 +112,10 @@ led@3 { }; }; +&pmi632_vib { + status = "okay"; +}; + &sdhc_1 { status = "okay"; vmmc-supply = <&pm8953_l8>; > Changes in v4: > 1. Update to use the combination of the HW type and register offset > as the constant match data, the register base address defined in > 'reg' property will be added when accessing SPMI registers using > regmap APIs. > 2. Remove 'qcom,spmi-vib-gen1' generic compatible string. > > Changes in v3: > 1. Refactor the driver to support different type of the vibrators with > better flexibility by introducing the HW type with corresponding > register fields definitions. > 2. Add 'qcom,spmi-vib-gen1' and 'qcom,spmi-vib-gen2' compatible > strings, and add PMI632, PM7250B, PM7325B, PM7550BA as compatbile as > spmi-vib-gen2. > > Changes in v2: > Remove the "pm7550ba-vib" compatible string as it's compatible with pm7325b. > > Fenglin Wu (3): > input: pm8xxx-vib: refactor to easily support new SPMI vibrator > dt-bindings: input: qcom,pm8xxx-vib: add new SPMI vibrator module > input: pm8xxx-vibrator: add new SPMI vibrator support > > .../bindings/input/qcom,pm8xxx-vib.yaml | 16 +- > drivers/input/misc/pm8xxx-vibrator.c | 171 ++++++++++++------ > 2 files changed, 132 insertions(+), 55 deletions(-)