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: 1113132 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7UDqdsp008954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 30 Aug 2011 13:52:59 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QyOk0-0004Pd-SV; Tue, 30 Aug 2011 13:52:36 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QyOjz-0004PY-KA for spi-devel-general@lists.sourceforge.net; Tue, 30 Aug 2011 13:52:35 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.216.182 as permitted sender) client-ip=209.85.216.182; envelope-from=bgamari.foss@gmail.com; helo=mail-qy0-f182.google.com; Received: from mail-qy0-f182.google.com ([209.85.216.182]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1QyOjz-0003HT-0U for spi-devel-general@lists.sourceforge.net; Tue, 30 Aug 2011 13:52:35 +0000 Received: by qyk9 with SMTP id 9so4887347qyk.13 for ; Tue, 30 Aug 2011 06:52:29 -0700 (PDT) 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 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> X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (bgamari.foss[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1QyOjz-0003HT-0U Cc: spi-devel-general@lists.sourceforge.net, beagleboard@googlegroups.com, linux-omap@vger.kernel.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 30 Aug 2011 13:53:00 +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,