From patchwork Wed Jun 26 01:24:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fernandes, Joel A" X-Patchwork-Id: 2781691 Return-Path: X-Original-To: patchwork-davinci@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 33A61C0AB1 for ; Wed, 26 Jun 2013 01:25:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3CFA82027F for ; Wed, 26 Jun 2013 01:25:37 +0000 (UTC) Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3696620249 for ; Wed, 26 Jun 2013 01:25:36 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5Q1OP83018490; Tue, 25 Jun 2013 20:24:25 -0500 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 r5Q1OPQc003338; Tue, 25 Jun 2013 20:24:25 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Tue, 25 Jun 2013 20:24:25 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5Q1OP3c012538; Tue, 25 Jun 2013 20:24:25 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4EFCD80627; Tue, 25 Jun 2013 20:24:25 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dlelxv90.itg.ti.com (dlelxv90.itg.ti.com [172.17.2.17]) by linux.omap.com (Postfix) with ESMTP id 88CDD80626 for ; Tue, 25 Jun 2013 20:24:23 -0500 (CDT) Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r5Q1ONij003327; Tue, 25 Jun 2013 20:24:23 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Tue, 25 Jun 2013 20:24:23 -0500 Received: from localhost.localdomain (h0-133.vpn.ti.com [172.24.0.133]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5Q1O9fX026263; Tue, 25 Jun 2013 20:24:22 -0500 From: Joel A Fernandes To: Tony Lindgren , Sekhar Nori , Matt Porter , Grant Likely , Rob Herring , Vinod Koul , Mark Brown , Benoit Cousson , Russell King , Rob Landley , Andrew Morton , Jason Kridner , Koen Kooi , Balaji TK , Chris Ball Subject: [PATCH 1/5] MMC: omap_hsmmc: Add reg_offset to DT bindings Date: Tue, 25 Jun 2013 20:24:09 -0500 Message-ID: <1372209849-6580-1-git-send-email-joelagnel@ti.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 CC: Linux DaVinci Kernel List , Arnd Bergmann , Linux Documentation List , Devicetree Discuss , Linux MMC List , Linux Kernel Mailing List , Linux SPI Devel List , Linux OMAP List , Linux ARM Kernel List X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Joel A Fernandes Some omap_hsmmc's need to start from a particular offset but otherwise are same and can be reused. Let the DT tell us about the HW difference, check for the reg-offset property and use the same in the driver. Signed-off-by: Joel A Fernandes --- drivers/mmc/host/omap_hsmmc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 5af62c6..aae0994 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1717,6 +1717,7 @@ static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev) struct omap_mmc_platform_data *pdata; struct device_node *np = dev->of_node; u32 bus_width, max_freq; + u32 reg_offset; int cd_gpio, wp_gpio; cd_gpio = of_get_named_gpio(np, "cd-gpios", 0); @@ -1755,6 +1756,9 @@ static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev) if (of_find_property(np, "ti,needs-special-hs-handling", NULL)) pdata->slots[0].features |= HSMMC_HAS_HSPE_SUPPORT; + if (!of_property_read_u32(np, "reg-offset", ®_offset)) + pdata->reg_offset = reg_offset; + return pdata; } #else @@ -1785,7 +1789,8 @@ static int omap_hsmmc_probe(struct platform_device *pdev) if (IS_ERR(pdata)) return PTR_ERR(pdata); - if (match->data) { + /* Provide reg_offset from match->data unless specified in DT */ + if (match->data && !pdata->reg_offset) { const u16 *offsetp = match->data; pdata->reg_offset = *offsetp; }