From patchwork Tue Apr 4 15:41:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Riegel X-Patchwork-Id: 9661909 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DF8E8602B9 for ; Tue, 4 Apr 2017 15:42:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD0D427DA4 for ; Tue, 4 Apr 2017 15:42:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF65927F8F; Tue, 4 Apr 2017 15:42:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 199A227DA4 for ; Tue, 4 Apr 2017 15:42:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752202AbdDDPmx (ORCPT ); Tue, 4 Apr 2017 11:42:53 -0400 Received: from mail.savoirfairelinux.com ([208.88.110.44]:55476 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753096AbdDDPmw (ORCPT ); Tue, 4 Apr 2017 11:42:52 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id B2F909C1FEE; Tue, 4 Apr 2017 11:42:51 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iroUmR64i_Z1; Tue, 4 Apr 2017 11:42:51 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 36D639C1E7B; Tue, 4 Apr 2017 11:42:51 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id t6ktlqQMTQv5; Tue, 4 Apr 2017 11:42:51 -0400 (EDT) Received: from workotop.humanware.local (unknown [192.252.129.34]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id F12CC9C1FEF; Tue, 4 Apr 2017 11:42:50 -0400 (EDT) From: Damien Riegel To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Rob Herring , Mark Rutland , kernel@savoirfairelinux.com, Damien Riegel Subject: [PATCH v2 5/5] Input: pm8xxx-vib: add support for pm8916's vibrator Date: Tue, 4 Apr 2017 11:41:53 -0400 Message-Id: <20170404154153.19901-5-damien.riegel@savoirfairelinux.com> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170404154153.19901-1-damien.riegel@savoirfairelinux.com> References: <20170404154153.19901-1-damien.riegel@savoirfairelinux.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add pm8xxx_regs for this PMIC and the device tree match table entry. Signed-off-by: Damien Riegel --- Changes in v2: - Added 0xc000 offset to enable_addr and drv_addr drivers/input/misc/Kconfig | 2 +- drivers/input/misc/pm8xxx-vibrator.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 5b6c52210d20..79d0be9885c5 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -143,7 +143,7 @@ config INPUT_PM8941_PWRKEY config INPUT_PM8XXX_VIBRATOR tristate "Qualcomm PM8XXX vibrator support" - depends on MFD_PM8XXX + depends on MFD_PM8XXX || MFD_SPMI_PMIC select INPUT_FF_MEMLESS help This option enables device driver support for the vibrator diff --git a/drivers/input/misc/pm8xxx-vibrator.c b/drivers/input/misc/pm8xxx-vibrator.c index 50b874e6f678..33b1fe9154b0 100644 --- a/drivers/input/misc/pm8xxx-vibrator.c +++ b/drivers/input/misc/pm8xxx-vibrator.c @@ -43,6 +43,15 @@ static struct pm8xxx_regs pm8058_regs = { .drv_en_manual_mask = 0xfc, }; +static struct pm8xxx_regs pm8916_regs = { + .enable_addr = 0xc046, + .enable_mask = BIT(7), + .drv_addr = 0xc041, + .drv_mask = 0x1F, + .drv_shift = 0, + .drv_en_manual_mask = 0, +}; + /** * struct pm8xxx_vib - structure to hold vibrator data * @vib_input_dev: input device supporting force feedback @@ -242,6 +251,7 @@ static SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL); static const struct of_device_id pm8xxx_vib_id_table[] = { { .compatible = "qcom,pm8058-vib", .data = &pm8058_regs }, { .compatible = "qcom,pm8921-vib", .data = &pm8058_regs }, + { .compatible = "qcom,pm8916-vib", .data = &pm8916_regs }, { } }; MODULE_DEVICE_TABLE(of, pm8xxx_vib_id_table);