From patchwork Tue Nov 18 18:07:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 5332281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CD3AEC11AC for ; Tue, 18 Nov 2014 18:11:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1074200C6 for ; Tue, 18 Nov 2014 18:11:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFFF2201CD for ; Tue, 18 Nov 2014 18:11:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XqnDh-00010D-2q; Tue, 18 Nov 2014 18:09:41 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XqnBX-00071v-HE for linux-arm-kernel@lists.infradead.org; Tue, 18 Nov 2014 18:07:28 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id sAII6sQX023054; Tue, 18 Nov 2014 12:06:54 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id sAII6s1s031312; Tue, 18 Nov 2014 12:06:54 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Tue, 18 Nov 2014 12:06:53 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id sAII6r9N005140; Tue, 18 Nov 2014 12:06:53 -0600 From: Felipe Balbi To: Tony Lindgren Subject: [PATCH 06/10] input: touchscreen: edt-ft5x06: fix driver autoprobing Date: Tue, 18 Nov 2014 12:07:04 -0600 Message-ID: <1416334028-7766-6-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1416334028-7766-1-git-send-email-balbi@ti.com> References: <1416334028-7766-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141118_100727_718809_7361292C X-CRM114-Status: GOOD ( 11.24 ) X-Spam-Score: -5.0 (-----) Cc: devicetree@vger.kernel.org, Dmitry Torokhov , Felipe Balbi , Rob Herring , stable@vger.kernel.org, linux-input@vger.kernel.org, Linux OMAP Mailing List , Linux ARM Kernel Mailing List , =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP i2c devices match against struct i2c_device_id even for CONFIG_OF case, so adding a struct of_device_id doesn't change anything. As a result, currently, edt-ft5x06 will not autoprobe if built as a module. To fix the issue and still maintain backwards compatibility with all DTS files currently in tree, we're just moving all ids from of_device_id to i2c_device_id while also adding the following specific ids which should be used from now on: { "edt-ft5206", 0, } { "edt-ft5306", 0, } { "edt-ft5406", 0, } Cc: Lothar Waßmann Cc: Rob Herring Cc: Dmitry Torokhov Cc: Cc: Cc: # v3.15+ Fixes: dac90dc2 (Input: edt-ft5x06 - add DT support) Signed-off-by: Felipe Balbi --- .../bindings/input/touchscreen/edt-ft5x06.txt | 9 ++++++--- drivers/input/touchscreen/edt-ft5x06.c | 17 ++++++----------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt index 76db967..50bd5d2 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt +++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt @@ -14,9 +14,12 @@ bindings. Required properties: - - compatible: "edt,edt-ft5206" - or: "edt,edt-ft5306" - or: "edt,edt-ft5406" + - compatible: "edt-ft5206" + or: "edt-ft5306" + or: "edt-ft5406" + or: "edt,edt-ft5206" (deprecated) + or: "edt,edt-ft5306" (deprecated) + or: "edt,edt-ft5406" (deprecated) - reg: I2C slave address of the chip (0x38) - interrupt-parent: a phandle pointing to the interrupt controller diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index ee3434f..f161ff9 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1119,25 +1119,20 @@ static SIMPLE_DEV_PM_OPS(edt_ft5x06_ts_pm_ops, static const struct i2c_device_id edt_ft5x06_ts_id[] = { { "edt-ft5x06", 0, }, + { "edt-ft5206", 0, }, + { "edt-ft5306", 0, }, + { "edt-ft5406", 0, }, + { "edt,edt-ft5206", 0, }, + { "edt,edt-ft5306", 0, }, + { "edt,edt-ft5406", 0, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(i2c, edt_ft5x06_ts_id); -#ifdef CONFIG_OF -static const struct of_device_id edt_ft5x06_of_match[] = { - { .compatible = "edt,edt-ft5206", }, - { .compatible = "edt,edt-ft5306", }, - { .compatible = "edt,edt-ft5406", }, - { /* sentinel */ } -}; -MODULE_DEVICE_TABLE(of, edt_ft5x06_of_match); -#endif - static struct i2c_driver edt_ft5x06_ts_driver = { .driver = { .owner = THIS_MODULE, .name = "edt_ft5x06", - .of_match_table = of_match_ptr(edt_ft5x06_of_match), .pm = &edt_ft5x06_ts_pm_ops, }, .id_table = edt_ft5x06_ts_id,