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: 5332711 Return-Path: X-Original-To: patchwork-linux-omap@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 630A39F2ED for ; Tue, 18 Nov 2014 19:09:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DD3C2018E for ; Tue, 18 Nov 2014 19:09:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 921C020173 for ; Tue, 18 Nov 2014 19:09:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754758AbaKRTJt (ORCPT ); Tue, 18 Nov 2014 14:09:49 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:36322 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754420AbaKRTJs (ORCPT ); Tue, 18 Nov 2014 14:09:48 -0500 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 CC: Felipe Balbi , Tony Lindgren , "Linux OMAP Mailing List" , Linux ARM Kernel Mailing List , Lothar =?iso-8859-1?Q?Wa=DFmann?= , Rob Herring , , , Subject: Re: [PATCH 06/10] input: touchscreen: edt-ft5x06: fix driver autoprobing Message-ID: <20141118190922.GL6179@saruman> Reply-To: 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 Content-Disposition: inline In-Reply-To: <20141118183847.GE3003@dtor-ws> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, 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))