From patchwork Sat Nov 16 00:36:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 3191791 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 265F3C045B for ; Sat, 16 Nov 2013 00:38:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46DF5208DD for ; Sat, 16 Nov 2013 00:38:32 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04D8E20915 for ; Sat, 16 Nov 2013 00:38:31 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhTt0-0004PO-Ft; Sat, 16 Nov 2013 00:37:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhTsl-0004e7-Mo; Sat, 16 Nov 2013 00:37:03 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhTsL-0004bc-24 for linux-arm-kernel@merlin.infradead.org; Sat, 16 Nov 2013 00:36:37 +0000 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhTsI-0002jz-L8 for linux-arm-kernel@lists.infradead.org; Sat, 16 Nov 2013 00:36:36 +0000 Received: from c-50-131-214-131.hsd1.ca.comcast.net ([50.131.214.131] helo=muffinssi.muru.com) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VhTru-000F02-Q5; Sat, 16 Nov 2013 00:36:11 +0000 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 50.131.214.131 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19rK3pYEnhyKo10e+ZqLp5n From: Tony Lindgren To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Subject: [PATCH 1/5] mfd: twl-core: Fix passing of platform data in the device tree case Date: Fri, 15 Nov 2013 16:36:03 -0800 Message-Id: <1384562167-14725-2-git-send-email-tony@atomide.com> X-Mailer: git-send-email 1.8.1.1 In-Reply-To: <1384562167-14725-1-git-send-email-tony@atomide.com> References: <1384562167-14725-1-git-send-email-tony@atomide.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131115_163634_852480_C156A50F X-CRM114-Status: GOOD ( 11.63 ) X-Spam-Score: 0.0 (/) Cc: Lee Jones , Samuel Ortiz X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Since we still need to rely on a mix of device tree initialized drivers and legacy platform data initialize drivers, let's fix the passing of platform data to twl4030-gpio. As the twl4030 GPIO is initialized by twl-core.c, we need to register the auxdata for twl4030 GPIO in twl-core.c. Cc: Samuel Ortiz Cc: Lee Jones Signed-off-by: Tony Lindgren Acked-by: Felipe Balbi --- Samuel & Lee, I'd like to merge this fix via arm-soc tree if this looks OK to you as I have other patches that depend on this. --- drivers/mfd/twl-core.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 29473c2..d5b3dd8 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -1133,6 +1133,11 @@ static int twl_remove(struct i2c_client *client) return 0; } +static struct of_dev_auxdata twl_auxdata_lookup[] = { + OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL), + { /* sentinel */ }, +}; + /* NOTE: This driver only handles a single twl4030/tps659x0 chip */ static int twl_probe(struct i2c_client *client, const struct i2c_device_id *id) @@ -1271,10 +1276,14 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); } - if (node) - status = of_platform_populate(node, NULL, NULL, &client->dev); - else + if (node) { + if (pdata) + twl_auxdata_lookup[0].platform_data = pdata->gpio; + status = of_platform_populate(node, NULL, twl_auxdata_lookup, + &client->dev); + } else { status = add_children(pdata, irq_base, id->driver_data); + } fail: if (status < 0)