From patchwork Thu Oct 6 08:43:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Twiss X-Patchwork-Id: 9364281 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 ACD576077E for ; Thu, 6 Oct 2016 09:10:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 992DC28E81 for ; Thu, 6 Oct 2016 09:10:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B56E28E83; Thu, 6 Oct 2016 09:10:56 +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=unavailable 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 0848728E7C for ; Thu, 6 Oct 2016 09:10:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966989AbcJFJKV (ORCPT ); Thu, 6 Oct 2016 05:10:21 -0400 Received: from mail1.bemta5.messagelabs.com ([195.245.231.142]:25195 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967259AbcJFJKN (ORCPT ); Thu, 6 Oct 2016 05:10:13 -0400 Received: from [85.158.139.51] by server-6.bemta-5.messagelabs.com id 7A/CC-06971-D4316F75; Thu, 06 Oct 2016 09:03:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHKsWRWlGSWpSXmKPExsUSt3Opsa638Ld wg2tTVCymPnzCZjH/yDlWi8OLXjBazL9yjdXi/tejjBbfrnQwWdz89I3V4vKuOWwWn3uPMFrc WLeP3eLJwjNMFkuvX2SyaN17BMh92MdmcXliJ7vFrRkvWB0EPNbMW8PosXPWXXaPa5vFPBbve cnksWlVJ5vHnWt72Dx2fm9g9/i8SS6AI4o1My8pvyKBNWPtp162gtsKFftermRuYNwm3cXIyS EksI5R4sM8UQi7QuLms1nsIDavQLLE2X2/mboYOTg4BRwlHkxxgihxkFj95iULiM0mYCgx781 7RhCbRUBFYsrTVWBxYQFTifPzTjB3MXJxiAh0MEq0zf3IBOIwC/xiluhvugq1QFDi5MwnYB3M AhISB1+8YAZZJiSgJbH8WCRIWELAXmL6+6tgYQkBfYnGY7EQYUOJ77O+sUCEzSU2nY+awCg4C 8nMWUhmLmBkWsWoXpxaVJZapGuql1SUmZ5RkpuYmaNraGCql5taXJyYnpqTmFSsl5yfu4kRGG 8MQLCD8Uu/8yFGSQ4mJVHe9UzfwoX4kvJTKjMSizPii0pzUosPMcpwcChJ8L4VBMoJFqWmp1a kZeYAIx8mLcHBoyTCe00AKM1bXJCYW5yZDpE6xagoJc4rLwSUEABJZJTmwbXBks0lRlkpYV5G oEOEeApSi3IzS1DlXzGKczAqCfNKgUzhycwrgZv+CmgxE9Di/KVfQBaXJCKkpBoYlX7v8pyT3 nb//Ya7p0LXXXfqbjIuPmLrXPkmLaMhSJ7ryLr84La3XE2R/mtENyn5MIiuMJMyazGZ/m8d17 7QLJPembN+1ElNUxLPbVoVOL185sx5lixL7/yXygpbvfTxJH0/lt0qn6b5RFfxxRx5+kzo9tZ +p9ml/JvesflLtL2/lKbmbRegxFKckWioxVxUnAgA37YBpjEDAAA= X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-15.tower-180.messagelabs.com!1475744586!47609953!3 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13363 invoked from network); 6 Oct 2016 09:03:07 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-15.tower-180.messagelabs.com with AES128-SHA encrypted SMTP; 6 Oct 2016 09:03:07 -0000 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.248.2; Thu, 6 Oct 2016 10:03:05 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22547) id 75BAE3FBE5; Thu, 6 Oct 2016 10:03:05 +0100 (BST) Message-ID: <56f388c16fa95da1b211a2980cfc2add736b5f46.1475743411.git.stwiss.opensource@diasemi.com> In-Reply-To: References: From: Steve Twiss Date: Thu, 6 Oct 2016 09:43:30 +0100 Subject: [PATCH V1 03/10] Input: da9061: onkey driver To: Dmitry Torokhov , LINUX-INPUT , LINUX-KERNEL CC: DEVICETREE , Eduardo Valentin , Guenter Roeck , LINUX-PM , LINUX-WATCHDOG , Lee Jones , Liam Girdwood , Mark Brown , Mark Rutland , Rob Herring , Support Opensource , Wim Van Sebroeck , Zhang Rui MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 06/10/2016 07:06:00 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Steve Twiss Support for the DA9061 onkey is added into the DA9063 onkey driver. The of_device_id match array is expanded to support "dlg,da9061-onkey" as a valid .compatible string. A new chip configuration register map listed in da9061_regs is added and linked to this device tree compatible string in the .data section. Copyright header is updated to add DA9061 in its description and the module description macro is extended to include DA9061. Kconfig is updated to reflect support for DA9061/62/63. Signed-off-by: Steve Twiss --- This patch applies against linux-next and v4.8 Dmitry, The DA9063 onkey driver is modified to support the DA9061 onkey. Because of earlier work with DA9062 it is a simple matter to extend this for DA9061 by adding a new compatible string and register mapping. { .compatible = "dlg,da9061-onkey", .data = &da9061_regs }, Regards, Steve Twiss, Dialog Semiconductor Ltd. drivers/input/misc/Kconfig | 7 ++++--- drivers/input/misc/da9063_onkey.c | 24 ++++++++++++++++++++---- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index efb0ca8..57cc9c2 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -613,11 +613,12 @@ config INPUT_DA9055_ONKEY will be called da9055_onkey. config INPUT_DA9063_ONKEY - tristate "Dialog DA9062/63 OnKey" + tristate "Dialog DA9063/62/61 OnKey" depends on MFD_DA9063 || MFD_DA9062 help - Support the ONKEY of Dialog DA9063 and DA9062 Power Management ICs - as an input device capable of reporting the power button status. + Support the ONKEY of Dialog DA9063, DA9062 and DA9061 Power + Management ICs as an input device capable of reporting the + power button status. To compile this driver as a module, choose M here: the module will be called da9063_onkey. diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c index bb863e0..60c29cd 100644 --- a/drivers/input/misc/da9063_onkey.c +++ b/drivers/input/misc/da9063_onkey.c @@ -1,5 +1,5 @@ /* - * OnKey device driver for DA9063 and DA9062 PMICs + * OnKey device driver for DA9063, DA9062 and DA9061 PMICs * Copyright (C) 2015 Dialog Semiconductor Ltd. * * This program is free software; you can redistribute it and/or @@ -82,9 +82,25 @@ static const struct da906x_chip_config da9062_regs = { .name = "da9062-onkey", }; +static const struct da906x_chip_config da9061_regs = { + /* REGS */ + .onkey_status = DA9062AA_STATUS_A, + .onkey_pwr_signalling = DA9062AA_CONTROL_B, + .onkey_fault_log = DA9062AA_FAULT_LOG, + .onkey_shutdown = DA9062AA_CONTROL_F, + /* MASKS */ + .onkey_nonkey_mask = DA9062AA_NONKEY_MASK, + .onkey_nonkey_lock_mask = DA9062AA_NONKEY_LOCK_MASK, + .onkey_key_reset_mask = DA9062AA_KEY_RESET_MASK, + .onkey_shutdown_mask = DA9062AA_SHUTDOWN_MASK, + /* NAMES */ + .name = "da9061-onkey", +}; + static const struct of_device_id da9063_compatible_reg_id_table[] = { { .compatible = "dlg,da9063-onkey", .data = &da9063_regs }, { .compatible = "dlg,da9062-onkey", .data = &da9062_regs }, + { .compatible = "dlg,da9061-onkey", .data = &da9061_regs }, { }, }; @@ -149,13 +165,13 @@ static void da9063_poll_on(struct work_struct *work) * and then send shutdown command */ dev_dbg(&onkey->input->dev, - "Sending SHUTDOWN to DA9063 ...\n"); + "Sending SHUTDOWN to PMIC ...\n"); error = regmap_write(onkey->regmap, config->onkey_shutdown, config->onkey_shutdown_mask); if (error) dev_err(&onkey->input->dev, - "Cannot SHUTDOWN DA9063: %d\n", + "Cannot SHUTDOWN PMIC: %d\n", error); } } @@ -300,6 +316,6 @@ static struct platform_driver da9063_onkey_driver = { module_platform_driver(da9063_onkey_driver); MODULE_AUTHOR("S Twiss "); -MODULE_DESCRIPTION("Onkey device driver for Dialog DA9063 and DA9062"); +MODULE_DESCRIPTION("Onkey device driver for Dialog DA9063, DA9062 and DA9061"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:" DA9063_DRVNAME_ONKEY);