From patchwork Thu Apr 22 14:43:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abraham Arce X-Patchwork-Id: 94134 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3MEi120029757 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 22 Apr 2010 14:44:38 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.69) (envelope-from ) id 1O4xdJ-0000GD-PZ; Thu, 22 Apr 2010 14:44:01 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1O4xdI-0000G5-B5 for spi-devel-general@lists.sourceforge.net; Thu, 22 Apr 2010 14:44:00 +0000 Received-SPF: pass (sfi-mx-1.v28.ch3.sourceforge.com: domain of ti.com designates 192.94.94.40 as permitted sender) client-ip=192.94.94.40; envelope-from=x0066660@ti.com; helo=arroyo.ext.ti.com; Received: from arroyo.ext.ti.com ([192.94.94.40]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1O4xdH-0003tB-EW for spi-devel-general@lists.sourceforge.net; Thu, 22 Apr 2010 14:44:00 +0000 Received: from dlep35.itg.ti.com ([157.170.170.118]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o3MEhcgd028792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Apr 2010 09:43:38 -0500 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id o3MEhb2N014753; Thu, 22 Apr 2010 09:43:37 -0500 (CDT) Received: from dlee74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id o3MEhbxI000697; Thu, 22 Apr 2010 09:43:37 -0500 (CDT) Received: from dlee03.ent.ti.com ([157.170.170.18]) by dlee74.ent.ti.com ([157.170.170.8]) with mapi; Thu, 22 Apr 2010 09:43:37 -0500 From: "Arce, Abraham" To: "linux-omap@vger.kernel.org" , "spi-devel-general@lists.sourceforge.net" Date: Thu, 22 Apr 2010 09:43:37 -0500 Thread-Topic: [PATCH 3/4] OMAP4: Ethernet: KS8851 Board Support Thread-Index: AcriKjEsTb6EVIQxR7ig4kXvAyyYHQ== Message-ID: <27F9C60D11D683428E133F85D2BB4A53043DC15EBD@dlee03.ent.ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-Spam-Score: -1.1 (-) 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 SPF_PASS SPF: sender matches SPF record 0.4 AWL AWL: From: address is in the auto white-list X-Headers-End: 1O4xdH-0003tB-EW Cc: Tony Lindgren , Russell King - ARM Linux , "Shilimkar, Santosh" Subject: [spi-devel-general] [PATCH 3/4] OMAP4: Ethernet: KS8851 Board Support 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: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 22 Apr 2010 14:44:38 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index b88f28c..801c2a7 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -32,6 +33,30 @@ #include #include +#define ETHERNET_KS8851_IRQ 34 +#define ETHERNET_KS8851_POWER_ENABLE 48 +#define ETHERNET_KS8851_QUART 138 + +static struct spi_board_info sdp4430_spi_board_info[] __initdata = { + { + .modalias = "ks8851", + .bus_num = 1, + .chip_select = 0, + .max_speed_hz = 24000000, + .irq = ETHERNET_KS8851_IRQ, + }, +}; + +static void omap_ethernet_init(void) +{ + gpio_request(ETHERNET_KS8851_POWER_ENABLE, "ethernet"); + gpio_direction_output(ETHERNET_KS8851_POWER_ENABLE, 1); + gpio_request(ETHERNET_KS8851_QUART, "quart"); + gpio_direction_output(ETHERNET_KS8851_QUART, 1); + gpio_request(ETHERNET_KS8851_IRQ, "ks8851"); + gpio_direction_input(ETHERNET_KS8851_IRQ); +} + static struct platform_device sdp4430_lcd_device = { .name = "sdp4430_lcd", .id = -1, @@ -120,6 +145,11 @@ static void __init omap_4430sdp_init(void) /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ if (!cpu_is_omap44xx()) usb_musb_init(&musb_board_data); + + omap_ethernet_init(); + sdp4430_spi_board_info[0].irq = gpio_to_irq(ETHERNET_KS8851_IRQ); + spi_register_board_info(sdp4430_spi_board_info, + ARRAY_SIZE(sdp4430_spi_board_info)); } static void __init omap_4430sdp_map_io(void)