From patchwork Tue Aug 30 13:52:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gamari X-Patchwork-Id: 1113122 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7UDqVm1002953 for ; Tue, 30 Aug 2011 13:52:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754134Ab1H3Nwa (ORCPT ); Tue, 30 Aug 2011 09:52:30 -0400 Received: from mail-qy0-f181.google.com ([209.85.216.181]:41887 "EHLO mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753069Ab1H3Nwa (ORCPT ); Tue, 30 Aug 2011 09:52:30 -0400 Received: by qyk34 with SMTP id 34so4497065qyk.19 for ; Tue, 30 Aug 2011 06:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=DjRnj+WJDpyrm/+CldMGOfJnm5TrAJhGWWhyVXeLGnk=; b=vCz4Kh4nIhvW3YSDMtF5HuUQ2mCNIf7hegsIB85pUmJq7Hkpx8lH7SJ1kW+HI4pIqz mOdX5V2t9qrTsk1Q8VIIsXI5bmYeQJwUMmrBB7PeBeQP9RnBgPh/C4wbeRo93JGgwuTL nbRuIusOAyAYquIsjddfn4yny1ak8p73RY9lg= Received: by 10.224.200.202 with SMTP id ex10mr2747023qab.40.1314712349609; Tue, 30 Aug 2011 06:52:29 -0700 (PDT) Received: from localhost.localdomain (pool-96-240-192-157.spfdma.east.verizon.net [96.240.192.157]) by mx.google.com with ESMTPS id m11sm4118489qcw.43.2011.08.30.06.52.28 (version=SSLv3 cipher=OTHER); Tue, 30 Aug 2011 06:52:28 -0700 (PDT) From: Ben Gamari To: Raju Sana Cc: beagleboard@googlegroups.com, linux-omap@vger.kernel.org, spi-devel-general@lists.sourceforge.net, Ben Gamari Subject: [PATCH] beagledaq: Hack in cs_gpios Date: Tue, 30 Aug 2011 09:52:23 -0400 Message-Id: <1314712343-27367-1-git-send-email-bgamari.foss@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314712254-27199-1-git-send-email-bgamari.foss@gmail.com> References: <1314712254-27199-1-git-send-email-bgamari.foss@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 30 Aug 2011 13:52:31 +0000 (UTC) --- arch/arm/mach-omap2/board-omap3beagle.c | 4 ++-- arch/arm/mach-omap2/devices.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 67999da..481c1a9 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -661,8 +661,8 @@ static struct spi_board_info beagledaq_mcspi_board_info[] = { }, }; -static int mcspi3_cs_gpios[4]; -static int mcspi4_cs_gpios[4]; +int mcspi3_cs_gpios[4]; +int mcspi4_cs_gpios[4]; static void __init beagledaq_init(void) { diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 5b8ca68..6808251 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -341,6 +341,9 @@ struct omap_device_pm_latency omap_mcspi_latency[] = { }, }; +extern int mcspi3_cs_gpios[4]; +extern int mcspi4_cs_gpios[4]; + static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) { struct omap_device *od; @@ -369,6 +372,18 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) return -EINVAL; } + /* HACK: Not enough time to figure out how to export cs_gpios from + * board file to driver correctly */ + if (spi_num == 2) { + // Setup McSPI3 cs_gpios + pdata->num_cs = 4; + pdata->cs_gpios = mcspi3_cs_gpios; + } else if (spi_num == 3) { + // Setup McSPI4 cs_gpios + pdata->num_cs = 4; + pdata->cs_gpios = mcspi4_cs_gpios; + } + spi_num++; od = omap_device_build(name, spi_num, oh, pdata, sizeof(*pdata), omap_mcspi_latency,