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: 41081 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9A76A241C9 for ; Tue, 18 Nov 2014 19:09:56 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf13126835lbg.1 for ; Tue, 18 Nov 2014 11:09:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=KlaxRj2uzghCZvcU7LVGNhALeTpR06DAkRjs+ylFDqQ=; b=Xjz1+1O3Wu7kXgLCFCG9dJy69Snk0hit4lgM58JCdlyS0jWS/OK3xGLHO0sDlKheQT RgbQSQ4X82msoJ/FdMcw7vvymGtypC+3T+EzvE3Au/fGgusMpDcAS1KYAjoqL1OuVD2g lVLA9GU898sjhK1dH7b3quSxQhBFGYsJjDOU+AP+lQTUimPKRfy1RO9NAL6XLjN2n29b qkuGQGZ5rkmzjqUARf2y3B3pg78eG8HnMKkckvG0RF75xADOmIz3m83sXhosfbMOpMJF A72cI+ItdPUUezkz/Z1pcPf72i5LlgAWPj7hyHW7sP6FSzTH5vpbulyg9MHU0MbvE6i7 xupg== X-Gm-Message-State: ALoCoQnE1JLB48PSePziMnNI4tPKcUh7HAB2t0fDGrtPUzITKByd9b70KG42XbRFcBGPL53/WTpS X-Received: by 10.195.17.134 with SMTP id ge6mr3157890wjd.2.1416337795530; Tue, 18 Nov 2014 11:09:55 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.68 with SMTP id p4ls1337028laa.52.gmail; Tue, 18 Nov 2014 11:09:55 -0800 (PST) X-Received: by 10.112.172.97 with SMTP id bb1mr821276lbc.38.1416337795132; Tue, 18 Nov 2014 11:09:55 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id r2si31894953lar.2.2014.11.18.11.09.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Nov 2014 11:09:55 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so19946714lbj.13 for ; Tue, 18 Nov 2014 11:09:55 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr825407lad.44.1416337795019; Tue, 18 Nov 2014 11:09:55 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp1386255lbc; Tue, 18 Nov 2014 11:09:52 -0800 (PST) X-Received: by 10.68.65.79 with SMTP id v15mr36154407pbs.56.1416337790972; Tue, 18 Nov 2014 11:09:50 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zm3si38837426pac.162.2014.11.18.11.09.50 for ; Tue, 18 Nov 2014 11:09:50 -0800 (PST) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754607AbaKRTJt (ORCPT + 4 others); 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: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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))