From patchwork Thu Dec 15 19:08:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Twiss X-Patchwork-Id: 9476761 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 65F9C6047D for ; Thu, 15 Dec 2016 19:39:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AAEB2877A for ; Thu, 15 Dec 2016 19:39:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F343287D8; Thu, 15 Dec 2016 19:39:20 +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 DEEF42877A for ; Thu, 15 Dec 2016 19:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751157AbcLOTjR (ORCPT ); Thu, 15 Dec 2016 14:39:17 -0500 Received: from mail1.bemta5.messagelabs.com ([195.245.231.139]:25321 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752803AbcLOTjO (ORCPT ); Thu, 15 Dec 2016 14:39:14 -0500 X-Greylist: delayed 486 seconds by postgrey-1.27 at vger.kernel.org; Thu, 15 Dec 2016 14:39:13 EST Received: from [85.158.139.19] by server-3.bemta-5.messagelabs.com id D1/07-01948-97FE2585; Thu, 15 Dec 2016 19:31:05 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNKsWRWlGSWpSXmKPExsUSt3OpsW7l+6A Ig8PNohZTHz5hs5h/5ByrxeFFLxgt5l+5xmpx/+tRRotvVzqYLG5++sZqcXnXHDaLz71HGC1u rNvHbvFk4Rkmi6XXLzJZtO49AuQ+7GOzuDyxk93i1owXrA4CHmvmrWH02DnrLrvHtc1iHov3v GTy2LSqk83jzrU9bB47vzewe3zeJBfAEcWamZeUX5HAmtG0n7VglXzFuT9b2RoY+6S6GLk4hA TWM0r0nv/N0sXICeRUSGz8vQfI5uDgFUiW2HsnFyTMKeAoseLZSjaIEgeJl/eawMrZBAwl5r1 5zwhSziKgKrHriy1IWFjARuLLyhZWkPEiAisYJe7M2MYM4jAL3GaW+PzrECtIFa+AoMTJmU/A BjELSEgcfPGCGWSQkICWxPJjkSBhCQF7ienvr4KFJQT0JRqPxUKEDSW+z/rGAmGbS8x4cIxtA qPgLCRDZyEZuoCRaRWjRnFqUVlqka6RuV5SUWZ6RkluYmaOrqGBqV5uanFxYnpqTmJSsV5yfu 4mRmDE1TMwMO5gvLrF7xCjJAeTkihv9vKgCCG+pPyUyozE4oz4otKc1OJDjDIcHEoSvFHvgHK CRanpqRVpmTnA2IdJS3DwKInwTgVJ8xYXJOYWZ6ZDpE4x6nI03Fj3lEmIJS8/L1VKnLcYpEgA pCijNA9uBCwNXWKUlRLmZWRgYBDiKUgtys0sQZV/xSjOwagkzLsWZApPZl4J3KZXQEcwAR0hu sQf5IiSRISUVAOjx8krDDq+Ziset1vH9Pc/EV9w6kXFWx7Gw5ZRVlujnm/W9FJ1V1O0Nk63bj 3xkZHjlU1pRqVi84OL0ku97U/br6haM0/n6tXaPdMm/5zHxSy6yWfe2+Spqyc8mX9+2yKOHKm FhafaqguvbBQqt9vAov5d89TKf57TvrY/VWW4vEd5voRW/p84JZbijERDLeai4kQA4xyeUz4D AAA= X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-14.tower-178.messagelabs.com!1481830263!75802103!6 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20503 invoked from network); 15 Dec 2016 19:31:05 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-14.tower-178.messagelabs.com with AES128-SHA encrypted SMTP; 15 Dec 2016 19:31:05 -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, 15 Dec 2016 19:31:04 +0000 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22547) id 457193FBD3; Thu, 15 Dec 2016 19:31:03 +0000 (GMT) Message-ID: In-Reply-To: References: From: Steve Twiss Date: Thu, 15 Dec 2016 19:08:41 +0000 Subject: [PATCH V5 6/8] watchdog: da9062/61: watchdog driver To: Guenter Roeck , LINUX-KERNEL , LINUX-WATCHDOG , Wim Van Sebroeck CC: DEVICETREE , Dmitry Torokhov , Eduardo Valentin , LINUX-INPUT , LINUX-PM , Lee Jones , Liam Girdwood , Mark Brown , Mark Rutland , Rob Herring , Support Opensource , 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: 15/12/2016 14:44:00 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 From: Steve Twiss The of_device_id match array is added to support "dlg,da9062-watchdog" as a valid .compatible string. A MODULE_DEVICE_TABLE() macro is added. This patch assumes the use of a DA9062 fallback compatible string for the DTS to pick up the DA9062 device driver for use with the DA9061 watchdog hardware 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. Reviewed-by: Guenter Roeck Signed-off-by: Steve Twiss --- This patch applies against linux-next and v4.9 v4 -> v5 - NO CODE CHANGE - Rebased from v4.8 to v4.9 v3 -> v4 - NO CODE CHANGE - Patch renamed from [PATCH V3 7/9] to [PATCH V4 6/8] - Added reviewed by Guenter Roeck v2 -> v3 - Patch renamed from [PATCH V2 08/10] to [PATCH V3 7/9] - Removal of match->data and of_match_node search. There is only one compatible string now. and delete the .data = &da9062_watchdog_info association in the struct of_device_id compatible table. - Addition of MODULE_DEVICE_TABLE macro to allow modinfo additions: da9062_wdt.ko platform:da9062_watchdog of:N*T*Cdlg,da9062_watchdogC* of:N*T*Cdlg,da9062_watchdog v1 -> v2 - Patch renamed from [PATCH V1 04/10] to [PATCH V2 08/10] -- these changes were made to fix checkpatch warnings caused by the patch set dependency order - Removal of the DA9061 compatible entries for this device driver. - Additional explanation in the patch description for the use of a fall-back compatible DTS string Hi, There are no code changes to this patch compared to the previous submission in [PATCH V3 7/9]. The differences are in the patch version rename and Reviewed-by tag. Regards, Steve Twiss, Dialog Semiconductor Ltd. drivers/watchdog/Kconfig | 4 ++-- drivers/watchdog/da9062_wdt.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 3eb58cb..bb4e7dd8 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -104,11 +104,11 @@ config DA9063_WATCHDOG This driver can be built as a module. The module name is da9063_wdt. config DA9062_WATCHDOG - tristate "Dialog DA9062 Watchdog" + tristate "Dialog DA9062/61 Watchdog" depends on MFD_DA9062 select WATCHDOG_CORE help - Support for the watchdog in the DA9062 PMIC. + Support for the watchdog in the DA9062 and DA9061 PMICs. This driver can be built as a module. The module name is da9062_wdt. diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c index 7386111..a02cee6 100644 --- a/drivers/watchdog/da9062_wdt.c +++ b/drivers/watchdog/da9062_wdt.c @@ -1,5 +1,5 @@ /* - * da9062_wdt.c - WDT device driver for DA9062 + * Watchdog device driver for DA9062 and DA9061 PMICs * Copyright (C) 2015 Dialog Semiconductor Ltd. * * This program is free software; you can redistribute it and/or @@ -188,6 +188,13 @@ static int da9062_wdt_set_timeout(struct watchdog_device *wdd, .set_timeout = da9062_wdt_set_timeout, }; +static const struct of_device_id da9062_compatible_id_table[] = { + { .compatible = "dlg,da9062-watchdog", }, + { }, +}; + +MODULE_DEVICE_TABLE(of, da9062_compatible_id_table); + static int da9062_wdt_probe(struct platform_device *pdev) { int ret; @@ -244,11 +251,12 @@ static int da9062_wdt_remove(struct platform_device *pdev) .remove = da9062_wdt_remove, .driver = { .name = "da9062-watchdog", + .of_match_table = da9062_compatible_id_table, }, }; module_platform_driver(da9062_wdt_driver); MODULE_AUTHOR("S Twiss "); -MODULE_DESCRIPTION("WDT device driver for Dialog DA9062"); +MODULE_DESCRIPTION("WDT device driver for Dialog DA9062 and DA9061"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:da9062-watchdog");