From patchwork Tue Nov 18 19:09:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 5332741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E6EE69F2ED for ; Tue, 18 Nov 2014 19:12:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 055A320160 for ; Tue, 18 Nov 2014 19:12:24 +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 F3A93200DB for ; Tue, 18 Nov 2014 19:12:22 +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 1Xqo9u-0007RM-6B; Tue, 18 Nov 2014 19:09:50 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xqo9q-0007Q6-8s for linux-arm-kernel@lists.infradead.org; Tue, 18 Nov 2014 19:09:47 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id sAIJ92bA002000; Tue, 18 Nov 2014 13:09:02 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id sAIJ92Q8025763; Tue, 18 Nov 2014 13:09:02 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Tue, 18 Nov 2014 13:09:01 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id sAIJ91Ve032271; Tue, 18 Nov 2014 13:09:01 -0600 Date: Tue, 18 Nov 2014 13:09:22 -0600 From: Felipe Balbi To: Dmitry Torokhov Subject: Re: [PATCH 06/10] input: touchscreen: edt-ft5x06: fix driver autoprobing Message-ID: <20141118190922.GL6179@saruman> References: <1416334028-7766-1-git-send-email-balbi@ti.com> <1416334028-7766-6-git-send-email-balbi@ti.com> <20141118183847.GE3003@dtor-ws> MIME-Version: 1.0 In-Reply-To: <20141118183847.GE3003@dtor-ws> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141118_110946_399718_D1CDEF2A X-CRM114-Status: GOOD ( 19.18 ) X-Spam-Score: -5.0 (-----) Cc: devicetree@vger.kernel.org, Tony Lindgren , Felipe Balbi , Rob Herring , stable@vger.kernel.org, linux-input@vger.kernel.org, Linux OMAP Mailing List , Linux ARM Kernel Mailing List , Lothar =?iso-8859-1?Q?Wa=DFmann?= 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: , Reply-To: balbi@ti.com 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 On Tue, Nov 18, 2014 at 10:38:47AM -0800, Dmitry Torokhov wrote: > Hi Felipe, > > On Tue, Nov 18, 2014 at 12:07:04PM -0600, Felipe Balbi wrote: > > 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. > > Why doe snot it autoprobe? We properly declare MODULE_DEVICE_TABLE for > OF, is it because we are missing some data in device uevent? because of of_i2c_register_devices(). Maybe Wolfram can give a better explanation here, but it just doesn't match through of_device_id. Apply this: then boot the board and you get http://hastebin.com/oqemezajez Interesting, it's matching against of but only when I modprobe. Let me debug this one a little more. > > 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, } > > Is this a tee-wide change? Link to the discussion? nope, just found it with my AM437x Starter Kit. diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 2f90ac6..f0dc16e 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -449,8 +449,10 @@ static const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id, const struct i2c_client *client) { while (id->name[0]) { - if (strcmp(client->name, id->name) == 0) + if (strcmp(client->name, id->name) == 0) { + dev_info(&client->dev, "i2c_device_id match\n"); return id; + } id++; } return NULL; @@ -465,8 +467,10 @@ static int i2c_device_match(struct device *dev, struct device_driver *drv) return 0; /* Attempt an OF style match */ - if (of_driver_match_device(dev, drv)) + if (of_driver_match_device(dev, drv)) { + dev_info(dev, "of driver match\n"); return 1; + } /* Then ACPI style match */ if (acpi_driver_match_device(dev, drv)) @@ -1081,6 +1085,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) client->dev.bus = &i2c_bus_type; client->dev.type = &i2c_client_type; client->dev.of_node = info->of_node; + dev_info(&adap->dev, "%s: of_node %p\n", __func__, info->of_node); ACPI_COMPANION_SET(&client->dev, info->acpi_node.companion); i2c_dev_set_name(adap, client); @@ -1411,6 +1416,7 @@ static void of_i2c_register_devices(struct i2c_adapter *adap) info.irq = irq_of_parse_and_map(node, 0); info.of_node = of_node_get(node); + dev_info(&adap->dev, "%s: of_node %p\n", __func__, info.of_node); info.archdata = &dev_ad; if (of_get_property(node, "wakeup-source", NULL))